linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATVH v2 0/4] arm64: dts: allwinner: h6: Enable CPU
@ 2019-02-15 13:49 Yangtao Li
  2019-02-15 13:49 ` [PATVH v2 1/4] arm64: dts: allwinner: h6: orangepi: Add CPU supply regulator Yangtao Li
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Yangtao Li @ 2019-02-15 13:49 UTC (permalink / raw)
  To: maxime.ripard, wens, robh+dt, mark.rutland
  Cc: linux-arm-kernel, devicetree, linux-kernel, Yangtao Li

Add the cpufreq support of h6, source of information is as follows.

h6 cpu opp info:
https://github.com/Allwinner-Homlet/H6-BSP4.9-linux/blob/master/arch/arm64/boot/dts/sunxi/sun50iw6p1.dtsi

axp805 spec:
http://linux-sunxi.org/images/b/bc/AXP805_Datasheet_V1.0_en.pdf

Yangtao Li (4):
  arm64: dts: allwinner: h6: orangepi: Add CPU supply regulator
  arm64: dts: allwinner: h6: pine: Add CPU supply regulator
  arm64: dts: allwinner: h6: Add clock to CPU cores
  arm64: dts: allwinner: h6: Add CPU Operating Performance Points table

 .../dts/allwinner/sun50i-h6-orangepi.dtsi     |  8 ++-
 .../boot/dts/allwinner/sun50i-h6-pine-h64.dts |  8 ++-
 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi  | 63 +++++++++++++++++++
 3 files changed, 75 insertions(+), 4 deletions(-)

-- 
2.17.0


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

* [PATVH v2 1/4] arm64: dts: allwinner: h6: orangepi: Add CPU supply regulator
  2019-02-15 13:49 [PATVH v2 0/4] arm64: dts: allwinner: h6: Enable CPU Yangtao Li
@ 2019-02-15 13:49 ` Yangtao Li
  2019-02-15 13:49 ` [PATVH v2 2/4] arm64: dts: allwinner: h6: pine: " Yangtao Li
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Yangtao Li @ 2019-02-15 13:49 UTC (permalink / raw)
  To: maxime.ripard, wens, robh+dt, mark.rutland
  Cc: linux-arm-kernel, devicetree, linux-kernel, Yangtao Li

The original orangepi use the dcdca to supply the CPU cores. According
to the axp805 spec, the range of dcdca is 0.6 to 1.1v, 1.12 to 1.52v.
In order to support more CPU frequency, slightly increase the voltage
maximum and minimum.

In fact, in sunxi's sdk, the actual minimum and maximum voltage of the
cpu is smaller or larger than the datasheet.

For some better quality ic, the minimum voltage can be smaller.
For some poor quality ic, the maximum voltage needs to be increased a
little.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi
index b2526dac2fcf..e7aebaf91ede 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi
@@ -159,8 +159,8 @@
 
 			reg_dcdca: dcdca {
 				regulator-always-on;
-				regulator-min-microvolt = <810000>;
-				regulator-max-microvolt = <1080000>;
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <1160000>;
 				regulator-name = "vdd-cpu";
 			};
 
@@ -191,6 +191,10 @@
 	};
 };
 
+&cpu0 {
+	cpu-supply = <&reg_dcdca>;
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_ph_pins>;
-- 
2.17.0


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

* [PATVH v2 2/4] arm64: dts: allwinner: h6: pine: Add CPU supply regulator
  2019-02-15 13:49 [PATVH v2 0/4] arm64: dts: allwinner: h6: Enable CPU Yangtao Li
  2019-02-15 13:49 ` [PATVH v2 1/4] arm64: dts: allwinner: h6: orangepi: Add CPU supply regulator Yangtao Li
@ 2019-02-15 13:49 ` Yangtao Li
  2019-02-15 13:49 ` [PATVH v2 3/4] arm64: dts: allwinner: h6: Add clock to CPU cores Yangtao Li
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Yangtao Li @ 2019-02-15 13:49 UTC (permalink / raw)
  To: maxime.ripard, wens, robh+dt, mark.rutland
  Cc: linux-arm-kernel, devicetree, linux-kernel, Yangtao Li

The original pine use the dcdca to supply the CPU cores. According
to the axp805 spec, the range of dcdca is 0.6 to 1.1v, 1.12 to 1.52v.
In order to support more CPU frequency, slightly increase the voltage
maximum and minimum.

In fact, in sunxi's sdk, the actual minimum and maximum voltage of the
cpu is smaller or larger than the datasheet.

For some better quality ic, the minimum voltage can be smaller. For
some poor quality ic, the maximum voltage needs to be increased a
little.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
index bdb8470fc8dc..95c81250c2b3 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
@@ -213,8 +213,8 @@
 
 			reg_dcdca: dcdca {
 				regulator-always-on;
-				regulator-min-microvolt = <810000>;
-				regulator-max-microvolt = <1080000>;
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <1160000>;
 				regulator-name = "vdd-cpu";
 			};
 
@@ -251,6 +251,10 @@
 	};
 };
 
+&cpu0 {
+	cpu-supply = <&reg_dcdca>;
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_ph_pins>;
-- 
2.17.0


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

* [PATVH v2 3/4] arm64: dts: allwinner: h6: Add clock to CPU cores
  2019-02-15 13:49 [PATVH v2 0/4] arm64: dts: allwinner: h6: Enable CPU Yangtao Li
  2019-02-15 13:49 ` [PATVH v2 1/4] arm64: dts: allwinner: h6: orangepi: Add CPU supply regulator Yangtao Li
  2019-02-15 13:49 ` [PATVH v2 2/4] arm64: dts: allwinner: h6: pine: " Yangtao Li
@ 2019-02-15 13:49 ` Yangtao Li
  2019-02-15 13:49 ` [PATVH v2 4/4] arm64: dts: allwinner: h6: Add CPU Operating Performance Points table Yangtao Li
  2019-02-15 15:13 ` [PATVH v2 0/4] arm64: dts: allwinner: h6: Enable CPU Maxime Ripard
  4 siblings, 0 replies; 8+ messages in thread
From: Yangtao Li @ 2019-02-15 13:49 UTC (permalink / raw)
  To: maxime.ripard, wens, robh+dt, mark.rutland
  Cc: linux-arm-kernel, devicetree, linux-kernel, Yangtao Li

The ARM CPU cores are fed by the CPU clock from the CCU. Add a
reference to the clock for each CPU core, along with the clock
transition latency.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
index d93a7add67e7..723f5d991a74 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
@@ -26,6 +26,8 @@
 			device_type = "cpu";
 			reg = <0>;
 			enable-method = "psci";
+			clocks = <&ccu CLK_CPUX>;
+			clock-latency-ns = <244144>; /* 8 32k periods */
 		};
 
 		cpu1: cpu@1 {
@@ -33,6 +35,8 @@
 			device_type = "cpu";
 			reg = <1>;
 			enable-method = "psci";
+			clocks = <&ccu CLK_CPUX>;
+			clock-latency-ns = <244144>; /* 8 32k periods */
 		};
 
 		cpu2: cpu@2 {
@@ -40,6 +44,8 @@
 			device_type = "cpu";
 			reg = <2>;
 			enable-method = "psci";
+			clocks = <&ccu CLK_CPUX>;
+			clock-latency-ns = <244144>; /* 8 32k periods */
 		};
 
 		cpu3: cpu@3 {
@@ -47,6 +53,8 @@
 			device_type = "cpu";
 			reg = <3>;
 			enable-method = "psci";
+			clocks = <&ccu CLK_CPUX>;
+			clock-latency-ns = <244144>; /* 8 32k periods */
 		};
 	};
 
-- 
2.17.0


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

* [PATVH v2 4/4] arm64: dts: allwinner: h6: Add CPU Operating Performance Points table
  2019-02-15 13:49 [PATVH v2 0/4] arm64: dts: allwinner: h6: Enable CPU Yangtao Li
                   ` (2 preceding siblings ...)
  2019-02-15 13:49 ` [PATVH v2 3/4] arm64: dts: allwinner: h6: Add clock to CPU cores Yangtao Li
@ 2019-02-15 13:49 ` Yangtao Li
  2019-02-15 15:13 ` [PATVH v2 0/4] arm64: dts: allwinner: h6: Enable CPU Maxime Ripard
  4 siblings, 0 replies; 8+ messages in thread
From: Yangtao Li @ 2019-02-15 13:49 UTC (permalink / raw)
  To: maxime.ripard, wens, robh+dt, mark.rutland
  Cc: linux-arm-kernel, devicetree, linux-kernel, Yangtao Li

Add an OPP (Operating Performance Points) table for the CPU cores to
enable DVFS (Dynamic Voltage & Frequency Scaling) on the H6. This
information comes from github.

When the four CPUs are running at 1.8 GHz, 100% busy, it is easy to heat
up and make the system restart. And currently H6 does not support the
thermal driver, can not get the temperature information of the cpu to
control the highest frequency. So temporarily remove the opp of 1.8GHz.

When the four CPUs operate at 1.4 GHz, 100% busy, the temperature is
stable at about 90 degrees, and the system can still operate normally.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 55 ++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
index 723f5d991a74..84fb47062fe6 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
@@ -28,6 +28,8 @@
 			enable-method = "psci";
 			clocks = <&ccu CLK_CPUX>;
 			clock-latency-ns = <244144>; /* 8 32k periods */
+			operating-points-v2 = <&cpu_opp_table>;
+			#cooling-cells = <2>;
 		};
 
 		cpu1: cpu@1 {
@@ -37,6 +39,8 @@
 			enable-method = "psci";
 			clocks = <&ccu CLK_CPUX>;
 			clock-latency-ns = <244144>; /* 8 32k periods */
+			operating-points-v2 = <&cpu_opp_table>;
+			#cooling-cells = <2>;
 		};
 
 		cpu2: cpu@2 {
@@ -46,6 +50,8 @@
 			enable-method = "psci";
 			clocks = <&ccu CLK_CPUX>;
 			clock-latency-ns = <244144>; /* 8 32k periods */
+			operating-points-v2 = <&cpu_opp_table>;
+			#cooling-cells = <2>;
 		};
 
 		cpu3: cpu@3 {
@@ -55,6 +61,55 @@
 			enable-method = "psci";
 			clocks = <&ccu CLK_CPUX>;
 			clock-latency-ns = <244144>; /* 8 32k periods */
+			operating-points-v2 = <&cpu_opp_table>;
+			#cooling-cells = <2>;
+		};
+	};
+
+	cpu_opp_table: opp_table {
+		compatible = "operating-points-v2";
+		opp-shared;
+
+		opp@480000000 {
+			opp-hz = /bits/ 64 <480000000>;
+			opp-microvolt = <800000 800000 880000>;
+			clock-latency-ns = <244144>; /* 8 32k periods */
+		};
+
+		opp@720000000 {
+			opp-hz = /bits/ 64 <720000000>;
+			opp-microvolt = <800000 800000 880000>;
+			clock-latency-ns = <244144>; /* 8 32k periods */
+		};
+
+		opp@816000000 {
+			opp-hz = /bits/ 64 <816000000>;
+			opp-microvolt = <800000 800000 880000>;
+			clock-latency-ns = <244144>; /* 8 32k periods */
+		};
+
+		opp@888000000 {
+			opp-hz = /bits/ 64 <888000000>;
+			opp-microvolt = <800000 800000 940000>;
+			clock-latency-ns = <244144>; /* 8 32k periods */
+		};
+
+		opp@1080000000 {
+			opp-hz = /bits/ 64 <1080000000>;
+			opp-microvolt = <840000 840000 1060000>;
+			clock-latency-ns = <244144>; /* 8 32k periods */
+		};
+
+		opp@1320000000 {
+			opp-hz = /bits/ 64 <1320000000>;
+			opp-microvolt = <900000 900000 1160000>;
+			clock-latency-ns = <244144>; /* 8 32k periods */
+		};
+
+		opp@1488000000 {
+			opp-hz = /bits/ 64 <1488000000>;
+			opp-microvolt = <960000 960000 1160000>;
+			clock-latency-ns = <244144>; /* 8 32k periods */
 		};
 	};
 
-- 
2.17.0


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

* Re: [PATVH v2 0/4] arm64: dts: allwinner: h6: Enable CPU
  2019-02-15 13:49 [PATVH v2 0/4] arm64: dts: allwinner: h6: Enable CPU Yangtao Li
                   ` (3 preceding siblings ...)
  2019-02-15 13:49 ` [PATVH v2 4/4] arm64: dts: allwinner: h6: Add CPU Operating Performance Points table Yangtao Li
@ 2019-02-15 15:13 ` Maxime Ripard
  2019-02-15 15:35   ` Frank Lee
  4 siblings, 1 reply; 8+ messages in thread
From: Maxime Ripard @ 2019-02-15 15:13 UTC (permalink / raw)
  To: Yangtao Li
  Cc: wens, robh+dt, mark.rutland, linux-arm-kernel, devicetree, linux-kernel

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

On Fri, Feb 15, 2019 at 08:49:33AM -0500, Yangtao Li wrote:
> Add the cpufreq support of h6, source of information is as follows.
> 
> h6 cpu opp info:
> https://github.com/Allwinner-Homlet/H6-BSP4.9-linux/blob/master/arch/arm64/boot/dts/sunxi/sun50iw6p1.dtsi
> 
> axp805 spec:
> http://linux-sunxi.org/images/b/bc/AXP805_Datasheet_V1.0_en.pdf

Was that tested on the two H6 boards this time?

Adding a changelog between version is nice as well so that we can see
what you changed.

Thanks!
Maxime

-- 
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

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

* Re: [PATVH v2 0/4] arm64: dts: allwinner: h6: Enable CPU
  2019-02-15 15:13 ` [PATVH v2 0/4] arm64: dts: allwinner: h6: Enable CPU Maxime Ripard
@ 2019-02-15 15:35   ` Frank Lee
  2019-02-18  8:46     ` Maxime Ripard
  0 siblings, 1 reply; 8+ messages in thread
From: Frank Lee @ 2019-02-15 15:35 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, robh+dt, mark.rutland, Linux ARM, devicetree,
	Linux Kernel Mailing List

On Fri, Feb 15, 2019 at 11:13 PM Maxime Ripard
<maxime.ripard@bootlin.com> wrote:
>
> On Fri, Feb 15, 2019 at 08:49:33AM -0500, Yangtao Li wrote:
> > Add the cpufreq support of h6, source of information is as follows.
> >
> > h6 cpu opp info:
> > https://github.com/Allwinner-Homlet/H6-BSP4.9-linux/blob/master/arch/arm64/boot/dts/sunxi/sun50iw6p1.dtsi
> >
> > axp805 spec:
> > http://linux-sunxi.org/images/b/bc/AXP805_Datasheet_V1.0_en.pdf
>
> Was that tested on the two H6 boards this time?
I tested two boards for about two hours.
>
> Adding a changelog between version is nice as well so that we can see
> what you changed.
Yes, sorry, I forgot.

Yours,
Yangtao
>
> Thanks!
> Maxime
>
> --
> Maxime Ripard, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

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

* Re: [PATVH v2 0/4] arm64: dts: allwinner: h6: Enable CPU
  2019-02-15 15:35   ` Frank Lee
@ 2019-02-18  8:46     ` Maxime Ripard
  0 siblings, 0 replies; 8+ messages in thread
From: Maxime Ripard @ 2019-02-18  8:46 UTC (permalink / raw)
  To: Frank Lee
  Cc: Chen-Yu Tsai, robh+dt, mark.rutland, Linux ARM, devicetree,
	Linux Kernel Mailing List

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

Hi,

On Fri, Feb 15, 2019 at 11:35:20PM +0800, Frank Lee wrote:
> On Fri, Feb 15, 2019 at 11:13 PM Maxime Ripard
> <maxime.ripard@bootlin.com> wrote:
> >
> > On Fri, Feb 15, 2019 at 08:49:33AM -0500, Yangtao Li wrote:
> > > Add the cpufreq support of h6, source of information is as follows.
> > >
> > > h6 cpu opp info:
> > > https://github.com/Allwinner-Homlet/H6-BSP4.9-linux/blob/master/arch/arm64/boot/dts/sunxi/sun50iw6p1.dtsi
> > >
> > > axp805 spec:
> > > http://linux-sunxi.org/images/b/bc/AXP805_Datasheet_V1.0_en.pdf
> >
> > Was that tested on the two H6 boards this time?
>
> I tested two boards for about two hours.

How did you test it?

Maxime

-- 
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

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

end of thread, other threads:[~2019-02-18  8:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-15 13:49 [PATVH v2 0/4] arm64: dts: allwinner: h6: Enable CPU Yangtao Li
2019-02-15 13:49 ` [PATVH v2 1/4] arm64: dts: allwinner: h6: orangepi: Add CPU supply regulator Yangtao Li
2019-02-15 13:49 ` [PATVH v2 2/4] arm64: dts: allwinner: h6: pine: " Yangtao Li
2019-02-15 13:49 ` [PATVH v2 3/4] arm64: dts: allwinner: h6: Add clock to CPU cores Yangtao Li
2019-02-15 13:49 ` [PATVH v2 4/4] arm64: dts: allwinner: h6: Add CPU Operating Performance Points table Yangtao Li
2019-02-15 15:13 ` [PATVH v2 0/4] arm64: dts: allwinner: h6: Enable CPU Maxime Ripard
2019-02-15 15:35   ` Frank Lee
2019-02-18  8:46     ` Maxime Ripard

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