]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
qualcommax: ipq8072: assign NVMEM MAC addresses for Linksys MX5300 24193/head
authorJackie264 <jackie.han@gmail.com>
Mon, 13 Jul 2026 08:45:09 +0000 (08:45 +0000)
committerRobert Marko <robimarko@gmail.com>
Mon, 13 Jul 2026 09:45:11 +0000 (11:45 +0200)
While the base NVMEM cell (hw_mac_addr) is already defined in the device tree, it was not being utilized by the actual interfaces.

This patch completes the kernel-level MAC assignment by:

1. Correcting the label-mac-device alias to point to the WAN port (&swport5), ensuring the system reports the sticker MAC address correctly.
2. Assigning the base MAC address (offset 0) to the WAN port (&swport5).
3. Assigning the base MAC address (offset 1) to the LAN ports (&swport1 - &swport4).
4. Configuring the proper NVMEM cell references for the PCIe-attached QCA9984 radio (offset 2) and the built-in ATH11K radio (offset 3).

This eliminates the need for post-boot MAC address manipulation and ensures robust, predictable interface initialization.

Signed-off-by: Jackie264 <jackie.han@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24193
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/qualcommax/dts/ipq8072-mx5300.dts

index f7defd66555a97aebb6af163c6a8790eed49d8ab..ebafca39067d69975fed3b2a095df94c7819e752 100644 (file)
@@ -19,7 +19,7 @@
                led-running = &led_system_blue;
                led-failsafe = &led_system_red;
                led-upgrade = &led_system_green;
-               label-mac-device = &swport2;
+               label-mac-device = &swport5;
        };
 
        chosen {
                        phy-handle = <&qca8075_0>;
                        phy-mode = "psgmii";
                        pcs-handle = <&uniphy0 0>;
-                       nvmem-cells = <&hw_mac_addr 0>;
+                       nvmem-cells = <&hw_mac_addr 1>;
                        nvmem-cell-names = "mac-address";
                };
 
                        phy-handle = <&qca8075_1>;
                        phy-mode = "psgmii";
                        pcs-handle = <&uniphy0 1>;
-                       nvmem-cells = <&hw_mac_addr 0>;
+                       nvmem-cells = <&hw_mac_addr 1>;
                        nvmem-cell-names = "mac-address";
                };
 
                        phy-handle = <&qca8075_2>;
                        phy-mode = "psgmii";
                        pcs-handle = <&uniphy0 2>;
-                       nvmem-cells = <&hw_mac_addr 0>;
+                       nvmem-cells = <&hw_mac_addr 1>;
                        nvmem-cell-names = "mac-address";
                };
 
                        phy-handle = <&qca8075_3>;
                        phy-mode = "psgmii";
                        pcs-handle = <&uniphy0 3>;
-                       nvmem-cells = <&hw_mac_addr 0>;
+                       nvmem-cells = <&hw_mac_addr 1>;
                        nvmem-cell-names = "mac-address";
                };
 
                        reg = <0x00010000 0 0 0 0>;
 
                        qcom,ath10k-calibration-variant = "Linksys-MX5300";
-                       nvmem-cell-names = "pre-calibration";
-                       nvmem-cells = <&caldata_qca9984>;
+                       nvmem-cell-names = "pre-calibration", "mac-address";
+                       nvmem-cells = <&caldata_qca9984>, <&hw_mac_addr 2>;
                };
        };
 };
        status = "okay";
 
        qcom,ath11k-calibration-variant = "Linksys-MX5300";
+       nvmem-cells = <&hw_mac_addr 3>;
+       nvmem-cell-names = "mac-address";
 };