ipq40xx: nvmem cells for EZVIZ CS-W3-WD1200G EUP
authorChristian Lamparter <chunkeey@gmail.com>
Sat, 27 Nov 2021 22:06:13 +0000 (23:06 +0100)
committerChristian Lamparter <chunkeey@gmail.com>
Fri, 3 Dec 2021 23:36:47 +0000 (00:36 +0100)
introduce nvmem pre-cal + mac-address cells for both Wifis
and ethernet on the EZVIZ CS-W3-WD1200G EUP. This is one of
the few devices in which the correct mac adress is already
at the right place for Wifi, so no separate nvmem cell is
needed.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts

index 8924fb3258fae652b26d033de901d806d0a8e279..d368475ffc4e8343ae39b876ffcce2f05498ab3c 100644 (file)
@@ -64,7 +64,6 @@ case "$FIRMWARE" in
        8dev,jalapeno |\
        alfa-network,ap120c-ac |\
        cilab,meshpoint-one |\
-       ezviz,cs-w3-wd1200g-eup |\
        glinet,gl-ap1300 |\
        glinet,gl-b1300 |\
        glinet,gl-b2200 |\
@@ -187,7 +186,6 @@ case "$FIRMWARE" in
        8dev,jalapeno |\
        alfa-network,ap120c-ac |\
        cilab,meshpoint-one |\
-       ezviz,cs-w3-wd1200g-eup |\
        glinet,gl-ap1300 |\
        glinet,gl-b1300 |\
        glinet,gl-b2200 |\
index 1b8454e4c5fc8993d47dacc40c3de9d3eb0a1690..d1fcd804d9540cfe00e75eed7f26a3095650fad4 100644 (file)
@@ -7,10 +7,6 @@ preinit_set_mac_address() {
                ip link set dev eth0 address $(macaddr_add "$base_mac" 1)
                ip link set dev eth1 address $(macaddr_add "$base_mac" 3)
                ;;
-       ezviz,cs-w3-wd1200g-eup)
-               ip link set dev eth0 address $(mtd_get_mac_binary "ART" 0x6)
-               ip link set dev eth1 address $(mtd_get_mac_binary "ART" 0x0)
-               ;;
        engenius,eap2200)
                base_mac=$(cat /sys/class/net/eth0/address)
                ip link set dev eth1 address $(macaddr_add "$base_mac" 1)
index 062826c7a43f0f3f8ae5991801614ad762bdff21..52311755b743f96ef07a8eaea7ec10bb82c5a10f 100644 (file)
                                label = "ART";
                                reg = <0x00170000 0x00010000>;
                                read-only;
+
+                               compatible = "nvmem-cells";
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+
+                               macaddr_art_0: macaddr@0 {
+                                       reg = <0x0 0x6>;
+                               };
+
+                               macaddr_art_6: macaddr@6 {
+                                       reg = <0x6 0x6>;
+                               };
+
+                               precal_art_1000: precal@1000 {
+                                       reg = <0x1000 0x2f20>;
+                               };
+
+                               precal_art_5000: precal@5000 {
+                                       reg = <0x5000 0x2f20>;
+                               };
                        };
 
                        partition9@580000 {
 &wifi0 {
        status = "okay";
        qcom,ath10k-calibration-variant = "ezviz-cs-w3-wd1200g-eup";
+       nvmem-cell-names = "pre-calibration";
+       nvmem-cells = <&precal_art_1000>;
 };
 
 &wifi1 {
        status = "okay";
        qcom,ath10k-calibration-variant = "ezviz-cs-w3-wd1200g-eup";
+       nvmem-cell-names = "pre-calibration";
+       nvmem-cells = <&precal_art_5000>;
+};
+
+&gmac0 {
+       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_art_6>;
+};
+
+&gmac1 {
+       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_art_0>;
 };