From patchwork Mon Mar 17 13:09:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikas Sajjan X-Patchwork-Id: 3843581 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 422FABF540 for ; Mon, 17 Mar 2014 13:12:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4814520170 for ; Mon, 17 Mar 2014 13:12:07 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (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 2ECC12015E for ; Mon, 17 Mar 2014 13:12:06 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WPXJb-0007lg-TY; Mon, 17 Mar 2014 13:10:52 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WPXJO-0001aL-Qa; Mon, 17 Mar 2014 13:10:38 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WPXJ3-0001Vl-A2 for linux-arm-kernel@lists.infradead.org; Mon, 17 Mar 2014 13:10:18 +0000 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N2L00EYK0K5OI40@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 17 Mar 2014 22:09:41 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.124]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 98.EB.14803.514F6235; Mon, 17 Mar 2014 22:09:41 +0900 (KST) X-AuditID: cbfee691-b7efc6d0000039d3-f7-5326f4150e5b Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 6C.BC.29263.514F6235; Mon, 17 Mar 2014 22:09:41 +0900 (KST) Received: from chromebld-server.sisodomain.com ([107.108.73.106]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N2L00H9D0JWPR00@mmp1.samsung.com>; Mon, 17 Mar 2014 22:09:41 +0900 (KST) From: Vikas Sajjan To: vikas.sajjan@samsung.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 3/3] arm: exynos5260: add support for S2R Date: Mon, 17 Mar 2014 18:39:55 +0530 Message-id: <1395061795-17777-4-git-send-email-vikas.sajjan@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1395061795-17777-1-git-send-email-vikas.sajjan@samsung.com> References: <1395061795-17777-1-git-send-email-vikas.sajjan@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrCLMWRmVeSWpSXmKPExsWyRsSkRlf0i1qwwfLD5haP1yxmsph/5Byr xfddX9gtehdcZbPY9Pgaq8WM8/uYLFbt+sNocfPZdiYHDo+ds+6ye2xeUu/Rt2UVo8fnTXIB LFFcNimpOZllqUX6dglcGet+rGQtuKxZ8eXUSsYGxrfKXYycHBICJhIru96zQdhiEhfurQez hQSWMkq8vxUDU3PtUgtjFyMXUHwRo8TkmxsYIYomMEl8eZcEYrMJ6EqsOPWcDaRIRKCZUeJk 92awScwC+RLrZ+xkBbGFBWwk/t+bB9bMIqAqcWnHfrA4r4CHxK8li1i6GDmAtilIzJlkAxLm F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iSWp2ampB ahHMFiYOTqkGxlZJw5xS2fTW9BuPr5fvXqpo+IKtvF+y5hrHT1b1/fMd68z4w8Q+PklK72J3 3BT6Wy/ZUsakniWOsVBOp/rvueMzThrMfLNa+uli79PcDHan0/0e77D3ff6g71Ief6S2m4HD DPMc0R+2MbO5ZDxeZ+/1XeBWUvPqpN/68/5u3sHTY4Tl1jcrsRRnJBpqMRcVJwIAp/dxxOUC AAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140317_091017_568066_BBF85A3F X-CRM114-Status: GOOD ( 13.69 ) X-Spam-Score: -6.9 (------) Cc: Abhilash Kesavan , kgene.kim@samsung.com, tomasz.figa@gmail.com, joshi@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=-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 Adds Suspend to RAM (S2R) support to exynos5260. Signed-off-by: Abhilash Kesavan Signed-off-by: Vikas Sajjan --- arch/arm/mach-exynos/pm.c | 62 +++++++++++++++++++++++++++++++-------- arch/arm/mach-exynos/regs-pmu.h | 12 ++++++++ 2 files changed, 61 insertions(+), 13 deletions(-) diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c index dbe9670..12cc241 100644 --- a/arch/arm/mach-exynos/pm.c +++ b/arch/arm/mach-exynos/pm.c @@ -77,12 +77,20 @@ static const struct exynos_wkup_irq exynos5250_wkup_irq[] = { { /* sentinel */ }, }; +static const struct exynos_wkup_irq exynos5260_wkup_irq[] = { + { 105, BIT(1) }, /* RTC alarm */ + { 106, BIT(2) }, /* RTC tick */ + { /* sentinel */ }, +}; + static int exynos_irq_set_wake(struct irq_data *data, unsigned int state) { const struct exynos_wkup_irq *wkup_irq; if (soc_is_exynos5250()) wkup_irq = exynos5250_wkup_irq; + else if (soc_is_exynos5260()) + wkup_irq = exynos5260_wkup_irq; else wkup_irq = exynos4_wkup_irq; @@ -124,10 +132,20 @@ static void exynos_pm_prepare(void) unsigned int tmp; /* Set wake-up mask registers */ - __raw_writel(exynos_get_eint_wake_mask(), S5P_EINT_WAKEUP_MASK); - __raw_writel(exynos_irqwake_intmask & ~(1 << 31), S5P_WAKEUP_MASK); + if (soc_is_exynos5260()) { + __raw_writel(exynos_get_eint_wake_mask(), + EXYNOS5260_EINT_WAKEUP_MASK); + __raw_writel(exynos_irqwake_intmask & ~(1 << 31), + EXYNOS5260_WAKEUP_MASK); + } else { + __raw_writel(exynos_get_eint_wake_mask(), + S5P_EINT_WAKEUP_MASK); + __raw_writel(exynos_irqwake_intmask & ~(1 << 31), + S5P_WAKEUP_MASK); + } - s3c_pm_do_save(exynos_core_save, ARRAY_SIZE(exynos_core_save)); + if (!soc_is_exynos5260()) + s3c_pm_do_save(exynos_core_save, ARRAY_SIZE(exynos_core_save)); if (soc_is_exynos5250()) { s3c_pm_do_save(exynos5_sys_save, ARRAY_SIZE(exynos5_sys_save)); @@ -221,21 +239,39 @@ static void exynos_pm_resume(void) : "cc"); } - /* For release retention */ - - __raw_writel((1 << 28), S5P_PAD_RET_MAUDIO_OPTION); - __raw_writel((1 << 28), S5P_PAD_RET_GPIO_OPTION); - __raw_writel((1 << 28), S5P_PAD_RET_UART_OPTION); - __raw_writel((1 << 28), S5P_PAD_RET_MMCA_OPTION); - __raw_writel((1 << 28), S5P_PAD_RET_MMCB_OPTION); - __raw_writel((1 << 28), S5P_PAD_RET_EBIA_OPTION); - __raw_writel((1 << 28), S5P_PAD_RET_EBIB_OPTION); + if (soc_is_exynos5250()) { + /* For release retention */ + + __raw_writel((1 << 28), S5P_PAD_RET_MAUDIO_OPTION); + __raw_writel((1 << 28), S5P_PAD_RET_GPIO_OPTION); + __raw_writel((1 << 28), S5P_PAD_RET_UART_OPTION); + __raw_writel((1 << 28), S5P_PAD_RET_MMCA_OPTION); + __raw_writel((1 << 28), S5P_PAD_RET_MMCB_OPTION); + __raw_writel((1 << 28), S5P_PAD_RET_EBIA_OPTION); + __raw_writel((1 << 28), S5P_PAD_RET_EBIB_OPTION); + } else if (soc_is_exynos5260()) { + /* For release retention */ + __raw_writel((1 << 28), EXYNOS5260_PAD_RETENTION_LPDDR3_OPTION); + __raw_writel((1 << 28), EXYNOS5260_PAD_RET_MAUDIO_OPTION); + __raw_writel((1 << 28), EXYNOS5260_PAD_RET_JTAG_OPTION); + __raw_writel((1 << 28), EXYNOS5260_PAD_RETENTION_MMC2_OPTION); + __raw_writel((1 << 28), EXYNOS5260_PAD_RETENTION_TOP_OPTION); + __raw_writel((1 << 28), EXYNOS5260_PAD_RETENTION_UART_OPTION); + __raw_writel((1 << 28), EXYNOS5260_PAD_RETENTION_MMC0_OPTION); + __raw_writel((1 << 28), EXYNOS5260_PAD_RETENTION_MMC1_OPTION); + __raw_writel((1 << 28), EXYNOS5260_PAD_RETENTION_SPI_OPTION); + __raw_writel((1 << 28), EXYNOS5260_PAD_RETENTION_MIF_OPTION); + __raw_writel((1 << 28), + EXYNOS5260_PAD_RETENTION_BOOTLDO_OPTION); + } if (soc_is_exynos5250()) s3c_pm_do_restore(exynos5_sys_save, ARRAY_SIZE(exynos5_sys_save)); - s3c_pm_do_restore_core(exynos_core_save, ARRAY_SIZE(exynos_core_save)); + if (!soc_is_exynos5260()) + s3c_pm_do_restore_core(exynos_core_save, + ARRAY_SIZE(exynos_core_save)); if (IS_ENABLED(CONFIG_SMP) && !soc_is_exynos5250()) scu_enable(S5P_VA_SCU); diff --git a/arch/arm/mach-exynos/regs-pmu.h b/arch/arm/mach-exynos/regs-pmu.h index a81926b..906dc1e 100644 --- a/arch/arm/mach-exynos/regs-pmu.h +++ b/arch/arm/mach-exynos/regs-pmu.h @@ -532,6 +532,18 @@ #define EXYNOS5260_EAGLE_L2_STATUS S5P_PMUREG(0x2604) #define EXYNOS5260_KFC_L2_STATUS S5P_PMUREG(0x2624) +#define EXYNOS5260_PAD_RETENTION_LPDDR3_OPTION S5P_PMUREG(0x3008) +#define EXYNOS5260_PAD_RET_MAUDIO_OPTION S5P_PMUREG(0x3028) +#define EXYNOS5260_PAD_RET_JTAG_OPTION S5P_PMUREG(0x3048) +#define EXYNOS5260_PAD_RETENTION_MMC2_OPTION S5P_PMUREG(0x30C8) +#define EXYNOS5260_PAD_RETENTION_TOP_OPTION S5P_PMUREG(0x3108) +#define EXYNOS5260_PAD_RETENTION_UART_OPTION S5P_PMUREG(0x3128) +#define EXYNOS5260_PAD_RETENTION_MMC0_OPTION S5P_PMUREG(0x3148) +#define EXYNOS5260_PAD_RETENTION_MMC1_OPTION S5P_PMUREG(0x3168) +#define EXYNOS5260_PAD_RETENTION_SPI_OPTION S5P_PMUREG(0x31C8) +#define EXYNOS5260_PAD_RETENTION_MIF_OPTION S5P_PMUREG(0x31E8) +#define EXYNOS5260_PAD_RETENTION_BOOTLDO_OPTION S5P_PMUREG(0x3248) + /* CENTRAL_SEQ_OPTION */ #define EXYNOS5260_ARM_USE_STANDBY_WFI0 (1 << 16) #define EXYNOS5260_ARM_USE_STANDBY_WFI1 (1 << 17)