From 726cbc3b62695eb890ef2d2b5074d751cb6d9494 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Sat, 2 Apr 2022 23:25:27 +0800 Subject: [PATCH] sunxi: OrangePi One Plus: enable cpufreq support Signed-off-by: AmadeusGhost --- ...6-Enable-CPU-opp-tables-for-orangepi.patch | 60 +++++++++++++++++++ ...6-Enable-CPU-opp-tables-for-orangepi.patch | 60 +++++++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 target/linux/sunxi/patches-5.10/105-arm64-dts-allwinner-h6-Enable-CPU-opp-tables-for-orangepi.patch create mode 100644 target/linux/sunxi/patches-5.4/103-arm64-dts-allwinner-h6-Enable-CPU-opp-tables-for-orangepi.patch diff --git a/target/linux/sunxi/patches-5.10/105-arm64-dts-allwinner-h6-Enable-CPU-opp-tables-for-orangepi.patch b/target/linux/sunxi/patches-5.10/105-arm64-dts-allwinner-h6-Enable-CPU-opp-tables-for-orangepi.patch new file mode 100644 index 0000000000..08e173ba4e --- /dev/null +++ b/target/linux/sunxi/patches-5.10/105-arm64-dts-allwinner-h6-Enable-CPU-opp-tables-for-orangepi.patch @@ -0,0 +1,60 @@ +From fe79ea577be81e1e71642826ab00e676dc59c194 Mon Sep 17 00:00:00 2001 +From: AmadeusGhost +Date: Mon, 21 Mar 2022 15:00:21 +0800 +Subject: [PATCH] arm64: dts: allwinner: h6: Enable CPU opp tables for OrangePi + +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: AmadeusGhost +--- + +--- 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 + +@@ -64,6 +65,10 @@ + }; + }; + ++&cpu0 { ++ cpu-supply = <®_dcdca>; ++}; ++ + &de { + status = "okay"; + }; +@@ -200,7 +205,8 @@ + 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"; + }; + +@@ -208,6 +214,7 @@ + regulator-enable-ramp-delay = <32000>; + regulator-min-microvolt = <810000>; + regulator-max-microvolt = <1080000>; ++ regulator-ramp-delay = <2500>; + regulator-name = "vdd-gpu"; + }; + diff --git a/target/linux/sunxi/patches-5.4/103-arm64-dts-allwinner-h6-Enable-CPU-opp-tables-for-orangepi.patch b/target/linux/sunxi/patches-5.4/103-arm64-dts-allwinner-h6-Enable-CPU-opp-tables-for-orangepi.patch new file mode 100644 index 0000000000..70433bd98f --- /dev/null +++ b/target/linux/sunxi/patches-5.4/103-arm64-dts-allwinner-h6-Enable-CPU-opp-tables-for-orangepi.patch @@ -0,0 +1,60 @@ +From fe79ea577be81e1e71642826ab00e676dc59c194 Mon Sep 17 00:00:00 2001 +From: AmadeusGhost +Date: Mon, 21 Mar 2022 15:00:21 +0800 +Subject: [PATCH] arm64: dts: allwinner: h6: Enable CPU opp tables for OrangePi + +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: AmadeusGhost +--- + +--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi +@@ -7,6 +7,7 @@ + /dts-v1/; + + #include "sun50i-h6.dtsi" ++#include "sun50i-h6-cpu-opp.dtsi" + + #include + +@@ -47,6 +48,10 @@ + }; + }; + ++&cpu0 { ++ cpu-supply = <®_dcdca>; ++}; ++ + &ehci0 { + status = "okay"; + }; +@@ -163,7 +168,8 @@ + 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"; + }; + +@@ -171,6 +177,7 @@ + regulator-enable-ramp-delay = <32000>; + regulator-min-microvolt = <810000>; + regulator-max-microvolt = <1080000>; ++ regulator-ramp-delay = <2500>; + regulator-name = "vdd-gpu"; + }; +