Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754073AbeAKFlD (ORCPT + 1 other); Thu, 11 Jan 2018 00:41:03 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:11620 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751042AbeAKFlA (ORCPT ); Thu, 11 Jan 2018 00:41:00 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20180111054058epoutp022e6b033aca1cab0f2f45d915407a8676~Iqvh9fq7P0808908089epoutp02F X-AuditID: b6c32a35-c69ff700000010dd-de-5a56f8e8b984 MIME-version: 1.0 Content-transfer-encoding: 8BIT Content-type: text/plain; charset="utf-8" Message-id: <5A56F8E8.7020006@samsung.com> Date: Thu, 11 Jan 2018 14:40:56 +0900 From: Chanwoo Choi Organization: Samsung Electronics User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 To: Krzysztof Kozlowski Cc: Marek Szyprowski , Sylwester Nawrocki , kgene@kernel.org, Tomasz Figa , chanwoo@kernel.org, Jaehoon Chung , Inki Dae , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Jonghwa Lee Subject: Re: [RFC PATCH 5/9] soc: samsung: pm: Add support for suspend-to-ram of Exynos5433 In-reply-to: X-Brightmail-Tracker: H4sIAAAAAAAAA01Sa0hTYRj229nZjtLsc2p9Weg6EKTg2pkzj5FdSGKUxcKoMMwOepjSLrIz IyPLoOYFu2ijdNlFuuFCsmmhUhpqGEFquVKDlDJMNLpQ85rVOTtF/Xve532e93u/h5fAlBdk EUSOxc7aLIyJlAVJ73dEr4odm96VpumoiaPLB7xS+kpnN05XDJ+V0gOzDpwuefYeo8+MTGB0 T0+9nPaMvMLpvpZqGV3Z0yqh6zrfyOmOj0U47W75ATYo9M2uN3K9x10i0zdcP6Y/3egG+m+e SAOexq7NZp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Z027OYin4 LF3x/0ULewPjFdEuRk4OCQETiR9tM9m7GLk4hATWMUq8+rOXGSTBKyAo8WPyPZYuRg4OZgF5 iSOXsiFMdYkpU3Ihyh8wSix42MsOEucV0JI4OtENpJNFQFVi3/ddjCA2G1B4/4sbbCA2v4Ci xNUfjxlBykUFIiS6T1SChEUENCWu//3OCmIzCyxnlmj5IwViCwvESsw/v5MFYtU8JomDc6+z gyQ4BYIlrix+xz6BUWAWkkNnIRw6C+HQBYzMqxglUwuKc9Nzi40KDPNSy/WKE3OLS/PS9ZLz czcxAuNj22Gtvh2M95fEH2IU4GBU4uGNEA2LEmJNLCuuzD3EKMHBrCTCuzgQKMSbklhZlVqU H19UmpNafIhRmoNFSZz3dt6xSCGB9MSS1OzU1ILUIpgsEwenVAOjcP43ecXWvpyXHi+Eenvz vqXvn6WhdmtJ/6tOvlSRaIGIG/1LY4LyrZX9H3Dzeta3hKZ2uhlLhv9aYnD8E7t7xNOMkLin D03+vaz9fUnxh/GJV+l5LncL5CfdZYtsT1W8sS5b4OO1ztIKhbJ1880Mi+bsnr9snqfMhe2n /wux5/7l2N2fnq7EUpyRaKjFXFScCADuKGK6iwIAAA== X-CMS-MailID: 20180111054056epcas1p32702e0ef84f0eadc8ab9d5bbd8799609 X-Msg-Generator: CA CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20180109075905epcas2p1fe6b554b646dbc80e04273ad6dd8489c X-RootMTR: 20180109075905epcas2p1fe6b554b646dbc80e04273ad6dd8489c References: <1515484746-10656-1-git-send-email-cw00.choi@samsung.com> <1515484746-10656-6-git-send-email-cw00.choi@samsung.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 2018년 01월 09일 21:45, Krzysztof Kozlowski wrote: > On Tue, Jan 9, 2018 at 8:59 AM, Chanwoo Choi wrote: >> This patch adds the specific exynos_pm_data instance for Exynos5433 >> in order to support the suspend-to-ram. Exynos5433 SoC need to write >> the 'cpu_resume' poiter address and the specific magic number >> for suspend mode. >> >> Signed-off-by: Jonghwa Lee >> Signed-off-by: Chanwoo Choi >> --- >> drivers/soc/samsung/exynos-pm.c | 38 ++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 38 insertions(+) >> >> diff --git a/drivers/soc/samsung/exynos-pm.c b/drivers/soc/samsung/exynos-pm.c >> index 45d84bbe5e61..70d949ba5cab 100644 >> --- a/drivers/soc/samsung/exynos-pm.c >> +++ b/drivers/soc/samsung/exynos-pm.c >> @@ -12,6 +12,7 @@ >> #include >> #include >> #include >> +#include >> >> #include >> #include >> @@ -123,7 +124,44 @@ static void exynos_pm_finish(void) >> #define exynos_pm_data_arm_ptr(data) NULL >> #endif >> >> +static int exynos5433_pm_suspend(unsigned long unused) >> +{ >> + /* >> + * Exynos5433 uses PSCI v0.1 which provides the only one >> + * entry point (psci_ops.cpu_suspend) for both cpuidle and >> + * suspend-to-RAM. Also, PSCI v0.1 needs the specific 'power_state' >> + * parameter for the suspend mode. In order to enter suspend mode, >> + * Exynos5433 calls the 'psci_ops.cpu_suspend' with '0x3010000' >> + * power_state parameter. >> + * >> + * '0x3010000' means that both cluster and system are going to enter >> + * the power-down state as following: >> + * - [25:24] 0x3 : Indicate the cluster and system. >> + * - [16] 0x1 : Indicate power-down state. > > Define them, it will be more readable (name of define given just as an example): > > EXYNOS5433_PCSI_SUSPEND_SYSTEM (0x3 << 24) > (or even split per system and cluser and use BIT() if this is real meaning) > and probably reuse existing S5P_CENTRAL_LOWPWR_CFG OK. I'll define it as the constant. > >> + */ >> + return psci_ops.cpu_suspend(0x3010000, __pa_symbol(cpu_resume)); >> +} >> + >> +static int exynos5433_pm_suspend_enter(suspend_state_t state) >> +{ >> + if (!sysram_ns_base_addr) >> + return -EINVAL; >> + >> + __raw_writel(virt_to_phys(cpu_resume), sysram_ns_base_addr + 0x8); >> + __raw_writel(EXYNOS_SLEEP_MAGIC, sysram_ns_base_addr + 0xc); > > Document them in Documentation/arm/Samsung/Bootloader-interface.txt. OK. > > Best regards, > Krzysztof > >> + >> + return cpu_suspend(0, exynos5433_pm_suspend); >> +} >> + >> +const struct exynos_pm_data exynos5433_pm_data = { >> + .enter = exynos5433_pm_suspend_enter, >> +}; >> + >> static const struct of_device_id exynos_pm_of_device_ids[] = { >> + { >> + .compatible = "samsung,exynos5433-pmu", >> + .data = exynos_pm_data_arm_ptr(exynos5433_pm_data), >> + }, >> { /*sentinel*/ }, >> }; >> >> -- >> 1.9.1 >> > -- > To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > > > -- Best Regards, Chanwoo Choi Samsung Electronics