From patchwork Mon Jun 2 12:35:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 4281651 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3744F9F326 for ; Mon, 2 Jun 2014 12:40:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6164D203B5 for ; Mon, 2 Jun 2014 12:40:41 +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 95CA7203B0 for ; Mon, 2 Jun 2014 12:40:40 +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 1WrRVn-0000EB-Na; Mon, 02 Jun 2014 12:38:47 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WrRVZ-00089l-9p for linux-arm-kernel@lists.infradead.org; Mon, 02 Jun 2014 12:38:34 +0000 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N6J0025NKFNWKC0@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 02 Jun 2014 21:38:11 +0900 (KST) X-AuditID: cbfee61b-b7fbb6d000001be3-1f-538c70337ca2 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id EB.F2.07139.3307C835; Mon, 02 Jun 2014 21:38:11 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N6J007MFKBF0910@mmp2.samsung.com>; Mon, 02 Jun 2014 21:38:11 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Kukjin Kim Subject: [PATCH v2 7/7] ARM: EXYNOS: cpuidle: add secure firmware support to AFTR mode code Date: Mon, 02 Jun 2014 14:35:43 +0200 Message-id: <1401712543-14281-8-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1401712543-14281-1-git-send-email-b.zolnierkie@samsung.com> References: <1401712543-14281-1-git-send-email-b.zolnierkie@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrKLMWRmVeSWpSXmKPExsVy+t9jQV3jgp5gg0/njSw2zljPajHvs6xF 74KrbBZnm96wW7w/9IzZYtPja6wWl3fNYbP43HuE0WLG+X1MFmdOX2K1OPmnl9Fi/YzXLBYb v3o48HrcubaHzWPzknqP2/8eM3tsudrO4tG3ZRWjx+dNcgFsUVw2Kak5mWWpRfp2CVwZC5ZN ZC/4KVTxsmcRcwPjK/4uRk4OCQETiblNC9ghbDGJC/fWs3UxcnEICUxnlLhz5wcjhNPFJDHj 7llWkCo2ASuJie2rGEFsEQE1iZ7FW8GKmAX2Mkss7d4ENkpYIFZizZ8nLCA2i4CqxO3568Hi vAIeEtMWfGKCWKco0f1sAhuIzSngKbHy3kOwBUJANfte7WKawMi7gJFhFaNoakFyQXFSeq6R XnFibnFpXrpecn7uJkZwYD6T3sG4qsHiEKMAB6MSD+8P9Z5gIdbEsuLK3EOMEhzMSiK8Sy2A QrwpiZVVqUX58UWlOanFhxilOViUxHkPtloHCgmkJ5akZqemFqQWwWSZODilGhjVW5Qus0o7 r8556Juz7tynD/yP1OfO/NWx/PHF/awqzB+OPNuU7fXGW2/nU6+8hZoH0iWalRcZBfIFz/y7 9cRa3qIvFuVZjxbs+Tqx9ujGCaHfJZcZ2tfZTJy4uEYzXO5r5+7TayqEps3XZn3/V2LuA7eP XRM39W1p2P9+StHLQr34swLiT9aeV2Ipzkg01GIuKk4EAD3uT29IAgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140602_053833_532973_025C7CD4 X-CRM114-Status: GOOD ( 12.94 ) X-Spam-Score: -5.7 (-----) Cc: linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, Sachin Kamat , Viresh Kumar , Tomasz Figa , Daniel Lezcano , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Kyungmin Park , linaro-kernel@lists.linaro.org, linux-arm-kernel@lists.infradead.org, b.zolnierkie@samsung.com 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 * Use do_idle firmware method instead of cpu_do_idle() on boards with secure firmware enabled. * Use sysram_ns_base_addr + 0x24 address for exynos_boot_vector_addr() and sysram_ns_base_addr + 0x20 one for exynos_boot_vector_flag() on boards with secure firmware enabled. This patch fixes hang on an attempt to enter AFTR mode for TRATS2 board (which uses EXYNOS4412 SoC with secure firmware enabled). This patch shouldn't cause any functionality changes on boards that don't use secure firmware. Signed-off-by: Bartlomiej Zolnierkiewicz Acked-by: Kyungmin Park --- arch/arm/mach-exynos/pm.c | 8 ++++++-- drivers/cpuidle/cpuidle-exynos.c | 7 ++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c index 0fb9a5a..62a0a5e 100644 --- a/arch/arm/mach-exynos/pm.c +++ b/arch/arm/mach-exynos/pm.c @@ -169,7 +169,9 @@ int exynos_cluster_power_state(int cluster) static inline void __iomem *exynos_boot_vector_addr(void) { - if (samsung_rev() == EXYNOS4210_REV_1_1) + if (firmware_run()) + return sysram_ns_base_addr + 0x24; + else if (samsung_rev() == EXYNOS4210_REV_1_1) return S5P_INFORM7; else if (samsung_rev() == EXYNOS4210_REV_1_0) return sysram_base_addr + 0x24; @@ -178,7 +180,9 @@ static inline void __iomem *exynos_boot_vector_addr(void) static inline void __iomem *exynos_boot_vector_flag(void) { - if (samsung_rev() == EXYNOS4210_REV_1_1) + if (firmware_run()) + return sysram_ns_base_addr + 0x20; + else if (samsung_rev() == EXYNOS4210_REV_1_1) return S5P_INFORM6; else if (samsung_rev() == EXYNOS4210_REV_1_0) return sysram_base_addr + 0x20; diff --git a/drivers/cpuidle/cpuidle-exynos.c b/drivers/cpuidle/cpuidle-exynos.c index 7c01512..f90a4a0 100644 --- a/drivers/cpuidle/cpuidle-exynos.c +++ b/drivers/cpuidle/cpuidle-exynos.c @@ -17,13 +17,18 @@ #include #include #include +#include static void (*exynos_enter_aftr)(void); static int idle_finisher(unsigned long flags) { exynos_enter_aftr(); - cpu_do_idle(); + if (firmware_run()) + /* no need to check the return value on EXYNOS SoCs */ + call_firmware_op(do_idle, FW_DO_IDLE_AFTR); + else + cpu_do_idle(); return 1; }