From patchwork Mon May 5 10:57:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 4113741 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4280EBFF02 for ; Mon, 5 May 2014 11:01:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CB95A20384 for ; Mon, 5 May 2014 11:01:51 +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 BB8772010C for ; Mon, 5 May 2014 11:01:50 +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 1WhGcR-0003y7-Gq; Mon, 05 May 2014 10:59:35 +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 1WhGcM-0003oG-12 for linux-arm-kernel@lists.infradead.org; Mon, 05 May 2014 10:59:30 +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 <0N53008ZVL69TJ90@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 05 May 2014 19:58:57 +0900 (KST) X-AuditID: cbfee61a-b7f2b6d000006c4d-b7-53676ef10155 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 0F.6D.27725.1FE67635; Mon, 05 May 2014 19:58:57 +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 <0N5300CW5L3PC1B0@mmp1.samsung.com>; Mon, 05 May 2014 19:58:57 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Kukjin Kim Subject: [PATCH 2/7] ARM: EXYNOS: add support for firmware-assisted c15resume Date: Mon, 05 May 2014 12:57:14 +0200 Message-id: <1399287439-31376-3-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1399287439-31376-1-git-send-email-b.zolnierkie@samsung.com> References: <1399287439-31376-1-git-send-email-b.zolnierkie@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrCLMWRmVeSWpSXmKPExsVy+t9jAd2PeenBBpP/6lhsnLGe1WLeZ1mL 3gVX2SzONr1ht3h/6BmzxabH11gtLu+aw2bxufcIo8WM8/uYLM6cvsRqcfJPL6PF+hmvWSw2 fvVw4PW4c20Pm8fmJfUet/89ZvbYcrWdxaNvyypGj8+b5ALYorhsUlJzMstSi/TtErgyVq99 z1Lwiqfi/ed+pgbGe1xdjJwcEgImEn1v7zBC2GISF+6tZ+ti5OIQEljEKNHfs5wdwulikti0 8jUbSBWbgJXExPZVYB0iAmoSPYu3MoIUMQvsZZZY2r2JHSQhLOAr8fXUJTCbRUBVYsvEj0BF HBy8Ah4SDcsEILYpSnQ/mwA2k1PAU2Lp5sfMILYQUMmGt+1sExh5FzAyrGIUTS1ILihOSs81 1CtOzC0uzUvXS87P3cQIDstnUjsYVzZYHGIU4GBU4uFNYE4PFmJNLCuuzD3EKMHBrCTCm50I FOJNSaysSi3Kjy8qzUktPsQozcGiJM57oNU6UEggPbEkNTs1tSC1CCbLxMEp1cA454B3/4VV U3Wcmr88ObFoz5PMswrt7Jem8E2Y1LHxotLEtcfLp35csCfBdwpnaeytqU+MUvZ8zFt89XRO xkrFQ2fMvjxbayayPn2uurZd6r/c+d8UWbOeSLWXdoY8Sns/T8iw5WL1QgHGv//3xXiZV2tb T1s0W85LT2vpS6YFwUUfvsxe5h9XrMRSnJFoqMVcVJwIAGf3/HpHAgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140505_035930_259705_2C92323D X-CRM114-Status: GOOD ( 12.11 ) 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 From: Tomasz Figa This change is a preparation for adding secure firmware support to EXYNOS cpuidle driver. This patch shouldn't cause any functionality changes. Signed-off-by: Tomasz Figa [bzolnier: splitted out from bigger patch] Signed-off-by: Bartlomiej Zolnierkiewicz --- arch/arm/include/asm/firmware.h | 4 ++++ arch/arm/mach-exynos/firmware.c | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/arch/arm/include/asm/firmware.h b/arch/arm/include/asm/firmware.h index c72ec47..70883c7 100644 --- a/arch/arm/include/asm/firmware.h +++ b/arch/arm/include/asm/firmware.h @@ -41,6 +41,10 @@ struct firmware_ops { * Initializes L2 cache */ int (*l2x0_init)(void); + /* + * Restores coprocessor 15 registers + */ + int (*c15resume)(u32 *regs); }; /* Global pointer for current firmware_ops structure, can't be NULL. */ diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c index 932129e..581c7bf 100644 --- a/arch/arm/mach-exynos/firmware.c +++ b/arch/arm/mach-exynos/firmware.c @@ -40,10 +40,18 @@ static int exynos_set_cpu_boot_addr(int cpu, unsigned long boot_addr) return 0; } +static int exynos_c15resume(u32 *regs) +{ + exynos_smc(SMC_CMD_C15RESUME, regs[0], regs[1], 0); + + return 0; +} + static const struct firmware_ops exynos_firmware_ops = { .do_idle = exynos_do_idle, .set_cpu_boot_addr = exynos_set_cpu_boot_addr, .cpu_boot = exynos_cpu_boot, + .c15resume = exynos_c15resume, }; void __init exynos_firmware_init(void)