From patchwork Fri Sep 26 02:40:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khiem Nguyen X-Patchwork-Id: 4978191 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 43F15BEEA6 for ; Fri, 26 Sep 2014 02:40:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6EE9B20274 for ; Fri, 26 Sep 2014 02:40:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8C9B820265 for ; Fri, 26 Sep 2014 02:40:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752482AbaIZCkk (ORCPT ); Thu, 25 Sep 2014 22:40:40 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:18242 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752386AbaIZCkj (ORCPT ); Thu, 25 Sep 2014 22:40:39 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie2.idc.renesas.com with ESMTP; 26 Sep 2014 11:40:39 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 21A1A3D126; Fri, 26 Sep 2014 11:40:39 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 0DCC88002E; Fri, 26 Sep 2014 11:40:39 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 0841A8002D; Fri, 26 Sep 2014 11:40:39 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac1.idc.renesas.com with ESMTP id MAF23247; Fri, 26 Sep 2014 11:40:39 +0900 X-IronPort-AV: E=Sophos;i="5.04,602,1406559600"; d="scan'208";a="171053560" Received: from hqdg0130.wireless.renesas.com (HELO [10.161.20.130]) ([10.161.20.130]) by relmlii2.idc.renesas.com with ESMTP; 26 Sep 2014 11:40:38 +0900 Message-ID: <5424D226.7020502@renesas.com> Date: Fri, 26 Sep 2014 11:40:38 +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 7/7] ARM: shmobile: Use separate CPUCMCR addresses for CA15/CA7 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 It turned out that the CPUCMCR common address was not worked for CA7. Change to use separate CPUCMCR addresses for CA15 and CA7. Signed-off-by: Khiem Nguyen --- arch/arm/mach-shmobile/platsmp-apmu.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c index 0dedb13..7d030fc 100644 --- a/arch/arm/mach-shmobile/platsmp-apmu.c +++ b/arch/arm/mach-shmobile/platsmp-apmu.c @@ -36,9 +36,11 @@ static struct { #define WUPCR_OFFS 0x10 #define PSTR_OFFS 0x40 #define CPUNCR_OFFS(n) (0x100 + (0x10 * (n))) -#define CPUCMCR 0xe6154184 +#define CPUCMCR_CA7 0xe6151184 +#define CPUCMCR_CA15 0xe6152184 -void __iomem *cpucmcr; +void __iomem *cpucmcr_ca7; +void __iomem *cpucmcr_ca15; static int __maybe_unused apmu_power_on(void __iomem *p, int bit) { @@ -254,20 +256,25 @@ static int shmobile_smp_apmu_enter_suspend(suspend_state_t state) */ gic_cpu_if_down(); - writel_relaxed(0x2, cpucmcr); if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A15) { is_a15_l2shutdown = 1; asm volatile("mrc p15, 1, %0, c9 , c0, 2" : "=r" (l2ctlr_value)); pr_debug("%s: l2ctlr: 0x%08x\n", __func__, l2ctlr_value); - } else + } else { + writel_relaxed(0x2, cpucmcr_ca7); is_a15_l2shutdown = 0; + } shmobile_smp_hook(smp_processor_id(), virt_to_phys(rcar_cpu_resume), 0); cpu_suspend(smp_processor_id(), shmobile_smp_apmu_do_suspend); cpu_leave_lowpower(); - writel_relaxed(0x0, cpucmcr); + if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A15) + writel_relaxed(0x0, cpucmcr_ca15); + else + writel_relaxed(0x0, cpucmcr_ca7); + rcar_sysc_clear_event_status(); is_a15_l2shutdown = 0; @@ -276,7 +283,9 @@ static int shmobile_smp_apmu_enter_suspend(suspend_state_t state) void __init shmobile_smp_apmu_suspend_init(void) { - cpucmcr = ioremap_nocache(CPUCMCR, 0x4); + cpucmcr_ca7 = ioremap_nocache(CPUCMCR_CA7, 0x4); + cpucmcr_ca15 = ioremap_nocache(CPUCMCR_CA15, 0x4); + shmobile_suspend_ops.enter = shmobile_smp_apmu_enter_suspend; } #endif