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: 30043 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1798620446 for ; Tue, 13 May 2014 11:59:07 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id cm18sf556185qab.9 for ; Tue, 13 May 2014 04:59:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:dlp-filter:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe; bh=MlXC042JGD2iQouIe864P4RbGi3l7kEIdmKNMUKh6yU=; b=X5CYPfTu03bZ+DtyKY5NTc01VlxFAuSfL60PTQGDGyQ4Px5EacX8DKJypmufj96okk EB/aRMyv+5b+ZZy/9DcjesY2iXTRTzqOABSMhvWydxYxQ20GbQem29G2pPcWd53PzXly HCBNprloo0Q51IVSA+m8iuJpyQVqLeOSNPM/BOJKVGXl2vSLFLAF0zDLUOEBc9hvEfke Y0ewHzw6gPpAMAFGwxgKupjzM3m6uRu3iafTSSvcd7m0JiE0CYvLtgBLesAlLWH1GoPq OKeRHE/NjFSIjPL2OyynvMWc6NFsZejEFFXtiH9Zwmj9vFVqXgdKe3ZYa1qz45PbSdsa JA0A== X-Gm-Message-State: ALoCoQkEtfed4OlNSqW5FDsfh1lElYn9AVsbCmh0bYjta1+sxtQRNS/uvv579WtOLqZyHdtIZ16z X-Received: by 10.58.22.166 with SMTP id e6mr17115086vef.6.1399982347800; Tue, 13 May 2014 04:59:07 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.21.203 with SMTP id 69ls1867888qgl.35.gmail; Tue, 13 May 2014 04:59:07 -0700 (PDT) X-Received: by 10.58.38.40 with SMTP id d8mr83869vek.61.1399982347711; Tue, 13 May 2014 04:59:07 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id iy9si2596300vec.195.2014.05.13.04.59.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 May 2014 04:59:07 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.170 as permitted sender) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id lf12so282440vcb.1 for ; Tue, 13 May 2014 04:59:07 -0700 (PDT) X-Received: by 10.221.34.7 with SMTP id sq7mr28651700vcb.5.1399982347616; Tue, 13 May 2014 04:59:07 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp145049vcb; Tue, 13 May 2014 04:59:07 -0700 (PDT) X-Received: by 10.68.173.65 with SMTP id bi1mr4685000pbc.130.1399982346247; Tue, 13 May 2014 04:59:06 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ck1si13056382pad.94.2014.05.13.04.59.05; Tue, 13 May 2014 04:59:05 -0700 (PDT) Received-SPF: none (google.com: linux-samsung-soc-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932609AbaEML7F (ORCPT + 9 others); Tue, 13 May 2014 07:59:05 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:13606 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932610AbaEML7D (ORCPT ); Tue, 13 May 2014 07:59:03 -0400 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-samsung-soc@vger.kernel.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 Cc: kesavan.abhilash@gmail.com, Leela Krishna Amudala , Abhilash Kesavan 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+NgFprFIsWRmVeSWpSXmK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rJJCWWJOKVAoILG4WEnf DtOE0BA3XQuYxghd35AguB4jAzSQsIYx4+uDf2wFj4UqDt1aydLA+Ii/i5GTQ0LARKLtzTVm CFtM4sK99WxdjFwcQgKLGCXWfz3LCpIQEuhjklj9RBjEZhPQk1jw7yszSJGIQA+TxNo9LSwg CWaBOomdc/vAJgkLhEpsevmaCcRmEVCVWPLtANggXgFXiRePNzB2MXIAbVOQmDPJBiTMKeAm Ma21lRlil6vEjXONTBMYeRcwMqxiFE0tSC4oTkrPNdQrTswtLs1L10vOz93ECI7HZ1I7GFc2 WBxiFOBgVOLh/WlcGCzEmlhWXJl7iFGCg1lJhNf9E1CINyWxsiq1KD++qDQntfgQYzLQUROZ pUST84GpIq8k3tDYxNzU2NTSxMLEzJI0YSVx3gOt1oFCAumJJanZqakFqUUwW5g4OKUaGI0M 7m/dziJx3rS53u34fvd+/6teU2NbrhfOldic/bz8qnNFsd3hPatvuXvEtJovEjqjXqsoHznB x5lx0XKbdLcLKjFTH93Zfk+I3SdzyXL5Qydvz134xeRY64G5yqVPprj8sPixKvjn14M27AzC 3gEaVXHuZyX2sdodSrpfx2uXHBnAyNh2V4mlOCPRUIu5qDgRAPneoNgLAwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: a.kesavan@samsung.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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)