From patchwork Tue Aug 5 13:34:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 4679161 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 701A49F373 for ; Tue, 5 Aug 2014 13:37:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D92F520117 for ; Tue, 5 Aug 2014 13:37:07 +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 4687B200ED for ; Tue, 5 Aug 2014 13:37:04 +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 1XEetY-0003PZ-M6; Tue, 05 Aug 2014 13:35:16 +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 1XEetP-0002BL-I4 for linux-arm-kernel@lists.infradead.org; Tue, 05 Aug 2014 13:35:11 +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 <0N9U00I6Y5PZ4J20@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 05 Aug 2014 22:34:47 +0900 (KST) X-AuditID: cbfee61a-f79e46d00000134f-98-53e0dd76680d Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 9C.33.04943.67DD0E35; Tue, 05 Aug 2014 22:34:46 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N9U00GY75PGK020@mmp1.samsung.com>; Tue, 05 Aug 2014 22:34:46 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Kukjin Kim Subject: [PATCH v5 2/5] ARM: EXYNOS: add AFTR mode support to firmware do_idle method Date: Tue, 05 Aug 2014 15:34:23 +0200 Message-id: <1407245666-20016-3-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1407245666-20016-1-git-send-email-b.zolnierkie@samsung.com> References: <1407245666-20016-1-git-send-email-b.zolnierkie@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrKLMWRmVeSWpSXmKPExsVy+t9jAd2yuw+CDfZ/sbHYOGM9q8W8z7IW vQuuslmcbXrDbvH+0DNmi02Pr7FaXN41h83ic+8RRosZ5/cxWZw5fYnV4uSfXkaL9TNes1hs /OrhwOtx59oeNo/NS+o9bv97zOyx5Wo7i0ffllWMHp83yQWwRXHZpKTmZJalFunbJXBltKzd z1awR7DibtsdxgbGs3xdjJwcEgImEs1d3cwQtpjEhXvr2boYuTiEBBYxSpzY28MO4XQxSXw7 s54RpIpNwEpiYvsqMFtEQE2iZ/FWRpAiZoG9zBJLuzexgySEBcIl/vTvZgWxWQRUJc48/Qu2 glfAQ+LpjQ1MEOsUJbqfTWADsTkFPCUarz0DqxECqtl8ZTfTBEbeBYwMqxhFUwuSC4qT0nMN 9YoTc4tL89L1kvNzNzGCA/OZ1A7GlQ0WhxgFOBiVeHgF1O4HC7EmlhVX5h5ilOBgVhLhZb/9 IFiINyWxsiq1KD++qDQntfgQozQHi5I474FW60AhgfTEktTs1NSC1CKYLBMHp1QD48Yk3Sx5 NsePTfkqPxjNtl1KeXO5Ybq0y84H3BJfXzY3LPV0zz/8dr2bioXSoe9MK9qfdJXGZH1Kk+Nf 3+P3cM1CQ4fG9P2fp7a4TZnrHsA+a2LIGgXx6xFxf4OzpOY4rtA5/tXNt1rgY50U49Nlh28q z07g4cg7Zic/LVK70rPu15GEVN90JZbijERDLeai4kQAx4IkN0gCAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140805_063507_750488_C55FCEA6 X-CRM114-Status: GOOD ( 13.18 ) 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.18-1 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.6 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 some platforms (i.e. EXYNOS ones) more than one idle mode is available and we need to distinguish them in firmware do_idle method. Add mode parameter to do_idle firmware method and AFTR mode support to EXYNOS do_idle implementation. This change is a preparation for adding secure firmware support to EXYNOS cpuidle driver. This patch shouldn't cause any functionality changes (please note that do_idle firmware method is unused currently). Signed-off-by: Bartlomiej Zolnierkiewicz Acked-by: Kyungmin Park --- arch/arm/include/asm/firmware.h | 2 +- arch/arm/mach-exynos/common.h | 5 +++++ arch/arm/mach-exynos/firmware.c | 10 ++++++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/arch/arm/include/asm/firmware.h b/arch/arm/include/asm/firmware.h index 5904f59..89aefe1 100644 --- a/arch/arm/include/asm/firmware.h +++ b/arch/arm/include/asm/firmware.h @@ -28,7 +28,7 @@ struct firmware_ops { /* * Enters CPU idle mode */ - int (*do_idle)(void); + int (*do_idle)(unsigned long mode); /* * Sets boot address of specified physical CPU */ diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index c218200..2d830df 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h @@ -119,6 +119,11 @@ extern void __iomem *sysram_base_addr; extern void __iomem *pmu_base_addr; void exynos_sysram_init(void); +enum { + FW_DO_IDLE_SLEEP, + FW_DO_IDLE_AFTR, +}; + void exynos_firmware_init(void); extern u32 exynos_get_eint_wake_mask(void); diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c index f5e626d..e57b7c3 100644 --- a/arch/arm/mach-exynos/firmware.c +++ b/arch/arm/mach-exynos/firmware.c @@ -28,9 +28,15 @@ #define EXYNOS_BOOT_ADDR 0x8 #define EXYNOS_BOOT_FLAG 0xc -static int exynos_do_idle(void) +static int exynos_do_idle(unsigned long mode) { - exynos_smc(SMC_CMD_SLEEP, 0, 0, 0); + switch (mode) { + case FW_DO_IDLE_AFTR: + exynos_smc(SMC_CMD_CPU0AFTR, 0, 0, 0); + break; + case FW_DO_IDLE_SLEEP: + exynos_smc(SMC_CMD_SLEEP, 0, 0, 0); + } return 0; }