Re: [PATCH 1/4] sunxi: dts: R40: Update Bananapi M2 Berry .dts

2020-01-21 Thread Jagan Teki
On Thu, Jan 2, 2020 at 5:15 AM Andre Przywara  wrote:
>
> Update the .dts file from the kernel, which carries much more nodes,
> some of them we need to enable USB and Ethernet support for the board.
>
> Signed-off-by: Andre Przywara 
> ---

Would be better to have all R40 files to sync at the same time?


[PATCH 1/4] sunxi: dts: R40: Update Bananapi M2 Berry .dts

2020-01-01 Thread Andre Przywara
Update the .dts file from the kernel, which carries much more nodes,
some of them we need to enable USB and Ethernet support for the board.

Signed-off-by: Andre Przywara 
---
 arch/arm/dts/sun8i-v40-bananapi-m2-berry.dts | 135 ---
 1 file changed, 120 insertions(+), 15 deletions(-)

diff --git a/arch/arm/dts/sun8i-v40-bananapi-m2-berry.dts 
b/arch/arm/dts/sun8i-v40-bananapi-m2-berry.dts
index 54ad4db468..15c22b06fc 100644
--- a/arch/arm/dts/sun8i-v40-bananapi-m2-berry.dts
+++ b/arch/arm/dts/sun8i-v40-bananapi-m2-berry.dts
@@ -50,6 +50,7 @@
compatible = "sinovoip,bpi-m2-berry", "allwinner,sun8i-r40";
 
aliases {
+   ethernet0 = &gmac;
serial0 = &uart0;
};
 
@@ -57,6 +58,17 @@
stdout-path = "serial0:115200n8";
};
 
+   connector {
+   compatible = "hdmi-connector";
+   type = "a";
+
+   port {
+   hdmi_con_in: endpoint {
+   remote-endpoint = <&hdmi_out_con>;
+   };
+   };
+   };
+
leds {
compatible = "gpio-leds";
 
@@ -84,12 +96,18 @@
wifi_pwrseq: wifi_pwrseq {
compatible = "mmc-pwrseq-simple";
reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 WIFI_EN */
+   clocks = <&ccu CLK_OUTA>;
+   clock-names = "ext_clock";
};
 };
 
 &ahci {
-   phy-supply = <®_eldo3>;  /* VDD12-SATA */
-   ahci-supply = <®_dldo4>; /* VDD25-SATA */
+   ahci-supply = <®_dldo4>;
+   phy-supply = <®_eldo3>;
+   status = "okay";
+};
+
+&de {
status = "okay";
 };
 
@@ -98,6 +116,32 @@
status = "okay";
 };
 
+&gmac {
+   pinctrl-names = "default";
+   pinctrl-0 = <&gmac_rgmii_pins>;
+   phy-handle = <&phy1>;
+   phy-mode = "rgmii";
+   phy-supply = <®_dc1sw>;
+   status = "okay";
+};
+
+&gmac_mdio {
+   phy1: ethernet-phy@1 {
+   compatible = "ethernet-phy-ieee802.3-c22";
+   reg = <1>;
+   };
+};
+
+&hdmi {
+   status = "okay";
+};
+
+&hdmi_out {
+   hdmi_out_con: endpoint {
+   remote-endpoint = <&hdmi_con_in>;
+   };
+};
+
 &i2c0 {
status = "okay";
 
@@ -111,6 +155,41 @@
 
 #include "axp22x.dtsi"
 
+&mmc0 {
+   vmmc-supply = <®_dcdc1>;
+   bus-width = <4>;
+   cd-gpios = <&pio 7 13 GPIO_ACTIVE_LOW>; /* PH13 */
+   status = "okay";
+};
+
+&mmc1 {
+   pinctrl-names = "default";
+   pinctrl-0 = <&mmc1_pg_pins>;
+   vmmc-supply = <®_dldo2>;
+   vqmmc-supply = <®_dldo1>;
+   mmc-pwrseq = <&wifi_pwrseq>;
+   bus-width = <4>;
+   non-removable;
+   status = "okay";
+};
+
+&pio {
+   pinctrl-names = "default";
+   pinctrl-0 = <&clk_out_a_pin>;
+   vcc-pa-supply = <®_aldo2>;
+   vcc-pc-supply = <®_dcdc1>;
+   vcc-pd-supply = <®_dcdc1>;
+   vcc-pe-supply = <®_eldo1>;
+   vcc-pf-supply = <®_dcdc1>;
+   vcc-pg-supply = <®_dldo1>;
+};
+
+®_aldo2 {
+   regulator-min-microvolt = <250>;
+   regulator-max-microvolt = <250>;
+   regulator-name = "vcc-pa";
+};
+
 ®_aldo3 {
regulator-always-on;
regulator-min-microvolt = <270>;
@@ -118,6 +197,12 @@
regulator-name = "avcc";
 };
 
+®_dc1sw {
+   regulator-min-microvolt = <300>;
+   regulator-max-microvolt = <300>;
+   regulator-name = "vcc-gmac-phy";
+};
+
 ®_dcdc1 {
regulator-always-on;
regulator-min-microvolt = <300>;
@@ -152,12 +237,27 @@
regulator-name = "vcc-wifi-io";
 };
 
+/*
+ * Our WiFi chip needs both DLDO2 and DLDO3 to be powered at the same
+ * time, with the two being in sync, to be able to meet maximum power
+ * consumption during transmits. Since this is not really supported
+ * right now, just use the two as always on, and we will fix it later.
+ */
+
 ®_dldo2 {
+   regulator-always-on;
regulator-min-microvolt = <330>;
regulator-max-microvolt = <330>;
regulator-name = "vcc-wifi";
 };
 
+®_dldo3 {
+   regulator-always-on;
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-name = "vcc-wifi-2";
+};
+
 ®_dldo4 {
regulator-min-microvolt = <250>;
regulator-max-microvolt = <250>;
@@ -170,28 +270,33 @@
regulator-name = "vdd1v2-sata";
 };
 
-&mmc0 {
-   vmmc-supply = <®_dcdc1>;
-   bus-width = <4>;
-   cd-gpios = <&pio 7 13 GPIO_ACTIVE_LOW>; /* PH13 */
+&tcon_tv0 {
status = "okay";
 };
 
-&mmc1 {
+&uart0 {
pinctrl-names = "default";
-   pinctrl-0 = <&mmc1_pg_pins>;
-   vmmc-supply = <®_dldo2>;
-   vqmmc-supply = <®_dldo1>;
-   mmc-pwrseq = <&wifi_pwrseq>;
-   bus-width = <4>;
-   non-removable;
+   pinctrl-0 = <&uart0_pb_pins>;
status = "okay";
 };
 
-&uart0 {
+&uart3 {
pinctrl-names = "