devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chanwoo Choi <cw00.choi@samsung.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	kgene@kernel.org, Tomasz Figa <tomasz.figa@gmail.com>,
	chanwoo@kernel.org, Jaehoon Chung <jh80.chung@samsung.com>,
	Inki Dae <inki.dae@samsung.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org,
	Jonghwa Lee <jonghwa3.lee@samsung.com>
Subject: Re: [RFC PATCH 5/9] soc: samsung: pm: Add support for suspend-to-ram of Exynos5433
Date: Thu, 11 Jan 2018 14:40:56 +0900	[thread overview]
Message-ID: <5A56F8E8.7020006@samsung.com> (raw)
In-Reply-To: <CAJKOXPdL7EbhaWkKCV7vMMnX2Z9vTr=r7UyDNx6E7ZLUikXy_Q@mail.gmail.com>

On 2018년 01월 09일 21:45, Krzysztof Kozlowski wrote:
> On Tue, Jan 9, 2018 at 8:59 AM, Chanwoo Choi <cw00.choi@samsung.com> 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 <jonghwa3.lee@samsung.com>
>> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
>> ---
>>  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 <linux/regulator/machine.h>
>>  #include <linux/syscore_ops.h>
>>  #include <linux/suspend.h>
>> +#include <linux/psci.h>
>>
>>  #include <asm/cpuidle.h>
>>  #include <asm/io.h>
>> @@ -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

  reply	other threads:[~2018-01-11  5:40 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180109075904epcas2p302d58aacfbb2195e455a25c90a1c610b@epcas2p3.samsung.com>
2018-01-09  7:58 ` [RFC PATCH 0/9] soc: samsung: Add support of suspend-to-RAM on Exynos5433 Chanwoo Choi
     [not found]   ` <CGME20180109075905epcas1p1486543d8fec46f47d9d5ac350d841337@epcas1p1.samsung.com>
2018-01-09  7:58     ` [PATCH 1/9] clk: samsung: exynos5433: Add clock flag to support suspend-to-ram Chanwoo Choi
     [not found]       ` <1515484746-10656-2-git-send-email-cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2018-01-09 11:44         ` Krzysztof Kozlowski
2018-01-10  9:31           ` Chanwoo Choi
2018-01-12 13:24           ` Marek Szyprowski
     [not found]   ` <CGME20180109075905epcas1p4e601230d86dd686db28796165178dafa@epcas1p4.samsung.com>
2018-01-09  7:58     ` [PATCH 2/9] soc: samsung: pmu: Add powerup_conf callback Chanwoo Choi
2018-01-09 11:52       ` Krzysztof Kozlowski
     [not found]   ` <CGME20180109075905epcas1p321b8898a0d45287d63364e1aa768fdab@epcas1p3.samsung.com>
2018-01-09  7:59     ` [PATCH 3/9] soc: samsung: pmu: Add the PMU data of exynos5433 to support low-power state Chanwoo Choi
     [not found]       ` <1515484746-10656-4-git-send-email-cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2018-01-09 12:23         ` Krzysztof Kozlowski
     [not found]           ` <CAJKOXPf027Nz4CsNt4i1yuiQVMtZpv8ncrbgP1D-y4YM8kn30A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-11  5:39             ` Chanwoo Choi
2018-01-09 12:33       ` Krzysztof Kozlowski
2018-01-09 14:11       ` Sudeep Holla
2018-01-10  1:46         ` Chanwoo Choi
2018-01-10 10:53           ` Sudeep Holla
2018-01-10 23:51             ` Chanwoo Choi
     [not found]   ` <CGME20180109075905epcas1p40431a90ecc3530f2200ade028bf54594@epcas1p4.samsung.com>
2018-01-09  7:59     ` [RFC PATCH 4/9] soc: samsung: Add generic power-management driver for Exynos Chanwoo Choi
2018-01-09 12:37       ` Krzysztof Kozlowski
2018-01-11  5:44         ` Chanwoo Choi
     [not found]   ` <CGME20180109075905epcas2p1fe6b554b646dbc80e04273ad6dd8489c@epcas2p1.samsung.com>
2018-01-09  7:59     ` [RFC PATCH 5/9] soc: samsung: pm: Add support for suspend-to-ram of Exynos5433 Chanwoo Choi
     [not found]       ` <1515484746-10656-6-git-send-email-cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2018-01-09 12:45         ` Krzysztof Kozlowski
2018-01-11  5:40           ` Chanwoo Choi [this message]
     [not found]   ` <CGME20180109075905epcas2p4aa0174854c0796cc7fa75bdf8a273791@epcas2p4.samsung.com>
2018-01-09  7:59     ` [PATCH 6/9] arm64: dts: exynos: Add iRAM device-tree node for Exynos5433 Chanwoo Choi
     [not found]       ` <1515484746-10656-7-git-send-email-cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2018-01-09 12:46         ` Krzysztof Kozlowski
     [not found]   ` <CGME20180109075905epcas2p156b0f057a13fe5ab96753bf77f2bf652@epcas2p1.samsung.com>
2018-01-09  7:59     ` [PATCH 7/9] arm64: dts: exynos: Use power key as a wakeup source on TM2/TM2E board Chanwoo Choi
     [not found]   ` <CGME20180109075906epcas1p15df259f70311dd96fc2c9ff256b2b615@epcas1p1.samsung.com>
     [not found]     ` <1515484746-10656-1-git-send-email-cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2018-01-09  7:59       ` [PATCH 8/9] arm64: dts: exynos: Add cpu_suspend property of PSCI for exynos5433 Chanwoo Choi
     [not found]   ` <CGME20180109075906epcas1p288212118a5d58bc15d62a2d828772a49@epcas1p2.samsung.com>
2018-01-09  7:59     ` [PATCH 9/9] arm64: dts: exynos: Add cpu topology information for Exynos5433 SoC Chanwoo Choi
2018-01-09 11:56   ` [RFC PATCH 0/9] soc: samsung: Add support of suspend-to-RAM on Exynos5433 Krzysztof Kozlowski
2018-01-10  9:19     ` Chanwoo Choi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5A56F8E8.7020006@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=chanwoo@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=inki.dae@samsung.com \
    --cc=jh80.chung@samsung.com \
    --cc=jonghwa3.lee@samsung.com \
    --cc=kgene@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=s.nawrocki@samsung.com \
    --cc=tomasz.figa@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).