ramips: add support for SNR-CPE-ME2-SFP
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_afoundry_ew1200.dts
index 661c7d89de9ae69451a527b28bec5f56ad872617..8d33f542dc1af0b294c8d7b8566d532283430bd9 100644 (file)
@@ -1,5 +1,3 @@
-/dts-v1/;
-
 #include "mt7621.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
                compatible = "gpio-leds";
 
                led_run: run {
-                       label = "ew1200:green:run";
+                       label = "green:run";
                        gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
                };
 
                usb {
-                       label = "ew1200:green:usb";
+                       label = "green:usb";
                        gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
                        trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
                        linux,default-trigger = "usbport";
 };
 
 &pcie0 {
-       mt76@0,0 {
+       wifi@0,0 {
+               compatible = "mediatek,mt76";
                reg = <0x0000 0 0 0 0>;
                mediatek,mtd-eeprom = <&factory 0x8000>;
                ieee80211-freq-limit = <5000000 6000000>;
+
+               led {
+                       led-sources = <2>;
+                       led-active-low;
+               };
        };
 };
 
 &pcie1 {
-       mt76@0,0 {
+       wifi@0,0 {
+               compatible = "mediatek,mt76";
                reg = <0x0000 0 0 0 0>;
                mediatek,mtd-eeprom = <&factory 0x0000>;
                ieee80211-freq-limit = <2400000 2500000>;
+
+               led {
+                       led-sources = <0>;
+                       led-active-low;
+               };
        };
 };
 
 &gmac0 {
-       mtd-mac-address = <&factory 0xe000>;
+       nvmem-cells = <&macaddr_factory_e000>;
+       nvmem-cell-names = "mac-address";
+};
+
+&gmac1 {
+       status = "okay";
+       label = "wan";
+       phy-handle = <&ethphy4>;
+
+       nvmem-cells = <&macaddr_factory_e000>;
+       nvmem-cell-names = "mac-address";
+       mac-address-increment = <1>;
+};
+
+&mdio {
+       ethphy4: ethernet-phy@4 {
+               reg = <4>;
+       };
 };
 
 &switch0 {
                        status = "okay";
                        label = "lan4";
                };
-
-               port@4 {
-                       status = "okay";
-                       label = "wan";
-                       mtd-mac-address = <&factory 0xe000>;
-                       mtd-mac-address-increment = <1>;
-               };
        };
 };
 
                function = "gpio";
        };
 };
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_e000: macaddr@e000 {
+               reg = <0xe000 0x6>;
+       };
+};