[PATCH] ARM: dts: sun7i: bananapro: amending axp209 definition

18 views
Skip to first unread message

Jan K

unread,
Mar 13, 2021, 10:28:05 PM3/13/21
to linux...@googlegroups.com, devic...@vger.kernel.org, linux-ar...@lists.infradead.org, Hans de Goede
Current "Lemaker Banana Pro" sun7i A20-based SBC device tree is missing
right definition of AXP209 (CPU-dedicated PMU). It does not include the
axp209.dtsi and does not include regulator configuration, which becomes
vital once AXP209 regulators are recognized by kernel.

Missing AXP209 regulators mean no CPU frequency scaling, missing AXP209
supply status "okay" in device tree means no monitoring of amperage and
voltage. Patch brings all that back (it was fine at least up to 4.10.1).

With regulators support some regulators must stay on, so they have been
assigned to correct subsystems or set always-on.


Signed-off-by: Jan Kończak <jan.z....@gmail.com>
---
arch/arm/boot/dts/sun7i-a20-bananapro.dts | 58 +++++++++++++++++++----
1 file changed, 50 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boot/dts/sun7i-a20-bananapro.dts
b/arch/arm/boot/dts/sun7i-a20-bananapro.dts
index e22f0e8bb..1640f1702 100644
--- a/arch/arm/boot/dts/sun7i-a20-bananapro.dts
+++ b/arch/arm/boot/dts/sun7i-a20-bananapro.dts
@@ -90,10 +90,6 @@ reg_gmac_3v3: gmac-3v3 {
};
};

-&ahci {
- status = "okay";
-};
-
&codec {
status = "okay";
};
@@ -119,16 +115,62 @@ &i2c0 {
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>;
};
};

+#include "axp209.dtsi"
+
+&ac_power_supply {
+ status = "okay";
+};
+
+&battery_power_supply {
+ status = "okay";
+};
+
+&cpu0 {
+ cpu-supply = <&reg_dcdc2>;
+};
+
+&ahci {
+ target-supply = <&reg_ldo4>;
+ status = "okay";
+};
+
+// axp209 regulators
+&reg_dcdc2 {
+ regulator-always-on;
+ regulator-min-microvolt = <1000000>;
+ regulator-max-microvolt = <1400000>;
+ 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_ldo4 {
+ regulator-name = "vdd-sata";
+ regulator-always-on;
+};
+
&i2c2 {
status = "okay";
};
--
2.26.2
Reply all
Reply to author
Forward
0 new messages