linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ARM: dts: sun8i-h3: add sy8106a to orange pi plus
@ 2018-09-29 13:18 jorik
  2018-10-01 15:45 ` Maxime Ripard
  0 siblings, 1 reply; 2+ messages in thread
From: jorik @ 2018-09-29 13:18 UTC (permalink / raw)
  To: robh+dt, mark.rutland, maxime.ripard, wens, devicetree,
	linux-arm-kernel, linux-kernel
  Cc: linux-sunxi, jorik

From: Jorik Jonker <jorik@kippendief.biz>

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 <jorik@kippendief.biz>
---
 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 b403e5d78..ac8438c2c 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 = <&reg_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 = <&reg_usb3_vbus>;
 };
-- 
2.17.1


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

* Re: [PATCH v2] ARM: dts: sun8i-h3: add sy8106a to orange pi plus
  2018-09-29 13:18 [PATCH v2] ARM: dts: sun8i-h3: add sy8106a to orange pi plus jorik
@ 2018-10-01 15:45 ` Maxime Ripard
  0 siblings, 0 replies; 2+ messages in thread
From: Maxime Ripard @ 2018-10-01 15:45 UTC (permalink / raw)
  To: jorik
  Cc: robh+dt, mark.rutland, wens, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

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

On Sat, Sep 29, 2018 at 03:18:30PM +0200, jorik@kippendief.biz wrote:
> From: Jorik Jonker <jorik@kippendief.biz>
> 
> 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 <jorik@kippendief.biz>

Queued for 4.21, thanks!
Maxime

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

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

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

end of thread, other threads:[~2018-10-01 18:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-29 13:18 [PATCH v2] ARM: dts: sun8i-h3: add sy8106a to orange pi plus jorik
2018-10-01 15:45 ` 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).