ramips: mt7621: convert Ubiquiti devices EEPROM to NVMEM format

-+-------------------------+-
 | Model |       NIC       |
-+-------------------------+-
 | All   | MT7603 + MT7615 |
-+-------------------------+-

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
This commit is contained in:
Shiji Yang 2024-01-16 20:57:35 +08:00 committed by Christian Marangi
parent cd9088c6f9
commit 3158a09bef
No known key found for this signature in database
GPG key ID: AC001D09ADBFEAD7
2 changed files with 36 additions and 8 deletions

View file

@ -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";
};
};

View file

@ -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";
};