From patchwork Fri Sep 26 02:40:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khiem Nguyen X-Patchwork-Id: 4978181 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6A4889F3DF for ; Fri, 26 Sep 2014 02:40:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 96AB7202AE for ; Fri, 26 Sep 2014 02:40:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C47A720274 for ; Fri, 26 Sep 2014 02:40:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752482AbaIZCk3 (ORCPT ); Thu, 25 Sep 2014 22:40:29 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:17833 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752386AbaIZCk3 (ORCPT ); Thu, 25 Sep 2014 22:40:29 -0400 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie3.idc.renesas.com with ESMTP; 26 Sep 2014 11:40:28 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 5E6F54C422; Fri, 26 Sep 2014 11:40:28 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 4CC2B8002E; Fri, 26 Sep 2014 11:40:28 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 4793A8002D; Fri, 26 Sep 2014 11:40:28 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id MAP23163; Fri, 26 Sep 2014 11:40:28 +0900 X-IronPort-AV: E=Sophos;i="5.04,601,1406559600"; d="scan'208";a="169968242" Received: from hqdg0130.wireless.renesas.com (HELO [10.161.20.130]) ([10.161.20.130]) by relmlii1.idc.renesas.com with ESMTP; 26 Sep 2014 11:40:28 +0900 Message-ID: <5424D21C.6000106@renesas.com> Date: Fri, 26 Sep 2014 11:40:28 +0900 From: Khiem Nguyen User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Magnus Damm , Simon Horman CC: khiem.nguyen.xt@renesas.com, Linux-sh list , KEITA KOBAYASHI Subject: [PATCH RFC 6/7] ARM: shmobile: Do additional settings for L2shutdown mode Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP According to Cortex-A15 TRM, some additional settings are needed. Although the procedure was not completely same as in TRM, it was referred to vexpress implementation to arrange order of additional settings. Signed-off-by: Khiem Nguyen --- arch/arm/mach-shmobile/platsmp-apmu.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c index dfa8a18..0dedb13 100644 --- a/arch/arm/mach-shmobile/platsmp-apmu.c +++ b/arch/arm/mach-shmobile/platsmp-apmu.c @@ -161,8 +161,32 @@ int shmobile_smp_apmu_boot_secondary(unsigned int cpu, struct task_struct *idle) #if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_SUSPEND) || \ defined(CONFIG_CPU_IDLE) +static void do_l2shutdown_settings(void) +{ + unsigned int v; + + /* Disable L2$ prefetches */ + asm volatile( + " mrc p15, 1, %0, c15, c0, 3\n" + " orr %0, %0, %1\n" + " mcr p15, 1, %0, c15, c0, 3\n" + : "=&r" (v) + : "Ir" (0x400) + : "cc"); + isb(); + dsb(); + + flush_cache_all(); + + /* Set Double lock control bit */ + __asm__ __volatile__("mcr p14, 0, %0, c1, c3, 4" : : "r" (0x1)); +} + static inline void cpu_enter_lowpower_a15(void) { + if (is_a15_l2shutdown) + do_l2shutdown_settings(); + v7_exit_coherency_flush(louis); } @@ -245,6 +269,7 @@ static int shmobile_smp_apmu_enter_suspend(suspend_state_t state) writel_relaxed(0x0, cpucmcr); rcar_sysc_clear_event_status(); + is_a15_l2shutdown = 0; return 0; }