All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: icenowy@aosc.io
Cc: linux-pm@vger.kernel.org, linux-sunxi@googlegroups.com,
	linux-kernel@vger.kernel.org,
	Quentin Schulz <quentin.schulz@free-electrons.com>,
	Chen-Yu Tsai <wens@csie.org>,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 4/5] ARM: sun8i: h3: add operating-points-v2 table for CPU
Date: Sun, 16 Apr 2017 22:57:40 +0200	[thread overview]
Message-ID: <20170416205740.b5pk3kcxwaegij6g@lukather> (raw)
In-Reply-To: <b37490ed1282f45542168701dea332bb@aosc.io>

[-- Attachment #1: Type: text/plain, Size: 3650 bytes --]

On Tue, Apr 11, 2017 at 09:28:55PM +0800, icenowy@aosc.io wrote:
> 在 2017-04-11 17:13,Maxime Ripard 写道:
> > On Sun, Apr 09, 2017 at 02:50:24AM +0800, Icenowy Zheng wrote:
> > > The CPU on Allwinner H3 can do dynamic frequency scaling.
> > > 
> > > Add a DVFS table based on the one tweaked by Armbian developers, which
> > > are proven to work stably on BSP kernels.
> > > 
> > > Frequencies higher than 1008MHz are temporarily dropped in the
> > > table, as
> > > they may lead to over voltage on boards without proper regulator
> > > settings or over temperature on boards with proper regulator settings.
> > > They will be added back once regulator settings are ready and thermal
> > > sensor driver is merged.
> > > 
> > > In order to satisfy all different regulators (SY8106A which is 50mV
> > > per
> > > level, SY8113B which have two states: 1.1V and 1.3V, and some board
> > > with
> > > non-tweakable regulators), all the OPPs are defined with a range
> > > which has
> > > the target value as the minimum allowed value, and 1.3V (the highest
> > > VDD-CPUX voltage suggested by the datasheet) as the maximum allowed
> > > value.
> > > It's proven to work well with a board with SY8113B.
> > > 
> > > Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> > > ---
> > >  arch/arm/boot/dts/sun8i-h3.dtsi | 38
> > > +++++++++++++++++++++++++++++++++++++-
> > >  1 file changed, 37 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi
> > > b/arch/arm/boot/dts/sun8i-h3.dtsi
> > > index b36f9f423c39..a0cee17fe44b 100644
> > > --- a/arch/arm/boot/dts/sun8i-h3.dtsi
> > > +++ b/arch/arm/boot/dts/sun8i-h3.dtsi
> > > @@ -43,32 +43,68 @@
> > >  #include "sunxi-h3-h5.dtsi"
> > > 
> > >  / {
> > > +	cpu0_opp_table: opp_table0 {
> > > +		compatible = "operating-points-v2";
> > > +		opp-shared;
> > > +
> > > +		opp@480000000 {
> > > +			opp-hz = /bits/ 64 <480000000>;
> > > +			opp-microvolt = <980000 980000 1300000>;
> > > +			clock-latency-ns = <244144>; /* 8 32k periods */
> > > +		};
> > > +
> > > +		opp@648000000 {
> > > +			opp-hz = /bits/ 64 <816000000>;
> > > +			opp-microvolt = <1020000 1020000 1300000>;
> > > +			clock-latency-ns = <244144>; /* 8 32k periods */
> > > +		};
> > > +
> > > +		opp@912000000 {
> > > +			opp-hz = /bits/ 64 <960000000>;
> > > +			opp-microvolt = <1080000 1080000 1300000>;
> > > +			clock-latency-ns = <244144>; /* 8 32k periods */
> > > +		};
> > > +
> > > +		opp@1008000000 {
> > > +			opp-hz = /bits/ 64 <1008000000>;
> > > +			opp-microvolt = <1140000 1140000 1300000>;
> > > +			clock-latency-ns = <244144>; /* 8 32k periods */
> > > +		};
> > > +	};
> > > +
> > 
> > From your serie, I guess you never actually tested those OPPs on any
> > board without SY8113B, right?
> 
> Yes. But I will test them on an Orange Pi PC (newly got) soon.

The orange pi pc also uses the SY8113B.

> (After all PLL_CPUX-related things are well fixed)
> 
> P.S. how to implement such a thing:
> 
> - Before tweaking CPUX clock, first switch it to osc24M
>   (implemented yet)
> - Before tweaking PLL_CPUX clock (triggered by tweaking CPUX
>   clock), first gate it
> - After tweaking PLL_CPUX clock, ungate it and wait it to be stable
> - After tweaking PLL_CPUX clock, change CPUX mux back to PLL_CPUX
>   (implemented yet)
> 
> I think notifiers on PLL_CPUX can be used to implement the second
> and third part?

Do you still have any issues with the code we merged?

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: icenowy-h8G6r0blFSE@public.gmane.org
Cc: linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Quentin Schulz
	<quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>,
	linux-clk-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 4/5] ARM: sun8i: h3: add operating-points-v2 table for CPU
Date: Sun, 16 Apr 2017 22:57:40 +0200	[thread overview]
Message-ID: <20170416205740.b5pk3kcxwaegij6g@lukather> (raw)
In-Reply-To: <b37490ed1282f45542168701dea332bb-h8G6r0blFSE@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 4014 bytes --]

On Tue, Apr 11, 2017 at 09:28:55PM +0800, icenowy-h8G6r0blFSE@public.gmane.org wrote:
> 在 2017-04-11 17:13,Maxime Ripard 写道:
> > On Sun, Apr 09, 2017 at 02:50:24AM +0800, Icenowy Zheng wrote:
> > > The CPU on Allwinner H3 can do dynamic frequency scaling.
> > > 
> > > Add a DVFS table based on the one tweaked by Armbian developers, which
> > > are proven to work stably on BSP kernels.
> > > 
> > > Frequencies higher than 1008MHz are temporarily dropped in the
> > > table, as
> > > they may lead to over voltage on boards without proper regulator
> > > settings or over temperature on boards with proper regulator settings.
> > > They will be added back once regulator settings are ready and thermal
> > > sensor driver is merged.
> > > 
> > > In order to satisfy all different regulators (SY8106A which is 50mV
> > > per
> > > level, SY8113B which have two states: 1.1V and 1.3V, and some board
> > > with
> > > non-tweakable regulators), all the OPPs are defined with a range
> > > which has
> > > the target value as the minimum allowed value, and 1.3V (the highest
> > > VDD-CPUX voltage suggested by the datasheet) as the maximum allowed
> > > value.
> > > It's proven to work well with a board with SY8113B.
> > > 
> > > Signed-off-by: Icenowy Zheng <icenowy-h8G6r0blFSE@public.gmane.org>
> > > ---
> > >  arch/arm/boot/dts/sun8i-h3.dtsi | 38
> > > +++++++++++++++++++++++++++++++++++++-
> > >  1 file changed, 37 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi
> > > b/arch/arm/boot/dts/sun8i-h3.dtsi
> > > index b36f9f423c39..a0cee17fe44b 100644
> > > --- a/arch/arm/boot/dts/sun8i-h3.dtsi
> > > +++ b/arch/arm/boot/dts/sun8i-h3.dtsi
> > > @@ -43,32 +43,68 @@
> > >  #include "sunxi-h3-h5.dtsi"
> > > 
> > >  / {
> > > +	cpu0_opp_table: opp_table0 {
> > > +		compatible = "operating-points-v2";
> > > +		opp-shared;
> > > +
> > > +		opp@480000000 {
> > > +			opp-hz = /bits/ 64 <480000000>;
> > > +			opp-microvolt = <980000 980000 1300000>;
> > > +			clock-latency-ns = <244144>; /* 8 32k periods */
> > > +		};
> > > +
> > > +		opp@648000000 {
> > > +			opp-hz = /bits/ 64 <816000000>;
> > > +			opp-microvolt = <1020000 1020000 1300000>;
> > > +			clock-latency-ns = <244144>; /* 8 32k periods */
> > > +		};
> > > +
> > > +		opp@912000000 {
> > > +			opp-hz = /bits/ 64 <960000000>;
> > > +			opp-microvolt = <1080000 1080000 1300000>;
> > > +			clock-latency-ns = <244144>; /* 8 32k periods */
> > > +		};
> > > +
> > > +		opp@1008000000 {
> > > +			opp-hz = /bits/ 64 <1008000000>;
> > > +			opp-microvolt = <1140000 1140000 1300000>;
> > > +			clock-latency-ns = <244144>; /* 8 32k periods */
> > > +		};
> > > +	};
> > > +
> > 
> > From your serie, I guess you never actually tested those OPPs on any
> > board without SY8113B, right?
> 
> Yes. But I will test them on an Orange Pi PC (newly got) soon.

The orange pi pc also uses the SY8113B.

> (After all PLL_CPUX-related things are well fixed)
> 
> P.S. how to implement such a thing:
> 
> - Before tweaking CPUX clock, first switch it to osc24M
>   (implemented yet)
> - Before tweaking PLL_CPUX clock (triggered by tweaking CPUX
>   clock), first gate it
> - After tweaking PLL_CPUX clock, ungate it and wait it to be stable
> - After tweaking PLL_CPUX clock, change CPUX mux back to PLL_CPUX
>   (implemented yet)
> 
> I think notifiers on PLL_CPUX can be used to implement the second
> and third part?

Do you still have any issues with the code we merged?

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

-- 
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: maxime.ripard@free-electrons.com (Maxime Ripard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/5] ARM: sun8i: h3: add operating-points-v2 table for CPU
Date: Sun, 16 Apr 2017 22:57:40 +0200	[thread overview]
Message-ID: <20170416205740.b5pk3kcxwaegij6g@lukather> (raw)
In-Reply-To: <b37490ed1282f45542168701dea332bb@aosc.io>

On Tue, Apr 11, 2017 at 09:28:55PM +0800, icenowy at aosc.io wrote:
> ? 2017-04-11 17:13?Maxime Ripard ???
> > On Sun, Apr 09, 2017 at 02:50:24AM +0800, Icenowy Zheng wrote:
> > > The CPU on Allwinner H3 can do dynamic frequency scaling.
> > > 
> > > Add a DVFS table based on the one tweaked by Armbian developers, which
> > > are proven to work stably on BSP kernels.
> > > 
> > > Frequencies higher than 1008MHz are temporarily dropped in the
> > > table, as
> > > they may lead to over voltage on boards without proper regulator
> > > settings or over temperature on boards with proper regulator settings.
> > > They will be added back once regulator settings are ready and thermal
> > > sensor driver is merged.
> > > 
> > > In order to satisfy all different regulators (SY8106A which is 50mV
> > > per
> > > level, SY8113B which have two states: 1.1V and 1.3V, and some board
> > > with
> > > non-tweakable regulators), all the OPPs are defined with a range
> > > which has
> > > the target value as the minimum allowed value, and 1.3V (the highest
> > > VDD-CPUX voltage suggested by the datasheet) as the maximum allowed
> > > value.
> > > It's proven to work well with a board with SY8113B.
> > > 
> > > Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> > > ---
> > >  arch/arm/boot/dts/sun8i-h3.dtsi | 38
> > > +++++++++++++++++++++++++++++++++++++-
> > >  1 file changed, 37 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi
> > > b/arch/arm/boot/dts/sun8i-h3.dtsi
> > > index b36f9f423c39..a0cee17fe44b 100644
> > > --- a/arch/arm/boot/dts/sun8i-h3.dtsi
> > > +++ b/arch/arm/boot/dts/sun8i-h3.dtsi
> > > @@ -43,32 +43,68 @@
> > >  #include "sunxi-h3-h5.dtsi"
> > > 
> > >  / {
> > > +	cpu0_opp_table: opp_table0 {
> > > +		compatible = "operating-points-v2";
> > > +		opp-shared;
> > > +
> > > +		opp at 480000000 {
> > > +			opp-hz = /bits/ 64 <480000000>;
> > > +			opp-microvolt = <980000 980000 1300000>;
> > > +			clock-latency-ns = <244144>; /* 8 32k periods */
> > > +		};
> > > +
> > > +		opp at 648000000 {
> > > +			opp-hz = /bits/ 64 <816000000>;
> > > +			opp-microvolt = <1020000 1020000 1300000>;
> > > +			clock-latency-ns = <244144>; /* 8 32k periods */
> > > +		};
> > > +
> > > +		opp at 912000000 {
> > > +			opp-hz = /bits/ 64 <960000000>;
> > > +			opp-microvolt = <1080000 1080000 1300000>;
> > > +			clock-latency-ns = <244144>; /* 8 32k periods */
> > > +		};
> > > +
> > > +		opp at 1008000000 {
> > > +			opp-hz = /bits/ 64 <1008000000>;
> > > +			opp-microvolt = <1140000 1140000 1300000>;
> > > +			clock-latency-ns = <244144>; /* 8 32k periods */
> > > +		};
> > > +	};
> > > +
> > 
> > From your serie, I guess you never actually tested those OPPs on any
> > board without SY8113B, right?
> 
> Yes. But I will test them on an Orange Pi PC (newly got) soon.

The orange pi pc also uses the SY8113B.

> (After all PLL_CPUX-related things are well fixed)
> 
> P.S. how to implement such a thing:
> 
> - Before tweaking CPUX clock, first switch it to osc24M
>   (implemented yet)
> - Before tweaking PLL_CPUX clock (triggered by tweaking CPUX
>   clock), first gate it
> - After tweaking PLL_CPUX clock, ungate it and wait it to be stable
> - After tweaking PLL_CPUX clock, change CPUX mux back to PLL_CPUX
>   (implemented yet)
> 
> I think notifiers on PLL_CPUX can be used to implement the second
> and third part?

Do you still have any issues with the code we merged?

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170416/c0044ce5/attachment-0001.sig>

  reply	other threads:[~2017-04-16 20:57 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-08 18:50 [PATCH 0/5] Some Allwinner CCU tweaks and basical DVFS support for H3/H2+ Icenowy Zheng
2017-04-08 18:50 ` Icenowy Zheng
2017-04-08 18:50 ` [PATCH 1/5] clk: sunxi-ng: prevent NKMP clocks from temporarily get higher freq Icenowy Zheng
2017-04-08 18:50   ` Icenowy Zheng
2017-04-08 21:59   ` [linux-sunxi] " Ondřej Jirman
2017-04-08 21:59     ` Ondřej Jirman
2017-04-08 21:59     ` 'Ondřej Jirman' via linux-sunxi
2017-04-08 18:50 ` [PATCH 2/5] clk: sunxi-ng: allow set parent clock (PLL_CPUX) for CPUX clock on H3 Icenowy Zheng
2017-04-08 18:50   ` Icenowy Zheng
2017-04-09  1:05   ` [linux-sunxi] " Chen-Yu Tsai
2017-04-09  1:05     ` Chen-Yu Tsai
2017-04-09  1:05     ` Chen-Yu Tsai
2017-04-08 18:50 ` [PATCH 3/5] cpufreq: dt: Add support for some new Allwinner SoCs Icenowy Zheng
2017-04-08 18:50   ` Icenowy Zheng
2017-04-11  7:03   ` Viresh Kumar
2017-04-11  7:03     ` Viresh Kumar
2017-04-11  7:03     ` Viresh Kumar
2017-04-08 18:50 ` [PATCH 4/5] ARM: sun8i: h3: add operating-points-v2 table for CPU Icenowy Zheng
2017-04-08 18:50   ` Icenowy Zheng
2017-04-08 18:50   ` Icenowy Zheng
2017-04-11  9:13   ` Maxime Ripard
2017-04-11  9:13     ` Maxime Ripard
2017-04-11  9:13     ` Maxime Ripard
2017-04-11 13:28     ` icenowy
2017-04-11 13:28       ` icenowy at aosc.io
2017-04-16 20:57       ` Maxime Ripard [this message]
2017-04-16 20:57         ` Maxime Ripard
2017-04-16 20:57         ` Maxime Ripard
2017-04-16 21:00         ` Icenowy Zheng
2017-04-16 21:00           ` Icenowy Zheng
2017-04-17  7:46           ` Maxime Ripard
2017-04-17  7:46             ` Maxime Ripard
2017-04-17  7:46             ` Maxime Ripard
2017-04-16 21:06         ` icenowy
2017-04-16 21:06           ` icenowy at aosc.io
2017-04-16 21:06           ` icenowy-h8G6r0blFSE
2017-04-08 18:50 ` [PATCH 5/5] ARM: sun8i: h2+: add SY8113B regulator used by Orange Pi Zero board Icenowy Zheng
2017-04-08 18:50   ` Icenowy Zheng
2017-04-08 18:50   ` Icenowy Zheng

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=20170416205740.b5pk3kcxwaegij6g@lukather \
    --to=maxime.ripard@free-electrons.com \
    --cc=icenowy@aosc.io \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=quentin.schulz@free-electrons.com \
    --cc=wens@csie.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.