From patchwork Fri Apr 18 14:42:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 4016571 Return-Path: X-Original-To: patchwork-linux-arm@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 430B8BFF02 for ; Fri, 18 Apr 2014 14:46:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6D8A7203B1 for ; Fri, 18 Apr 2014 14:46:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 72848202B4 for ; Fri, 18 Apr 2014 14:46:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WbA1N-0007Uq-Qs; Fri, 18 Apr 2014 14:44:05 +0000 Received: from mailout4.w1.samsung.com ([210.118.77.14]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WbA0z-0006kp-3t for linux-arm-kernel@lists.infradead.org; Fri, 18 Apr 2014 14:43:41 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N48003PFE7X7B60@mailout4.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 18 Apr 2014 15:43:09 +0100 (BST) X-AuditID: cbfec7f5-b7fc96d000004885-30-53513a0058aa Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 1F.CB.18565.00A31535; Fri, 18 Apr 2014 15:43:12 +0100 (BST) Received: from AMDC1227.digital.local ([106.116.147.199]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0N480017ZE7W2P00@eusync3.samsung.com>; Fri, 18 Apr 2014 15:43:12 +0100 (BST) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH 1/4] ARM: EXYNOS: Fix definitions of S5P_ARM_CORE_* registers Date: Fri, 18 Apr 2014 16:42:58 +0200 Message-id: <1397832181-5153-2-git-send-email-t.figa@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1397832181-5153-1-git-send-email-t.figa@samsung.com> References: <1397832181-5153-1-git-send-email-t.figa@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprLLMWRmVeSWpSXmKPExsVy+t/xq7oMVoHBBuv+sFj8nXSM3WL+kXOs Fr0LrrJZbHp8jdVixvl9TBZrj9xlt/h75x+bxdLrF5ksWvceYbdYP+M1i8XmTVOZLVbt+sPo wOOxZt4aRo/fvyYxeuycdZfdY9OqTjaPd+fOsXtsXlLv0bdlFaPH501yARxRXDYpqTmZZalF +nYJXBn3mpeyFLSIVGx+0sXWwPhaoIuRg0NCwERiwlqRLkZOIFNM4sK99WxdjFwcQgJLGSWO TNvBBOH0MUm0/HnOBlLFJqAm8bnhEZgtIqAq8bltATtIEbPAdGaJb0c6WUASwgK+Em27J4LZ LEBF3R9OMoHYvAKOEjc33maCWCcn8f/lCjCbU8BJYvnEC2D1QkA1W641ME5g5F3AyLCKUTS1 NLmgOCk910ivODG3uDQvXS85P3cTIyRIv+5gXHrM6hCjAAejEg/vha/+wUKsiWXFlbmHGCU4 mJVEeHf/DQgW4k1JrKxKLcqPLyrNSS0+xMjEwSnVwBgp8tlMdhP317DXWbIPNq7vm1zVHci/ UHNXx+MmnbaG3oKpDT9WPXLz/Noi560l7uFkM8Xbw21C2a+OD39NWLUzDZm3hVqfWa3wuLV5 W8DjCqcLL+coZk8IEKid3/Kr5sKqm/4Pm5a/q/O3Y192z6hq86K7U9ZynzPsuvz28CORPt9N k6xu5CuxFGckGmoxFxUnAgD3flTxMAIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140418_074341_313187_792F469D X-CRM114-Status: GOOD ( 13.37 ) X-Spam-Score: -5.7 (-----) Cc: Mark Rutland , devicetree@vger.kernel.org, Kukjin Kim , Arnd Bergmann , Marc Zyngier , Tomasz Figa , Tomasz Figa , Rob Herring , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Marek Szyprowski X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 On SoCs with more than 2 cores there are more than 2 S5P_ARM_CORE_* registers that can be addressed with fixed stride of 0x80. This patch renames the definitions of S5P_ARM_CORE1_* registers to be S5P_ARM_CORE_* and make them take physical core ID as argument to calculate register address. Signed-off-by: Tomasz Figa --- arch/arm/mach-exynos/hotplug.c | 2 +- arch/arm/mach-exynos/platsmp.c | 6 +++--- arch/arm/mach-exynos/regs-pmu.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-exynos/hotplug.c b/arch/arm/mach-exynos/hotplug.c index 5eead53..7e0f31a 100644 --- a/arch/arm/mach-exynos/hotplug.c +++ b/arch/arm/mach-exynos/hotplug.c @@ -96,7 +96,7 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious) /* make cpu1 to be turned off at next WFI command */ if (cpu == 1) - __raw_writel(0, S5P_ARM_CORE1_CONFIGURATION); + __raw_writel(0, S5P_ARM_CORE_CONFIGURATION(1)); /* * here's the WFI diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c index 03e5e9f..7b7de4b 100644 --- a/arch/arm/mach-exynos/platsmp.c +++ b/arch/arm/mach-exynos/platsmp.c @@ -107,14 +107,14 @@ static int exynos_boot_secondary(unsigned int cpu, struct task_struct *idle) */ write_pen_release(phys_cpu); - if (!(__raw_readl(S5P_ARM_CORE1_STATUS) & S5P_CORE_LOCAL_PWR_EN)) { + if (!(__raw_readl(S5P_ARM_CORE_STATUS(1)) & S5P_CORE_LOCAL_PWR_EN)) { __raw_writel(S5P_CORE_LOCAL_PWR_EN, - S5P_ARM_CORE1_CONFIGURATION); + S5P_ARM_CORE_CONFIGURATION(1)); timeout = 10; /* wait max 10 ms until cpu1 is on */ - while ((__raw_readl(S5P_ARM_CORE1_STATUS) + while ((__raw_readl(S5P_ARM_CORE_STATUS(1)) & S5P_CORE_LOCAL_PWR_EN) != S5P_CORE_LOCAL_PWR_EN) { if (timeout-- == 0) break; diff --git a/arch/arm/mach-exynos/regs-pmu.h b/arch/arm/mach-exynos/regs-pmu.h index 4f6a256..d94bbc8 100644 --- a/arch/arm/mach-exynos/regs-pmu.h +++ b/arch/arm/mach-exynos/regs-pmu.h @@ -105,8 +105,8 @@ #define S5P_GPS_LOWPWR S5P_PMUREG(0x139C) #define S5P_GPS_ALIVE_LOWPWR S5P_PMUREG(0x13A0) -#define S5P_ARM_CORE1_CONFIGURATION S5P_PMUREG(0x2080) -#define S5P_ARM_CORE1_STATUS S5P_PMUREG(0x2084) +#define S5P_ARM_CORE_CONFIGURATION(n) S5P_PMUREG(0x2000 + (n) * 0x80) +#define S5P_ARM_CORE_STATUS(n) S5P_PMUREG(0x2004 + (n) * 0x80) #define S5P_PAD_RET_MAUDIO_OPTION S5P_PMUREG(0x3028) #define S5P_PAD_RET_GPIO_OPTION S5P_PMUREG(0x3108)