aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/ath9k/544-ath9k-ar933x-usb-hang-workaround.patch
diff options
context:
space:
mode:
authorAnsuel Smith <ansuelsmth@gmail.com>2021-06-02 01:49:50 +0200
committerDavid Bauer <mail@david-bauer.net>2021-06-04 22:44:40 +0200
commit3394af677cadd1f9b877100312c830d87488fcfb (patch)
treeb07d71fd6b6b7d059c5624597866f9949c07469b /package/kernel/mac80211/patches/ath9k/544-ath9k-ar933x-usb-hang-workaround.patch
parent89bd8607f8cdacea7e8d13c1233a2a8b13fdf64c (diff)
downloadupstream-3394af677cadd1f9b877100312c830d87488fcfb.tar.gz
upstream-3394af677cadd1f9b877100312c830d87488fcfb.tar.bz2
upstream-3394af677cadd1f9b877100312c830d87488fcfb.zip
mac80211: split ath patch in dedicated subdir
The ath patch number is already large and adding other patch for ath11k will add more confusion with the patch numbering. Since the support of ath11k based device is imminent, prepare the mac80211 ath patch dir and split it in the dedicated ath5k, ath9k, ath10k and ath11k (empty for now). Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Diffstat (limited to 'package/kernel/mac80211/patches/ath9k/544-ath9k-ar933x-usb-hang-workaround.patch')
-rw-r--r--package/kernel/mac80211/patches/ath9k/544-ath9k-ar933x-usb-hang-workaround.patch79
1 files changed, 79 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/ath9k/544-ath9k-ar933x-usb-hang-workaround.patch b/package/kernel/mac80211/patches/ath9k/544-ath9k-ar933x-usb-hang-workaround.patch
new file mode 100644
index 0000000000..93eee34b64
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath9k/544-ath9k-ar933x-usb-hang-workaround.patch
@@ -0,0 +1,79 @@
+--- a/drivers/net/wireless/ath/ath9k/hw.c
++++ b/drivers/net/wireless/ath/ath9k/hw.c
+@@ -248,6 +248,19 @@ void ath9k_hw_get_channel_centers(struct
+ centers->synth_center + (extoff * HT40_CHANNEL_CENTER_SHIFT);
+ }
+
++static inline void ath9k_hw_disable_pll_lock_detect(struct ath_hw *ah)
++{
++ /* On AR9330 and AR9340 devices, some PHY registers must be
++ * tuned to gain better stability/performance. These registers
++ * might be changed while doing wlan reset so the registers must
++ * be reprogrammed after each reset.
++ */
++ REG_CLR_BIT(ah, AR_PHY_USB_CTRL1, BIT(20));
++ REG_RMW(ah, AR_PHY_USB_CTRL2,
++ (1 << 21) | (0xf << 22),
++ (1 << 21) | (0x3 << 22));
++}
++
+ /******************/
+ /* Chip Revisions */
+ /******************/
+@@ -1455,6 +1468,9 @@ static bool ath9k_hw_set_reset(struct at
+ udelay(50);
+ }
+
++ if (AR_SREV_9330(ah) || AR_SREV_9340(ah))
++ ath9k_hw_disable_pll_lock_detect(ah);
++
+ return true;
+ }
+
+@@ -1554,6 +1570,9 @@ static bool ath9k_hw_chip_reset(struct a
+ ar9003_hw_internal_regulator_apply(ah);
+ ath9k_hw_init_pll(ah, chan);
+
++ if (AR_SREV_9330(ah) || AR_SREV_9340(ah))
++ ath9k_hw_disable_pll_lock_detect(ah);
++
+ return true;
+ }
+
+@@ -1861,8 +1880,14 @@ static int ath9k_hw_do_fastcc(struct ath
+ if (AR_SREV_9271(ah))
+ ar9002_hw_load_ani_reg(ah, chan);
+
++ if (AR_SREV_9330(ah) || AR_SREV_9340(ah))
++ ath9k_hw_disable_pll_lock_detect(ah);
++
+ return 0;
+ fail:
++ if (AR_SREV_9330(ah) || AR_SREV_9340(ah))
++ ath9k_hw_disable_pll_lock_detect(ah);
++
+ return -EINVAL;
+ }
+
+@@ -2116,6 +2141,9 @@ int ath9k_hw_reset(struct ath_hw *ah, st
+ ath9k_hw_set_radar_params(ah);
+ }
+
++ if (AR_SREV_9330(ah) || AR_SREV_9340(ah))
++ ath9k_hw_disable_pll_lock_detect(ah);
++
+ return 0;
+ }
+ EXPORT_SYMBOL(ath9k_hw_reset);
+--- a/drivers/net/wireless/ath/ath9k/phy.h
++++ b/drivers/net/wireless/ath/ath9k/phy.h
+@@ -48,6 +48,9 @@
+ #define AR_PHY_PLL_CONTROL 0x16180
+ #define AR_PHY_PLL_MODE 0x16184
+
++#define AR_PHY_USB_CTRL1 0x16c84
++#define AR_PHY_USB_CTRL2 0x16c88
++
+ enum ath9k_ant_div_comb_lna_conf {
+ ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2,
+ ATH_ANT_DIV_COMB_LNA2,