From patchwork Tue Nov 6 06:12:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhilash Kesavan X-Patchwork-Id: 1703051 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 514B83FCDE for ; Tue, 6 Nov 2012 06:09:04 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TVcJl-0000OB-3Y; Tue, 06 Nov 2012 06:07:21 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TVcJg-0000Ko-7W for linux-arm-kernel@lists.infradead.org; Tue, 06 Nov 2012 06:07:17 +0000 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MD100355Y9YD2G0@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 06 Nov 2012 15:07:13 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.122]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 4F.C7.01231.119A8905; Tue, 06 Nov 2012 15:07:13 +0900 (KST) X-AuditID: cbfee61a-b7fa66d0000004cf-8d-5098a911fef0 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 1E.C7.01231.119A8905; Tue, 06 Nov 2012 15:07:13 +0900 (KST) Received: from localhost.localdomain ([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 <0MD100IY4YA4QW80@mmp1.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 06 Nov 2012 15:07:13 +0900 (KST) From: Abhilash Kesavan To: linux-arm-kernel@lists.infradead.org, kgene.kim@samsung.com Subject: [PATCH 1/5] ARM: EXYNOS: fix the hotplug for Cortex-A15 Date: Tue, 06 Nov 2012 11:42:32 +0530 Message-id: <1352182356-28989-2-git-send-email-a.kesavan@samsung.com> X-Mailer: git-send-email 1.6.6.1 In-reply-to: <1352182356-28989-1-git-send-email-a.kesavan@samsung.com> References: <1352182356-28989-1-git-send-email-a.kesavan@samsung.com> DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrALMWRmVeSWpSXmKPExsWyRsSkSldw5YwAg1lbzSw2Pb7G6sDosXlJ fQBjFJdNSmpOZllqkb5dAlfGihXrmQr2CFVsP7yVrYHxOl8XIyeHhICJxJcDG1ggbDGJC/fW s3UxcnEICSxllGg5184MU/Rv1VVmiMQiRomTNxoYIZz1TBJt+48xglSxCehJLPj3FaxDRMBe YsWJk2C2sICDxI7Wf2wgNouAqsSV/sdMIDavgKvE9df7mSA2KEic/rCWHcTmFHCTWPmzHywu BFRz4spKRoheAYlvkw8BncoBVC8rsekA2EESAkfYJD6emgE1R1Li4IobLBMYhRYwMqxiFE0t SC4oTkrPNdQrTswtLs1L10vOz93ECAy20/+eSe1gXNlgcYhRgINRiYd3p/CMACHWxLLiytxD jBIczEoivBx3pgcI8aYkVlalFuXHF5XmpBYfYvQBumQis5Rocj4wEvJK4g2NTcxNjU0tjYzM TE1xCCuJ8zZ7pAQICaQnlqRmp6YWpBbBjGPi4JRqYGyMUXt9pueTtMDU09pTL17b/kzR84eZ wemGhc9MRDRX7OYIs71TOD23yctwlsQkzqbnn5L9/Gdu65Vs7/pS87GM/cvcUOOIxhdTXu9e uF3nVqtThvR2BjZtvQSZpCL7W9OPGMTFJu5fdYvnBK9llPyKK2vWHfOaKx8wq2PHf2W7Wnnl 6dP2bVViKc5INNRiLipOBABWy67kYwIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrPLMWRmVeSWpSXmKPExsVy+t9jAV3BlTMCDD690LPY9PgaqwOjx+Yl 9QGMUQ2MNhmpiSmpRQqpecn5KZl56bZK3sHxzvGmZgaGuoaWFuZKCnmJuam2Si4+AbpumTlA U5UUyhJzSoFCAYnFxUr6dpgmhIa46VrANEbo+oYEwfUYGaCBhDWMGStWrGcq2CNUsf3wVrYG xut8XYycHBICJhL/Vl1lhrDFJC7cW8/WxcjFISSwiFHi5I0GRghnPZNE2/5jjCBVbAJ6Egv+ fQXrEBGwl1hx4iSYLSzgILGj9R8biM0ioCpxpf8xE4jNK+Aqcf31fiaIDQoSpz+sZQexOQXc JFb+7AeLCwHVnLiyknECI88CRoZVjKKpBckFxUnpuYZ6xYm5xaV56XrJ+bmbGMGh/ExqB+PK BotDjAIcjEo8vDuFZwQIsSaWFVfmHmKU4GBWEuHluDM9QIg3JbGyKrUoP76oNCe1+BCjD9BV E5mlRJPzgXGWVxJvaGxibmpsamliYWJmiUNYSZy32SMlQEggPbEkNTs1tSC1CGYcEwenVAPj lniHvnTO4u2R5aesEp/decojZ3+30aT6ZPKF2qmZob/LbCWM5vx8LWjnm3J50v9pDzsXHdoh Zrzy2OatsxLqerKqRDPvX5ng2MlxedLsT47S12apmU/e9FlBVfS549rbOsK2NXv7Kk/c3u/M O1XnTR/bbzYuxuXW/gvUzT9n9f4PCIvUWPtciaU4I9FQi7moOBEAJQJQhZICAAA= X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121106_010716_604411_FAEF8BAF X-CRM114-Status: GOOD ( 13.02 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.33 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The sequence of cpu_enter_lowpower() for Cortex-A15 is different from the sequence for Cortex-A9. This patch implements cpu_enter_lowpower() for EXYNOS5 SoC which has Cortex-A15 cores. Signed-off-by: Changhwan Youn Cc: Russell King Signed-off-by: Kukjin Kim Tested-by: Abhilash Kesavan --- arch/arm/mach-exynos/hotplug.c | 45 +++++++++++++++++++++++++++++++++++++-- 1 files changed, 42 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-exynos/hotplug.c b/arch/arm/mach-exynos/hotplug.c index f4d7dd2..8c06c4f 100644 --- a/arch/arm/mach-exynos/hotplug.c +++ b/arch/arm/mach-exynos/hotplug.c @@ -20,10 +20,11 @@ #include #include +#include #include "common.h" -static inline void cpu_enter_lowpower(void) +static inline void cpu_enter_lowpower_a9(void) { unsigned int v; @@ -45,6 +46,35 @@ static inline void cpu_enter_lowpower(void) : "cc"); } +static inline void cpu_enter_lowpower_a15(void) +{ + unsigned int v; + + asm volatile( + " mrc p15, 0, %0, c1, c0, 0\n" + " bic %0, %0, %1\n" + " mcr p15, 0, %0, c1, c0, 0\n" + : "=&r" (v) + : "Ir" (CR_C) + : "cc"); + + flush_cache_all(); + + asm volatile( + /* + * Turn off coherency + */ + " mrc p15, 0, %0, c1, c0, 1\n" + " bic %0, %0, %1\n" + " mcr p15, 0, %0, c1, c0, 1\n" + : "=&r" (v) + : "Ir" (0x40) + : "cc"); + + isb(); + dsb(); +} + static inline void cpu_leave_lowpower(void) { unsigned int v; @@ -103,11 +133,20 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious) void __ref exynos_cpu_die(unsigned int cpu) { int spurious = 0; + int primary_part = 0; /* - * we're ready for shutdown now, so do it + * we're ready for shutdown now, so do it. + * Exynos4 is A9 based while Exynos5 is A15; check the CPU part + * number by reading the Main ID register and then perform the + * appropriate sequence for entering low power. */ - cpu_enter_lowpower(); + asm("mrc p15, 0, %0, c0, c0, 0" : "=r"(primary_part) : : "cc"); + if ((primary_part & 0xfff0) == 0xc0f0) + cpu_enter_lowpower_a15(); + else + cpu_enter_lowpower_a9(); + platform_do_lowpower(cpu, &spurious); /*