ramips: mt7621: convert Xiaomi devices EEPROM to NVMEM format
authorShiji Yang <yangshiji66@qq.com>
Tue, 16 Jan 2024 12:21:35 +0000 (20:21 +0800)
committerChristian Marangi <ansuelsmth@gmail.com>
Wed, 17 Jan 2024 00:14:49 +0000 (01:14 +0100)
-+---------------------------+-
 |  Model  |       NIC       |
-+---------------------------+-
 | AC2100  | MT7603 + MT7615 |
-+---------------------------+-
 | MI4A V2 | MT7603 + MT7613 |
-+---------------------------+-
 | Others  | MT7603 + MT7612 |
-+---------------------------+-

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g.dts
target/linux/ramips/dts/mt7621_xiaomi_mi-router-4.dts
target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-3g-v2.dtsi
target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-common.dtsi
target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-gigabit-v2.dts
target/linux/ramips/dts/mt7621_xiaomi_nand_128m.dtsi
target/linux/ramips/dts/mt7621_xiaomi_router-ac2100.dtsi

index 763973a193fde2d841c5c1f224970d49df1a6b6e..bd8400c8985a095fcb4091db4b9653a84a8a2869 100644 (file)
@@ -86,7 +86,8 @@
        wifi@0,0 {
                compatible = "pci14c3,7603";
                reg = <0x0000 0 0 0 0>;
-               mediatek,mtd-eeprom = <&factory 0x0000>;
+               nvmem-cells = <&eeprom_factory_0>;
+               nvmem-cell-names = "eeprom";
                ieee80211-freq-limit = <2400000 2500000>;
        };
 };
@@ -95,7 +96,8 @@
        wifi@0,0 {
                compatible = "pci14c3,7662";
                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>;
        };
 };
index 8340ca5d287f3923b0c68574e891c4fa24095b14..a9b62b1b28d3ae5080a7efda7ea23e6f92ca5fb0 100644 (file)
@@ -50,7 +50,8 @@
        wifi@0,0 {
                compatible = "pci14c3,7603";
                reg = <0x0000 0 0 0 0>;
-               mediatek,mtd-eeprom = <&factory 0x0000>;
+               nvmem-cells = <&eeprom_factory_0>;
+               nvmem-cell-names = "eeprom";
                ieee80211-freq-limit = <2400000 2500000>;
        };
 };
@@ -59,7 +60,8 @@
        wifi@0,0 {
                compatible = "pci14c3,7662";
                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>;
        };
 };
index d05872337be26f420ee1d6bf146251ee59050284..8f88eb175dd60e2658c318c0af1d8a6d0c1ba2dc 100644 (file)
 };
 
 &wifi0 {
-       mediatek,mtd-eeprom = <&factory 0x8000>;
+       nvmem-cells = <&eeprom_factory_8000>;
+       nvmem-cell-names = "eeprom";
        ieee80211-freq-limit = <5000000 6000000>;
 };
 
 &wifi1 {
-       mediatek,mtd-eeprom = <&factory 0x0000>;
+       nvmem-cells = <&eeprom_factory_0>;
+       nvmem-cell-names = "eeprom";
        ieee80211-freq-limit = <2400000 2500000>;
 };
 
index 7ce9aea3351fec57c845af25b66114ebe533d959..7b8c4e8dfdc221a106df815bf6558ada7afc0f7e 100644 (file)
                                        #address-cells = <1>;
                                        #size-cells = <1>;
 
+                                       eeprom_factory_0: eeprom@0 {
+                                               reg = <0x0 0x400>;
+                                       };
+
+                                       eeprom_factory_8000: eeprom@8000 {
+                                               reg = <0x8000 0x200>;
+                                       };
+
                                        macaddr_factory_e000: macaddr@e000 {
                                                reg = <0xe000 0x6>;
                                        };
index 67ff6ea11e161fce792be77a0f00a78d62181eeb..719d430fd874563a0bc30ead7e89a1b2bc1038e0 100644 (file)
        };
 };
 
+/* override EEPROM size to 0x4da8 for MT7613 */
+&eeprom_factory_8000 {
+       reg = <0x8000 0x4da8>;
+};
+
 &partitions {
        partition@180000 {
                // size changed against to the common dtsi
 };
 
 &wifi0 {
-       mediatek,mtd-eeprom = <&factory 0x0000>;
+       nvmem-cells = <&eeprom_factory_0>;
+       nvmem-cell-names = "eeprom";
        ieee80211-freq-limit = <2400000 2500000>;
 };
 
 &wifi1 {
-       mediatek,mtd-eeprom = <&factory 0x8000>;
+       nvmem-cells = <&eeprom_factory_8000>;
+       nvmem-cell-names = "eeprom";
        ieee80211-freq-limit = <5000000 6000000>;
 };
 
index 1dc91d8b47eeef0431543d9a7ee7550a146ced29..3a877e9bec3415c7fb63a4c117e87f9db99193b9 100644 (file)
                                #address-cells = <1>;
                                #size-cells = <1>;
 
+                               eeprom_factory_0: eeprom@0 {
+                                       reg = <0x0 0x400>;
+                               };
+
+                               eeprom_factory_8000: eeprom@8000 {
+                                       reg = <0x8000 0x200>;
+                               };
+
                                macaddr_factory_e000: macaddr@e000 {
                                        reg = <0xe000 0x6>;
                                };
index c7d6c574aa0c67052a6a2f6434f499105f65e92b..468f9456bfff5c31e133f27d053975be2f7124f5 100644 (file)
@@ -2,6 +2,11 @@
 
 #include "mt7621_xiaomi_nand_128m.dtsi"
 
+/* override EEPROM size to 0x4da8 for MT7615 */
+&eeprom_factory_8000 {
+       reg = <0x8000 0x4da8>;
+};
+
 &pcie {
        status = "okay";
 };
@@ -10,7 +15,8 @@
        wifi@0,0 {
                compatible = "mediatek,mt76";
                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>;
        };
 };
@@ -19,7 +25,8 @@
        wifi@0,0 {
                compatible = "mediatek,mt76";
                reg = <0x0000 0 0 0 0>;
-               mediatek,mtd-eeprom = <&factory 0x0000>;
+               nvmem-cells = <&eeprom_factory_0>;
+               nvmem-cell-names = "eeprom";
                ieee80211-freq-limit = <2400000 2500000>;
        };
 };