ramips: iptime,t5004: use nvmem for ubootenv

Userspace handling is deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/14182
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
Rosen Penev 2024-06-12 14:03:49 -07:00 committed by Robert Marko
parent 65f2b060a3
commit 8dd95cc6b5
2 changed files with 17 additions and 4 deletions

View file

@ -55,6 +55,15 @@
partition@80000 {
label = "u-boot-env";
reg = <0x80000 0xc0000>;
nvmem-layout {
compatible = "u-boot,env";
env-size = <0x1000>;
macaddr_uboot_ethaddr: ethaddr {
#nvmem-cell-cells = <1>;
};
};
};
partition@140000 {
@ -85,10 +94,18 @@
};
};
&gmac0 {
nvmem-cells = <&macaddr_uboot_ethaddr 0>;
nvmem-cell-names = "mac-address";
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
nvmem-cells = <&macaddr_uboot_ethaddr 1>;
nvmem-cell-names = "mac-address";
};
&ethphy0 {

View file

@ -274,10 +274,6 @@ ramips_setup_macs()
wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
label_mac=$wan_mac
;;
iptime,t5004)
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
wan_mac=$(macaddr_add "$lan_mac" 1)
;;
jdcloud,re-sp-01b)
lan_mac=$(mtd_get_mac_ascii config mac)
wan_mac=$lan_mac