mediatek: convert cmcc a10 eeprom to nvmem format

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2024-09-12 21:27:36 +08:00
parent f921d645cc
commit ab175b2985
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
4 changed files with 17 additions and 6 deletions

View File

@ -243,7 +243,6 @@
nvmem-cell-names = "mac-address";
};
band@1 {
reg = <1>;
nvmem-cells = <&macaddr_art_0 2>;

View File

@ -144,6 +144,16 @@
#address-cells = <1>;
#size-cells = <1>;
eeprom_factory_0: eeprom@0 {
reg = <0x0 0x1000>;
};
macaddr_factory_a: macaddr@a {
compatible = "mac-base";
reg = <0xa 0x6>;
#nvmem-cell-cells = <1>;
};
macaddr_factory_24: macaddr@24 {
compatible = "mac-base";
reg = <0x24 0x6>;
@ -243,7 +253,13 @@
};
&wifi {
nvmem-cells = <&eeprom_factory_0>;
nvmem-cell-names = "eeprom";
status = "okay";
mediatek,mtd-eeprom = <&factory 0x0>;
band@1 {
reg = <1>;
nvmem-cells = <&macaddr_factory_a 0>;
nvmem-cell-names = "mac-address";
};
};

View File

@ -266,7 +266,6 @@
nvmem-cell-names = "mac-address";
};
band@1 {
reg = <1>;
nvmem-cells = <&macaddr_factory_2a 2>;

View File

@ -56,9 +56,6 @@ case "$board" in
[ "$PHYNBR" = "0" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "1" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
;;
cmcc,a10-ubootmod)
[ "$PHYNBR" = "1" ] && mtd_get_mac_binary Factory 0xa > /sys${DEVPATH}/macaddress
;;
cmcc,rax3000m)
addr=$(cat /sys/class/net/eth0/address)
[ "$PHYNBR" = "1" ] && macaddr_add $addr -1 > /sys${DEVPATH}/macaddress