[PATCH v2 1/2] arm64: allwinner: a64: enable AXP803 regulators for Pine64

2017-07-21 Thread Icenowy Zheng
Add support of AXP803 regulators in the Pine64 device tree.

The phy-supply regulator is also set in EMAC device node, in order to
prevent Ethernet regression by regulator get disabled by regulator
framework.

Signed-off-by: Icenowy Zheng 
---
Changes in v2:
- Change the min voltage of vdd-cpux to 1.04V.
- Added constraints for FLDO1 (vcc-1v2-hsic), as it's connected to the SoC
  (although HSIC function is not used).

 .../arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 102 +
 1 file changed, 102 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts 
b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
index 64cce0d68cae..2bcf0a3e36b4 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
@@ -83,6 +83,7 @@
pinctrl-0 = <_pins>;
phy-mode = "rmii";
phy-handle = <_rmii_phy1>;
+   phy-supply = <_dc1sw>;
status = "okay";
 
 };
@@ -134,6 +135,107 @@
};
 };
 
+#include "axp803.dtsi"
+
+_aldo2 {
+   regulator-always-on;
+   regulator-min-microvolt = <180>;
+   regulator-max-microvolt = <330>;
+   regulator-name = "vcc-pl";
+};
+
+_aldo3 {
+   regulator-always-on;
+   regulator-min-microvolt = <300>;
+   regulator-max-microvolt = <300>;
+   regulator-name = "vcc-pll-avcc";
+};
+
+_dc1sw {
+   regulator-name = "vcc-phy";
+};
+
+_dcdc1 {
+   regulator-always-on;
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-name = "vcc-3v3";
+};
+
+_dcdc2 {
+   regulator-always-on;
+   regulator-min-microvolt = <104>;
+   regulator-max-microvolt = <130>;
+   regulator-name = "vdd-cpux";
+};
+
+/* DCDC3 is polyphased with DCDC2 */
+
+/*
+ * The DRAM chips used by Pine64 boards are DDR3L-compatible, so they can
+ * work at 1.35V with less power consumption.
+ * As AXP803 DCDC5 cannot reach 1.35V accurately, use 1.36V instead.
+ */
+_dcdc5 {
+   regulator-always-on;
+   regulator-min-microvolt = <136>;
+   regulator-max-microvolt = <136>;
+   regulator-name = "vcc-dram";
+};
+
+_dcdc6 {
+   regulator-always-on;
+   regulator-min-microvolt = <110>;
+   regulator-max-microvolt = <110>;
+   regulator-name = "vdd-sys";
+};
+
+_dldo1 {
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-name = "vcc-hdmi";
+};
+
+_dldo2 {
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-name = "vcc-mipi";
+};
+
+_dldo4 {
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-name = "vcc-wifi";
+};
+
+_eldo1 {
+   regulator-min-microvolt = <180>;
+   regulator-max-microvolt = <180>;
+   regulator-name = "cpvdd";
+};
+
+_fldo1 {
+   regulator-min-microvolt = <120>;
+   regulator-max-microvolt = <120>;
+   regulator-name = "vcc-1v2-hsic";
+};
+
+/*
+ * The A64 chip cannot work without this regulator off, although
+ * it seems to be only driving the AR100 core.
+ * Maybe we don't still know well about CPUs domain.
+ */
+_fldo2 {
+   regulator-always-on;
+   regulator-min-microvolt = <110>;
+   regulator-max-microvolt = <110>;
+   regulator-name = "vdd-cpus";
+};
+
+_rtc_ldo {
+   regulator-name = "vcc-rtc";
+};
+
 /* On Exp and Euler connectors */
  {
pinctrl-names = "default";
-- 
2.13.0



[PATCH v2 1/2] arm64: allwinner: a64: enable AXP803 regulators for Pine64

2017-07-21 Thread Icenowy Zheng
Add support of AXP803 regulators in the Pine64 device tree.

The phy-supply regulator is also set in EMAC device node, in order to
prevent Ethernet regression by regulator get disabled by regulator
framework.

Signed-off-by: Icenowy Zheng 
---
Changes in v2:
- Change the min voltage of vdd-cpux to 1.04V.
- Added constraints for FLDO1 (vcc-1v2-hsic), as it's connected to the SoC
  (although HSIC function is not used).

 .../arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 102 +
 1 file changed, 102 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts 
b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
index 64cce0d68cae..2bcf0a3e36b4 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
@@ -83,6 +83,7 @@
pinctrl-0 = <_pins>;
phy-mode = "rmii";
phy-handle = <_rmii_phy1>;
+   phy-supply = <_dc1sw>;
status = "okay";
 
 };
@@ -134,6 +135,107 @@
};
 };
 
+#include "axp803.dtsi"
+
+_aldo2 {
+   regulator-always-on;
+   regulator-min-microvolt = <180>;
+   regulator-max-microvolt = <330>;
+   regulator-name = "vcc-pl";
+};
+
+_aldo3 {
+   regulator-always-on;
+   regulator-min-microvolt = <300>;
+   regulator-max-microvolt = <300>;
+   regulator-name = "vcc-pll-avcc";
+};
+
+_dc1sw {
+   regulator-name = "vcc-phy";
+};
+
+_dcdc1 {
+   regulator-always-on;
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-name = "vcc-3v3";
+};
+
+_dcdc2 {
+   regulator-always-on;
+   regulator-min-microvolt = <104>;
+   regulator-max-microvolt = <130>;
+   regulator-name = "vdd-cpux";
+};
+
+/* DCDC3 is polyphased with DCDC2 */
+
+/*
+ * The DRAM chips used by Pine64 boards are DDR3L-compatible, so they can
+ * work at 1.35V with less power consumption.
+ * As AXP803 DCDC5 cannot reach 1.35V accurately, use 1.36V instead.
+ */
+_dcdc5 {
+   regulator-always-on;
+   regulator-min-microvolt = <136>;
+   regulator-max-microvolt = <136>;
+   regulator-name = "vcc-dram";
+};
+
+_dcdc6 {
+   regulator-always-on;
+   regulator-min-microvolt = <110>;
+   regulator-max-microvolt = <110>;
+   regulator-name = "vdd-sys";
+};
+
+_dldo1 {
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-name = "vcc-hdmi";
+};
+
+_dldo2 {
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-name = "vcc-mipi";
+};
+
+_dldo4 {
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-name = "vcc-wifi";
+};
+
+_eldo1 {
+   regulator-min-microvolt = <180>;
+   regulator-max-microvolt = <180>;
+   regulator-name = "cpvdd";
+};
+
+_fldo1 {
+   regulator-min-microvolt = <120>;
+   regulator-max-microvolt = <120>;
+   regulator-name = "vcc-1v2-hsic";
+};
+
+/*
+ * The A64 chip cannot work without this regulator off, although
+ * it seems to be only driving the AR100 core.
+ * Maybe we don't still know well about CPUs domain.
+ */
+_fldo2 {
+   regulator-always-on;
+   regulator-min-microvolt = <110>;
+   regulator-max-microvolt = <110>;
+   regulator-name = "vdd-cpus";
+};
+
+_rtc_ldo {
+   regulator-name = "vcc-rtc";
+};
+
 /* On Exp and Euler connectors */
  {
pinctrl-names = "default";
-- 
2.13.0