From patchwork Mon Sep 29 05:05:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khiem Nguyen X-Patchwork-Id: 4993431 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 2D3149F2BA for ; Mon, 29 Sep 2014 05:06:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 52A6B20254 for ; Mon, 29 Sep 2014 05:06:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7939A20142 for ; Mon, 29 Sep 2014 05:06:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751335AbaI2FGA (ORCPT ); Mon, 29 Sep 2014 01:06:00 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:9249 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750844AbaI2FF7 (ORCPT ); Mon, 29 Sep 2014 01:05:59 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie3.idc.renesas.com with ESMTP; 29 Sep 2014 14:05:58 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id F0C2C42421; Mon, 29 Sep 2014 14:05:58 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id F1891480A7; Mon, 29 Sep 2014 14:05:58 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id E994D480A4; Mon, 29 Sep 2014 14:05:58 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac4.idc.renesas.com with ESMTP id QAA28948; Mon, 29 Sep 2014 14:05:58 +0900 X-IronPort-AV: E=Sophos;i="5.04,617,1406559600"; d="scan'208";a="171207151" Received: from hqdg0130.wireless.renesas.com (HELO [10.161.20.130]) ([10.161.20.130]) by relmlii2.idc.renesas.com with ESMTP; 29 Sep 2014 14:05:58 +0900 Message-ID: <5428E8B6.4010504@renesas.com> Date: Mon, 29 Sep 2014 14:05:58 +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 , Linux-sh list , rjw@rjwysocki.net, Russell King CC: khiem.nguyen.xt@renesas.com, KEITA KOBAYASHI , Geert Uytterhoeven , sergei.shtylyov@cogentembedded.com Subject: [PATCH RFC v2 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.5 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 ef146fa..82db155 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); } @@ -246,6 +270,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; }