All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mason <slash.tmp@free.fr>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	linux-pm <linux-pm@vger.kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Thibaud Cornic <thibaud_cornic@sigmadesigns.com>
Subject: Re: cpufreq: frequency scaling spec in DT node
Date: Wed, 12 Jul 2017 11:58:53 +0200	[thread overview]
Message-ID: <9476e8ee-24ae-1676-067b-18a867892894@free.fr> (raw)
In-Reply-To: <20170712034150.GD17115@vireshk-i7>

On 12/07/2017 05:41, Viresh Kumar wrote:

> On 11-07-17, 13:09, Mason wrote:
>
>> What I meant is that the bootloader originally set the max frequency
>> to 1206 MHz. The OPP table in DTS was written based on that value.
>>
>> Later, someone changed the bootloader code to set a slightly higher
>> max frequency. When I flashed the new bootloader on my board, the
>> OPP table no longer matches the actual frequency.
>>
>> But I am not notified when bootloader authors change max frequencies,
>> which is why I wrote "changed the max freq behind my back".
>>
>> (The bootloader is not DT-aware, so it leaves the DT untouched.)
> 
> Here we go. Finally I have understood what the problem you are facing is :)
> And yes, it was really not clear to me until now. I though that someone just
> changed the max in DT and that's making things go bad :)
> 
> Anyway, how does the bootloader control the max frequency? For the boards I
> worked on, it's just a PLL that the kernel needs to set and kernel can choose to
> program it the way it wants to irrespective of the way bootloader has worked on it.

I would object to the characterization of "just a PLL" :-)

The PLL outputs "garbage" before actually "locking" a target
frequency. It is not possible for the CPU to blindly change
the PLL settings, because that crashes the system.

The bootloader implements the steps required to change said
settings, so the strategy has been: have Linux use whatever
PLL frequency the bootloader programs.

Behind the PLL, there is a glitch-free divider, which is able
to divide the PLL output without crashing the system. I've
been using that divider for DFS.

drivers/clk/clk-tango4.c

Regards.

WARNING: multiple messages have this Message-ID (diff)
From: slash.tmp@free.fr (Mason)
To: linux-arm-kernel@lists.infradead.org
Subject: cpufreq: frequency scaling spec in DT node
Date: Wed, 12 Jul 2017 11:58:53 +0200	[thread overview]
Message-ID: <9476e8ee-24ae-1676-067b-18a867892894@free.fr> (raw)
In-Reply-To: <20170712034150.GD17115@vireshk-i7>

On 12/07/2017 05:41, Viresh Kumar wrote:

> On 11-07-17, 13:09, Mason wrote:
>
>> What I meant is that the bootloader originally set the max frequency
>> to 1206 MHz. The OPP table in DTS was written based on that value.
>>
>> Later, someone changed the bootloader code to set a slightly higher
>> max frequency. When I flashed the new bootloader on my board, the
>> OPP table no longer matches the actual frequency.
>>
>> But I am not notified when bootloader authors change max frequencies,
>> which is why I wrote "changed the max freq behind my back".
>>
>> (The bootloader is not DT-aware, so it leaves the DT untouched.)
> 
> Here we go. Finally I have understood what the problem you are facing is :)
> And yes, it was really not clear to me until now. I though that someone just
> changed the max in DT and that's making things go bad :)
> 
> Anyway, how does the bootloader control the max frequency? For the boards I
> worked on, it's just a PLL that the kernel needs to set and kernel can choose to
> program it the way it wants to irrespective of the way bootloader has worked on it.

I would object to the characterization of "just a PLL" :-)

The PLL outputs "garbage" before actually "locking" a target
frequency. It is not possible for the CPU to blindly change
the PLL settings, because that crashes the system.

The bootloader implements the steps required to change said
settings, so the strategy has been: have Linux use whatever
PLL frequency the bootloader programs.

Behind the PLL, there is a glitch-free divider, which is able
to divide the PLL output without crashing the system. I've
been using that divider for DFS.

drivers/clk/clk-tango4.c

Regards.

  reply	other threads:[~2017-07-12  9:59 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29  9:48 cpufreq: frequency scaling spec in DT node Mason
2017-06-29  9:48 ` Mason
2017-06-29 10:04 ` Viresh Kumar
2017-06-29 10:04   ` Viresh Kumar
2017-06-29 11:41   ` Mason
2017-06-29 11:41     ` Mason
2017-06-29 13:01     ` Mason
2017-06-29 13:01       ` Mason
2017-06-29 14:35       ` Viresh Kumar
2017-06-29 14:35         ` Viresh Kumar
2017-06-29 14:34     ` Viresh Kumar
2017-06-29 14:34       ` Viresh Kumar
2017-07-11  9:27       ` Mason
2017-07-11  9:27         ` Mason
2017-07-11 10:25         ` Viresh Kumar
2017-07-11 10:25           ` Viresh Kumar
2017-07-11 11:09           ` Mason
2017-07-11 11:09             ` Mason
2017-07-11 11:56             ` Mason
2017-07-11 11:56               ` Mason
2017-07-12  3:41             ` Viresh Kumar
2017-07-12  3:41               ` Viresh Kumar
2017-07-12  9:58               ` Mason [this message]
2017-07-12  9:58                 ` Mason
2017-07-12 10:09                 ` Viresh Kumar
2017-07-12 10:09                   ` Viresh Kumar
2017-07-12 11:25                   ` Mason
2017-07-12 11:25                     ` Mason
2017-07-12 14:08                     ` Viresh Kumar
2017-07-12 14:08                       ` Viresh Kumar
2017-07-11 13:36         ` Mason
2017-07-11 13:36           ` Mason
2017-07-12  3:56           ` Viresh Kumar
2017-07-12  3:56             ` Viresh Kumar

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=9476e8ee-24ae-1676-067b-18a867892894@free.fr \
    --to=slash.tmp@free.fr \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=thibaud_cornic@sigmadesigns.com \
    --cc=viresh.kumar@linaro.org \
    /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.