]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
ath79: engenius,eXXX: use nvmem 16231/head
authorRosen Penev <rosenp@gmail.com>
Fri, 14 Jun 2024 18:30:31 +0000 (11:30 -0700)
committerRobert Marko <robimarko@gmail.com>
Fri, 24 Oct 2025 09:53:44 +0000 (11:53 +0200)
Userspace handling is deprecated.

Move calibration for pcie node out of dtsi. calibration size for ath10k
and ath9k differs.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16231
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/ath79/dts/qca9557_engenius_esr1200.dts
target/linux/ath79/dts/qca9558_engenius_epg5000.dts
target/linux/ath79/dts/qca9558_engenius_esr1750.dts
target/linux/ath79/dts/qca9558_engenius_esr900.dts
target/linux/ath79/dts/qca955x_senao_router-dual.dtsi
target/linux/ath79/generic/base-files/etc/board.d/02_network
target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh

index fd805fa13f67da4b0b1c4d7377422bd87f0f44a4..5faf3277fab74bc867975bbbbf0601b275170182 100644 (file)
        status = "okay";
 };
 
+&nvmem {
+       calibration_art_5000: calibration@5000 {
+               reg = <0x5000 0x844>;
+       };
+};
+
 &wmac {
-       nvmem-cells = <&calibration_art_1000>;
-       nvmem-cell-names = "calibration";
+       nvmem-cells = <&calibration_art_1000>, <&macaddr_uboot_eth 1>;
+       nvmem-cell-names = "calibration", "mac-address";
 };
 
-&ath10k_0 {
-       nvmem-cells = <&calibration_art_5000>;
-       nvmem-cell-names = "calibration";
+&wifi0 {
+       compatible = "qcom,ath10k";
+
+       nvmem-cells = <&calibration_art_5000>, <&macaddr_uboot_eth 0>;
+       nvmem-cell-names = "calibration", "mac-address";
 };
index 52708f3c6b20153e7e2a7e04183a1fe52d258954..560436b0df9b19058d5b46d746ffb9e6941808eb 100644 (file)
        status = "okay";
 };
 
+&nvmem {
+       calibration_art_5000: calibration@5000 {
+               reg = <0x5000 0x844>;
+       };
+};
+
 &wmac {
-       nvmem-cells = <&calibration_art_1000>;
-       nvmem-cell-names = "calibration";
+       nvmem-cells = <&calibration_art_1000>, <&macaddr_uboot_eth 1>;
+       nvmem-cell-names = "calibration", "mac-address";
 };
 
-&ath10k_0 {
-       nvmem-cells = <&calibration_art_5000>;
-       nvmem-cell-names = "calibration";
+&wifi0 {
+       compatible = "qcom,ath10k";
+
+       nvmem-cells = <&calibration_art_5000>, <&macaddr_uboot_eth 0>;
+       nvmem-cell-names = "calibration", "mac-address";
 };
index 0aae9b5187c2e4549140131248152c7f940cc066..52075d248133294bc521a11b2bc6d1677800096c 100644 (file)
        status = "okay";
 };
 
+&nvmem {
+       calibration_art_5000: calibration@5000 {
+               reg = <0x5000 0x844>;
+       };
+};
+
 &wmac {
-       nvmem-cells = <&calibration_art_1000>;
-       nvmem-cell-names = "calibration";
+       nvmem-cells = <&calibration_art_1000>, <&macaddr_uboot_eth 1>;
+       nvmem-cell-names = "calibration", "mac-address";
 };
 
-&ath10k_0 {
-       nvmem-cells = <&calibration_art_5000>;
-       nvmem-cell-names = "calibration";
+&wifi0 {
+       compatible = "qcom,ath10k";
+
+       nvmem-cells = <&calibration_art_5000>, <&macaddr_uboot_eth 0>;
+       nvmem-cell-names = "calibration", "mac-address";
 };
index 39a0790f121e15997b447ba7d520c42d87a59c92..9ceacb0199b0d3f5bf475edf11a4ed7403d3d7c2 100644 (file)
        status = "okay";
 };
 
+&nvmem {
+       calibration_art_5000: calibration@5000 {
+               reg = <0x5000 0x440>;
+       };
+};
+
 &wmac {
-       nvmem-cells = <&calibration_art_1000>;
-       nvmem-cell-names = "calibration";
+       nvmem-cells = <&calibration_art_1000>, <&macaddr_uboot_eth 0>;
+       nvmem-cell-names = "calibration", "mac-address";
 };
 
-&pcie0 {
-       status = "okay";
+&wifi0 {
+       compatible = "pci168c,0033";
 
-       wifi@0,0 {
-               compatible = "pci168c,0033";
-               reg = <0x0000 0 0 0 0>;
-               nvmem-cells = <&calibration_art_5000>;
-               nvmem-cell-names = "calibration";
-       };
+       nvmem-cells = <&calibration_art_5000>, <&macaddr_uboot_eth 1>;
+       nvmem-cell-names = "calibration", "mac-address";
 };
index ece2f5d6fba43481b2fd6cc95ef6a0264d37f2d7..b8680772ce11247162d8231b639973900e90c3b0 100644 (file)
@@ -30,6 +30,9 @@
 
        phy-handle = <&phy0>;
        pll-data = <0xa6000000 0x00000101 0x00001616>;
+
+       nvmem-cells = <&macaddr_uboot_eth 0>;
+       nvmem-cell-names = "mac-address";
 };
 
 &mdio0 {
@@ -43,8 +46,7 @@
 &pcie0 {
        status = "okay";
 
-       ath10k_0: wifi@0,0 {
-               compatible = "qcom,ath10k";
+       wifi0: wifi@0,0 {
                reg = <0x0000 0 0 0 0>;
        };
 };
                                label = "u-boot-env";
                                reg = <0x030000 0x010000>;
                                read-only;
+
+                               nvmem-layout {
+                                       compatible = "u-boot,env";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       macaddr_uboot_eth: ethaddr {
+                                               #nvmem-cell-cells = <1>;
+                                       };
+                               };
                        };
 
                        partition@40000 {
                                reg = <0xff0000 0x010000>;
                                read-only;
 
-                               nvmem-layout {
+                               nvmem: nvmem-layout {
                                        compatible = "fixed-layout";
                                        #address-cells = <1>;
                                        #size-cells = <1>;
                                        calibration_art_1000: calibration@1000 {
                                                reg = <0x1000 0x440>;
                                        };
-
-                                       calibration_art_5000: calibration@5000 {
-                                               reg = <0x5000 0x844>;
-                                       };
                                };
                        };
                };
index 48787f0f9bc6fee44b43affb6471f81100acc9fc..f01da50c0847c1150d82dc22883bb2244368e417 100644 (file)
@@ -737,7 +737,6 @@ ath79_setup_macs()
        engenius,esr1200|\
        engenius,esr1750|\
        engenius,esr900)
-               lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
                wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
                ;;
        engenius,ews511ap)
index ed8cc44783167c03edb67c0943cc4b58908796cc..291241b6ee3dc7618435c66ea2ee717dbf4a6b1b 100644 (file)
@@ -52,12 +52,6 @@ case "$board" in
                [ "$PHYNBR" -eq 0 ] && \
                        mtd_get_mac_ascii u-boot-env athaddr > /sys${DEVPATH}/macaddress
                ;;
-       engenius,epg5000|\
-       engenius,esr1200|\
-       engenius,esr1750|\
-       engenius,esr900)
-               macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" "$PHYNBR" > /sys${DEVPATH}/macaddress
-               ;;
        engenius,ews511ap)
                [ "$PHYNBR" -eq 0 ] && \
                macaddr_add $(cat /sys/class/net/eth0/address) 1 > /sys${DEVPATH}/macaddress
index 4b6cb7b6ede0fddc7e0f7440f4beab9d0962d61d..1126a1eefc0205e60834122d8d2a9057dc531bf5 100644 (file)
@@ -12,12 +12,6 @@ preinit_set_mac_address() {
                ip link set dev eth0 address $(mtd_get_mac_ascii bdcfg "lanmac")
                ip link set dev eth1 address $(mtd_get_mac_ascii bdcfg "wanmac")
                ;;
-       engenius,epg5000|\
-       engenius,esr1200|\
-       engenius,esr1750|\
-       engenius,esr900)
-               ip link set dev eth0 address $(mtd_get_mac_ascii u-boot-env ethaddr)
-               ;;
        siemens,ws-ap3610)
                ip link set dev eth0 address $(mtd_get_mac_ascii cfg1 ethaddr)
                ;;