ath79: WNDR3700/3800/MAC: utilize nvmem for caldata fetching
authorChristian Lamparter <chunkeey@gmail.com>
Fri, 5 Nov 2021 21:50:45 +0000 (22:50 +0100)
committerChristian Lamparter <chunkeey@gmail.com>
Sat, 6 Nov 2021 21:18:45 +0000 (22:18 +0100)
converts the still popular WNDR3700 Series to fetch the
caldata through nvmem. As the "MAC with NVMEM" has shown,
there could pitfalls along the way.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
target/linux/ath79/dts/ar7161_netgear_wndr.dtsi
target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts
target/linux/ath79/dts/ar7161_netgear_wndr3700.dts
target/linux/ath79/dts/ar7161_netgear_wndr3800.dts
target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts
target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts
target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts
target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom

index 414d5e6d992978699c6fb6c2242a8b5595247ab8..afbccb801694587a95c13c33383c00198dd57213 100644 (file)
                compatible = "pci168c,0029";
                reg = <0x8800 0 0 0 0>;
 
-               qca,no-eeprom;
                #gpio-cells = <2>;
                gpio-controller;
 
                compatible = "pci168c,0029";
                reg = <0x9000 0 0 0 0>;
 
-               qca,no-eeprom;
                #gpio-cells = <2>;
                gpio-controller;
        };
index 0a133ce52ee454f5c5f1ec668bc3decc2df867c8..351d5e03647eeae6c5650446d913dc34c9ede94c 100644 (file)
 };
 
 &ath9k0 {
-       nvmem-cells = <&macaddr_art_c>;
-       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_art_c>, <&cal_art_1000>;
+       nvmem-cell-names = "mac-address", "calibration";
 };
 
 &ath9k1 {
-       nvmem-cells = <&macaddr_art_0>;
-       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_art_0>, <&cal_art_5000>;
+       nvmem-cell-names = "mac-address", "calibration";
 };
 
 &eth0 {
        macaddr_art_c: macaddr@c {
                reg = <0xc 0x6>;
        };
+
+       cal_art_1000: cal@1000 {
+               reg = <0x1000 0xeb8>;
+       };
+
+       cal_art_5000: cal@5000 {
+               reg = <0x5000 0xeb8>;
+       };
 };
index 99bc5f56bb58bf524ff6e236e8b5f6a0617c441d..eedd375cc9f32b377cf321e44c453d4f328d5e26 100644 (file)
 };
 
 &ath9k0 {
-       nvmem-cells = <&macaddr_art_c>;
-       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_art_c>, <&cal_art_1000>;
+       nvmem-cell-names = "mac-address", "calibration";
 };
 
 &ath9k1 {
-       nvmem-cells = <&macaddr_art_0>;
-       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_art_0>, <&cal_art_5000>;
+       nvmem-cell-names = "mac-address", "calibration";
 
        /* The original WNDR3700(v1) variant have four antennae dedicated
         * to the 5GHz radio as well. Again, two antennae are available for
        macaddr_art_c: macaddr@c {
                reg = <0xc 0x6>;
        };
+
+       cal_art_1000: cal@1000 {
+               reg = <0x1000 0xeb8>;
+       };
+
+       cal_art_5000: cal@5000 {
+               reg = <0x5000 0xeb8>;
+       };
 };
index 0ad5c9d0e8ede8313af9cbc470ab17eac40fb97b..487b00b0dd0c697a665274c22bb05fe1cb09c9d4 100644 (file)
 };
 
 &ath9k0 {
-       nvmem-cells = <&macaddr_art_c>;
-       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_art_c>, <&cal_art_1000>;
+       nvmem-cell-names = "mac-address", "calibration";
 };
 
 &ath9k1 {
-       nvmem-cells = <&macaddr_art_0>;
-       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_art_0>, <&cal_art_5000>;
+       nvmem-cell-names = "mac-address", "calibration";
 };
 
 &eth0 {
        macaddr_art_c: macaddr@c {
                reg = <0xc 0x6>;
        };
+
+       cal_art_1000: cal@1000 {
+               reg = <0x1000 0xeb8>;
+       };
+
+       cal_art_5000: cal@5000 {
+               reg = <0x5000 0xeb8>;
+       };
 };
index be997211a9b8a2199c898a2873e5ba31e59b4276..0c2eadae5c18bca0f5baae8f2f4671ab719d2367 100644 (file)
 };
 
 &ath9k0 {
-       nvmem-cells = <&macaddr_art_c>;
-       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_art_c>, <&cal_art_1000>;
+       nvmem-cell-names = "mac-address", "calibration";
 };
 
 &ath9k1 {
-       nvmem-cells = <&macaddr_art_0>;
-       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_art_0>, <&cal_art_5000>;
+       nvmem-cell-names = "mac-address", "calibration";
 };
 
 &eth0 {
        macaddr_art_c: macaddr@c {
                reg = <0xc 0x6>;
        };
+
+       cal_art_1000: cal@1000 {
+               reg = <0x1000 0xeb8>;
+       };
+
+       cal_art_5000: cal@5000 {
+               reg = <0x5000 0xeb8>;
+       };
 };
index fa0f40c424d43ad46a277d29f5ffc33bf5fd36d2..88c3170c6e8d7d3e3e50c8244a279bd54226c82a 100644 (file)
 };
 
 &ath9k0 {
-       nvmem-cells = <&macaddr_art_c>;
-       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_art_c>, <&cal_art_1000>;
+       nvmem-cell-names = "mac-address", "calibration";
 };
 
 &ath9k1 {
-       nvmem-cells = <&macaddr_art_0>;
-       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_art_0>, <&cal_art_5000>;
+       nvmem-cell-names = "mac-address", "calibration";
 };
 
 &eth0 {
        macaddr_art_c: macaddr@c {
                reg = <0xc 0x6>;
        };
+
+       cal_art_1000: cal@1000 {
+               reg = <0x1000 0xeb8>;
+       };
+
+       cal_art_5000: cal@5000 {
+               reg = <0x5000 0xeb8>;
+       };
 };
index ba96eba2629f3b240a08487301cfe02db5448f2f..0536ecb05332017ec13e874026d7f757a0107f62 100644 (file)
 };
 
 &ath9k0 {
-       nvmem-cells = <&macaddr_art_c>;
-       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_art_c>, <&cal_art_1000>;
+       nvmem-cell-names = "mac-address", "calibration";
 };
 
 &ath9k1 {
-       nvmem-cells = <&macaddr_art_0>;
-       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_art_0>, <&cal_art_5000>;
+       nvmem-cell-names = "mac-address", "calibration";
 };
 
 &eth0 {
        macaddr_art_c: macaddr@c {
                reg = <0xc 0x6>;
        };
+
+       cal_art_1000: cal@1000 {
+               reg = <0x1000 0xeb8>;
+       };
+
+       cal_art_5000: cal@5000 {
+               reg = <0x5000 0xeb8>;
+       };
 };
index 3e02b066a98b90f35ed75309306d5c1be8b73547..9a3054e2765efd90c2a3d576681e93bc802305bf 100644 (file)
@@ -146,13 +146,7 @@ case "$FIRMWARE" in
 "ath9k-eeprom-pci-0000:00:11.0.bin")
        case $board in
        buffalo,wzr-600dhp|\
-       buffalo,wzr-hp-ag300h|\
-       netgear,wndr3700|\
-       netgear,wndr3700-v2|\
-       netgear,wndr3800|\
-       netgear,wndr3800ch|\
-       netgear,wndrmac-v1|\
-       netgear,wndrmac-v2)
+       buffalo,wzr-hp-ag300h)
                caldata_extract "art" 0x1000 0xeb8
                ;;
        dlink,dir-825-b1)
@@ -170,13 +164,7 @@ case "$FIRMWARE" in
 "ath9k-eeprom-pci-0000:00:12.0.bin")
        case $board in
        buffalo,wzr-600dhp|\
-       buffalo,wzr-hp-ag300h|\
-       netgear,wndr3700|\
-       netgear,wndr3700-v2|\
-       netgear,wndr3800|\
-       netgear,wndr3800ch|\
-       netgear,wndrmac-v1|\
-       netgear,wndrmac-v2)
+       buffalo,wzr-hp-ag300h)
                caldata_extract "art" 0x5000 0xeb8
                ;;
        dlink,dir-825-b1)