ramips: Add support for Cudy WR1300 v3
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_iodata_wn-ax1167gr.dts
index 879fb68c853bb4e48988e3c0d33b5efb49ced580..b08939a451d012ed8ec39ceade8b110b0ea0328b 100644 (file)
                        };
 
                        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 0x200>;
+                               };
+
+                               macaddr_factory_4: macaddr@4 {
+                                       reg = <0x4 0x6>;
+                               };
                        };
 
                        iNIC_rf: partition@50000 {
+                               compatible = "nvmem-cells";
                                label = "iNIC_rf";
                                reg = <0x50000 0x10000>;
+                               #address-cells = <1>;
+                               #size-cells = <1>;
                                read-only;
+
+                               eeprom_iNIC_rf_0: eeprom@0 {
+                                       reg = <0x0 0x400>;
+                               };
+
+                               macaddr_iNIC_rf_4: macaddr@4 {
+                                       reg = <0x4 0x6>;
+                               };
                        };
 
                        partition@60000 {
 };
 
 &gmac0 {
-       mtd-mac-address = <&iNIC_rf 0x4>;
+       nvmem-cells = <&macaddr_iNIC_rf_4>;
+       nvmem-cell-names = "mac-address";
+};
+
+&gmac1 {
+       status = "okay";
+       label = "wan";
+       phy-handle = <&ethphy0>;
+
+       nvmem-cells = <&macaddr_factory_4>;
+       nvmem-cell-names = "mac-address";
+       mac-address-increment = <1>;
+};
+
+&mdio {
+       ethphy0: ethernet-phy@0 {
+               reg = <0>;
+       };
 };
 
 &switch0 {
        ports {
-               port@0 {
-                       status = "okay";
-                       label = "wan";
-                       mtd-mac-address = <&factory 0x4>;
-                       mtd-mac-address-increment = <1>;
-               };
-
                port@1 {
                        status = "okay";
                        label = "lan4";
 &pcie0 {
        mt76@0,0 {
                reg = <0x0000 0 0 0 0>;
-               mediatek,mtd-eeprom = <&iNIC_rf 0x0>;
+               nvmem-cells = <&eeprom_iNIC_rf_0>;
+               nvmem-cell-names = "eeprom";
        };
 };
 
 &pcie1 {
        mt76@0,0 {
                reg = <0x0000 0 0 0 0>;
-               mediatek,mtd-eeprom = <&factory 0x0>;
+               nvmem-cells = <&eeprom_factory_0>;
+               nvmem-cell-names = "eeprom";
                ieee80211-freq-limit = <5000000 6000000>;
        };
 };