ramips: mt7621: convert Ubiquiti devices EEPROM to NVMEM format
authorShiji Yang <yangshiji66@qq.com>
Tue, 16 Jan 2024 12:57:35 +0000 (20:57 +0800)
committerChristian Marangi <ansuelsmth@gmail.com>
Wed, 17 Jan 2024 00:14:50 +0000 (01:14 +0100)
-+-------------------------+-
 | Model |       NIC       |
-+-------------------------+-
 | All   | MT7603 + MT7615 |
-+-------------------------+-

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
target/linux/ramips/dts/mt7621_ubnt_unifi-flexhd.dts
target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts

index 36df3ef883dcc898dfd22bcf434a86fd33fa58bb..d458b91ca6d9543090b4c56f54b99f1685345de8 100644 (file)
                                label = "factory";
                                reg = <0x70000 0x10000>;
                                read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       eeprom_factory_0: eeprom@0 {
+                                               reg = <0x0 0x400>;
+                                       };
+
+                                       eeprom_factory_8000: eeprom@8000 {
+                                               reg = <0x8000 0x4da8>;
+                                       };
+                               };
                        };
 
                        eeprom: partition@80000 {
 &pcie0 {
        wifi@0,0 {
                reg = <0x0 0 0 0 0>;
-               mediatek,mtd-eeprom = <&factory 0x0>;
                // On newer devices there is a MediaTek MAC in the above
                // device EEPROM, so override it with a calculated one.
-               nvmem-cells = <&macaddr_eeprom_0 1>;
-               nvmem-cell-names = "mac-address";
+               nvmem-cells = <&eeprom_factory_0>, <&macaddr_eeprom_0 1>;
+               nvmem-cell-names = "eeprom", "mac-address";
        };
 };
 
 &pcie1 {
        wifi@0,0 {
                reg = <0x0 0 0 0 0>;
-               mediatek,mtd-eeprom = <&factory 0x8000>;
                // On newer devices there is a MediaTek MAC in the above
                // device EEPROM, so override it with a calculated one.
-               nvmem-cells = <&macaddr_eeprom_0 2>;
-               nvmem-cell-names = "mac-address";
+               nvmem-cells = <&eeprom_factory_8000>, <&macaddr_eeprom_0 2>;
+               nvmem-cell-names = "eeprom", "mac-address";
        };
 };
 
index b4000464f7be6e6aaeaa1c1193596186024dccd7..d81a23852d721c5fdb31246e3441c2b6da83bcb7 100644 (file)
                                label = "factory";
                                reg = <0x70000 0x10000>;
                                read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       eeprom_factory_0: eeprom@0 {
+                                               reg = <0x0 0x400>;
+                                       };
+
+                                       eeprom_factory_8000: eeprom@8000 {
+                                               reg = <0x8000 0x4da8>;
+                                       };
+                               };
                        };
 
                        eeprom: partition@80000 {
 };
 
 &wlan_2g {
-       mediatek,mtd-eeprom = <&factory 0x0>;
+       nvmem-cells = <&eeprom_factory_0>;
+       nvmem-cell-names = "eeprom";
 };
 
 &wlan_5g {
-       mediatek,mtd-eeprom = <&factory 0x8000>;
+       nvmem-cells = <&eeprom_factory_8000>;
+       nvmem-cell-names = "eeprom";
 };