All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drivers: cpufreq: sun8i-r40: Add cpufreq support
@ 2022-05-10  0:36 ` qianfanguijin
  0 siblings, 0 replies; 10+ messages in thread
From: qianfanguijin @ 2022-05-10  0:36 UTC (permalink / raw)
  To: linux-sunxi
  Cc: Rob Herring, Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec,
	Rafael J . Wysocki, Viresh Kumar, devicetree, linux-arm-kernel,
	linux-kernel, linux-pm, qianfan Zhao

From: qianfan Zhao <qianfanguijin@163.com>

OPP table value is get from allwinner lichee 3.10 kernel.
And completed 'cpu-supply' on sun8i based board.

Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
---
 .../boot/dts/sun8i-r40-bananapi-m2-ultra.dts  |  4 ++
 arch/arm/boot/dts/sun8i-r40-feta40i.dtsi      |  4 ++
 arch/arm/boot/dts/sun8i-r40.dtsi              | 47 +++++++++++++++++++
 arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts      |  4 ++
 .../boot/dts/sun8i-v40-bananapi-m2-berry.dts  |  4 ++
 drivers/cpufreq/cpufreq-dt-platdev.c          |  1 +
 6 files changed, 64 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
index a6a1087a0c9b..4f30018ec4a2 100644
--- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
+++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
@@ -113,6 +113,10 @@ &ahci {
 	status = "okay";
 };
 
+&cpu0 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
 &de {
 	status = "okay";
 };
diff --git a/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi b/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi
index 265e0fa57a32..b872b51a346d 100644
--- a/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi
+++ b/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi
@@ -6,6 +6,10 @@
 
 #include "sun8i-r40.dtsi"
 
+&cpu0 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
 &i2c0 {
 	status = "okay";
 
diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi
index 291f4784e86c..90de119095fa 100644
--- a/arch/arm/boot/dts/sun8i-r40.dtsi
+++ b/arch/arm/boot/dts/sun8i-r40.dtsi
@@ -54,6 +54,41 @@ / {
 	#size-cells = <1>;
 	interrupt-parent = <&gic>;
 
+	cpu0_opp_table: opp_table0 {
+		compatible = "operating-points-v2";
+		opp-shared;
+
+		opp-720000000 {
+			opp-hz = /bits/ 64 <720000000>;
+			opp-microvolt = <1000000 1000000 1300000>;
+			clock-latency-ns = <2000000>;
+		};
+
+		opp-912000000 {
+			opp-hz = /bits/ 64 <912000000>;
+			opp-microvolt = <1100000 1100000 1300000>;
+			clock-latency-ns = <2000000>;
+		};
+
+		opp-1008000000 {
+			opp-hz = /bits/ 64 <1008000000>;
+			opp-microvolt = <1160000 1160000 1300000>;
+			clock-latency-ns = <2000000>;
+		};
+
+		opp-1104000000 {
+			opp-hz = /bits/ 64 <1104000000>;
+			opp-microvolt = <1240000 1240000 1300000>;
+			clock-latency-ns = <2000000>;
+		};
+
+		opp-1200000000 {
+			opp-hz = /bits/ 64 <1200000000>;
+			opp-microvolt = <1300000 1300000 1300000>;
+			clock-latency-ns = <2000000>;
+		};
+	};
+
 	clocks {
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -84,24 +119,36 @@ cpu0: cpu@0 {
 			compatible = "arm,cortex-a7";
 			device_type = "cpu";
 			reg = <0>;
+			clocks = <&ccu CLK_CPU>;
+			clock-names = "cpu";
+			operating-points-v2 = <&cpu0_opp_table>;
 		};
 
 		cpu1: cpu@1 {
 			compatible = "arm,cortex-a7";
 			device_type = "cpu";
 			reg = <1>;
+			clocks = <&ccu CLK_CPU>;
+			clock-names = "cpu";
+			operating-points-v2 = <&cpu0_opp_table>;
 		};
 
 		cpu2: cpu@2 {
 			compatible = "arm,cortex-a7";
 			device_type = "cpu";
 			reg = <2>;
+			clocks = <&ccu CLK_CPU>;
+			clock-names = "cpu";
+			operating-points-v2 = <&cpu0_opp_table>;
 		};
 
 		cpu3: cpu@3 {
 			compatible = "arm,cortex-a7";
 			device_type = "cpu";
 			reg = <3>;
+			clocks = <&ccu CLK_CPU>;
+			clock-names = "cpu";
+			operating-points-v2 = <&cpu0_opp_table>;
 		};
 	};
 
diff --git a/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts b/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts
index 6931aaab2382..0eb1990742ff 100644
--- a/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts
+++ b/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts
@@ -88,6 +88,10 @@ &ahci {
 	status = "okay";
 };
 
+&cpu0 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
 &de {
 	status = "okay";
 };
diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
index 47954551f573..fdf8bd12faaa 100644
--- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
+++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
@@ -107,6 +107,10 @@ &ahci {
 	status = "okay";
 };
 
+&cpu0 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
 &de {
 	status = "okay";
 };
diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c
index ca1d103ec449..971a99219d4d 100644
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
@@ -26,6 +26,7 @@ static const struct of_device_id allowlist[] __initconst = {
 	{ .compatible = "allwinner,sun8i-a23", },
 	{ .compatible = "allwinner,sun8i-a83t", },
 	{ .compatible = "allwinner,sun8i-h3", },
+	{ .compatible = "allwinner,sun8i-r40", },
 
 	{ .compatible = "apm,xgene-shadowcat", },
 
-- 
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] 10+ messages in thread

* [PATCH v2] drivers: cpufreq: sun8i-r40: Add cpufreq support
@ 2022-05-10  0:36 ` qianfanguijin
  0 siblings, 0 replies; 10+ messages in thread
From: qianfanguijin @ 2022-05-10  0:36 UTC (permalink / raw)
  To: linux-sunxi
  Cc: Rob Herring, Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec,
	Rafael J . Wysocki, Viresh Kumar, devicetree, linux-arm-kernel,
	linux-kernel, linux-pm, qianfan Zhao

From: qianfan Zhao <qianfanguijin@163.com>

OPP table value is get from allwinner lichee 3.10 kernel.
And completed 'cpu-supply' on sun8i based board.

Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
---
 .../boot/dts/sun8i-r40-bananapi-m2-ultra.dts  |  4 ++
 arch/arm/boot/dts/sun8i-r40-feta40i.dtsi      |  4 ++
 arch/arm/boot/dts/sun8i-r40.dtsi              | 47 +++++++++++++++++++
 arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts      |  4 ++
 .../boot/dts/sun8i-v40-bananapi-m2-berry.dts  |  4 ++
 drivers/cpufreq/cpufreq-dt-platdev.c          |  1 +
 6 files changed, 64 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
index a6a1087a0c9b..4f30018ec4a2 100644
--- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
+++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
@@ -113,6 +113,10 @@ &ahci {
 	status = "okay";
 };
 
+&cpu0 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
 &de {
 	status = "okay";
 };
diff --git a/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi b/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi
index 265e0fa57a32..b872b51a346d 100644
--- a/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi
+++ b/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi
@@ -6,6 +6,10 @@
 
 #include "sun8i-r40.dtsi"
 
+&cpu0 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
 &i2c0 {
 	status = "okay";
 
diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi
index 291f4784e86c..90de119095fa 100644
--- a/arch/arm/boot/dts/sun8i-r40.dtsi
+++ b/arch/arm/boot/dts/sun8i-r40.dtsi
@@ -54,6 +54,41 @@ / {
 	#size-cells = <1>;
 	interrupt-parent = <&gic>;
 
+	cpu0_opp_table: opp_table0 {
+		compatible = "operating-points-v2";
+		opp-shared;
+
+		opp-720000000 {
+			opp-hz = /bits/ 64 <720000000>;
+			opp-microvolt = <1000000 1000000 1300000>;
+			clock-latency-ns = <2000000>;
+		};
+
+		opp-912000000 {
+			opp-hz = /bits/ 64 <912000000>;
+			opp-microvolt = <1100000 1100000 1300000>;
+			clock-latency-ns = <2000000>;
+		};
+
+		opp-1008000000 {
+			opp-hz = /bits/ 64 <1008000000>;
+			opp-microvolt = <1160000 1160000 1300000>;
+			clock-latency-ns = <2000000>;
+		};
+
+		opp-1104000000 {
+			opp-hz = /bits/ 64 <1104000000>;
+			opp-microvolt = <1240000 1240000 1300000>;
+			clock-latency-ns = <2000000>;
+		};
+
+		opp-1200000000 {
+			opp-hz = /bits/ 64 <1200000000>;
+			opp-microvolt = <1300000 1300000 1300000>;
+			clock-latency-ns = <2000000>;
+		};
+	};
+
 	clocks {
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -84,24 +119,36 @@ cpu0: cpu@0 {
 			compatible = "arm,cortex-a7";
 			device_type = "cpu";
 			reg = <0>;
+			clocks = <&ccu CLK_CPU>;
+			clock-names = "cpu";
+			operating-points-v2 = <&cpu0_opp_table>;
 		};
 
 		cpu1: cpu@1 {
 			compatible = "arm,cortex-a7";
 			device_type = "cpu";
 			reg = <1>;
+			clocks = <&ccu CLK_CPU>;
+			clock-names = "cpu";
+			operating-points-v2 = <&cpu0_opp_table>;
 		};
 
 		cpu2: cpu@2 {
 			compatible = "arm,cortex-a7";
 			device_type = "cpu";
 			reg = <2>;
+			clocks = <&ccu CLK_CPU>;
+			clock-names = "cpu";
+			operating-points-v2 = <&cpu0_opp_table>;
 		};
 
 		cpu3: cpu@3 {
 			compatible = "arm,cortex-a7";
 			device_type = "cpu";
 			reg = <3>;
+			clocks = <&ccu CLK_CPU>;
+			clock-names = "cpu";
+			operating-points-v2 = <&cpu0_opp_table>;
 		};
 	};
 
diff --git a/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts b/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts
index 6931aaab2382..0eb1990742ff 100644
--- a/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts
+++ b/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts
@@ -88,6 +88,10 @@ &ahci {
 	status = "okay";
 };
 
+&cpu0 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
 &de {
 	status = "okay";
 };
diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
index 47954551f573..fdf8bd12faaa 100644
--- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
+++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
@@ -107,6 +107,10 @@ &ahci {
 	status = "okay";
 };
 
+&cpu0 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
 &de {
 	status = "okay";
 };
diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c
index ca1d103ec449..971a99219d4d 100644
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
@@ -26,6 +26,7 @@ static const struct of_device_id allowlist[] __initconst = {
 	{ .compatible = "allwinner,sun8i-a23", },
 	{ .compatible = "allwinner,sun8i-a83t", },
 	{ .compatible = "allwinner,sun8i-h3", },
+	{ .compatible = "allwinner,sun8i-r40", },
 
 	{ .compatible = "apm,xgene-shadowcat", },
 
-- 
2.25.1


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

* Re: [PATCH v2] drivers: cpufreq: sun8i-r40: Add cpufreq support
  2022-05-10  0:36 ` qianfanguijin
@ 2022-05-11 20:13   ` Jernej Škrabec
  -1 siblings, 0 replies; 10+ messages in thread
From: Jernej Škrabec @ 2022-05-11 20:13 UTC (permalink / raw)
  To: linux-sunxi, qianfanguijin
  Cc: Rob Herring, Maxime Ripard, Chen-Yu Tsai, Rafael J . Wysocki,
	Viresh Kumar, devicetree, linux-arm-kernel, linux-kernel,
	linux-pm, qianfan Zhao

Dne torek, 10. maj 2022 ob 02:36:11 CEST je qianfanguijin@163.com napisal(a):
> From: qianfan Zhao <qianfanguijin@163.com>
> 
> OPP table value is get from allwinner lichee 3.10 kernel.
> And completed 'cpu-supply' on sun8i based board.
> 
> Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
> ---
>  .../boot/dts/sun8i-r40-bananapi-m2-ultra.dts  |  4 ++
>  arch/arm/boot/dts/sun8i-r40-feta40i.dtsi      |  4 ++
>  arch/arm/boot/dts/sun8i-r40.dtsi              | 47 +++++++++++++++++++
>  arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts      |  4 ++
>  .../boot/dts/sun8i-v40-bananapi-m2-berry.dts  |  4 ++
>  drivers/cpufreq/cpufreq-dt-platdev.c          |  1 +

This patch needs to be split in two:
1. driver change
2. DT changes

And please add change log here for next submission.

>  6 files changed, 64 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/
boot/dts/sun8i-r40-bananapi-m2-ultra.dts
> index a6a1087a0c9b..4f30018ec4a2 100644
> --- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
> +++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
> @@ -113,6 +113,10 @@ &ahci {
>  	status = "okay";
>  };
>  
> +&cpu0 {
> +	cpu-supply = <&reg_dcdc2>;
> +};
> +
>  &de {
>  	status = "okay";
>  };
> diff --git a/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi b/arch/arm/boot/dts/
sun8i-r40-feta40i.dtsi
> index 265e0fa57a32..b872b51a346d 100644
> --- a/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi
> +++ b/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi
> @@ -6,6 +6,10 @@
>  
>  #include "sun8i-r40.dtsi"
>  
> +&cpu0 {
> +	cpu-supply = <&reg_dcdc2>;
> +};
> +
>  &i2c0 {
>  	status = "okay";
>  
> diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-
r40.dtsi
> index 291f4784e86c..90de119095fa 100644
> --- a/arch/arm/boot/dts/sun8i-r40.dtsi
> +++ b/arch/arm/boot/dts/sun8i-r40.dtsi
> @@ -54,6 +54,41 @@ / {
>  	#size-cells = <1>;
>  	interrupt-parent = <&gic>;
>  
> +	cpu0_opp_table: opp_table0 {
> +		compatible = "operating-points-v2";
> +		opp-shared;
> +
> +		opp-720000000 {
> +			opp-hz = /bits/ 64 <720000000>;
> +			opp-microvolt = <1000000 1000000 1300000>;
> +			clock-latency-ns = <2000000>;
> +		};
> +
> +		opp-912000000 {
> +			opp-hz = /bits/ 64 <912000000>;
> +			opp-microvolt = <1100000 1100000 1300000>;
> +			clock-latency-ns = <2000000>;
> +		};
> +
> +		opp-1008000000 {
> +			opp-hz = /bits/ 64 <1008000000>;
> +			opp-microvolt = <1160000 1160000 1300000>;
> +			clock-latency-ns = <2000000>;
> +		};
> +
> +		opp-1104000000 {
> +			opp-hz = /bits/ 64 <1104000000>;
> +			opp-microvolt = <1240000 1240000 1300000>;
> +			clock-latency-ns = <2000000>;
> +		};
> +
> +		opp-1200000000 {
> +			opp-hz = /bits/ 64 <1200000000>;
> +			opp-microvolt = <1300000 1300000 1300000>;
> +			clock-latency-ns = <2000000>;
> +		};
> +	};
> +
>  	clocks {
>  		#address-cells = <1>;
>  		#size-cells = <1>;
> @@ -84,24 +119,36 @@ cpu0: cpu@0 {
>  			compatible = "arm,cortex-a7";
>  			device_type = "cpu";
>  			reg = <0>;
> +			clocks = <&ccu CLK_CPU>;
> +			clock-names = "cpu";
> +			operating-points-v2 = <&cpu0_opp_table>;
>  		};
>  
>  		cpu1: cpu@1 {
>  			compatible = "arm,cortex-a7";
>  			device_type = "cpu";
>  			reg = <1>;
> +			clocks = <&ccu CLK_CPU>;
> +			clock-names = "cpu";
> +			operating-points-v2 = <&cpu0_opp_table>;
>  		};
>  
>  		cpu2: cpu@2 {
>  			compatible = "arm,cortex-a7";
>  			device_type = "cpu";
>  			reg = <2>;
> +			clocks = <&ccu CLK_CPU>;
> +			clock-names = "cpu";
> +			operating-points-v2 = <&cpu0_opp_table>;
>  		};
>  
>  		cpu3: cpu@3 {
>  			compatible = "arm,cortex-a7";
>  			device_type = "cpu";
>  			reg = <3>;
> +			clocks = <&ccu CLK_CPU>;
> +			clock-names = "cpu";
> +			operating-points-v2 = <&cpu0_opp_table>;
>  		};
>  	};
>  
> diff --git a/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts b/arch/arm/boot/dts/
sun8i-t3-cqa3t-bv3.dts
> index 6931aaab2382..0eb1990742ff 100644
> --- a/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts
> +++ b/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts
> @@ -88,6 +88,10 @@ &ahci {
>  	status = "okay";
>  };
>  
> +&cpu0 {
> +	cpu-supply = <&reg_dcdc2>;
> +};
> +
>  &de {
>  	status = "okay";
>  };
> diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/
boot/dts/sun8i-v40-bananapi-m2-berry.dts
> index 47954551f573..fdf8bd12faaa 100644
> --- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
> +++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
> @@ -107,6 +107,10 @@ &ahci {
>  	status = "okay";
>  };
>  
> +&cpu0 {
> +	cpu-supply = <&reg_dcdc2>;
> +};
> +
>  &de {
>  	status = "okay";
>  };
> diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-
dt-platdev.c
> index ca1d103ec449..971a99219d4d 100644
> --- a/drivers/cpufreq/cpufreq-dt-platdev.c
> +++ b/drivers/cpufreq/cpufreq-dt-platdev.c
> @@ -26,6 +26,7 @@ static const struct of_device_id allowlist[] __initconst = 
{
>  	{ .compatible = "allwinner,sun8i-a23", },
>  	{ .compatible = "allwinner,sun8i-a83t", },
>  	{ .compatible = "allwinner,sun8i-h3", },
> +	{ .compatible = "allwinner,sun8i-r40", },

Why on allow list? Comment says operatings-point-v2 should be on block list, 
just like H6.

Best regards,
Jernej

>  
>  	{ .compatible = "apm,xgene-shadowcat", },
>  
> -- 
> 2.25.1
> 
> 



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

* Re: [PATCH v2] drivers: cpufreq: sun8i-r40: Add cpufreq support
@ 2022-05-11 20:13   ` Jernej Škrabec
  0 siblings, 0 replies; 10+ messages in thread
From: Jernej Škrabec @ 2022-05-11 20:13 UTC (permalink / raw)
  To: linux-sunxi, qianfanguijin
  Cc: Rob Herring, Maxime Ripard, Chen-Yu Tsai, Rafael J . Wysocki,
	Viresh Kumar, devicetree, linux-arm-kernel, linux-kernel,
	linux-pm, qianfan Zhao

Dne torek, 10. maj 2022 ob 02:36:11 CEST je qianfanguijin@163.com napisal(a):
> From: qianfan Zhao <qianfanguijin@163.com>
> 
> OPP table value is get from allwinner lichee 3.10 kernel.
> And completed 'cpu-supply' on sun8i based board.
> 
> Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
> ---
>  .../boot/dts/sun8i-r40-bananapi-m2-ultra.dts  |  4 ++
>  arch/arm/boot/dts/sun8i-r40-feta40i.dtsi      |  4 ++
>  arch/arm/boot/dts/sun8i-r40.dtsi              | 47 +++++++++++++++++++
>  arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts      |  4 ++
>  .../boot/dts/sun8i-v40-bananapi-m2-berry.dts  |  4 ++
>  drivers/cpufreq/cpufreq-dt-platdev.c          |  1 +

This patch needs to be split in two:
1. driver change
2. DT changes

And please add change log here for next submission.

>  6 files changed, 64 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/
boot/dts/sun8i-r40-bananapi-m2-ultra.dts
> index a6a1087a0c9b..4f30018ec4a2 100644
> --- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
> +++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
> @@ -113,6 +113,10 @@ &ahci {
>  	status = "okay";
>  };
>  
> +&cpu0 {
> +	cpu-supply = <&reg_dcdc2>;
> +};
> +
>  &de {
>  	status = "okay";
>  };
> diff --git a/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi b/arch/arm/boot/dts/
sun8i-r40-feta40i.dtsi
> index 265e0fa57a32..b872b51a346d 100644
> --- a/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi
> +++ b/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi
> @@ -6,6 +6,10 @@
>  
>  #include "sun8i-r40.dtsi"
>  
> +&cpu0 {
> +	cpu-supply = <&reg_dcdc2>;
> +};
> +
>  &i2c0 {
>  	status = "okay";
>  
> diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-
r40.dtsi
> index 291f4784e86c..90de119095fa 100644
> --- a/arch/arm/boot/dts/sun8i-r40.dtsi
> +++ b/arch/arm/boot/dts/sun8i-r40.dtsi
> @@ -54,6 +54,41 @@ / {
>  	#size-cells = <1>;
>  	interrupt-parent = <&gic>;
>  
> +	cpu0_opp_table: opp_table0 {
> +		compatible = "operating-points-v2";
> +		opp-shared;
> +
> +		opp-720000000 {
> +			opp-hz = /bits/ 64 <720000000>;
> +			opp-microvolt = <1000000 1000000 1300000>;
> +			clock-latency-ns = <2000000>;
> +		};
> +
> +		opp-912000000 {
> +			opp-hz = /bits/ 64 <912000000>;
> +			opp-microvolt = <1100000 1100000 1300000>;
> +			clock-latency-ns = <2000000>;
> +		};
> +
> +		opp-1008000000 {
> +			opp-hz = /bits/ 64 <1008000000>;
> +			opp-microvolt = <1160000 1160000 1300000>;
> +			clock-latency-ns = <2000000>;
> +		};
> +
> +		opp-1104000000 {
> +			opp-hz = /bits/ 64 <1104000000>;
> +			opp-microvolt = <1240000 1240000 1300000>;
> +			clock-latency-ns = <2000000>;
> +		};
> +
> +		opp-1200000000 {
> +			opp-hz = /bits/ 64 <1200000000>;
> +			opp-microvolt = <1300000 1300000 1300000>;
> +			clock-latency-ns = <2000000>;
> +		};
> +	};
> +
>  	clocks {
>  		#address-cells = <1>;
>  		#size-cells = <1>;
> @@ -84,24 +119,36 @@ cpu0: cpu@0 {
>  			compatible = "arm,cortex-a7";
>  			device_type = "cpu";
>  			reg = <0>;
> +			clocks = <&ccu CLK_CPU>;
> +			clock-names = "cpu";
> +			operating-points-v2 = <&cpu0_opp_table>;
>  		};
>  
>  		cpu1: cpu@1 {
>  			compatible = "arm,cortex-a7";
>  			device_type = "cpu";
>  			reg = <1>;
> +			clocks = <&ccu CLK_CPU>;
> +			clock-names = "cpu";
> +			operating-points-v2 = <&cpu0_opp_table>;
>  		};
>  
>  		cpu2: cpu@2 {
>  			compatible = "arm,cortex-a7";
>  			device_type = "cpu";
>  			reg = <2>;
> +			clocks = <&ccu CLK_CPU>;
> +			clock-names = "cpu";
> +			operating-points-v2 = <&cpu0_opp_table>;
>  		};
>  
>  		cpu3: cpu@3 {
>  			compatible = "arm,cortex-a7";
>  			device_type = "cpu";
>  			reg = <3>;
> +			clocks = <&ccu CLK_CPU>;
> +			clock-names = "cpu";
> +			operating-points-v2 = <&cpu0_opp_table>;
>  		};
>  	};
>  
> diff --git a/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts b/arch/arm/boot/dts/
sun8i-t3-cqa3t-bv3.dts
> index 6931aaab2382..0eb1990742ff 100644
> --- a/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts
> +++ b/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts
> @@ -88,6 +88,10 @@ &ahci {
>  	status = "okay";
>  };
>  
> +&cpu0 {
> +	cpu-supply = <&reg_dcdc2>;
> +};
> +
>  &de {
>  	status = "okay";
>  };
> diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/
boot/dts/sun8i-v40-bananapi-m2-berry.dts
> index 47954551f573..fdf8bd12faaa 100644
> --- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
> +++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
> @@ -107,6 +107,10 @@ &ahci {
>  	status = "okay";
>  };
>  
> +&cpu0 {
> +	cpu-supply = <&reg_dcdc2>;
> +};
> +
>  &de {
>  	status = "okay";
>  };
> diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-
dt-platdev.c
> index ca1d103ec449..971a99219d4d 100644
> --- a/drivers/cpufreq/cpufreq-dt-platdev.c
> +++ b/drivers/cpufreq/cpufreq-dt-platdev.c
> @@ -26,6 +26,7 @@ static const struct of_device_id allowlist[] __initconst = 
{
>  	{ .compatible = "allwinner,sun8i-a23", },
>  	{ .compatible = "allwinner,sun8i-a83t", },
>  	{ .compatible = "allwinner,sun8i-h3", },
> +	{ .compatible = "allwinner,sun8i-r40", },

Why on allow list? Comment says operatings-point-v2 should be on block list, 
just like H6.

Best regards,
Jernej

>  
>  	{ .compatible = "apm,xgene-shadowcat", },
>  
> -- 
> 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	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] drivers: cpufreq: sun8i-r40: Add cpufreq support
  2022-05-11 20:13   ` Jernej Škrabec
@ 2022-05-12  4:34     ` qianfan
  -1 siblings, 0 replies; 10+ messages in thread
From: qianfan @ 2022-05-12  4:34 UTC (permalink / raw)
  To: Jernej Škrabec, linux-sunxi
  Cc: Rob Herring, Maxime Ripard, Chen-Yu Tsai, Rafael J . Wysocki,
	Viresh Kumar, devicetree, linux-arm-kernel, linux-kernel,
	linux-pm



在 2022/5/12 4:13, Jernej Škrabec 写道:
> Dne torek, 10. maj 2022 ob 02:36:11 CEST je qianfanguijin@163.com napisal(a):
>> From: qianfan Zhao <qianfanguijin@163.com>
>>
>> OPP table value is get from allwinner lichee 3.10 kernel.
>> And completed 'cpu-supply' on sun8i based board.
>>
>> Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
>> ---
>>   .../boot/dts/sun8i-r40-bananapi-m2-ultra.dts  |  4 ++
>>   arch/arm/boot/dts/sun8i-r40-feta40i.dtsi      |  4 ++
>>   arch/arm/boot/dts/sun8i-r40.dtsi              | 47 +++++++++++++++++++
>>   arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts      |  4 ++
>>   .../boot/dts/sun8i-v40-bananapi-m2-berry.dts  |  4 ++
>>   drivers/cpufreq/cpufreq-dt-platdev.c          |  1 +
> This patch needs to be split in two:
> 1. driver change
> 2. DT changes
>
> And please add change log here for next submission.
Maybe there patch is better? one of driver, one of sun8i-r40.dtsi
and the others is the board's changes.
>
>>   6 files changed, 64 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/
> boot/dts/sun8i-r40-bananapi-m2-ultra.dts
>> index a6a1087a0c9b..4f30018ec4a2 100644
>> --- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
>> +++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
>> @@ -113,6 +113,10 @@ &ahci {
>>   	status = "okay";
>>   };
>>   
>> +&cpu0 {
>> +	cpu-supply = <&reg_dcdc2>;
>> +};
>> +
>>   &de {
>>   	status = "okay";
>>   };
>> diff --git a/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi b/arch/arm/boot/dts/
> sun8i-r40-feta40i.dtsi
>> index 265e0fa57a32..b872b51a346d 100644
>> --- a/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi
>> +++ b/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi
>> @@ -6,6 +6,10 @@
>>   
>>   #include "sun8i-r40.dtsi"
>>   
>> +&cpu0 {
>> +	cpu-supply = <&reg_dcdc2>;
>> +};
>> +
>>   &i2c0 {
>>   	status = "okay";
>>   
>> diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-
> r40.dtsi
>> index 291f4784e86c..90de119095fa 100644
>> --- a/arch/arm/boot/dts/sun8i-r40.dtsi
>> +++ b/arch/arm/boot/dts/sun8i-r40.dtsi
>> @@ -54,6 +54,41 @@ / {
>>   	#size-cells = <1>;
>>   	interrupt-parent = <&gic>;
>>   
>> +	cpu0_opp_table: opp_table0 {
>> +		compatible = "operating-points-v2";
>> +		opp-shared;
>> +
>> +		opp-720000000 {
>> +			opp-hz = /bits/ 64 <720000000>;
>> +			opp-microvolt = <1000000 1000000 1300000>;
>> +			clock-latency-ns = <2000000>;
>> +		};
>> +
>> +		opp-912000000 {
>> +			opp-hz = /bits/ 64 <912000000>;
>> +			opp-microvolt = <1100000 1100000 1300000>;
>> +			clock-latency-ns = <2000000>;
>> +		};
>> +
>> +		opp-1008000000 {
>> +			opp-hz = /bits/ 64 <1008000000>;
>> +			opp-microvolt = <1160000 1160000 1300000>;
>> +			clock-latency-ns = <2000000>;
>> +		};
>> +
>> +		opp-1104000000 {
>> +			opp-hz = /bits/ 64 <1104000000>;
>> +			opp-microvolt = <1240000 1240000 1300000>;
>> +			clock-latency-ns = <2000000>;
>> +		};
>> +
>> +		opp-1200000000 {
>> +			opp-hz = /bits/ 64 <1200000000>;
>> +			opp-microvolt = <1300000 1300000 1300000>;
>> +			clock-latency-ns = <2000000>;
>> +		};
>> +	};
>> +
>>   	clocks {
>>   		#address-cells = <1>;
>>   		#size-cells = <1>;
>> @@ -84,24 +119,36 @@ cpu0: cpu@0 {
>>   			compatible = "arm,cortex-a7";
>>   			device_type = "cpu";
>>   			reg = <0>;
>> +			clocks = <&ccu CLK_CPU>;
>> +			clock-names = "cpu";
>> +			operating-points-v2 = <&cpu0_opp_table>;
>>   		};
>>   
>>   		cpu1: cpu@1 {
>>   			compatible = "arm,cortex-a7";
>>   			device_type = "cpu";
>>   			reg = <1>;
>> +			clocks = <&ccu CLK_CPU>;
>> +			clock-names = "cpu";
>> +			operating-points-v2 = <&cpu0_opp_table>;
>>   		};
>>   
>>   		cpu2: cpu@2 {
>>   			compatible = "arm,cortex-a7";
>>   			device_type = "cpu";
>>   			reg = <2>;
>> +			clocks = <&ccu CLK_CPU>;
>> +			clock-names = "cpu";
>> +			operating-points-v2 = <&cpu0_opp_table>;
>>   		};
>>   
>>   		cpu3: cpu@3 {
>>   			compatible = "arm,cortex-a7";
>>   			device_type = "cpu";
>>   			reg = <3>;
>> +			clocks = <&ccu CLK_CPU>;
>> +			clock-names = "cpu";
>> +			operating-points-v2 = <&cpu0_opp_table>;
>>   		};
>>   	};
>>   
>> diff --git a/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts b/arch/arm/boot/dts/
> sun8i-t3-cqa3t-bv3.dts
>> index 6931aaab2382..0eb1990742ff 100644
>> --- a/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts
>> +++ b/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts
>> @@ -88,6 +88,10 @@ &ahci {
>>   	status = "okay";
>>   };
>>   
>> +&cpu0 {
>> +	cpu-supply = <&reg_dcdc2>;
>> +};
>> +
>>   &de {
>>   	status = "okay";
>>   };
>> diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/
> boot/dts/sun8i-v40-bananapi-m2-berry.dts
>> index 47954551f573..fdf8bd12faaa 100644
>> --- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
>> +++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
>> @@ -107,6 +107,10 @@ &ahci {
>>   	status = "okay";
>>   };
>>   
>> +&cpu0 {
>> +	cpu-supply = <&reg_dcdc2>;
>> +};
>> +
>>   &de {
>>   	status = "okay";
>>   };
>> diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-
> dt-platdev.c
>> index ca1d103ec449..971a99219d4d 100644
>> --- a/drivers/cpufreq/cpufreq-dt-platdev.c
>> +++ b/drivers/cpufreq/cpufreq-dt-platdev.c
>> @@ -26,6 +26,7 @@ static const struct of_device_id allowlist[] __initconst =
> {
>>   	{ .compatible = "allwinner,sun8i-a23", },
>>   	{ .compatible = "allwinner,sun8i-a83t", },
>>   	{ .compatible = "allwinner,sun8i-h3", },
>> +	{ .compatible = "allwinner,sun8i-r40", },
> Why on allow list? Comment says operatings-point-v2 should be on block list,
> just like H6.
Actually I'm not make sure the difference, seems both of them can work.
Most of allwinner device_id is added in allowlist, so I did this.
>
> Best regards,
> Jernej
>
>>   
>>   	{ .compatible = "apm,xgene-shadowcat", },
>>   
>> -- 
>> 2.25.1
>>
>>


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

* Re: [PATCH v2] drivers: cpufreq: sun8i-r40: Add cpufreq support
@ 2022-05-12  4:34     ` qianfan
  0 siblings, 0 replies; 10+ messages in thread
From: qianfan @ 2022-05-12  4:34 UTC (permalink / raw)
  To: Jernej Škrabec, linux-sunxi
  Cc: Rob Herring, Maxime Ripard, Chen-Yu Tsai, Rafael J . Wysocki,
	Viresh Kumar, devicetree, linux-arm-kernel, linux-kernel,
	linux-pm



在 2022/5/12 4:13, Jernej Škrabec 写道:
> Dne torek, 10. maj 2022 ob 02:36:11 CEST je qianfanguijin@163.com napisal(a):
>> From: qianfan Zhao <qianfanguijin@163.com>
>>
>> OPP table value is get from allwinner lichee 3.10 kernel.
>> And completed 'cpu-supply' on sun8i based board.
>>
>> Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
>> ---
>>   .../boot/dts/sun8i-r40-bananapi-m2-ultra.dts  |  4 ++
>>   arch/arm/boot/dts/sun8i-r40-feta40i.dtsi      |  4 ++
>>   arch/arm/boot/dts/sun8i-r40.dtsi              | 47 +++++++++++++++++++
>>   arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts      |  4 ++
>>   .../boot/dts/sun8i-v40-bananapi-m2-berry.dts  |  4 ++
>>   drivers/cpufreq/cpufreq-dt-platdev.c          |  1 +
> This patch needs to be split in two:
> 1. driver change
> 2. DT changes
>
> And please add change log here for next submission.
Maybe there patch is better? one of driver, one of sun8i-r40.dtsi
and the others is the board's changes.
>
>>   6 files changed, 64 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/
> boot/dts/sun8i-r40-bananapi-m2-ultra.dts
>> index a6a1087a0c9b..4f30018ec4a2 100644
>> --- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
>> +++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
>> @@ -113,6 +113,10 @@ &ahci {
>>   	status = "okay";
>>   };
>>   
>> +&cpu0 {
>> +	cpu-supply = <&reg_dcdc2>;
>> +};
>> +
>>   &de {
>>   	status = "okay";
>>   };
>> diff --git a/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi b/arch/arm/boot/dts/
> sun8i-r40-feta40i.dtsi
>> index 265e0fa57a32..b872b51a346d 100644
>> --- a/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi
>> +++ b/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi
>> @@ -6,6 +6,10 @@
>>   
>>   #include "sun8i-r40.dtsi"
>>   
>> +&cpu0 {
>> +	cpu-supply = <&reg_dcdc2>;
>> +};
>> +
>>   &i2c0 {
>>   	status = "okay";
>>   
>> diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-
> r40.dtsi
>> index 291f4784e86c..90de119095fa 100644
>> --- a/arch/arm/boot/dts/sun8i-r40.dtsi
>> +++ b/arch/arm/boot/dts/sun8i-r40.dtsi
>> @@ -54,6 +54,41 @@ / {
>>   	#size-cells = <1>;
>>   	interrupt-parent = <&gic>;
>>   
>> +	cpu0_opp_table: opp_table0 {
>> +		compatible = "operating-points-v2";
>> +		opp-shared;
>> +
>> +		opp-720000000 {
>> +			opp-hz = /bits/ 64 <720000000>;
>> +			opp-microvolt = <1000000 1000000 1300000>;
>> +			clock-latency-ns = <2000000>;
>> +		};
>> +
>> +		opp-912000000 {
>> +			opp-hz = /bits/ 64 <912000000>;
>> +			opp-microvolt = <1100000 1100000 1300000>;
>> +			clock-latency-ns = <2000000>;
>> +		};
>> +
>> +		opp-1008000000 {
>> +			opp-hz = /bits/ 64 <1008000000>;
>> +			opp-microvolt = <1160000 1160000 1300000>;
>> +			clock-latency-ns = <2000000>;
>> +		};
>> +
>> +		opp-1104000000 {
>> +			opp-hz = /bits/ 64 <1104000000>;
>> +			opp-microvolt = <1240000 1240000 1300000>;
>> +			clock-latency-ns = <2000000>;
>> +		};
>> +
>> +		opp-1200000000 {
>> +			opp-hz = /bits/ 64 <1200000000>;
>> +			opp-microvolt = <1300000 1300000 1300000>;
>> +			clock-latency-ns = <2000000>;
>> +		};
>> +	};
>> +
>>   	clocks {
>>   		#address-cells = <1>;
>>   		#size-cells = <1>;
>> @@ -84,24 +119,36 @@ cpu0: cpu@0 {
>>   			compatible = "arm,cortex-a7";
>>   			device_type = "cpu";
>>   			reg = <0>;
>> +			clocks = <&ccu CLK_CPU>;
>> +			clock-names = "cpu";
>> +			operating-points-v2 = <&cpu0_opp_table>;
>>   		};
>>   
>>   		cpu1: cpu@1 {
>>   			compatible = "arm,cortex-a7";
>>   			device_type = "cpu";
>>   			reg = <1>;
>> +			clocks = <&ccu CLK_CPU>;
>> +			clock-names = "cpu";
>> +			operating-points-v2 = <&cpu0_opp_table>;
>>   		};
>>   
>>   		cpu2: cpu@2 {
>>   			compatible = "arm,cortex-a7";
>>   			device_type = "cpu";
>>   			reg = <2>;
>> +			clocks = <&ccu CLK_CPU>;
>> +			clock-names = "cpu";
>> +			operating-points-v2 = <&cpu0_opp_table>;
>>   		};
>>   
>>   		cpu3: cpu@3 {
>>   			compatible = "arm,cortex-a7";
>>   			device_type = "cpu";
>>   			reg = <3>;
>> +			clocks = <&ccu CLK_CPU>;
>> +			clock-names = "cpu";
>> +			operating-points-v2 = <&cpu0_opp_table>;
>>   		};
>>   	};
>>   
>> diff --git a/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts b/arch/arm/boot/dts/
> sun8i-t3-cqa3t-bv3.dts
>> index 6931aaab2382..0eb1990742ff 100644
>> --- a/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts
>> +++ b/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts
>> @@ -88,6 +88,10 @@ &ahci {
>>   	status = "okay";
>>   };
>>   
>> +&cpu0 {
>> +	cpu-supply = <&reg_dcdc2>;
>> +};
>> +
>>   &de {
>>   	status = "okay";
>>   };
>> diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/
> boot/dts/sun8i-v40-bananapi-m2-berry.dts
>> index 47954551f573..fdf8bd12faaa 100644
>> --- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
>> +++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
>> @@ -107,6 +107,10 @@ &ahci {
>>   	status = "okay";
>>   };
>>   
>> +&cpu0 {
>> +	cpu-supply = <&reg_dcdc2>;
>> +};
>> +
>>   &de {
>>   	status = "okay";
>>   };
>> diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-
> dt-platdev.c
>> index ca1d103ec449..971a99219d4d 100644
>> --- a/drivers/cpufreq/cpufreq-dt-platdev.c
>> +++ b/drivers/cpufreq/cpufreq-dt-platdev.c
>> @@ -26,6 +26,7 @@ static const struct of_device_id allowlist[] __initconst =
> {
>>   	{ .compatible = "allwinner,sun8i-a23", },
>>   	{ .compatible = "allwinner,sun8i-a83t", },
>>   	{ .compatible = "allwinner,sun8i-h3", },
>> +	{ .compatible = "allwinner,sun8i-r40", },
> Why on allow list? Comment says operatings-point-v2 should be on block list,
> just like H6.
Actually I'm not make sure the difference, seems both of them can work.
Most of allwinner device_id is added in allowlist, so I did this.
>
> Best regards,
> Jernej
>
>>   
>>   	{ .compatible = "apm,xgene-shadowcat", },
>>   
>> -- 
>> 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	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] drivers: cpufreq: sun8i-r40: Add cpufreq support
  2022-05-12  4:34     ` qianfan
@ 2022-05-12  4:58       ` Viresh Kumar
  -1 siblings, 0 replies; 10+ messages in thread
From: Viresh Kumar @ 2022-05-12  4:58 UTC (permalink / raw)
  To: qianfan
  Cc: Jernej Škrabec, linux-sunxi, Rob Herring, Maxime Ripard,
	Chen-Yu Tsai, Rafael J . Wysocki, devicetree, linux-arm-kernel,
	linux-kernel, linux-pm

On 12-05-22, 12:34, qianfan wrote:
> Actually I'm not make sure the difference, seems both of them can work.
> Most of allwinner device_id is added in allowlist, so I did this.

For OPP V1 the cpufreq device isn't created by default and hence the allowlist
allows us to know the devices for which the device shall be created.

For OPP V2, we have the compatible string available and with help of that we
create a device without need of any entry to any list. The blocklist however
allows us to skip creating the device for some platforms, which don't want it.

As your case is opp-v2 and you want the device, you aren't required to add entry
anywhere.

-- 
viresh

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

* Re: [PATCH v2] drivers: cpufreq: sun8i-r40: Add cpufreq support
@ 2022-05-12  4:58       ` Viresh Kumar
  0 siblings, 0 replies; 10+ messages in thread
From: Viresh Kumar @ 2022-05-12  4:58 UTC (permalink / raw)
  To: qianfan
  Cc: Jernej Škrabec, linux-sunxi, Rob Herring, Maxime Ripard,
	Chen-Yu Tsai, Rafael J . Wysocki, devicetree, linux-arm-kernel,
	linux-kernel, linux-pm

On 12-05-22, 12:34, qianfan wrote:
> Actually I'm not make sure the difference, seems both of them can work.
> Most of allwinner device_id is added in allowlist, so I did this.

For OPP V1 the cpufreq device isn't created by default and hence the allowlist
allows us to know the devices for which the device shall be created.

For OPP V2, we have the compatible string available and with help of that we
create a device without need of any entry to any list. The blocklist however
allows us to skip creating the device for some platforms, which don't want it.

As your case is opp-v2 and you want the device, you aren't required to add entry
anywhere.

-- 
viresh

_______________________________________________
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] 10+ messages in thread

* Re: [PATCH v2] drivers: cpufreq: sun8i-r40: Add cpufreq support
  2022-05-12  4:58       ` Viresh Kumar
@ 2022-05-12  6:22         ` qianfan
  -1 siblings, 0 replies; 10+ messages in thread
From: qianfan @ 2022-05-12  6:22 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Jernej Škrabec, linux-sunxi, Rob Herring, Maxime Ripard,
	Chen-Yu Tsai, Rafael J . Wysocki, devicetree, linux-arm-kernel,
	linux-kernel, linux-pm



在 2022/5/12 12:58, Viresh Kumar 写道:
> On 12-05-22, 12:34, qianfan wrote:
>> Actually I'm not make sure the difference, seems both of them can work.
>> Most of allwinner device_id is added in allowlist, so I did this.
> For OPP V1 the cpufreq device isn't created by default and hence the allowlist
> allows us to know the devices for which the device shall be created.
>
> For OPP V2, we have the compatible string available and with help of that we
> create a device without need of any entry to any list. The blocklist however
> allows us to skip creating the device for some platforms, which don't want it.
>
> As your case is opp-v2 and you want the device, you aren't required to add entry
> anywhere.
I read the source code again and understand the behaivors.
And I will it from allowlist.

Thanks
>


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

* Re: [PATCH v2] drivers: cpufreq: sun8i-r40: Add cpufreq support
@ 2022-05-12  6:22         ` qianfan
  0 siblings, 0 replies; 10+ messages in thread
From: qianfan @ 2022-05-12  6:22 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Jernej Škrabec, linux-sunxi, Rob Herring, Maxime Ripard,
	Chen-Yu Tsai, Rafael J . Wysocki, devicetree, linux-arm-kernel,
	linux-kernel, linux-pm



在 2022/5/12 12:58, Viresh Kumar 写道:
> On 12-05-22, 12:34, qianfan wrote:
>> Actually I'm not make sure the difference, seems both of them can work.
>> Most of allwinner device_id is added in allowlist, so I did this.
> For OPP V1 the cpufreq device isn't created by default and hence the allowlist
> allows us to know the devices for which the device shall be created.
>
> For OPP V2, we have the compatible string available and with help of that we
> create a device without need of any entry to any list. The blocklist however
> allows us to skip creating the device for some platforms, which don't want it.
>
> As your case is opp-v2 and you want the device, you aren't required to add entry
> anywhere.
I read the source code again and understand the behaivors.
And I will it from allowlist.

Thanks
>


_______________________________________________
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] 10+ messages in thread

end of thread, other threads:[~2022-05-12  6:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-10  0:36 [PATCH v2] drivers: cpufreq: sun8i-r40: Add cpufreq support qianfanguijin
2022-05-10  0:36 ` qianfanguijin
2022-05-11 20:13 ` Jernej Škrabec
2022-05-11 20:13   ` Jernej Škrabec
2022-05-12  4:34   ` qianfan
2022-05-12  4:34     ` qianfan
2022-05-12  4:58     ` Viresh Kumar
2022-05-12  4:58       ` Viresh Kumar
2022-05-12  6:22       ` qianfan
2022-05-12  6:22         ` qianfan

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.