linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] ARM: dts: sunxi: Add regulators and board-specific operating points for LeMaker BananaPi
@ 2015-07-27  1:28 Timo Sigurdsson
  2015-07-27  8:07 ` [linux-sunxi] " Hans de Goede
  0 siblings, 1 reply; 18+ messages in thread
From: Timo Sigurdsson @ 2015-07-27  1:28 UTC (permalink / raw)
  To: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak, linux,
	maxime.ripard, devicetree, linux-arm-kernel, linux-kernel,
	linux-sunxi
  Cc: Timo Sigurdsson

sun7i-a20-bananapi.dts doesn't contain regulator nodes for the AXP209 PMU
driver, so add them to allow for voltage-scaling with cpufreq-dt. With the
regulators enabled, we can define board-specific operating points. The defined
CPU voltages are more conservative (based on the values used by the vendor),
so they should be more failsafe across all boards of this kind out there.

I'm posting this as RFC as I would like to make a few more remarks and raise
questions along the way (plus, I'm anything but an experienced developer, so a
a critical review might help).

I checked the regulator definitions against the schematics released by LeMaker.
I also compared that to the DT and schematics of Cubiboard 2 and Cubietruck. Of
course, I also tested the patch on the actual hardware and it works fine for me.
The CPU voltages are slightly higher than those set in sun7i-a20.dtsi and even
though they work well for me, I thought it might be safer to use the more
conservative values used by LeMaker in their old fex file. Would you agree?
Besides, it it ok to have this in one patch or should it be splitted in two
(one for the regulators and one for the opp)? Did I miss something important?

Signed-off-by: Timo Sigurdsson <public_timo.s@silentcreek.de>
---
 arch/arm/boot/dts/sun7i-a20-bananapi.dts | 47 +++++++++++++++++++++++++++++---
 1 file changed, 43 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/sun7i-a20-bananapi.dts b/arch/arm/boot/dts/sun7i-a20-bananapi.dts
index 9f7b472..2bcbb0e 100644
--- a/arch/arm/boot/dts/sun7i-a20-bananapi.dts
+++ b/arch/arm/boot/dts/sun7i-a20-bananapi.dts
@@ -92,6 +92,22 @@
 	status = "okay";
 };
 
+&cpu0 {
+	cpu-supply = <&reg_dcdc2>;
+	operating-points = <
+		/* kHz	  uV */
+		1008000	1450000
+		960000	1425000
+		912000	1425000
+		864000	1350000
+		720000	1250000
+		528000	1150000
+		312000	1100000
+		144000	1050000
+		>;
+	cooling-max-level = <7>;
+};
+
 &ehci0 {
 	status = "okay";
 };
@@ -119,13 +135,9 @@
 	status = "okay";
 
 	axp209: pmic@34 {
-		compatible = "x-powers,axp209";
 		reg = <0x34>;
 		interrupt-parent = <&nmi_intc>;
 		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
-
-		interrupt-controller;
-		#interrupt-cells = <1>;
 	};
 };
 
@@ -182,6 +194,33 @@
 	};
 };
 
+#include "axp209.dtsi"
+
+&reg_dcdc2 {
+	regulator-always-on;
+	regulator-min-microvolt = <1050000>;
+	regulator-max-microvolt = <1450000>;
+	regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc3 {
+	regulator-always-on;
+	regulator-min-microvolt = <1000000>;
+	regulator-max-microvolt = <1400000>;
+	regulator-name = "vdd-int-dll";
+};
+
+&reg_ldo1 {
+	regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+	regulator-always-on;
+	regulator-min-microvolt = <3000000>;
+	regulator-max-microvolt = <3000000>;
+	regulator-name = "avcc";
+};
+
 &reg_usb1_vbus {
 	status = "okay";
 };
-- 
2.1.4


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

end of thread, other threads:[~2015-08-02 22:00 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-27  1:28 [RFC] ARM: dts: sunxi: Add regulators and board-specific operating points for LeMaker BananaPi Timo Sigurdsson
2015-07-27  8:07 ` [linux-sunxi] " Hans de Goede
2015-07-27 12:09   ` public_timo.s
2015-07-27 12:43     ` Hans de Goede
2015-07-28  9:02       ` Timo Sigurdsson
2015-07-28 12:55         ` Maxime Ripard
2015-07-28 14:57           ` Timo Sigurdsson
2015-07-28 12:49       ` Maxime Ripard
2015-07-28 14:24         ` Hans de Goede
2015-07-28 15:09           ` Timo Sigurdsson
2015-07-28 15:29             ` Hans de Goede
2015-08-02 22:00               ` Timo Sigurdsson
2015-07-28 14:45         ` Timo Sigurdsson
2015-07-27 12:36   ` public_timo.s
2015-07-27 12:54     ` Hans de Goede
     [not found]       ` <CAGb2v65ApKvrj6K+kw43u=0q6=auTsmQjCXhibgZkW+vd5nDqA@mail.gmail.com>
2015-07-28  9:02         ` Timo Sigurdsson
2015-07-28 12:55           ` Maxime Ripard
2015-07-28 15:01             ` Timo Sigurdsson

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