]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
ramips: h3x,tx180x: use nvmem for uboot-env
authorRosen Penev <rosenp@gmail.com>
Wed, 12 Jun 2024 20:57:58 +0000 (13:57 -0700)
committerRobert Marko <robimarko@gmail.com>
Sat, 14 Mar 2026 20:34:29 +0000 (21:34 +0100)
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>
target/linux/ramips/dts/mt7621_h3c_tx180x.dtsi
target/linux/ramips/mt7621/base-files/etc/board.d/02_network

index 1520aaf5b10da8e8cc45dfea9523fe45de0d419c..31347723cf25dd96106a97705178588fb72fba3e 100644 (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;
        };
 };
 
+&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 {
                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 {
index 18e979df614f89118c672f6259126a79c54d9444..493811893b070af10fdadb00e2f5e51981d54bca 100644 (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