ramips: mt7621: convert Linksys devices EEPROM to NVMEM format
authorShiji Yang <yangshiji66@qq.com>
Tue, 16 Jan 2024 13:41:40 +0000 (21:41 +0800)
committerChristian Marangi <ansuelsmth@gmail.com>
Wed, 17 Jan 2024 00:14:50 +0000 (01:14 +0100)
-+-----------------------------+-
 |    Model   |       NIC      |
-+-----------------------------+-
 | EA6350 v4 | MT7603 + MT7613 |
-+-----------------------------+-
 | EA7300 v2 | MT7603 + MT7615 |
-+-----------------------------+-
 |  Others   |    MT7615 *2    |
-+-----------------------------+-

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
target/linux/ramips/dts/mt7621_linksys_ea6350-v4.dts
target/linux/ramips/dts/mt7621_linksys_ea7300-v2.dts
target/linux/ramips/dts/mt7621_linksys_ea7xxx.dtsi

index 71e8dcedbf0cfc22716a49f907fd915616e71239..35a90ea07059f69edd3eaf0f6334daab78bed886 100644 (file)
@@ -7,6 +7,11 @@
        model = "Linksys EA6350 v4";
 };
 
+/* override EEPROM size to 0x400 for MT7603 */
+&eeprom_factory_0 {
+       reg = <0x0 0x400>;
+};
+
 &gmac1 {
        phy-handle = <&ethphy4>;
 };
index 4ee148828a8eb808d29846e5518fba918dc9f84e..e3336c1dbb5e768bd29e52dca7f0f5335c56f733 100644 (file)
@@ -6,3 +6,8 @@
        compatible = "linksys,ea7300-v2", "mediatek,mt7621-soc";
        model = "Linksys EA7300 v2";
 };
+
+/* override EEPROM size to 0x400 for MT7603 */
+&eeprom_factory_0 {
+       reg = <0x0 0x400>;
+};
index 4663d873fe95b7ba062e213ec1216ab3b34b0c2c..4980b4fe9b4a774c0c3d2acb121f34581352ff26 100644 (file)
                        label = "factory";
                        reg = <0xc0000 0x40000>;
                        read-only;
+
+                       nvmem-layout {
+                               compatible = "fixed-layout";
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+
+                               eeprom_factory_0: eeprom@0 {
+                                       reg = <0x0 0x4da8>;
+                               };
+
+                               eeprom_factory_8000: eeprom@8000 {
+                                       reg = <0x8000 0x4da8>;
+                               };
+                       };
                };
 
                partition@100000 {
        mt76@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";
        };
 };
 
        mt76@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";
        };
 };