ramips: add support for SNR-CPE-ME2-SFP
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_storylink_sap-g3200u3.dts
index 4194154f07650497a72117e27e28b5357142d810..833e1b07d0c9462ea1db61d88e2a2b3f62d0dc7e 100644 (file)
@@ -1,5 +1,3 @@
-/dts-v1/;
-
 #include "mt7621.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
@@ -9,16 +7,12 @@
        compatible = "storylink,sap-g3200u3", "mediatek,mt7621-soc";
        model = "STORYLiNK SAP-G3200U3";
 
-       chosen {
-               bootargs = "console=ttyS0,57600";
-       };
-
        leds {
                compatible = "gpio-leds";
 
                usb {
-                       label = "sap-g3200u3:green:usb";
-                       gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
+                       label = "green:usb";
+                       gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
                        trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
                        linux,default-trigger = "usbport";
                };
 
                reset {
                        label = "reset";
-                       gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
+                       gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_RESTART>;
                };
 
                rfkill {
                        label = "rfkill";
-                       gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
+                       gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_RFKILL>;
                };
        };
@@ -44,7 +38,7 @@
 &spi0 {
        status = "okay";
 
-       m25p80@0 {
+       flash@0 {
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <10000000>;
        };
 };
 
-&ethernet {
-       mtd-mac-address = <&factory 0xe006>;
+&gmac0 {
+       nvmem-cells = <&macaddr_factory_e006>;
+       nvmem-cell-names = "mac-address";
+};
+
+&gmac1 {
+       status = "okay";
+       label = "wan";
+       phy-handle = <&ethphy4>;
+
+       nvmem-cells = <&macaddr_factory_e006>;
+       nvmem-cell-names = "mac-address";
+       mac-address-increment = <1>;
+};
+
+&mdio {
+       ethphy4: ethernet-phy@4 {
+               reg = <4>;
+       };
 };
 
-&pinctrl {
-       state_default: pinctrl0 {
-               gpio {
-                       ralink,group = "uart3", "jtag";
-                       ralink,function = "gpio";
+&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 {
+               groups = "uart3", "jtag";
+               function = "gpio";
+       };
+};
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_e006: macaddr@e006 {
+               reg = <0xe006 0x6>;
        };
 };