ipq40xx: Properly set MAC addresses for the EAP1300
authorCorey Minyard <minyard@acm.org>
Fri, 3 May 2024 13:12:38 +0000 (08:12 -0500)
committerChristian Marangi <ansuelsmth@gmail.com>
Mon, 6 May 2024 10:45:53 +0000 (12:45 +0200)
The code that was there was just taking whatever was left in the
registers, which was just wrong.  Set the addresses using the value from
the u-boot environment, the same way the OEM firmware does.

Signed-off-by: Corey Minyard <minyard@acm.org>
Link: https://github.com/openwrt/openwrt/pull/15358
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-eap1300.dts

index 3629101403e6178a33f396a614de217f8a6b90d8..bfbed30b90d4e5b40312a2c88502bb3d5255ce4a 100644 (file)
                                reg = <0x190000 0x1dc0000>;
                        };
                        partition9@1f50000 {
+                               compatible = "u-boot,env";
                                label = "u-boot-env";
                                reg = <0x01f50000 0x00010000>;
+
+                               macaddr_ubootenv_ethaddr: ethaddr {
+                                       #nvmem-cell-cells = <1>;
+                               };
                        };
                        partition10@1f60000 {
                                label = "userconfig";
 &swport5 {
        status = "okay";
        label = "lan";
+       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_ubootenv_ethaddr 0>;
 };
 
 &gmac {
 
 &wifi0 {
        status = "okay";
-       nvmem-cell-names = "pre-calibration";
-       nvmem-cells = <&precal_art_1000>;
+       nvmem-cell-names = "pre-calibration", "mac-address";
+       nvmem-cells = <&precal_art_1000>, <&macaddr_ubootenv_ethaddr 1>;
        qcom,ath10k-calibration-variant = "EnGenius-EAP1300";
 };
 
 &wifi1 {
        status = "okay";
-       nvmem-cell-names = "pre-calibration";
-       nvmem-cells = <&precal_art_5000>;
+       nvmem-cell-names = "pre-calibration", "mac-address";
+       nvmem-cells = <&precal_art_5000>, <&macaddr_ubootenv_ethaddr 2>;
        qcom,ath10k-calibration-variant = "EnGenius-EAP1300";
 };