All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: Dmitry Osipenko <digetx@gmail.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Peter De Schrijver <pdeschrijver@nvidia.com>,
	Prashant Gaikwad <pgaikwad@nvidia.com>
Cc: Stephen Boyd <sboyd@kernel.org>,
	linux-tegra@vger.kernel.org,
	Michael Turquette <mturquette@baylibre.com>,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/4] ARM: tegra: Enable PLLP bypass during Tegra124 LP1
Date: Thu, 3 Oct 2019 10:34:14 -0600	[thread overview]
Message-ID: <485c9828-120a-8e62-bf85-c5d8407d3513@wwwdotorg.org> (raw)
In-Reply-To: <437f030b-9e20-43e5-42ce-f98430d2149b@gmail.com>

On 10/3/19 5:27 AM, Dmitry Osipenko wrote:
> 02.10.2019 00:13, Stephen Warren пишет:
>> From: Stephen Warren <swarren@nvidia.com>
>>
>> For a little over a year, U-Boot has configured the flow controller to
>> perform automatic RAM re-repair on off->on power transitions of the CPU
>> rail1]. This is mandatory for correct operation of Tegra124. However, RAM
>> re-repair relies on certain clocks, which the kernel must enable and
>> leave running. PLLP is one of those clocks. This clock is shut down
>> during LP1 in order to save power. Enable bypass (which I believe routes
>> osc_div_clk, essentially the crystal clock, to the PLL output) so that
>> this clock signal toggles even though the PLL is not active. This is
>> required so that LP1 power mode (system suspend) operates correctly.
>>
>> The bypass configuration must then be undone when resuming from LP1, so
>> that all peripheral clocks run at the expected rate. Without this, many
>> peripherals won't work correctly; for example, the UART baud rate would
>> be incorrect.
>>
>> NVIDIA's downstream kernel code only does this if not compiled for
>> Tegra30, so the added code is made conditional upon the chip ID. NVIDIA's
>> downstream code makes this change conditional upon the active CPU
>> cluster. The upstream kernel currently doesn't support cluster switching,
>> so this patch doesn't test the active CPU cluster ID.
>>
>> [1] 3cc7942a4ae5 ARM: tegra: implement RAM repair
>>
>> Reported-by: Jonathan Hunter <jonathanh@nvidia.com>
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
>> ---
>>   arch/arm/mach-tegra/sleep-tegra30.S | 11 +++++++++++
>>   1 file changed, 11 insertions(+)
>>
>> diff --git a/arch/arm/mach-tegra/sleep-tegra30.S b/arch/arm/mach-tegra/sleep-tegra30.S
>> index b408fa56eb89..6922dd8d3e2d 100644
>> --- a/arch/arm/mach-tegra/sleep-tegra30.S
>> +++ b/arch/arm/mach-tegra/sleep-tegra30.S
>> @@ -370,6 +370,14 @@ _pll_m_c_x_done:
>>   	pll_locked r1, r0, CLK_RESET_PLLC_BASE
>>   	pll_locked r1, r0, CLK_RESET_PLLX_BASE
>>   
>> +	tegra_get_soc_id TEGRA_APB_MISC_BASE, r1
>> +	cmp	r1, #TEGRA30
>> +	beq	1f
> 
> What about T114, or does it need enabled PLLP as well?

I'm nowhere near as familiar with T114 as T124, so I can't be 100% sure. 
However, a very quick look at the CAR section in the T114 TRM does show 
the same gate/mux structure around a reshift and fuse clock, so I assume 
the requirement is identical there.

Also, NVIDIA's downstream kernel has a compile-time ifdef around the 
code I've added here. It's not compiled for T30 specifically, and is 
compiled for anything else, which I believe means both T114 and T124.

In patch 1 in this series, I only enabled the fuse clock for T124, since 
I don't have a T114 system to test any more. However, the revised patch 
1 that Thierry and I are discussing would enable the fuse clock on all 
SoCs, and hence make the code work identically on T114 as it does on T124.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Stephen Warren <swarren@wwwdotorg.org>
To: Dmitry Osipenko <digetx@gmail.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Peter De Schrijver <pdeschrijver@nvidia.com>,
	Prashant Gaikwad <pgaikwad@nvidia.com>
Cc: Stephen Boyd <sboyd@kernel.org>,
	linux-tegra@vger.kernel.org,
	Michael Turquette <mturquette@baylibre.com>,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/4] ARM: tegra: Enable PLLP bypass during Tegra124 LP1
Date: Thu, 3 Oct 2019 10:34:14 -0600	[thread overview]
Message-ID: <485c9828-120a-8e62-bf85-c5d8407d3513@wwwdotorg.org> (raw)
In-Reply-To: <437f030b-9e20-43e5-42ce-f98430d2149b@gmail.com>

On 10/3/19 5:27 AM, Dmitry Osipenko wrote:
> 02.10.2019 00:13, Stephen Warren пишет:
>> From: Stephen Warren <swarren@nvidia.com>
>>
>> For a little over a year, U-Boot has configured the flow controller to
>> perform automatic RAM re-repair on off->on power transitions of the CPU
>> rail1]. This is mandatory for correct operation of Tegra124. However, RAM
>> re-repair relies on certain clocks, which the kernel must enable and
>> leave running. PLLP is one of those clocks. This clock is shut down
>> during LP1 in order to save power. Enable bypass (which I believe routes
>> osc_div_clk, essentially the crystal clock, to the PLL output) so that
>> this clock signal toggles even though the PLL is not active. This is
>> required so that LP1 power mode (system suspend) operates correctly.
>>
>> The bypass configuration must then be undone when resuming from LP1, so
>> that all peripheral clocks run at the expected rate. Without this, many
>> peripherals won't work correctly; for example, the UART baud rate would
>> be incorrect.
>>
>> NVIDIA's downstream kernel code only does this if not compiled for
>> Tegra30, so the added code is made conditional upon the chip ID. NVIDIA's
>> downstream code makes this change conditional upon the active CPU
>> cluster. The upstream kernel currently doesn't support cluster switching,
>> so this patch doesn't test the active CPU cluster ID.
>>
>> [1] 3cc7942a4ae5 ARM: tegra: implement RAM repair
>>
>> Reported-by: Jonathan Hunter <jonathanh@nvidia.com>
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
>> ---
>>   arch/arm/mach-tegra/sleep-tegra30.S | 11 +++++++++++
>>   1 file changed, 11 insertions(+)
>>
>> diff --git a/arch/arm/mach-tegra/sleep-tegra30.S b/arch/arm/mach-tegra/sleep-tegra30.S
>> index b408fa56eb89..6922dd8d3e2d 100644
>> --- a/arch/arm/mach-tegra/sleep-tegra30.S
>> +++ b/arch/arm/mach-tegra/sleep-tegra30.S
>> @@ -370,6 +370,14 @@ _pll_m_c_x_done:
>>   	pll_locked r1, r0, CLK_RESET_PLLC_BASE
>>   	pll_locked r1, r0, CLK_RESET_PLLX_BASE
>>   
>> +	tegra_get_soc_id TEGRA_APB_MISC_BASE, r1
>> +	cmp	r1, #TEGRA30
>> +	beq	1f
> 
> What about T114, or does it need enabled PLLP as well?

I'm nowhere near as familiar with T114 as T124, so I can't be 100% sure. 
However, a very quick look at the CAR section in the T114 TRM does show 
the same gate/mux structure around a reshift and fuse clock, so I assume 
the requirement is identical there.

Also, NVIDIA's downstream kernel has a compile-time ifdef around the 
code I've added here. It's not compiled for T30 specifically, and is 
compiled for anything else, which I believe means both T114 and T124.

In patch 1 in this series, I only enabled the fuse clock for T124, since 
I don't have a T114 system to test any more. However, the revised patch 
1 that Thierry and I are discussing would enable the fuse clock on all 
SoCs, and hence make the code work identically on T114 as it does on T124.

  reply	other threads:[~2019-10-03 16:34 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-01 21:13 [PATCH 1/4] clk: tegra: Enable fuse clock on Tegra124 Stephen Warren
2019-10-01 21:13 ` Stephen Warren
2019-10-01 21:13 ` Stephen Warren
2019-10-01 21:13 ` [PATCH 2/4] ARM: tegra: Enable PLLP bypass during Tegra124 LP1 Stephen Warren
2019-10-01 21:13   ` Stephen Warren
2019-10-01 21:13   ` Stephen Warren
2019-10-03 11:27   ` Dmitry Osipenko
2019-10-03 11:27     ` Dmitry Osipenko
2019-10-03 16:34     ` Stephen Warren [this message]
2019-10-03 16:34       ` Stephen Warren
2019-10-03 18:00       ` Dmitry Osipenko
2019-10-03 18:00         ` Dmitry Osipenko
2019-10-01 21:13 ` [PATCH 3/4] ARM: tegra: modify reshift divider during LP1 Stephen Warren
2019-10-01 21:13   ` Stephen Warren
2019-10-01 21:13   ` Stephen Warren
2019-10-01 21:13 ` PATCH 4/4] ARM: tegra: use clk_m CPU on Tegra124 LP1 resume Stephen Warren
2019-10-01 21:13   ` Stephen Warren
2019-10-01 21:13   ` Stephen Warren
2019-10-02 11:04 ` [PATCH 1/4] clk: tegra: Enable fuse clock on Tegra124 Thierry Reding
2019-10-02 11:04   ` Thierry Reding
2019-10-02 20:59   ` Stephen Warren
2019-10-02 20:59     ` Stephen Warren
2019-10-02 20:59     ` Stephen Warren
2019-10-04 12:18     ` Thierry Reding
2019-10-04 12:18       ` Thierry Reding
2019-10-04 16:07       ` Stephen Warren
2019-10-04 16:07         ` Stephen Warren
2019-10-04 16:07         ` Stephen Warren
     [not found] ` <20191002224944.D324720659@mail.kernel.org>
2019-10-02 23:07   ` Stephen Warren
2019-10-03 11:23 ` Dmitry Osipenko
2019-10-03 11:23   ` Dmitry Osipenko
2019-10-03 16:28   ` Stephen Warren
2019-10-03 16:28     ` Stephen Warren

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=485c9828-120a-8e62-bf85-c5d8407d3513@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=digetx@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=pdeschrijver@nvidia.com \
    --cc=pgaikwad@nvidia.com \
    --cc=sboyd@kernel.org \
    --cc=thierry.reding@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 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.