]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
arm64: allwinner: orangepi-pc2: Enable dwmac-sun8i
authorCorentin Labbe <clabbe.montjoie@gmail.com>
Mon, 5 Jun 2017 19:21:28 +0000 (21:21 +0200)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Tue, 6 Jun 2017 18:12:20 +0000 (20:12 +0200)
The dwmac-sun8i hardware is present on the Orange PI PC2.
It uses an external PHY rtl8211e via RGMII.

This patch create the needed regulator, emac and phy nodes.
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts

index dfecc17dcc927bea1410f25d8bcfdd4c0512e61d..a8296feee88411718818ab5452202d8b19b7b921 100644 (file)
@@ -59,6 +59,7 @@
        };
 
        aliases {
+               ethernet0 = &emac;
                serial0 = &uart0;
        };
 
                };
        };
 
+       reg_gmac_3v3: gmac-3v3 {
+               compatible = "regulator-fixed";
+               regulator-name = "gmac-3v3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               startup-delay-us = <100000>;
+               enable-active-high;
+               gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
+       };
+
        reg_usb0_vbus: usb0-vbus {
                compatible = "regulator-fixed";
                regulator-name = "usb0-vbus";
        status = "okay";
 };
 
+&emac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&emac_rgmii_pins>;
+       phy-supply = <&reg_gmac_3v3>;
+       phy-handle = <&ext_rgmii_phy>;
+       phy-mode = "rgmii";
+       status = "okay";
+};
+
 &ir {
        pinctrl-names = "default";
        pinctrl-0 = <&ir_pins_a>;
        status = "okay";
 };
 
+&mdio {
+       ext_rgmii_phy: ethernet-phy@1 {
+               compatible = "ethernet-phy-ieee802.3-c22";
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;