ramips: zyxel wsm20: set mac address in dts

Support in mt76 has existed for quite a while. Use it.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19799
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
Rosen Penev 2025-08-13 17:22:35 -07:00 committed by Hauke Mehrtens
parent 41106141b8
commit 749fa79e01
2 changed files with 18 additions and 6 deletions

View File

@ -121,7 +121,9 @@
};
macaddr_factory_1fdfa: macaddr@1fdfa {
compatible = "mac-base";
reg = <0x1fdfa 0x6>;
#nvmem-cell-cells = <1>;
};
macaddr_factory_1fdf4: macaddr@1fdf4 {
@ -180,7 +182,7 @@
};
&gmac0 {
nvmem-cells = <&macaddr_factory_1fdfa>;
nvmem-cells = <&macaddr_factory_1fdfa 0>;
nvmem-cell-names = "mac-address";
};
@ -208,6 +210,21 @@
nvmem-cells = <&eeprom_factory_0>, <&precal_factory_e10>;
nvmem-cell-names = "eeprom", "precal";
mediatek,disable-radar-background;
#address-cells = <1>;
#size-cells = <0>;
band@0 {
reg = <0>;
nvmem-cells = <&macaddr_factory_1fdfa 1>;
nvmem-cell-names = "mac-address";
};
band@1 {
reg = <1>;
nvmem-cells = <&macaddr_factory_1fdfa 2>;
nvmem-cell-names = "mac-address";
};
};
};

View File

@ -245,9 +245,4 @@ case "$board" in
[ "$PHYNBR" = "0" ] && macaddr_setbit_la "$hw_mac_addr" > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "1" ] && echo -n "$hw_mac_addr" > /sys${DEVPATH}/macaddress
;;
zyxel,wsm20)
hw_mac_addr="$(mtd_get_mac_binary Factory 0x1fdfa)"
[ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress
;;
esac