ramips: mt7621: convert MT7915 EEPROM to NVMEM format
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620a_iodata_wn-ac733gr3.dts
index ad96d94849eb7dea44bdfe845e6bb86122f81e8b..bc674fa4b3044f578fb40607a727ece5dd66667e 100644 (file)
@@ -1,5 +1,4 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
-/dts-v1/;
 
 #include "mt7620a.dtsi"
 
                compatible = "gpio-leds";
 
                led_power: power {
-                       label = "wn-ac733gr3:green:power";
+                       label = "green:power";
                        gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
                        default-state = "on";
                };
 
                notification {
-                       label = "wn-ac733gr3:green:notification";
+                       label = "green:notification";
                        gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
                };
 
                wlan2g {
-                       label = "wn-ac733gr3:green:wlan2g";
+                       label = "green:wlan2g";
                        gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
                };
 
                wlan5g {
-                       label = "wn-ac733gr3:green:wlan5g";
+                       label = "green:wlan5g";
                        gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
                };
        };
 
        keys {
-               compatible = "gpio-keys-polled";
-               poll-interval = <20>;
+               compatible = "gpio-keys";
 
                reset {
                        label = "reset";
                                label = "factory";
                                reg = <0x40000 0x8000>;
                                read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       eeprom_factory_0: eeprom@0 {
+                                               reg = <0x0 0x200>;
+                                       };
+
+                                       macaddr_factory_4: macaddr@4 {
+                                               reg = <0x4 0x6>;
+                                       };
+                               };
                        };
 
                        iNIC_rf: partition@48000 {
                                label = "iNIC_rf";
                                reg = <0x48000 0x8000>;
                                read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       eeprom_iNIC_rf_0: eeprom@0 {
+                                               reg = <0x0 0x200>;
+                                       };
+                               };
                        };
 
                        partition@50000 {
 &ethernet {
        pinctrl-names = "default";
        pinctrl-0 = <&rgmii1_pins>;
-       mtd-mac-address = <&factory 0x4>;
+
+       nvmem-cells = <&macaddr_factory_4>;
+       nvmem-cell-names = "mac-address";
 
        port@5 {
                status = "okay";
        };
 };
 
-&pinctrl {
-       state_default: pinctrl0 {
-               gpio {
-                       ralink,group = "i2c", "uartf", "mdio";
-                       ralink,function = "gpio";
-               };
+&state_default {
+       gpio {
+               groups = "i2c", "uartf", "mdio";
+               function = "gpio";
        };
 };
 
        wifi@0,0 {
                compatible = "mediatek,mt76";
                reg = <0x0000 0 0 0 0>;
-               mediatek,mtd-eeprom = <&iNIC_rf 0x0>;
+               nvmem-cells = <&eeprom_iNIC_rf_0>;
+               nvmem-cell-names = "eeprom";
                ieee80211-freq-limit = <5000000 6000000>;
        };
 };
 
 &wmac {
-       ralink,mtd-eeprom = <&factory 0x0>;
+       nvmem-cells = <&eeprom_factory_0>;
+       nvmem-cell-names = "eeprom";
 };