From patchwork Wed Mar 18 16:00:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 6041641 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 975B99F399 for ; Wed, 18 Mar 2015 16:19:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B6674203E3 for ; Wed, 18 Mar 2015 16:19:53 +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 B8FC2203DF for ; Wed, 18 Mar 2015 16:19:52 +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 1YYGeJ-0002P1-F3; Wed, 18 Mar 2015 16:16:51 +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 1YYGPS-0004l3-5x for linux-arm-kernel@lists.infradead.org; Wed, 18 Mar 2015 16:01:32 +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 <0NLF00BB50HXX1D0@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 19 Mar 2015 01:01:09 +0900 (KST) X-AuditID: cbfee61b-f79d76d0000024d6-54-5509a145dbcd Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 86.FD.09430.541A9055; Thu, 19 Mar 2015 01:01:09 +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 <0NLF00H420HIA880@mmp1.samsung.com>; Thu, 19 Mar 2015 01:01:09 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Kukjin Kim , Kukjin Kim Subject: [PATCH v4 2/4] ARM: EXYNOS: add code for setting/clearing boot flag Date: Wed, 18 Mar 2015 17:00:51 +0100 Message-id: <1426694453-3242-3-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1426694453-3242-1-git-send-email-b.zolnierkie@samsung.com> References: <1426694453-3242-1-git-send-email-b.zolnierkie@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOLMWRmVeSWpSXmKPExsVy+t9jAV3XhZyhBo9/G1hsnLGe1WLeZ1mL 3gVX2Sz6H79mtjjb9IbdYtPja6wWl3fNYbP43HuE0WLG+X1MFqt2/WF04PLYOesuu8emVZ1s Hneu7WHz2Lyk3qNvyypGj8+b5ALYorhsUlJzMstSi/TtErgyTsydw1Jwlq9i56djrA2My3i6 GDk5JARMJGY83coIYYtJXLi3nq2LkYtDSGARo0THn2eMEE4Xk8SqRxOZQKrYBKwkJravAusQ EXCVmHNlElgRs8BCJolZb5+wgySEBXwkbv/sAbNZBFQleg5OALN5Bdwl1s3pZoZYpyjR/WwC G4jNKeAh8XHjVrAaIaCaKS8usE9g5F3AyLCKUTS1ILmgOCk910ivODG3uDQvXS85P3cTIzj4 nknvYFzVYHGIUYCDUYmHV+IqR6gQa2JZcWXuIUYJDmYlEd4bszhDhXhTEiurUovy44tKc1KL DzFKc7AoifMq2beFCAmkJ5akZqemFqQWwWSZODilGhgbC61XyO2z4H+qmjPp3gG30zOvs5do ngozWuyr/Wm64PaNP6Xvz/xowR4WOONHal2sDfsuf+c297zYTTWvd9x2FyvyYZyW+Mg34iK3 6dLZVTJnOCQm7ZyY4ddgsmlfitG7BJ6dK+JnLb7AFJNz5/t/hxztZS63uienhFaZu1+xkOht d38pdFCJpTgj0VCLuag4EQCYWUxpOgIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150318_090130_416903_B30B0226 X-CRM114-Status: UNSURE ( 9.61 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.0 (-----) Cc: linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, Daniel Lezcano , Tomasz Figa , linux-kernel@vger.kernel.org, Kyungmin Park , 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=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 This code is needed for cpuidle (W-)AFTR mode support on Exynos3250. Cc: Daniel Lezcano Signed-off-by: Bartlomiej Zolnierkiewicz Acked-by: Kyungmin Park --- arch/arm/mach-exynos/common.h | 6 ++++++ arch/arm/mach-exynos/firmware.c | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index f70eca7..acd5b56 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h @@ -126,6 +126,12 @@ enum { void exynos_firmware_init(void); +/* CPU BOOT mode flag for Exynos3250 SoC bootloader */ +#define C2_STATE (1 << 3) + +void exynos_set_boot_flag(unsigned int cpu, unsigned int mode); +void exynos_clear_boot_flag(unsigned int cpu, unsigned int mode); + extern u32 exynos_get_eint_wake_mask(void); #ifdef CONFIG_PM_SLEEP diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c index 4791a3c..27b8ae3 100644 --- a/arch/arm/mach-exynos/firmware.c +++ b/arch/arm/mach-exynos/firmware.c @@ -206,3 +206,28 @@ void __init exynos_firmware_init(void) outer_cache.configure = exynos_l2_configure; } } + +#define REG_CPU_STATE_ADDR (sysram_ns_base_addr + 0x28) +#define BOOT_MODE_MASK 0x1f + +void exynos_set_boot_flag(unsigned int cpu, unsigned int mode) +{ + unsigned int tmp; + + tmp = __raw_readl(REG_CPU_STATE_ADDR + cpu * 4); + + if (mode & BOOT_MODE_MASK) + tmp &= ~BOOT_MODE_MASK; + + tmp |= mode; + __raw_writel(tmp, REG_CPU_STATE_ADDR + cpu * 4); +} + +void exynos_clear_boot_flag(unsigned int cpu, unsigned int mode) +{ + unsigned int tmp; + + tmp = __raw_readl(REG_CPU_STATE_ADDR + cpu * 4); + tmp &= ~mode; + __raw_writel(tmp, REG_CPU_STATE_ADDR + cpu * 4); +}