ramips: add support for TP-Link EX220 v1
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_xiaoyu_xy-c5.dts
index b54476096725a8e6c9fe8aa11217bfbc4f24f6bd..e4de0b82310fd77462e0fb68ffa54e2b7636ab42 100644 (file)
@@ -1,5 +1,3 @@
-/dts-v1/;
-
 #include "mt7621.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
                led-failsafe = &led_sys;
                led-running = &led_sys;
                led-upgrade = &led_sys;
-               label-mac-device = &ethernet;
-       };
-
-       chosen {
-               bootargs = "console=ttyS0,57600";
+               label-mac-device = &gmac0;
        };
 
        leds {
                compatible = "gpio-leds";
 
                work {
-                       label = "xy-c5:green:work";
-                       gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
+                       label = "green:work";
+                       gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
                };
 
                led_sys: sys {
-                       label = "xy-c5:green:sys";
-                       gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
+                       label = "green:sys";
+                       gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
                };
        };
 
@@ -40,7 +34,7 @@
 
                reset {
                        label = "reset";
-                       gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
+                       gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_RESTART>;
                };
        };
@@ -53,6 +47,7 @@
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <25000000>;
+               broken-flash-reset;
 
                partitions {
                        compatible = "fixed-partitions";
        status = "okay";
 };
 
-&ethernet {
-       mtd-mac-address = <&factory 0x4>;
+&gmac0 {
+       nvmem-cells = <&macaddr_factory_4>;
+       nvmem-cell-names = "mac-address";
+};
+
+&gmac1 {
+       status = "okay";
+       label = "wan";
+       phy-handle = <&ethphy4>;
+
+       nvmem-cells = <&macaddr_factory_4>;
+       nvmem-cell-names = "mac-address";
+       mac-address-increment = <1>;
+};
+
+&mdio {
+       ethphy4: ethernet-phy@4 {
+               reg = <4>;
+       };
+};
+
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+       };
 };
 
 &state_default {
        gpio {
-               ralink,group = "uart3", "wdt";
-               ralink,function = "gpio";
+               groups = "uart3", "wdt";
+               function = "gpio";
+       };
+};
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_4: macaddr@4 {
+               reg = <0x4 0x6>;
        };
 };