ramips: mt7620n: convert to nvmem-layout
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_youhua_wr1200js.dts
index 1a759bf7c35ec8d72ff52f46c8719526da3372dd..2389112c3e6bff20f5d37a30eb34da0200d8fdae 100644 (file)
@@ -1,5 +1,3 @@
-/dts-v1/;
-
 #include "mt7621.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
                compatible = "gpio-leds";
 
                internet {
-                       label = "wr1200js:blue:internet";
-                       gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
+                       label = "blue:internet";
+                       gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
                };
 
                led_wps: wps {
-                       label = "wr1200js:blue:wps";
-                       gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
+                       label = "blue:wps";
+                       gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
                };
 
                usb {
-                       label = "wr1200js:blue:usb";
-                       gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
+                       label = "blue:usb";
+                       gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
                        trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
                        linux,default-trigger = "usbport";
                };
 
                reset {
                        label = "reset";
-                       gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
+                       gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_RESTART>;
                };
 
                wps {
                        label = "wps";
-                       gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
+                       gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_WPS_BUTTON>;
                };
 
                wifi {
                        label = "wifi";
-                       gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
+                       gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_RFKILL>;
                };
        };
@@ -65,7 +63,7 @@
 &spi0 {
        status = "okay";
 
-       m25p80@0 {
+       flash@0 {
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <10000000>;
                        };
 
                        factory: partition@40000 {
+                               compatible = "nvmem-cells";
                                label = "factory";
                                reg = <0x40000 0x10000>;
+                               #address-cells = <1>;
+                               #size-cells = <1>;
                                read-only;
+
+                               eeprom_factory_0: eeprom@0 {
+                                       reg = <0x0 0x400>;
+                               };
+
+                               eeprom_factory_8000: eeprom@8000 {
+                                       reg = <0x8000 0x200>;
+                               };
+
+                               macaddr_factory_e000: macaddr@e000 {
+                                       reg = <0xe000 0x6>;
+                               };
+
+                               macaddr_factory_e006: macaddr@e006 {
+                                       reg = <0xe006 0x6>;
+                               };
                        };
 
                        partition@50000 {
 &pcie0 {
        mt76@0,0 {
                reg = <0x0000 0 0 0 0>;
-               mediatek,mtd-eeprom = <&factory 0x0000>;
+               nvmem-cells = <&eeprom_factory_0>;
+               nvmem-cell-names = "eeprom";
        };
 };
 
 &pcie1 {
        mt76@0,0 {
                reg = <0x0000 0 0 0 0>;
-               mediatek,mtd-eeprom = <&factory 0x8000>;
+               nvmem-cells = <&eeprom_factory_8000>;
+               nvmem-cell-names = "eeprom";
                ieee80211-freq-limit = <5000000 6000000>;
 
                led {
        };
 };
 
-&ethernet {
-       mtd-mac-address = <&factory 0xe000>;
+&gmac0 {
+       nvmem-cells = <&macaddr_factory_e000>;
+       nvmem-cell-names = "mac-address";
+};
+
+&gmac1 {
+       status = "okay";
+       label = "wan";
+       phy-handle = <&ethphy0>;
+
+       nvmem-cells = <&macaddr_factory_e006>;
+       nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+       ethphy0: ethernet-phy@0 {
+               reg = <0>;
+       };
+};
+
+&switch0 {
+       ports {
+               port@1 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "lan4";
+               };
+       };
 };
 
 &state_default {
        gpio {
-               ralink,group = "i2c", "uart2", "uart3", "wdt";
-               ralink,function = "gpio";
+               groups = "i2c", "uart2", "uart3", "wdt";
+               function = "gpio";
        };
 };