]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
ramips: elecom,wrc-2533ghbk: use nvmem for mac addresses 14182/head
authorRosen Penev <rosenp@gmail.com>
Wed, 11 Mar 2026 05:14:32 +0000 (22:14 -0700)
committerRobert Marko <robimarko@gmail.com>
Sat, 14 Mar 2026 20:34:29 +0000 (21:34 +0100)
Userspace handling is deprecated.

Since the u-boot ethaddr variable is quoted, we cannot use it.

Use mac-base instead to specify in dts.

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_elecom_wrc-2533ghbk.dtsi
target/linux/ramips/mt7621/base-files/etc/board.d/02_network

index cdb94dcdc1b516a97da857145357ac1c0c47e6f4..545a2031b8f725de34851953222139c0ba7bbe1f 100644 (file)
@@ -12,6 +12,7 @@
                led-failsafe = &led_power;
                led-running = &led_power;
                led-upgrade = &led_power;
+               label-mac-device = &gmac1;
        };
 
        leds {
                                                reg = <0x0 0x4da8>;
                                        };
 
+                                       macaddr_factory_4: mac-address@4 {
+                                               compatible = "mac-base";
+                                               reg = <0x4 0x6>;
+                                               #nvmem-cell-cells = <1>;
+                                       };
+
                                        eeprom_factory_8000: eeprom@8000 {
                                                reg = <0x8000 0x4da8>;
                                        };
        };
 };
 
+&gmac0 {
+       nvmem-cells = <&eeprom_factory_0 (-1)>;
+       nvmem-cell-names = "mac-address";
+};
+
 &gmac1 {
        status = "okay";
        label = "wan";
        phy-handle = <&ethphy0>;
+
+       nvmem-cells = <&eeprom_factory_0 (-2)>;
+       nvmem-cell-names = "mac-address";
 };
 
 &ethphy0 {
index c16196e1c09f193d65efc58a688810b35bb338ab..25a8beecfee35d948478508cb2c99ccbd67b5d74 100644 (file)
@@ -263,12 +263,6 @@ ramips_setup_macs()
        edimax,rg21s)
                wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
                ;;
-       elecom,wrc-2533ghbk2-t|\
-       elecom,wrc-2533ghbk-i)
-               lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
-               wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
-               label_mac=$wan_mac
-               ;;
        iodata,wnpr2600g)
                wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
                label_mac=$wan_mac