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: 3843521 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 4A2B7BF540 for ; Mon, 17 Mar 2014 13:09:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 55DBB20200 for ; Mon, 17 Mar 2014 13:09:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3566820170 for ; Mon, 17 Mar 2014 13:09:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933112AbaCQNJs (ORCPT ); Mon, 17 Mar 2014 09:09:48 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:8637 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932702AbaCQNJq (ORCPT ); Mon, 17 Mar 2014 09:09:46 -0400 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>; Mon, 17 Mar 2014 22:09:42 +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 Cc: kgene.kim@samsung.com, tomasz.figa@gmail.com, joshi@samsung.com, Abhilash Kesavan 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 FPCU+Px3H9RBHhIzWtaCHSEhMI9dYueP7cwQcwQkvk0+BNUrK7HpADPE0ZISB1fcYJnAKLyA kWEVo2hqQXJBcVJ6kalecWJucWleul5yfu4mRmCIn/73bOIOxvsHrA8xJgONm8gsJZqcD4yR vJJ4Q2MzIwtTE1NjI3NLM9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xeZ+/1XeBWUvPqpN/68/5u3sHTY4Tl1jcrsRRnJBpqMRcVJwIAp/dxxOUC AAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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)