From: Shiji Yang Date: Tue, 16 Jan 2024 12:57:35 +0000 (+0800) Subject: ramips: mt7621: convert Ubiquiti devices EEPROM to NVMEM format X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3158a09bef69d6f63bdcbcb69f9a3fcaad1300cd;p=openwrt%2Fstaging%2Fblocktrron.git ramips: mt7621: convert Ubiquiti devices EEPROM to NVMEM format -+-------------------------+- | Model | NIC | -+-------------------------+- | All | MT7603 + MT7615 | -+-------------------------+- Signed-off-by: Shiji Yang --- diff --git a/target/linux/ramips/dts/mt7621_ubnt_unifi-flexhd.dts b/target/linux/ramips/dts/mt7621_ubnt_unifi-flexhd.dts index 36df3ef883..d458b91ca6 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_unifi-flexhd.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_unifi-flexhd.dts @@ -61,6 +61,20 @@ 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 { @@ -128,22 +142,20 @@ &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"; }; }; diff --git a/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts b/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts index b4000464f7..d81a23852d 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts @@ -36,6 +36,20 @@ 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 { @@ -86,9 +100,11 @@ }; &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"; };