]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
ipq40xx: avoid randomized MAC address on boot 22857/head
authorRosen Penev <rosenp@gmail.com>
Wed, 8 Apr 2026 21:01:36 +0000 (14:01 -0700)
committerRobert Marko <robimarko@gmail.com>
Sat, 11 Apr 2026 10:16:02 +0000 (12:16 +0200)
In cases where an nvmem definition is applied to the switch ports,
change to apply to the root gmac so that a randomized MAC address does
not get set.

Also remove the aliases. Since nvmem is used, we don't care about the
bootloader.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22857
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/ipq40xx/dts/qcom-ipq4018-a42.dts
target/linux/ipq40xx/dts/qcom-ipq4018-gl-a1300.dts
target/linux/ipq40xx/dts/qcom-ipq4018-pa1200.dts
target/linux/ipq40xx/dts/qcom-ipq4018-rt-ac58u.dts
target/linux/ipq40xx/dts/qcom-ipq4019-a62.dts
target/linux/ipq40xx/dts/qcom-ipq4019-deco-m5.dtsi
target/linux/ipq40xx/dts/qcom-ipq4019-pa2200.dts
target/linux/ipq40xx/dts/qcom-ipq4029-gl-b1300.dts

index 97b20c0fa44c975c292bf16cd0240110786271d6..f84d3c299a78c9e86de68510115b0c5c1a886a80 100644 (file)
        };
 
        aliases {
-               // TODO: Verify if the ethernet0 alias is needed
-               ethernet0 = &gmac;
                led-boot = &led_status_green;
                led-failsafe = &led_status_green;
                led-running = &led_status_green;
                led-upgrade = &led_status_green;
-               label-mac-device = &swport5;
+               label-mac-device = &gmac;
        };
 
        leds {
 
 &gmac {
        status = "okay";
+
+       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_gmac0>;
 };
 
 &switch {
 &swport5 {
        status = "okay";
        label = "ethernet1";
-
-       nvmem-cell-names = "mac-address";
-       nvmem-cells = <&macaddr_gmac0>;
 };
 
 &wifi0 {
index 7dc583b71acb71d20d95968d05d5b141a87bf37c..009d92a5bfc287c943027203c17268e149241680 100644 (file)
        compatible = "glinet,gl-a1300", "qcom,ipq4019";
 
        aliases {
-               // TODO: Verify if the ethernet0 alias is needed
-               ethernet0 = &gmac;
                led-boot = &led_run;
                led-failsafe = &led_run;
                led-running = &led_run;
                led-upgrade = &led_run;
-               label-mac-device = &swport4;
+               label-mac-device = &gmac;
        };
 
        chosen {
 
 &gmac {
        status = "okay";
+
+       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_gmac0 0>;
 };
 
 &switch {
        status = "okay";
 
        label = "lan1";
-       nvmem-cell-names = "mac-address";
-       nvmem-cells = <&macaddr_gmac0 0>;
 };
 
 &swport5 {
index abf9201f63288247aa8ac01365a9d710e7fc96e1..dc3bcca89b5446176ffc6facb91be752c5716938 100644 (file)
        };
 
        aliases {
-               // TODO: Verify if the ethernet0 alias is needed
-               ethernet0 = &gmac;
                led-boot = &led_status_purple;
                led-failsafe = &led_status_yellow;
                led-running = &led_status_cyan;
                led-upgrade = &led_status_yellow;
-               label-mac-device = &swport5;
+               label-mac-device = &gmac;
        };
 
        leds {
 
 &gmac {
        status = "okay";
+
+       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_gmac0>;
 };
 
 &switch {
 &swport5 {
        status = "okay";
        label = "ethernet1";
-
-       nvmem-cell-names = "mac-address";
-       nvmem-cells = <&macaddr_gmac0>;
 };
 
 &wifi0 {
index 1c698b4b4170f76feb3a75e44527df5e2b32f820..99b27edd626ab887d5d8b35455d95968ac14939f 100644 (file)
@@ -16,8 +16,6 @@
        };
 
        aliases {
-               // TODO: Verify if the ethernet0 alias is needed
-               ethernet0 = &gmac;
                led-boot = &led_power;
                led-failsafe = &led_power;
                led-running = &led_power;
 
 &gmac {
        status = "okay";
+
        nvmem-cells = <&macaddr_factory_5006>;
        nvmem-cell-names = "mac-address";
 };
index 686b9c01d3046bd31a0e5154accd6d1bbf8fa392..2267e39e2584d7fd8dc955d3f2e89dbf5408f64e 100644 (file)
        };
 
        aliases {
-               // TODO: Verify if the ethernet0 alias is needed
-               ethernet0 = &gmac;
                led-boot = &led_status_green;
                led-failsafe = &led_status_green;
                led-running = &led_status_green;
                led-upgrade = &led_status_green;
-               label-mac-device = &swport4;
+               label-mac-device = &gmac;
        };
 
        leds {
 
 &gmac {
        status = "okay";
+
+       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_gmac0>;
 };
 
 &switch {
 &swport4 {
        status = "okay";
        label = "ethernet1";
-
-       nvmem-cell-names = "mac-address";
-       nvmem-cells = <&macaddr_gmac0>;
 };
 
 &swport5 {
index 450eeeee29223fd69552bf5da9e06c2763061e5e..7b51ce7fb27946bc254540be0cef6a11302c1d60 100644 (file)
@@ -12,7 +12,7 @@
        };
 
        aliases {
-               label-mac-device = &swport4;
+               label-mac-device = &gmac;
        };
 
        keys {
 
 &gmac {
        status = "okay";
+
+       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_gmac0 0>;
 };
 
 &switch {
 &swport4 {
        status = "okay";
        label = "lan";
-
-       nvmem-cell-names = "mac-address";
-       nvmem-cells = <&macaddr_gmac0 0>;
 };
 
 &swport5 {
index c0a24001f3fda03fea8a586f9e877b22942f2550..3b154ad014b99fc4783edad959c4b1cd1e07327a 100644 (file)
        };
 
        aliases {
-               // TODO: Verify if the ethernet0 alias is needed
-               ethernet0 = &gmac;
                led-boot = &led_power_orange;
                led-failsafe = &led_status_blue;
                led-running = &led_power_orange;
                led-upgrade = &led_status_blue;
-               label-mac-device = &swport4;
+               label-mac-device = &gmac;
        };
 
        leds {
 
 &gmac {
        status = "okay";
+
+       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_gmac0>;
 };
 
 &switch {
 &swport4 {
        status = "okay";
        label = "ethernet1";
-
-       nvmem-cell-names = "mac-address";
-       nvmem-cells = <&macaddr_gmac0>;
 };
 
 &swport5 {
index 3f687f4de629e86b88da991b9be4b70c866d89b2..646f65102d67c5293be5db7770ebb3a5a6b39b43 100644 (file)
        compatible = "glinet,gl-b1300";
 
        aliases {
-               // TODO: Verify if the ethernet0 alias is needed
-               ethernet0 = &gmac;
                led-boot = &power;
                led-failsafe = &power;
                led-running = &power;
                led-upgrade = &power;
-               label-mac-device = &swport4;
+               label-mac-device = &gmac;
        };
 
        memory {
 
 &gmac {
        status = "okay";
+
+       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_gmac0 0>;
 };
 
 &switch {
        status = "okay";
 
        label = "lan1";
-       nvmem-cell-names = "mac-address";
-       nvmem-cells = <&macaddr_gmac0 0>;
 };
 
 &swport5 {