ramips: h3x,tx180x: use nvmem for uboot-env

Removes deprecated userspace handling.

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 13:57:58 -07:00 committed by Robert Marko
parent f2699cce13
commit 65f2b060a3
2 changed files with 18 additions and 7 deletions

View file

@ -8,6 +8,7 @@
/ {
aliases {
label-mac-device = &gmac1;
led-boot = &led_status_amber;
led-failsafe = &led_status_green;
led-running = &led_status_green;
@ -52,10 +53,18 @@
};
};
&gmac0 {
nvmem-cells = <&macaddr_uboot_ethaddr 1>;
nvmem-cell-names = "mac-address";
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
nvmem-cells = <&macaddr_uboot_ethaddr 0>;
nvmem-cell-names = "mac-address";
};
&ethphy4 {
@ -84,6 +93,15 @@
partition@80000 {
label = "u-boot-env";
reg = <0x0080000 0x0080000>;
nvmem-layout {
compatible = "u-boot,env";
env-size = <0x20000>;
macaddr_uboot_ethaddr: ethaddr {
#nvmem-cell-cells = <1>;
};
};
};
partition@100000 {

View file

@ -270,13 +270,6 @@ ramips_setup_macs()
wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
label_mac=$wan_mac
;;
h3c,tx1800-plus|\
h3c,tx1801-plus|\
h3c,tx1806)
label_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
lan_mac=$(macaddr_add "$label_mac" 1)
wan_mac=$label_mac
;;
iodata,wnpr2600g)
wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
label_mac=$wan_mac