From patchwork Tue May 13 11:58:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhilash Kesavan X-Patchwork-Id: 4167071 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 A4799BFF02 for ; Tue, 13 May 2014 12:01:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 74E102018A for ; Tue, 13 May 2014 12:01:49 +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 759D0200D4 for ; Tue, 13 May 2014 12:01:48 +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 1WkBMk-0008GC-Pl; Tue, 13 May 2014 11:59:26 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WkBMh-00081Y-Qb for linux-arm-kernel@lists.infradead.org; Tue, 13 May 2014 11:59:24 +0000 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N5I00ASYHAEHR90@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 13 May 2014 20:59:02 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.125]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id D4.2A.11120.60902735; Tue, 13 May 2014 20:59:02 +0900 (KST) X-AuditID: cbfee68f-b7eff6d000002b70-3a-5372090617b3 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id CE.89.27725.60902735; Tue, 13 May 2014 20:59:02 +0900 (KST) Received: from abhilash-ubuntu.sisodomain.com ([107.108.73.92]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N5I00EZ6H7CR340@mmp1.samsung.com>; Tue, 13 May 2014 20:59:01 +0900 (KST) From: Abhilash Kesavan To: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kgene.kim@samsung.com, abrestic@chromium.org, thomas.ab@samsung.com, inderpal.s@samsung.com, lorenzo.pieralisi@arm.com, nicolas.pitre@linaro.org, Dave.Martin@arm.com, t.figa@samsung.com Subject: [PATCH v6 2/5] ARM: EXYNOS: use generic exynos cpu power control functions Date: Tue, 13 May 2014 17:28:41 +0530 Message-id: <1399982324-27879-3-git-send-email-a.kesavan@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1399982324-27879-1-git-send-email-a.kesavan@samsung.com> References: <1399982324-27879-1-git-send-email-a.kesavan@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprFIsWRmVeSWpSXmKPExsWyRsSkVpeNsyjY4PQ/IYvHaxYzWax8/5fR omnuHkaL3fe+MFqs+atk0bvgKpvFhP0fWCw2Pb7GajHj/D4mize/X7BbfHr2j91i/YzXLBYd yxgdeD3WzFvD6DG74SKLx85Zd9k97lzbw+axeUm9R9+WVYwenzfJBbBHcdmkpOZklqUW6dsl cGV8ffCPreCxUMWhWytZGhgf8XcxcnJICJhIdN07xgRhi0lcuLeeDcQWEljKKDFrtzBMTdub a8xdjFxA8UWMEuu/nmWFKOpjklj9BKyITUBPYsG/r2BFIgI9TBJr97SwgCSYBeokds7tYwax hQVCJTa9fA22jUVAVWLJtwNgg3gFXCVePN7A2MXIAbRNQWLO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QntfgQYzLQUROZ pUST84GpIq8k3tDYxNzU2NTSxMLEzJI0YSVx3gOt1oFCAumJJanZqakFqUUwW5g4OKUaGI0M 7m/dziJx3rS53u34fvd+/6teU2NbrhfOldic/bz8qnNFsd3hPatvuXvEtJovEjqjXqsoHznB x5lx0XKbdLcLKjFTH93Zfk+I3SdzyXL5Qydvz134xeRY64G5yqVPprj8sPixKvjn14M27AzC 3gEaVXHuZyX2sdodSrpfx2uXHBnAyNh2V4mlOCPRUIu5qDgRAPneoNgLAwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140513_045924_038116_D3B384EA X-CRM114-Status: GOOD ( 11.56 ) X-Spam-Score: -5.7 (-----) Cc: Abhilash Kesavan , kesavan.abhilash@gmail.com, Leela Krishna Amudala 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 From: Leela Krishna Amudala Use generic exynos cpu power control functions to power up/down and to know the status of the cpu in platsmp and hotplug code. Signed-off-by: Leela Krishna Amudala Signed-off-by: Abhilash Kesavan --- arch/arm/mach-exynos/hotplug.c | 2 +- arch/arm/mach-exynos/platsmp.c | 9 +++------ arch/arm/mach-exynos/regs-pmu.h | 3 --- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/arch/arm/mach-exynos/hotplug.c b/arch/arm/mach-exynos/hotplug.c index 3cab3f5..69fa483 100644 --- a/arch/arm/mach-exynos/hotplug.c +++ b/arch/arm/mach-exynos/hotplug.c @@ -44,7 +44,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); + exynos_cpu_power_down(cpu); /* * here's the WFI diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c index 51cdabe..9c16da2 100644 --- a/arch/arm/mach-exynos/platsmp.c +++ b/arch/arm/mach-exynos/platsmp.c @@ -131,15 +131,12 @@ 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)) { - __raw_writel(S5P_CORE_LOCAL_PWR_EN, - S5P_ARM_CORE1_CONFIGURATION); - + if (!exynos_cpu_power_state(cpu)) { + exynos_cpu_power_up(cpu); timeout = 10; /* wait max 10 ms until cpu1 is on */ - while ((__raw_readl(S5P_ARM_CORE1_STATUS) - & S5P_CORE_LOCAL_PWR_EN) != S5P_CORE_LOCAL_PWR_EN) { + while (exynos_cpu_power_state(cpu) != 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 84634ac..98fb8d8 100644 --- a/arch/arm/mach-exynos/regs-pmu.h +++ b/arch/arm/mach-exynos/regs-pmu.h @@ -111,9 +111,6 @@ #define EXYNOS_ARM_CORE_STATUS(_nr) \ (EXYNOS_ARM_CORE_CONFIGURATION(_nr) + 0x4) -#define S5P_ARM_CORE1_CONFIGURATION S5P_PMUREG(0x2080) -#define S5P_ARM_CORE1_STATUS S5P_PMUREG(0x2084) - #define S5P_PAD_RET_MAUDIO_OPTION S5P_PMUREG(0x3028) #define S5P_PAD_RET_GPIO_OPTION S5P_PMUREG(0x3108) #define S5P_PAD_RET_UART_OPTION S5P_PMUREG(0x3128)