ARM: dts: sunxi: Add mdio bus sub-node to GMAC
authorChen-Yu Tsai <wens@csie.org>
Wed, 14 Aug 2019 04:22:08 +0000 (12:22 +0800)
committerMaxime Ripard <maxime.ripard@bootlin.com>
Fri, 23 Aug 2019 07:14:48 +0000 (09:14 +0200)
The DWMAC binding never supported having the Ethernet PHY node as a
direct child to the controller, nor did it support the "phy" property
as a way to specify which Ethernet PHY to use. What seemed to work
was simply the implementation ignoring the "phy" property and instead
probing all addresses on the MDIO bus and using the first available
one.

The recent switch from "phy" to "phy-handle" breaks the assumptions
of the implementation, and does not match what the binding requires.
The binding requires that if an MDIO bus is described, it shall be
a sub-node with the "snps,dwmac-mdio" compatible string.

Add a device node for the MDIO bus, and move the Ethernet PHY node
under it. Also fix up the #address-cells and #size-cells properties
where needed.

Fixes: de332de26d19 ("ARM: dts: sunxi: Switch from phy to phy-handle")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
34 files changed:
arch/arm/boot/dts/sun6i-a31-colombus.dts
arch/arm/boot/dts/sun6i-a31-hummingbird.dts
arch/arm/boot/dts/sun6i-a31-i7.dts
arch/arm/boot/dts/sun6i-a31-m9.dts
arch/arm/boot/dts/sun6i-a31-mele-a1000g-quad.dts
arch/arm/boot/dts/sun6i-a31.dtsi
arch/arm/boot/dts/sun6i-a31s-cs908.dts
arch/arm/boot/dts/sun6i-a31s-sina31s.dts
arch/arm/boot/dts/sun6i-a31s-sinovoip-bpi-m2.dts
arch/arm/boot/dts/sun7i-a20-bananapi-m1-plus.dts
arch/arm/boot/dts/sun7i-a20-bananapi.dts
arch/arm/boot/dts/sun7i-a20-bananapro.dts
arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
arch/arm/boot/dts/sun7i-a20-cubietruck.dts
arch/arm/boot/dts/sun7i-a20-hummingbird.dts
arch/arm/boot/dts/sun7i-a20-i12-tvbox.dts
arch/arm/boot/dts/sun7i-a20-icnova-swac.dts
arch/arm/boot/dts/sun7i-a20-itead-ibox.dts
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts
arch/arm/boot/dts/sun7i-a20-m3.dts
arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts
arch/arm/boot/dts/sun7i-a20-olimex-som204-evb.dts
arch/arm/boot/dts/sun7i-a20-olinuxino-lime.dts
arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts
arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
arch/arm/boot/dts/sun7i-a20-orangepi-mini.dts
arch/arm/boot/dts/sun7i-a20-orangepi.dts
arch/arm/boot/dts/sun7i-a20-pcduino3-nano.dts
arch/arm/boot/dts/sun7i-a20-pcduino3.dts
arch/arm/boot/dts/sun7i-a20-wits-pro-a20-dkt.dts
arch/arm/boot/dts/sun7i-a20.dtsi
arch/arm/boot/dts/sun9i-a80-cubieboard4.dts
arch/arm/boot/dts/sun9i-a80-optimus.dts
arch/arm/boot/dts/sun9i-a80.dtsi

index 50092b0..93a15ea 100644 (file)
        phy-handle = <&phy1>;
        phy-mode = "rgmii";
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
 };
 
 &i2c0 {
        };
 };
 
+&mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_vcc3v0>;
        bus-width = <4>;
index 7c611dd..049e6ab 100644 (file)
        phy-handle = <&phy1>;
        phy-mode = "rgmii";
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-               reset-gpios = <&pio 0 21 GPIO_ACTIVE_LOW>;
-               reset-assert-us = <10000>;
-               reset-deassert-us = <30000>;
-       };
 };
 
 &hdmi {
        status = "okay";
 };
 
+&mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+               reset-gpios = <&pio 0 21 GPIO_ACTIVE_LOW>;
+               reset-assert-us = <10000>;
+               reset-deassert-us = <30000>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_dcdc1>;
        bus-width = <4>;
index ebb0b47..6cc8ccf 100644 (file)
        phy-handle = <&phy1>;
        phy-mode = "mii";
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
 };
 
 &hdmi {
        status = "okay";
 };
 
+&mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
index 4910c6c..a645c8f 100644 (file)
        phy-mode = "mii";
        phy-supply = <&reg_dldo1>;
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
 };
 
 &ir {
        status = "okay";
 };
 
+&mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_dcdc1>;
        bus-width = <4>;
index 703e1c1..648f247 100644 (file)
        phy-mode = "mii";
        phy-supply = <&reg_dldo1>;
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
 };
 
 &ir {
        status = "okay";
 };
 
+&mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_dcdc1>;
        bus-width = <4>;
index 9ddde11..8d0db8a 100644 (file)
                        snps,fixed-burst;
                        snps,force_sf_dma_mode;
                        status = "disabled";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
+
+                       mdio: mdio {
+                               compatible = "snps,dwmac-mdio";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
                };
 
                crypto: crypto-engine@1c15000 {
index 6e9ec3f..1d15e15 100644 (file)
@@ -70,9 +70,6 @@
        phy-handle = <&phy1>;
        phy-mode = "mii";
        status = "okay";
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
 };
 
 &ir {
        status = "okay";
 };
 
+&mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &ohci1 {
        status = "okay";
 };
index c92779b..0af48e1 100644 (file)
        phy-mode = "mii";
        phy-supply = <&reg_dldo1>;
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
 };
 
 &hdmi {
        };
 };
 
+&mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_dcdc1>;
        bus-width = <4>;
index e993b2d..708caee 100644 (file)
        phy-mode = "rgmii";
        phy-supply = <&reg_dldo1>;
        status = "okay";
+};
+
+&ir {
+       pinctrl-names = "default";
+       pinctrl-0 = <&s_ir_rx_pin>;
+       status = "okay";
+};
 
+&mdio {
        phy1: ethernet-phy@1 {
                reg = <1>;
                reset-gpios = <&pio 0 21 GPIO_ACTIVE_LOW>; /* PA21 */
        };
 };
 
-&ir {
-       pinctrl-names = "default";
-       pinctrl-0 = <&s_ir_rx_pin>;
-       status = "okay";
-};
-
 &mmc0 {
        vmmc-supply = <&reg_dcdc1>;
        bus-width = <4>;
index c601ecf..32d5d45 100644 (file)
        phy-mode = "rgmii";
        phy-supply = <&reg_gmac_3v3>;
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
 };
 
 &hdmi {
        status = "okay";
 };
 
+&gmac_mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
index c5730b3..bb3987e 100644 (file)
        phy-mode = "rgmii";
        phy-supply = <&reg_gmac_3v3>;
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
 };
 
 &hdmi {
        status = "okay";
 };
 
+&gmac_mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
index 86f4ebb..01ccff7 100644 (file)
        phy-mode = "rgmii";
        phy-supply = <&reg_gmac_3v3>;
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
 };
 
 &i2c0 {
        status = "okay";
 };
 
+&gmac_mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
index e322f0f..b8203e4 100644 (file)
        phy-handle = <&phy1>;
        phy-mode = "mii";
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
 };
 
 &hdmi {
        status = "okay";
 };
 
+&gmac_mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &ohci0 {
        status = "okay";
 };
index a8f7f63..8c8dee6 100644 (file)
        phy-handle = <&phy1>;
        phy-mode = "rgmii";
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
 };
 
 &hdmi {
        status = "okay";
 };
 
+&gmac_mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
index 322717c..3def2a3 100644 (file)
        phy-mode = "rgmii";
        phy-supply = <&reg_gmac_vdd>;
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-               reset-gpios = <&pio 0 17 GPIO_ACTIVE_LOW>; /* PA17 */
-               reset-assert-us = <10000>;
-               /* wait 1s after reset, otherwise fail to read phy id */
-               reset-deassert-us = <1000000>;
-       };
 };
 
 &i2c0 {
        status = "okay";
 };
 
+&gmac_mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+               reset-gpios = <&pio 0 17 GPIO_ACTIVE_LOW>; /* PA17 */
+               reset-assert-us = <10000>;
+               /* wait 1s after reset, otherwise fail to read phy id */
+               reset-deassert-us = <1000000>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_vcc3v0>;
        bus-width = <4>;
index 8a610da..358ed5f 100644 (file)
        phy-mode = "mii";
        phy-supply = <&reg_gmac_3v3>;
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
 };
 
 &i2c0 {
        status = "okay";
 };
 
+&gmac_mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
index a20e91c..413505f 100644 (file)
        phy-handle = <&phy1>;
        phy-mode = "mii";
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
 };
 
 &i2c0 {
        status = "okay";
 };
 
+&gmac_mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
index c27567c..946c272 100644 (file)
        phy-handle = <&phy1>;
        phy-mode = "mii";
        status = "okay";
+};
 
+&gmac_mdio {
        phy1: ethernet-phy@1 {
                reg = <1>;
        };
index 3e170cf..17fa890 100644 (file)
        phy-mode = "rgmii";
        phy-supply = <&reg_gmac_3v3>;
        status = "okay";
-       /delete-property/#address-cells;
-       /delete-property/#size-cells;
 
        fixed-link {
                speed = <1000>;
index bde0ef7..6bff9e7 100644 (file)
        phy-handle = <&phy1>;
        phy-mode = "mii";
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
 };
 
 &i2c0 {
        status = "okay";
 };
 
+&gmac_mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
index f419b9e..6f9c54b 100644 (file)
        phy-handle = <&phy1>;
        phy-mode = "rgmii";
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
 };
 
 &hdmi {
        };
 };
 
+&gmac_mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
index d3d03b7..230d62a 100644 (file)
        phy-mode = "rgmii";
        phy-supply = <&reg_vcc3v3>;
        status = "okay";
-
-       phy3: ethernet-phy@3 {
-               reg = <3>;
-               reset-gpios = <&pio 0 17 GPIO_ACTIVE_LOW>; /* PA17 */
-               reset-assert-us = <10000>;
-               /* wait 1s after reset, otherwise fail to read phy id */
-               reset-deassert-us = <1000000>;
-       };
 };
 
 &hdmi {
        status = "okay";
 };
 
+&gmac_mdio {
+       phy3: ethernet-phy@3 {
+               reg = <3>;
+               reset-gpios = <&pio 0 17 GPIO_ACTIVE_LOW>; /* PA17 */
+               reset-assert-us = <10000>;
+               /* wait 1s after reset, otherwise fail to read phy id */
+               reset-deassert-us = <1000000>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
index 70a8832..2adbac8 100644 (file)
        phy-handle = <&phy1>;
        phy-mode = "mii";
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
 };
 
 &hdmi {
        };
 };
 
+&gmac_mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
index 0fe657e..9ba6277 100644 (file)
        phy-handle = <&phy1>;
        phy-mode = "rgmii";
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
 };
 
 &hdmi {
        vref-supply = <&reg_vcc3v0>;
 };
 
+&gmac_mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
index 5597369..359bd0d 100644 (file)
        phy-handle = <&phy1>;
        phy-mode = "mii";
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
 };
 
 &hdmi {
        };
 };
 
+&gmac_mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
index a94ff50..2e328d2 100644 (file)
        phy-mode = "rgmii";
        phy-supply = <&reg_gmac_3v3>;
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
 };
 
 &hdmi {
        status = "okay";
 };
 
+&gmac_mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
index 956579a..d75b2e2 100644 (file)
        phy-mode = "rgmii";
        phy-supply = <&reg_gmac_3v3>;
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
 };
 
 &i2c0 {
        status = "okay";
 };
 
+&gmac_mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
index 993fb97..fce2f7f 100644 (file)
        phy-handle = <&phy1>;
        phy-mode = "rgmii";
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
 };
 
 &hdmi {
        status = "okay";
 };
 
+&gmac_mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
index 02e3215..cc8271d 100644 (file)
        phy-handle = <&phy1>;
        phy-mode = "mii";
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
 };
 
 &i2c0 {
        status = "okay";
 };
 
+&gmac_mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
index 9dfe7e2..3bfae98 100644 (file)
        phy-handle = <&phy1>;
        phy-mode = "rgmii";
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
 };
 
 &i2c0 {
 
 #include "axp209.dtsi"
 
+&gmac_mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
index 9ad8e44..651d7fe 100644 (file)
                        snps,fixed-burst;
                        snps,force_sf_dma_mode;
                        status = "disabled";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
+
+                       gmac_mdio: mdio {
+                               compatible = "snps,dwmac-mdio";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
                };
 
                hstimer@1c60000 {
index 650890b..d3b337b 100644 (file)
        phy-mode = "rgmii";
        phy-supply = <&reg_cldo1>;
        status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
 };
 
 &i2c3 {
        status = "okay";
 };
 
+&mdio {
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc0_pins>;
index 03ad255..bbc6335 100644 (file)
        phy-mode = "rgmii";
        phy-supply = <&reg_cldo1>;
        status = "okay";
+};
 
+&mdio {
        phy1: ethernet-phy@1 {
                reg = <1>;
        };
index 310cd97..c34d505 100644 (file)
                        snps,fixed-burst;
                        snps,force_sf_dma_mode;
                        status = "disabled";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
+
+                       mdio: mdio {
+                               compatible = "snps,dwmac-mdio";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
                };
 
                ehci0: usb@a00000 {