From patchwork Fri Sep 5 13:51:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 4852371 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 75B7B9F2EC for ; Fri, 5 Sep 2014 13:57:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C5A2E20260 for ; Fri, 5 Sep 2014 13:57:31 +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 97B412025A for ; Fri, 5 Sep 2014 13:57:30 +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 1XPtwi-0007Jb-Ej; Fri, 05 Sep 2014 13:53:00 +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 1XPtwP-00070b-Td for linux-arm-kernel@lists.infradead.org; Fri, 05 Sep 2014 13:52:42 +0000 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NBF004K3L7B4GD0@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 05 Sep 2014 22:52:23 +0900 (KST) X-AuditID: cbfee61b-f79f86d00000144c-02-5409c0178d4b Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id E9.63.05196.710C9045; Fri, 05 Sep 2014 22:52:23 +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 <0NBF00CACL5UXFA0@mmp1.samsung.com>; Fri, 05 Sep 2014 22:52:23 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Kukjin Kim Subject: [PATCH v6 2/5] ARM: EXYNOS: add AFTR mode support to firmware do_idle method Date: Fri, 05 Sep 2014 15:51:25 +0200 Message-id: <1409925088-4705-3-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1409925088-4705-1-git-send-email-b.zolnierkie@samsung.com> References: <1409925088-4705-1-git-send-email-b.zolnierkie@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrALMWRmVeSWpSXmKPExsVy+t9jAV3xA5whBnevCFpsnLGe1WLeZ1mL 3gVX2SzONr1ht3h/6BmzxabH11gtLu+aw2bxufcIo8WM8/uYLM6cvsRqcfJPL6PFxq8eDjwe d67tYfPYvKTe4/a/x8weW662s3j0bVnF6PF5k1wAWxSXTUpqTmZZapG+XQJXxvrVM9gLLgpW tE1dydzAeIuvi5GTQ0LARGL1mxVMELaYxIV769m6GLk4hAQWMUpsuL8Yyulikth97yM7SBWb gJXExPZVjCC2iICaRM/irYwgRcwCs5klXj18wAKSEBYIl9i8cQtYA4uAqsTsdadYQWxeAXeJ JcsvMEOsU5TofjaBDcTmFPCQmPLgC1hcCKhmZ/dNlgmMvAsYGVYxiqYWJBcUJ6XnGukVJ+YW l+al6yXn525iBIfjM+kdjKsaLA4xCnAwKvHwLvjMESLEmlhWXJl7iFGCg1lJhNd2N2eIEG9K YmVValF+fFFpTmrxIUZpDhYlcd6DrdaBQgLpiSWp2ampBalFMFkmDk6pBkbNFc4LFhfs6LCY HxIy5/uN+WFq3A8+SwjG3/n8mH3vJx2Wqpif4kV+l0Q2nNFcN6tuTom4Nduh2C+8xyaHJM5K MXtivNfAcPeTubm31iY95BLU2vCqN4Utfr1X/eE7Zi4VyWd0ql5uEK3vURZU2BXlt4b3mi9T ycyuYvZM643mvaHHs9c0NCuxFGckGmoxFxUnAgCoT+GrQwIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140905_065242_090995_83D7E538 X-CRM114-Status: GOOD ( 12.61 ) X-Spam-Score: -6.7 (------) Cc: linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, Sachin Kamat , Viresh Kumar , 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=-3.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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 --- v6: - no changes 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; }