From: Shiji Yang Date: Tue, 16 Jan 2024 12:21:35 +0000 (+0800) Subject: ramips: mt7621: convert Xiaomi devices EEPROM to NVMEM format X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=afc390a69f33e9d1273e12e3c1bad4500cc2ccb3;p=openwrt%2Fstaging%2Fjow.git ramips: mt7621: convert Xiaomi devices EEPROM to NVMEM format -+---------------------------+- | Model | NIC | -+---------------------------+- | AC2100 | MT7603 + MT7615 | -+---------------------------+- | MI4A V2 | MT7603 + MT7613 | -+---------------------------+- | Others | MT7603 + MT7612 | -+---------------------------+- Signed-off-by: Shiji Yang --- diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g.dts b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g.dts index 763973a193..bd8400c898 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g.dts @@ -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>; }; }; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4.dts b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4.dts index 8340ca5d28..a9b62b1b28 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4.dts @@ -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>; }; }; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-3g-v2.dtsi b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-3g-v2.dtsi index d05872337b..8f88eb175d 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-3g-v2.dtsi +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-3g-v2.dtsi @@ -23,12 +23,14 @@ }; &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>; }; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-common.dtsi b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-common.dtsi index 7ce9aea335..7b8c4e8dfd 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-common.dtsi +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-common.dtsi @@ -70,6 +70,14 @@ #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>; }; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-gigabit-v2.dts b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-gigabit-v2.dts index 67ff6ea11e..719d430fd8 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-gigabit-v2.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-gigabit-v2.dts @@ -35,6 +35,11 @@ }; }; +/* override EEPROM size to 0x4da8 for MT7613 */ +&eeprom_factory_8000 { + reg = <0x8000 0x4da8>; +}; + &partitions { partition@180000 { // size changed against to the common dtsi @@ -49,12 +54,14 @@ }; &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>; }; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_nand_128m.dtsi b/target/linux/ramips/dts/mt7621_xiaomi_nand_128m.dtsi index 1dc91d8b47..3a877e9bec 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_nand_128m.dtsi +++ b/target/linux/ramips/dts/mt7621_xiaomi_nand_128m.dtsi @@ -56,6 +56,14 @@ #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>; }; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_router-ac2100.dtsi b/target/linux/ramips/dts/mt7621_xiaomi_router-ac2100.dtsi index c7d6c574aa..468f9456bf 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_router-ac2100.dtsi +++ b/target/linux/ramips/dts/mt7621_xiaomi_router-ac2100.dtsi @@ -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>; }; };