linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Re:Re: [PATCH] arm64: dts: allwinner: h6: Enable CPU opp tables for OrangePi One Plus
@ 2022-05-08 13:29 Chukun Pan
  2022-05-09  4:55 ` Samuel Holland
  0 siblings, 1 reply; 4+ messages in thread
From: Chukun Pan @ 2022-05-08 13:29 UTC (permalink / raw)
  To: Samuel Holland
  Cc: Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, Rob Herring,
	Krzysztof Kozlowski, devicetree, linux-arm-kernel, linux-sunxi,
	linux-kernel

>The AXP805 datasheet has this information in the description for REG 1A.
>DVM is disabled by default, and when it is enabled, the default ramp rate
>is 10mV/15.625 us == 640 uV/us.
>
>Did you notice any instability without this delay?

Actually I write this based on the commit https://github.com/torvalds/linux/commit/ebae33c
("arm64: dts: allwinner: h6: Enable CPU opp tables for Orange Pi 3") and https://github.com/
torvalds/linux/commit/fe79ea5 ("arm64: dts: allwinner: h6: Enable CPU opp tables for Pine
H64"), so I think it's necessary to add this delay.

>> @@ -216,6 +222,7 @@ reg_dcdcc: dcdcc {
>>  				regulator-enable-ramp-delay = <32000>;
>>  				regulator-min-microvolt = <810000>;
>>  				regulator-max-microvolt = <1080000>;
>> +				regulator-ramp-delay = <2500>;
>
>This change is not related to CPU frequency scaling, so it belongs in a separate
>patch (if it is needed).

The two commits mentioned above also add this delay to dcdcc regulator.
If there is a need for a separate patch, I will send these separately.

Thanks,
Chukun


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64: dts: allwinner: h6: Enable CPU opp tables for OrangePi One Plus
  2022-05-08 13:29 Re:Re: [PATCH] arm64: dts: allwinner: h6: Enable CPU opp tables for OrangePi One Plus Chukun Pan
@ 2022-05-09  4:55 ` Samuel Holland
  0 siblings, 0 replies; 4+ messages in thread
From: Samuel Holland @ 2022-05-09  4:55 UTC (permalink / raw)
  To: Chukun Pan
  Cc: Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, Rob Herring,
	Krzysztof Kozlowski, devicetree, linux-arm-kernel, linux-sunxi,
	linux-kernel, x

Hi Chukun,

On 5/8/22 8:29 AM, Chukun Pan wrote:
>> The AXP805 datasheet has this information in the description for REG 1A.
>> DVM is disabled by default, and when it is enabled, the default ramp rate
>> is 10mV/15.625 us == 640 uV/us.
>>
>> Did you notice any instability without this delay?
> 
> Actually I write this based on the commit https://github.com/torvalds/linux/commit/ebae33c
> ("arm64: dts: allwinner: h6: Enable CPU opp tables for Orange Pi 3") and https://github.com/
> torvalds/linux/commit/fe79ea5 ("arm64: dts: allwinner: h6: Enable CPU opp tables for Pine
> H64"), so I think it's necessary to add this delay.

Thanks for the context! I think the suggestion comes originally from here:
https://lore.kernel.org/lkml/20200405115138.vrrvv7spnv6ifm6x@core.my.home/

From my reading of that thread, there appear to have been no reliability issues
before adding this change. It was just based on the available information at the
time.

On the other hand, adding this property will cause the CPU to spin for up to
112us in _regulator_do_set_voltage() during each CPU frequency change. So this
adds a lot of latency, which I would like to avoid if possible.

Regards,
Samuel

>>> @@ -216,6 +222,7 @@ reg_dcdcc: dcdcc {
>>>  				regulator-enable-ramp-delay = <32000>;
>>>  				regulator-min-microvolt = <810000>;
>>>  				regulator-max-microvolt = <1080000>;
>>> +				regulator-ramp-delay = <2500>;
>>
>> This change is not related to CPU frequency scaling, so it belongs in a separate
>> patch (if it is needed).
> 
> The two commits mentioned above also add this delay to dcdcc regulator.
> If there is a need for a separate patch, I will send these separately.
> 
> Thanks,
> Chukun
> 
> 


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64: dts: allwinner: h6: Enable CPU opp tables for OrangePi One Plus
  2022-05-02 15:01 Chukun Pan
@ 2022-05-03  2:24 ` Samuel Holland
  0 siblings, 0 replies; 4+ messages in thread
From: Samuel Holland @ 2022-05-03  2:24 UTC (permalink / raw)
  To: Chukun Pan, Maxime Ripard
  Cc: Chen-Yu Tsai, Jernej Skrabec, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-arm-kernel, linux-sunxi, linux-kernel

On 5/2/22 10:01 AM, Chukun Pan wrote:
> Enable CPU opp tables for OrangePi One Plus.
> 
> This needs to change the CPU regulator max voltage to fit
> the OPP table.
> 
> Also add the ramp-delay information to avoid any out of spec
> running as the regulator is slower at reaching the voltage
> requested compare to the PLL reaching the frequency.
> 
> There is no such information for AXP805 but similar PMIC (AXP813)
> has a DVM (Dynamic Voltage scaling Management) ramp rate equal
> to 2500uV/us.

The AXP805 datasheet has this information in the description for REG 1A. DVM is
disabled by default, and when it is enabled, the default ramp rate is 10
mV/15.625 us == 640 uV/us.

Did you notice any instability without this delay?

> Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
> ---
>  arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi
> index 92745128fcfe..d7b82ef6be55 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi
> @@ -5,6 +5,7 @@
>  /dts-v1/;
>  
>  #include "sun50i-h6.dtsi"
> +#include "sun50i-h6-cpu-opp.dtsi"
>  
>  #include <dt-bindings/gpio/gpio.h>
>  
> @@ -64,6 +65,10 @@ reg_vcc5v: vcc5v {
>  	};
>  };
>  
> +&cpu0 {
> +	cpu-supply = <&reg_dcdca>;
> +};
> +
>  &de {
>  	status = "okay";
>  };
> @@ -208,7 +213,8 @@ reg_cldo3: cldo3 {
>  			reg_dcdca: dcdca {
>  				regulator-always-on;
>  				regulator-min-microvolt = <810000>;
> -				regulator-max-microvolt = <1080000>;
> +				regulator-max-microvolt = <1160000>;
> +				regulator-ramp-delay = <2500>;
>  				regulator-name = "vdd-cpu";
>  			};
>  
> @@ -216,6 +222,7 @@ reg_dcdcc: dcdcc {
>  				regulator-enable-ramp-delay = <32000>;
>  				regulator-min-microvolt = <810000>;
>  				regulator-max-microvolt = <1080000>;
> +				regulator-ramp-delay = <2500>;

This change is not related to CPU frequency scaling, so it belongs in a separate
patch (if it is needed).

Regards,
Samuel

>  				regulator-name = "vdd-gpu";
>  			};
>  
> 


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] arm64: dts: allwinner: h6: Enable CPU opp tables for OrangePi One Plus
@ 2022-05-02 15:01 Chukun Pan
  2022-05-03  2:24 ` Samuel Holland
  0 siblings, 1 reply; 4+ messages in thread
From: Chukun Pan @ 2022-05-02 15:01 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Rob Herring,
	Krzysztof Kozlowski, devicetree, linux-arm-kernel, linux-sunxi,
	linux-kernel, Chukun Pan

Enable CPU opp tables for OrangePi One Plus.

This needs to change the CPU regulator max voltage to fit
the OPP table.

Also add the ramp-delay information to avoid any out of spec
running as the regulator is slower at reaching the voltage
requested compare to the PLL reaching the frequency.

There is no such information for AXP805 but similar PMIC (AXP813)
has a DVM (Dynamic Voltage scaling Management) ramp rate equal
to 2500uV/us.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
---
 arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi
index 92745128fcfe..d7b82ef6be55 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi
@@ -5,6 +5,7 @@
 /dts-v1/;
 
 #include "sun50i-h6.dtsi"
+#include "sun50i-h6-cpu-opp.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 
@@ -64,6 +65,10 @@ reg_vcc5v: vcc5v {
 	};
 };
 
+&cpu0 {
+	cpu-supply = <&reg_dcdca>;
+};
+
 &de {
 	status = "okay";
 };
@@ -208,7 +213,8 @@ reg_cldo3: cldo3 {
 			reg_dcdca: dcdca {
 				regulator-always-on;
 				regulator-min-microvolt = <810000>;
-				regulator-max-microvolt = <1080000>;
+				regulator-max-microvolt = <1160000>;
+				regulator-ramp-delay = <2500>;
 				regulator-name = "vdd-cpu";
 			};
 
@@ -216,6 +222,7 @@ reg_dcdcc: dcdcc {
 				regulator-enable-ramp-delay = <32000>;
 				regulator-min-microvolt = <810000>;
 				regulator-max-microvolt = <1080000>;
+				regulator-ramp-delay = <2500>;
 				regulator-name = "vdd-gpu";
 			};
 
-- 
2.25.1


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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-05-09  4:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-08 13:29 Re:Re: [PATCH] arm64: dts: allwinner: h6: Enable CPU opp tables for OrangePi One Plus Chukun Pan
2022-05-09  4:55 ` Samuel Holland
  -- strict thread matches above, loose matches on Subject: below --
2022-05-02 15:01 Chukun Pan
2022-05-03  2:24 ` Samuel Holland

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).