From patchwork Wed Dec 11 11:57:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhilash Kesavan X-Patchwork-Id: 3325291 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 E2AEB9F1F0 for ; Wed, 11 Dec 2013 11:59:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D726420771 for ; Wed, 11 Dec 2013 11:59:14 +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 992E32076B for ; Wed, 11 Dec 2013 11:59:13 +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 1VqiQC-000296-W5; Wed, 11 Dec 2013 11:57:45 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VqiPt-0001Cz-MJ; Wed, 11 Dec 2013 11:57:25 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VqiPM-00018P-JD for linux-arm-kernel@lists.infradead.org; Wed, 11 Dec 2013 11:56:53 +0000 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MXN007AF5687R30@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 11 Dec 2013 20:56:33 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.125]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 20.A0.19199.0F258A25; Wed, 11 Dec 2013 20:56:32 +0900 (KST) X-AuditID: cbfee68d-b7f5c6d000004aff-30-52a852f0beae Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id E9.93.17171.0F258A25; Wed, 11 Dec 2013 20:56:32 +0900 (KST) Received: from abhilash-ubuntu.sisodomain.com ([107.108.73.92]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MXN0011U55RWB90@mmp1.samsung.com>; Wed, 11 Dec 2013 20:56:32 +0900 (KST) From: Abhilash Kesavan To: dianders@chromium.org, olof@lixom.net, kgene.kim@samsung.com, jonghwa3.lee@samsung.com, yadi.brar@samsung.com, mturquette@linaro.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org Subject: [PATCH 4/5] ARM: EXYNOS5250: Implement pm_power_off Date: Wed, 11 Dec 2013 17:27:08 +0530 Message-id: <1386763029-8516-5-git-send-email-a.kesavan@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1386763029-8516-1-git-send-email-a.kesavan@samsung.com> References: <1386763029-8516-1-git-send-email-a.kesavan@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprMIsWRmVeSWpSXmKPExsWyRsSkVvdD0Ioggyf9lhaP1yxmsjgw+yGr xdllB9ksOs8+YbboXXCVzWLT42usFjPO72OyeDrhIpvFqeuf2Sy+btnNaDFn+jsmB26P2Q0X WTzuXNvD5rF5Sb3H+RkLGT2unGhi9ejbsorR4/MmuQD2KC6blNSczLLUIn27BK6My5+esBZs Fa5Y13aesYFxqkAXIyeHhICJxLQrX9ghbDGJC/fWs3UxcnEICSxllLj6/yo7TNHUvvXsEIlF jBKrlnQwQzh9TBJ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KE5KzzXUK07MLS7NS9dLzs/dxAiOv2dSOxhXNlgcYhTgYFTi 4T1QtDxIiDWxrLgy9xCjBAezkgjvJ88VQUK8KYmVValF+fFFpTmpxYcYk4GOmsgsJZqcD0wN eSXxhsYm5qbGppYmFiZmlqQJK4nzHmi1DhQSSE8sSc1OTS1ILYLZwsTBKdXAGGydc1Vq27T0 HLHPux47bZ+a/q15i/2lnb7TG/rmPM8Wlvo4Jcr7cbX/wlliRY80a56nukXN/29kI8MtK7M5 8dL11aympc5GVrJHPKZM1JGvTT154hXnwriT007PsnrMUj3xgavI6QlvIpKkFrVO1+sN6uWV 4/b03KKpuXETh8bXO+WxTveWKLEUZyQaajEXFScCAB73GhEDAwAA 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-20131211_065652_848057_2F58AFAE X-CRM114-Status: GOOD ( 11.23 ) X-Spam-Score: -7.1 (-------) Cc: Abhilash Kesavan , Olof Johansson 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.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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: Olof Johansson Add pm_power_off callback function for exynos5250 to make soft power off work properly. Signed-off-by: Abhilash Kesavan Signed-off-by: Olof Johansson --- arch/arm/mach-exynos/include/mach/regs-pmu.h | 3 +++ arch/arm/mach-exynos/pmu.c | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/arch/arm/mach-exynos/include/mach/regs-pmu.h b/arch/arm/mach-exynos/include/mach/regs-pmu.h index 2cdb63e..da2fab0 100644 --- a/arch/arm/mach-exynos/include/mach/regs-pmu.h +++ b/arch/arm/mach-exynos/include/mach/regs-pmu.h @@ -343,6 +343,7 @@ #define EXYNOS5_TOP_PWR_OPTION S5P_PMUREG(0x2C48) #define EXYNOS5_TOP_PWR_SYSMEM_OPTION S5P_PMUREG(0x2CC8) #define EXYNOS5_JPEG_MEM_OPTION S5P_PMUREG(0x2F48) +#define EXYNOS5_PS_HOLD_CONTROL S5P_PMUREG(0x330C) #define EXYNOS5_GSCL_STATUS S5P_PMUREG(0x4004) #define EXYNOS5_ISP_STATUS S5P_PMUREG(0x4024) #define EXYNOS5_GSCL_OPTION S5P_PMUREG(0x4008) @@ -365,4 +366,6 @@ #define EXYNOS5_OPTION_USE_RETENTION (1 << 4) +#define EXYNOS5_PS_HOLD_CONTROL_DATA (1 << 8) + #endif /* __ASM_ARCH_REGS_PMU_H */ diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c index 5f4d26b..9053b6c 100644 --- a/arch/arm/mach-exynos/pmu.c +++ b/arch/arm/mach-exynos/pmu.c @@ -12,6 +12,8 @@ #include #include #include +#include +#include #include @@ -409,6 +411,23 @@ void exynos_sys_powerdown_conf(enum sys_powerdown mode) } } +static void exynos5_power_off(void) +{ + unsigned int tmp; + + pr_info("Power down\n"); + tmp = __raw_readl(EXYNOS5_PS_HOLD_CONTROL); + tmp &= ~EXYNOS5_PS_HOLD_CONTROL_DATA; + __raw_writel(tmp, EXYNOS5_PS_HOLD_CONTROL); + + /* Wait a little so we don't give a false warning below */ + mdelay(100); + + pr_err("Power down failed, please power off system manually.\n"); + while (1) + ; +} + static int __init exynos_pmu_init(void) { unsigned int value; @@ -444,6 +463,7 @@ static int __init exynos_pmu_init(void) __raw_writel(0x0, exynos5_list_disable_pmu_reg[i]); exynos_pmu_config = exynos5250_pmu_config; + pm_power_off = exynos5_power_off; pr_info("EXYNOS5250 PMU Initialize\n"); } else { pr_info("EXYNOS: PMU not supported\n");