From 3f699085ff453d51e97b63ca99459d1155b16413 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Sat, 16 Feb 2019 19:51:38 -0800 Subject: [PATCH] [armhf] Add patch from upstream fixing cpufreq on Orange Pi Plus. --- debian/changelog | 3 + ...n8i-h3-add-sy8106a-to-orange-pi-plus.patch | 80 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 84 insertions(+) create mode 100644 debian/patches/bugfix/arm/ARM-dts-sun8i-h3-add-sy8106a-to-orange-pi-plus.patch diff --git a/debian/changelog b/debian/changelog index ba3d1b859..89e400097 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,9 @@ linux (4.19.20-2) UNRELEASED; urgency=medium * linux-perf: Enable coresight trace (libopencsd) support in perf (Closes: #895131) + [ Vagrant Cascadian ] + * [armhf] Add patch from upstream fixing cpufreq on Orange Pi Plus. + -- Ben Hutchings Tue, 12 Feb 2019 12:49:10 +0000 linux (4.19.20-1) unstable; urgency=medium diff --git a/debian/patches/bugfix/arm/ARM-dts-sun8i-h3-add-sy8106a-to-orange-pi-plus.patch b/debian/patches/bugfix/arm/ARM-dts-sun8i-h3-add-sy8106a-to-orange-pi-plus.patch new file mode 100644 index 000000000..dfc7660eb --- /dev/null +++ b/debian/patches/bugfix/arm/ARM-dts-sun8i-h3-add-sy8106a-to-orange-pi-plus.patch @@ -0,0 +1,80 @@ +From e98d72d98a25890308941080d3a17b4c77e3f460 Mon Sep 17 00:00:00 2001 +From: Jorik Jonker +Date: Sat, 29 Sep 2018 15:18:30 +0200 +Subject: [PATCH] ARM: dts: sun8i-h3: add sy8106a to orange pi plus + +The Orange Pi Plus board lacks voltage scaling capabilities in its +current form. This results in random freezes during boot when cpufreq is +enabled, probably due to wrong voltages. + +This patch (more or less copy/paste from 06139c) does the following +things on this board: +- enable r_i2c +- add sy8106a to the r_i2c bus +- have the sy8106a regulate VDD of cpu + +Since the Orange Pi Plus has the same PMU setup as the Orange Pi PC, I +simply took min/max/fixed/ramp from the latter DTS. In that file the +origin of the values are described by the following comment: + + "The datasheet uses 1.1V as the minimum value of VDD-CPUX, + however both the Armbian DVFS table and the official one + have operating points with voltage under 1.1V, and both + DVFS table are known to work properly at the lowest + operating point. + Use 1.0V as the minimum voltage instead." + +I have tested this on patch two Orange Pi Plus boards, by running a +kernel with this patch and do intermettent runs of cpuburn while +monitoring voltage, frequency and temperature. The board runs stable +across its operatiing points while showing a reasonable (< 40C) +temperature. My Orange Pi PC, when put to the same test, yields similar +stable results. + +Signed-off-by: Jorik Jonker +Signed-off-by: Maxime Ripard +--- + arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts +index b403e5d787cb..ac8438c2cff1 100644 +--- a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts ++++ b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts +@@ -74,6 +74,10 @@ + }; + }; + ++&cpu0 { ++ cpu-supply = <®_vdd_cpux>; ++}; ++ + &ehci3 { + status = "okay"; + }; +@@ -119,6 +123,22 @@ + }; + }; + ++&r_i2c { ++ status = "okay"; ++ ++ reg_vdd_cpux: regulator@65 { ++ compatible = "silergy,sy8106a"; ++ reg = <0x65>; ++ regulator-name = "vdd-cpux"; ++ silergy,fixed-microvolt = <1200000>; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-ramp-delay = <200>; ++ regulator-boot-on; ++ regulator-always-on; ++ }; ++}; ++ + &usbphy { + usb3_vbus-supply = <®_usb3_vbus>; + }; +-- +2.20.1 + diff --git a/debian/patches/series b/debian/patches/series index eb64913dc..68679b658 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -80,6 +80,7 @@ bugfix/x86/x86-32-disable-3dnow-in-generic-config.patch bugfix/powerpc/powerpc-fix-mcpu-options-for-spe-only-compiler.patch bugfix/m68k/m68k-build-with-ffreestanding.patch bugfix/x86/x86-kvmclock-set-offset-for-kvm-unstable-clock.patch +bugfix/arm/ARM-dts-sun8i-h3-add-sy8106a-to-orange-pi-plus.patch # Arch features features/mips/MIPS-increase-MAX-PHYSMEM-BITS-on-Loongson-3-only.patch