From: Tomasz Figa <tomasz.figa@gmail.com>
To: Vikas Sajjan <vikas.sajjan@samsung.com>
Cc: "linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
linux-samsung-soc <linux-samsung-soc@vger.kernel.org>,
Kukjin Kim <kgene.kim@samsung.com>,
sunil joshi <joshi@samsung.com>,
Doug Anderson <dianders@chromium.org>,
Olof Johansson <olof@lixom.net>
Subject: Re: [PATCH v3 1/2] ARM: EXYNOS: Move Disabling of JPEG USE_RETENTION for exynos5250 to pmu.c
Date: Mon, 18 Aug 2014 15:23:35 +0200 [thread overview]
Message-ID: <53F1FE57.80209@gmail.com> (raw)
In-Reply-To: <CAGm_ybiKm7sZB0zPoQ99b2+jZ8h=+48zjv24QvaC5GcccAPORg@mail.gmail.com>
On 18.08.2014 15:21, Vikas Sajjan wrote:
> Hi Tomasz,
>
> On Mon, Aug 18, 2014 at 5:42 PM, Tomasz Figa <tomasz.figa@gmail.com> wrote:
>> Hi Vikas,
>>
>> On 07.08.2014 13:59, Vikas Sajjan wrote:
>>> Move the Disabling of JPEG USE_RETENTION for exynos5250 to pmu.c to make way for
>>> refactoring of pm.c and to create common functions across exynos4 and
>>> exynos5250.
>>>
>>> Signed-off-by: Vikas Sajjan <vikas.sajjan@samsung.com>
>>> ---
>>> arch/arm/mach-exynos/pm.c | 7 +------
>>> arch/arm/mach-exynos/pmu.c | 6 ++++++
>>> 2 files changed, 7 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
>>> index c4c6d98..fdd68c2 100644
>>> --- a/arch/arm/mach-exynos/pm.c
>>> +++ b/arch/arm/mach-exynos/pm.c
>>> @@ -265,13 +265,8 @@ static void exynos_pm_prepare(void)
>>>
>>> s3c_pm_do_save(exynos_core_save, ARRAY_SIZE(exynos_core_save));
>>>
>>> - if (soc_is_exynos5250()) {
>>> + if (soc_is_exynos5250())
>>> s3c_pm_do_save(exynos5_sys_save, ARRAY_SIZE(exynos5_sys_save));
>>> - /* Disable USE_RETENTION of JPEG_MEM_OPTION */
>>> - tmp = pmu_raw_readl(EXYNOS5_JPEG_MEM_OPTION);
>>> - tmp &= ~EXYNOS5_OPTION_USE_RETENTION;
>>> - pmu_raw_writel(tmp, EXYNOS5_JPEG_MEM_OPTION);
>>> - }
>>>
>>> /* Set value of power down register for sleep mode */
>>>
>>> diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c
>>> index ff9d23f..6021adb 100644
>>> --- a/arch/arm/mach-exynos/pmu.c
>>> +++ b/arch/arm/mach-exynos/pmu.c
>>> @@ -389,6 +389,7 @@ void exynos_sys_powerdown_conf(enum sys_powerdown mode)
>>> static int __init exynos_pmu_init(void)
>>> {
>>> unsigned int value;
>>> + unsigned int tmp;
>>>
>>> exynos_pmu_config = exynos4210_pmu_config;
>>>
>>> @@ -411,6 +412,11 @@ static int __init exynos_pmu_init(void)
>>> value &= ~EXYNOS5_SYS_WDTRESET;
>>> pmu_raw_writel(value, EXYNOS5_MASK_WDTRESET_REQUEST);
>>>
>>> + /* Disable USE_RETENTION of JPEG_MEM_OPTION */
>>> + tmp = pmu_raw_readl(EXYNOS5_JPEG_MEM_OPTION);
>>> + tmp &= ~EXYNOS5_OPTION_USE_RETENTION;
>>> + pmu_raw_writel(tmp, EXYNOS5_JPEG_MEM_OPTION);
>>> +
>>
>> Note that this code is executed once at system bootup. Is this register
>> preserved across a suspend/resume cycle?
>>
>> Anyway, what I suggested in my comment to previous revision of this
>> series was stuffing this thing into the PMU configuration array. As you
>> can see in the arrays for Exynos4 SoCs, they just hardcode the
>> MEM_OPTION registers to constant values, because I believe the only
>> field from those registers with non-zero value in practice is
>> EXYNOS5_OPTION_USE_RETENTION (or 0x10 used directly in PMU arrays for
>> Exynos4 SoCs). This would also cover my comment above, because the
>> arrays are written to the PMU every time a low power state is being entered.
>>
>
> Is this what you meant,
>
> diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c
> index 6021adb..67b70fd 100644
> --- a/arch/arm/mach-exynos/pmu.c
> +++ b/arch/arm/mach-exynos/pmu.c
> @@ -264,6 +264,7 @@ static const struct exynos_pmu_conf
> exynos5250_pmu_config[] = {
> { EXYNOS5_INTRAM_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} },
> { EXYNOS5_INTROM_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} },
> { EXYNOS5_JPEG_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} },
> + { EXYNOS5_JPEG_MEM_OPTION, { 0x10, 0x10, 0x0} },
> { EXYNOS5_HSI_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} },
> { EXYNOS5_MCUIOP_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} },
> { EXYNOS5_SATA_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} },
> @@ -412,11 +413,6 @@ static int __init exynos_pmu_init(void)
> value &= ~EXYNOS5_SYS_WDTRESET;
> pmu_raw_writel(value, EXYNOS5_MASK_WDTRESET_REQUEST);
>
> - /* Disable USE_RETENTION of JPEG_MEM_OPTION */
> - tmp = pmu_raw_readl(EXYNOS5_JPEG_MEM_OPTION);
> - tmp &= ~EXYNOS5_OPTION_USE_RETENTION;
> - pmu_raw_writel(tmp, EXYNOS5_JPEG_MEM_OPTION);
> -
> exynos_pmu_config = exynos5250_pmu_config;
> pr_info("EXYNOS5250 PMU Initialize\n");
> } else {
>
> for AFTR and LPA mode, i still maintain 0x10 like any other
> XXX_XXX_MEM_OPTION register,
> but for sleep mode, I am disabling USE_RETENTION of JPEG_MEM_OPTION as required.
>
>
> Hope this is fine.
>
> I tested with the above change on snow, S2R works well.
Yes, looks good, thanks.
Best regards,
Tomasz
WARNING: multiple messages have this Message-ID (diff)
From: tomasz.figa@gmail.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/2] ARM: EXYNOS: Move Disabling of JPEG USE_RETENTION for exynos5250 to pmu.c
Date: Mon, 18 Aug 2014 15:23:35 +0200 [thread overview]
Message-ID: <53F1FE57.80209@gmail.com> (raw)
In-Reply-To: <CAGm_ybiKm7sZB0zPoQ99b2+jZ8h=+48zjv24QvaC5GcccAPORg@mail.gmail.com>
On 18.08.2014 15:21, Vikas Sajjan wrote:
> Hi Tomasz,
>
> On Mon, Aug 18, 2014 at 5:42 PM, Tomasz Figa <tomasz.figa@gmail.com> wrote:
>> Hi Vikas,
>>
>> On 07.08.2014 13:59, Vikas Sajjan wrote:
>>> Move the Disabling of JPEG USE_RETENTION for exynos5250 to pmu.c to make way for
>>> refactoring of pm.c and to create common functions across exynos4 and
>>> exynos5250.
>>>
>>> Signed-off-by: Vikas Sajjan <vikas.sajjan@samsung.com>
>>> ---
>>> arch/arm/mach-exynos/pm.c | 7 +------
>>> arch/arm/mach-exynos/pmu.c | 6 ++++++
>>> 2 files changed, 7 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
>>> index c4c6d98..fdd68c2 100644
>>> --- a/arch/arm/mach-exynos/pm.c
>>> +++ b/arch/arm/mach-exynos/pm.c
>>> @@ -265,13 +265,8 @@ static void exynos_pm_prepare(void)
>>>
>>> s3c_pm_do_save(exynos_core_save, ARRAY_SIZE(exynos_core_save));
>>>
>>> - if (soc_is_exynos5250()) {
>>> + if (soc_is_exynos5250())
>>> s3c_pm_do_save(exynos5_sys_save, ARRAY_SIZE(exynos5_sys_save));
>>> - /* Disable USE_RETENTION of JPEG_MEM_OPTION */
>>> - tmp = pmu_raw_readl(EXYNOS5_JPEG_MEM_OPTION);
>>> - tmp &= ~EXYNOS5_OPTION_USE_RETENTION;
>>> - pmu_raw_writel(tmp, EXYNOS5_JPEG_MEM_OPTION);
>>> - }
>>>
>>> /* Set value of power down register for sleep mode */
>>>
>>> diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c
>>> index ff9d23f..6021adb 100644
>>> --- a/arch/arm/mach-exynos/pmu.c
>>> +++ b/arch/arm/mach-exynos/pmu.c
>>> @@ -389,6 +389,7 @@ void exynos_sys_powerdown_conf(enum sys_powerdown mode)
>>> static int __init exynos_pmu_init(void)
>>> {
>>> unsigned int value;
>>> + unsigned int tmp;
>>>
>>> exynos_pmu_config = exynos4210_pmu_config;
>>>
>>> @@ -411,6 +412,11 @@ static int __init exynos_pmu_init(void)
>>> value &= ~EXYNOS5_SYS_WDTRESET;
>>> pmu_raw_writel(value, EXYNOS5_MASK_WDTRESET_REQUEST);
>>>
>>> + /* Disable USE_RETENTION of JPEG_MEM_OPTION */
>>> + tmp = pmu_raw_readl(EXYNOS5_JPEG_MEM_OPTION);
>>> + tmp &= ~EXYNOS5_OPTION_USE_RETENTION;
>>> + pmu_raw_writel(tmp, EXYNOS5_JPEG_MEM_OPTION);
>>> +
>>
>> Note that this code is executed once at system bootup. Is this register
>> preserved across a suspend/resume cycle?
>>
>> Anyway, what I suggested in my comment to previous revision of this
>> series was stuffing this thing into the PMU configuration array. As you
>> can see in the arrays for Exynos4 SoCs, they just hardcode the
>> MEM_OPTION registers to constant values, because I believe the only
>> field from those registers with non-zero value in practice is
>> EXYNOS5_OPTION_USE_RETENTION (or 0x10 used directly in PMU arrays for
>> Exynos4 SoCs). This would also cover my comment above, because the
>> arrays are written to the PMU every time a low power state is being entered.
>>
>
> Is this what you meant,
>
> diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c
> index 6021adb..67b70fd 100644
> --- a/arch/arm/mach-exynos/pmu.c
> +++ b/arch/arm/mach-exynos/pmu.c
> @@ -264,6 +264,7 @@ static const struct exynos_pmu_conf
> exynos5250_pmu_config[] = {
> { EXYNOS5_INTRAM_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} },
> { EXYNOS5_INTROM_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} },
> { EXYNOS5_JPEG_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} },
> + { EXYNOS5_JPEG_MEM_OPTION, { 0x10, 0x10, 0x0} },
> { EXYNOS5_HSI_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} },
> { EXYNOS5_MCUIOP_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} },
> { EXYNOS5_SATA_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} },
> @@ -412,11 +413,6 @@ static int __init exynos_pmu_init(void)
> value &= ~EXYNOS5_SYS_WDTRESET;
> pmu_raw_writel(value, EXYNOS5_MASK_WDTRESET_REQUEST);
>
> - /* Disable USE_RETENTION of JPEG_MEM_OPTION */
> - tmp = pmu_raw_readl(EXYNOS5_JPEG_MEM_OPTION);
> - tmp &= ~EXYNOS5_OPTION_USE_RETENTION;
> - pmu_raw_writel(tmp, EXYNOS5_JPEG_MEM_OPTION);
> -
> exynos_pmu_config = exynos5250_pmu_config;
> pr_info("EXYNOS5250 PMU Initialize\n");
> } else {
>
> for AFTR and LPA mode, i still maintain 0x10 like any other
> XXX_XXX_MEM_OPTION register,
> but for sleep mode, I am disabling USE_RETENTION of JPEG_MEM_OPTION as required.
>
>
> Hope this is fine.
>
> I tested with the above change on snow, S2R works well.
Yes, looks good, thanks.
Best regards,
Tomasz
next prev parent reply other threads:[~2014-08-18 13:23 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-07 11:59 [PATCH v3 0/2] Refactor the pm code to use DT based lookup Vikas Sajjan
2014-08-07 11:59 ` Vikas Sajjan
2014-08-07 11:59 ` [PATCH v3 1/2] ARM: EXYNOS: Move Disabling of JPEG USE_RETENTION for exynos5250 to pmu.c Vikas Sajjan
2014-08-07 11:59 ` Vikas Sajjan
2014-08-18 12:12 ` Tomasz Figa
2014-08-18 12:12 ` Tomasz Figa
2014-08-18 13:21 ` Vikas Sajjan
2014-08-18 13:21 ` Vikas Sajjan
2014-08-18 13:23 ` Tomasz Figa [this message]
2014-08-18 13:23 ` Tomasz Figa
2014-08-07 11:59 ` [PATCH v3 2/2] ARM: EXYNOS: Refactor the pm code to use DT based lookup Vikas Sajjan
2014-08-07 11:59 ` Vikas Sajjan
2014-08-18 12:14 ` Tomasz Figa
2014-08-18 12:14 ` Tomasz Figa
2014-08-18 10:33 ` [PATCH v3 0/2] " Vikas Sajjan
2014-08-18 10:33 ` Vikas Sajjan
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=53F1FE57.80209@gmail.com \
--to=tomasz.figa@gmail.com \
--cc=dianders@chromium.org \
--cc=joshi@samsung.com \
--cc=kgene.kim@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=olof@lixom.net \
--cc=vikas.sajjan@samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.