]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: switch Netgear RTL8380 devices to NVMEM 22055/head
authorJan Hoffmann <jan@3e8.eu>
Mon, 16 Feb 2026 20:36:05 +0000 (21:36 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Fri, 20 Feb 2026 23:31:48 +0000 (00:31 +0100)
Use NVMEM in device tree to set the label and eth0 MAC address based on
the U-Boot environment.

Invididual port MAC addresses and bridge MAC are still handled in the
02_network script to maintain the current assignment.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
Link: https://github.com/openwrt/openwrt/pull/22055
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/realtek/base-files/etc/board.d/02_network
target/linux/realtek/dts/rtl8380_netgear_gigabit.dtsi

index 528ca4f342fd2b564514b7561ad7cefd345a1bdb..1d1f3e733f0d82f06d8eeb4920eb4225805c9dc8 100644 (file)
@@ -53,6 +53,11 @@ realtek_setup_macs()
 
        case $board in
        edgecore,ecs4100-12ph|\
+       netgear,gs108t-v3|\
+       netgear,gs110tpp-v1|\
+       netgear,gs110tup-v1|\
+       netgear,gs308t-v1|\
+       netgear,gs310tp-v1|\
        tplink,sg2008p-v1|\
        tplink,sg2210p-v3|\
        tplink,sg2452p-v4|\
@@ -119,11 +124,6 @@ realtek_setup_macs()
        linksys,lgs310c|\
        linksys,lgs328c|\
        linksys,lgs352c|\
-       netgear,gs108t-v3|\
-       netgear,gs110tpp-v1|\
-       netgear,gs110tup-v1|\
-       netgear,gs308t-v1|\
-       netgear,gs310tp-v1|\
        netgear,gs750e|\
        panasonic,m16eg-pn28160k|\
        panasonic,m24eg-pn28240k|\
index 662f8db652a5b9d14019fb5644d33e866f9c1003..cd48e2f14a30a9d9d7615e4c26b7e593e845701a 100644 (file)
@@ -8,6 +8,10 @@
 / {
        compatible = "realtek,rtl838x-soc";
 
+       aliases {
+               label-mac-device = &ethernet0;
+       };
+
        memory@0 {
                device_type = "memory";
                reg = <0x0 0x8000000>;
                        partition@e0000 {
                                label = "u-boot-env";
                                reg = <0x00e0000 0x0010000>;
+
+                               nvmem-layout {
+                                       compatible = "u-boot,env";
+
+                                       macaddr_ubootenv_ethaddr: ethaddr {
+                                               #nvmem-cell-cells = <1>;
+                                       };
+                               };
                        };
 
                        partition@f0000 {
        };
 };
 
+&ethernet0 {
+       nvmem-cells = <&macaddr_ubootenv_ethaddr 0>;
+       nvmem-cell-names = "mac-address";
+};
+
 &switch0 {
        ports {
                #address-cells = <1>;