[openwrt/openwrt] ath79: WNDR3700/3800/MAC: utilize nvmem for caldata fetching
LEDE Commits
lede-commits at lists.infradead.org
Sat Nov 6 15:41:12 PDT 2021
chunkeey pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/217571b6abb3118a81e1cde32dd1151a9e95a0fc
commit 217571b6abb3118a81e1cde32dd1151a9e95a0fc
Author: Christian Lamparter <chunkeey at gmail.com>
AuthorDate: Fri Nov 5 22:50:45 2021 +0100
ath79: WNDR3700/3800/MAC: utilize nvmem for caldata fetching
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 at gmail.com>
---
target/linux/ath79/dts/ar7161_netgear_wndr.dtsi | 2 --
target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts | 16 ++++++++++++----
target/linux/ath79/dts/ar7161_netgear_wndr3700.dts | 16 ++++++++++++----
target/linux/ath79/dts/ar7161_netgear_wndr3800.dts | 16 ++++++++++++----
target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts | 16 ++++++++++++----
target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts | 16 ++++++++++++----
target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts | 16 ++++++++++++----
.../base-files/etc/hotplug.d/firmware/10-ath9k-eeprom | 16 ++--------------
8 files changed, 74 insertions(+), 40 deletions(-)
diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr.dtsi b/target/linux/ath79/dts/ar7161_netgear_wndr.dtsi
index 414d5e6d99..afbccb8016 100644
--- a/target/linux/ath79/dts/ar7161_netgear_wndr.dtsi
+++ b/target/linux/ath79/dts/ar7161_netgear_wndr.dtsi
@@ -153,7 +153,6 @@
compatible = "pci168c,0029";
reg = <0x8800 0 0 0 0>;
- qca,no-eeprom;
#gpio-cells = <2>;
gpio-controller;
@@ -181,7 +180,6 @@
compatible = "pci168c,0029";
reg = <0x9000 0 0 0 0>;
- qca,no-eeprom;
#gpio-cells = <2>;
gpio-controller;
};
diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts
index 0a133ce52e..351d5e0364 100644
--- a/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts
+++ b/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts
@@ -39,13 +39,13 @@
};
&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";
};
ð0 {
@@ -74,4 +74,12 @@
macaddr_art_c: macaddr at c {
reg = <0xc 0x6>;
};
+
+ cal_art_1000: cal at 1000 {
+ reg = <0x1000 0xeb8>;
+ };
+
+ cal_art_5000: cal at 5000 {
+ reg = <0x5000 0xeb8>;
+ };
};
diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3700.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3700.dts
index 99bc5f56bb..eedd375cc9 100644
--- a/target/linux/ath79/dts/ar7161_netgear_wndr3700.dts
+++ b/target/linux/ath79/dts/ar7161_netgear_wndr3700.dts
@@ -39,13 +39,13 @@
};
&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
@@ -93,4 +93,12 @@
macaddr_art_c: macaddr at c {
reg = <0xc 0x6>;
};
+
+ cal_art_1000: cal at 1000 {
+ reg = <0x1000 0xeb8>;
+ };
+
+ cal_art_5000: cal at 5000 {
+ reg = <0x5000 0xeb8>;
+ };
};
diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts
index 0ad5c9d0e8..487b00b0dd 100644
--- a/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts
+++ b/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts
@@ -40,13 +40,13 @@
};
&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";
};
ð0 {
@@ -75,4 +75,12 @@
macaddr_art_c: macaddr at c {
reg = <0xc 0x6>;
};
+
+ cal_art_1000: cal at 1000 {
+ reg = <0x1000 0xeb8>;
+ };
+
+ cal_art_5000: cal at 5000 {
+ reg = <0x5000 0xeb8>;
+ };
};
diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts
index be997211a9..0c2eadae5c 100644
--- a/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts
+++ b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts
@@ -40,13 +40,13 @@
};
&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";
};
ð0 {
@@ -75,4 +75,12 @@
macaddr_art_c: macaddr at c {
reg = <0xc 0x6>;
};
+
+ cal_art_1000: cal at 1000 {
+ reg = <0x1000 0xeb8>;
+ };
+
+ cal_art_5000: cal at 5000 {
+ reg = <0x5000 0xeb8>;
+ };
};
diff --git a/target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts b/target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts
index fa0f40c424..88c3170c6e 100644
--- a/target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts
+++ b/target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts
@@ -39,13 +39,13 @@
};
&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";
};
ð0 {
@@ -74,4 +74,12 @@
macaddr_art_c: macaddr at c {
reg = <0xc 0x6>;
};
+
+ cal_art_1000: cal at 1000 {
+ reg = <0x1000 0xeb8>;
+ };
+
+ cal_art_5000: cal at 5000 {
+ reg = <0x5000 0xeb8>;
+ };
};
diff --git a/target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts b/target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts
index ba96eba262..0536ecb053 100644
--- a/target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts
+++ b/target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts
@@ -40,13 +40,13 @@
};
&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";
};
ð0 {
@@ -75,4 +75,12 @@
macaddr_art_c: macaddr at c {
reg = <0xc 0x6>;
};
+
+ cal_art_1000: cal at 1000 {
+ reg = <0x1000 0xeb8>;
+ };
+
+ cal_art_5000: cal at 5000 {
+ reg = <0x5000 0xeb8>;
+ };
};
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index 3e02b066a9..9a3054e276 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -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)
More information about the lede-commits
mailing list