]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
mediatek: predator-w6x: set MAC in NVMEM main master 23764/head
authorRosen Penev <rosenp@gmail.com>
Wed, 29 Apr 2026 20:52:15 +0000 (13:52 -0700)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Tue, 16 Jun 2026 07:47:22 +0000 (09:47 +0200)
Userspace handling is deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23764
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
target/linux/mediatek/dts/mt7986a-acer-predator-w6x-stock.dts
target/linux/mediatek/dts/mt7986a-acer-predator-w6x-ubootmod.dts
target/linux/mediatek/dts/mt7986a-acer-predator-w6x.dtsi
target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh

index 68b3481dd83144fee1cbf54a05109ffa02af2a04..7c5c89b0a520fc81d3f96ee73d204aff14970942 100644 (file)
        partition@800000 {
                label = "ubi";
                reg = <0x800000 0x6400000>;
        partition@800000 {
                label = "ubi";
                reg = <0x800000 0x6400000>;
+
+               volumes {
+                       ubi-volume-ubootenv {
+                               volname = "ubootenv";
+
+                               nvmem-layout {
+                                       compatible = "u-boot,env-redundant-bool";
+
+                                       macaddr_uboot_ethaddr: ethaddr {
+                                               #nvmem-cell-cells = <1>;
+                                       };
+                               };
+                       };
+               };
        };
 
        partition@6C00000 {
        };
 
        partition@6C00000 {
index e7920f515dd3c1966e7ed8b007ab9defb1dae6d9..851dbb80caf1cc039fafb343392250f81d161b76 100644 (file)
                        ubi_rootdisk: ubi-volume-fit {
                                volname = "fit";
                        };
                        ubi_rootdisk: ubi-volume-fit {
                                volname = "fit";
                        };
+
+                       ubi-volume-ubootenv {
+                               volname = "ubootenv";
+
+                               nvmem-layout {
+                                       compatible = "u-boot,env-redundant-bool";
+
+                                       macaddr_uboot_ethaddr: ethaddr {
+                                               #nvmem-cell-cells = <1>;
+                                       };
+                               };
+                       };
                };
        };
 };
                };
        };
 };
index 1d299b70e13f37dba33e5c7a5498788148b2731a..fb5b5d63c21bc39dd619c76a9e592a8f16ac100b 100644 (file)
@@ -77,6 +77,9 @@
                reg = <0>;
                phy-mode = "2500base-x";
 
                reg = <0>;
                phy-mode = "2500base-x";
 
+               nvmem-cells = <&macaddr_uboot_ethaddr 1>;
+               nvmem-cell-names = "mac-address";
+
                fixed-link {
                        speed = <2500>;
                        full-duplex;
                fixed-link {
                        speed = <2500>;
                        full-duplex;
@@ -88,6 +91,9 @@
                reg = <1>;
                phy-mode = "2500base-x";
                phy-handle = <&phy6>;
                reg = <1>;
                phy-mode = "2500base-x";
                phy-handle = <&phy6>;
+
+               nvmem-cells = <&macaddr_uboot_ethaddr 0>;
+               nvmem-cell-names = "mac-address";
        };
 
        mdio-bus {
        };
 
        mdio-bus {
index 0d4c165e48539429dfca9e076316c01da678d711..ead84eca2657769685e06f1e7a8a3cdf9e7280de 100644 (file)
@@ -12,16 +12,6 @@ preinit_set_mac_address() {
                ip link set dev game address "$lan_mac"
                ip link set dev eth1 address "$wan_mac"
                ;;
                ip link set dev game address "$lan_mac"
                ip link set dev eth1 address "$wan_mac"
                ;;
-       acer,predator-w6x-stock|\
-       acer,predator-w6x-ubootmod)
-               wan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
-               lan_mac=$(macaddr_add "$wan_mac" 1)
-               ip link set dev lan1 address "$lan_mac"
-               ip link set dev lan2 address "$lan_mac"
-               ip link set dev lan3 address "$lan_mac"
-               ip link set dev lan4 address "$lan_mac"
-               ip link set dev eth1 address "$wan_mac"
-               ;;
        acer,vero-w6m)
                wan_mac=$(mmc_get_mac_ascii u-boot-env WANMAC)
                lan_mac=$(mmc_get_mac_ascii u-boot-env LANMAC)
        acer,vero-w6m)
                wan_mac=$(mmc_get_mac_ascii u-boot-env WANMAC)
                lan_mac=$(mmc_get_mac_ascii u-boot-env LANMAC)