Skip to contentSkip to conversation

ath9k: Add support for AR9287 based chipsets.

PATCH In review Vivek Natarajan 2 participants 3 messages Jul 15, 2009 – Jul 16, 2009 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 ath9k: Add support for AR9287 based chipsets.

---
 drivers/net/wireless/ath/ath9k/calib.c  |   22 +-
 drivers/net/wireless/ath/ath9k/eeprom.c | 1203 ++++++++++++++++++++++++++++++-
 drivers/net/wireless/ath/ath9k/eeprom.h |  163 +++++-
 drivers/net/wireless/ath/ath9k/hw.c     |  110 +++-
 drivers/net/wireless/ath/ath9k/hw.h     |    4 +
 drivers/net/wireless/ath/ath9k/main.c   |    3 +-
 drivers/net/wireless/ath/ath9k/pci.c    |    2 +
 drivers/net/wireless/ath/ath9k/phy.h    |    1 +
 8 files changed, 1482 insertions(+), 26 deletions(-)
drivers/net/wireless/ath/ath9k/calib.c +14 -8
index 1f0c5fe..d1bbb02 100644
@@ -116,7 +116,7 @@ static void ath9k_hw_do_getnf(struct ath_hw *ah,
 				"NF calibrated [ctl] [chain 1] is %d\n", nf);
 		nfarray[1] = nf;
 
-		if (!AR_SREV_9280(ah)) {
+		if (!AR_SREV_9280(ah) && !AR_SREV_9287(ah)) {
 			nf = MS(REG_READ(ah, AR_PHY_CH2_CCA),
 					AR_PHY_CH2_MINCCA_PWR);
 			if (nf & 0x100)
@@ -154,7 +154,7 @@ static void ath9k_hw_do_getnf(struct ath_hw *ah,
 				"NF calibrated [ext] [chain 1] is %d\n", nf);
 		nfarray[4] = nf;
 
-		if (!AR_SREV_9280(ah)) {
+		if (!AR_SREV_9280(ah) && !AR_SREV_9287(ah)) {
 			nf = MS(REG_READ(ah, AR_PHY_CH2_EXT_CCA),
 					AR_PHY_CH2_EXT_MINCCA_PWR);
 			if (nf & 0x100)
@@ -613,7 +613,7 @@ void ath9k_hw_loadnf(struct ath_hw *ah, struct ath9k_channel *chan)
 
 	if (AR_SREV_9285(ah))
 		chainmask = 0x9;
-	else if (AR_SREV_9280(ah))
+	else if (AR_SREV_9280(ah) || AR_SREV_9287(ah))
 		chainmask = 0x1B;
 	else
 		chainmask = 0x3F;
@@ -873,7 +873,7 @@ bool ath9k_hw_calibrate(struct ath_hw *ah, struct ath9k_channel *chan,
 		if (AR_SREV_9285_11_OR_LATER(ah))
 			ath9k_hw_9285_pa_cal(ah);
 
-		if (OLC_FOR_AR9280_20_LATER)
+		if (OLC_FOR_AR9280_20_LATER || OLC_FOR_AR9287_10_LATER)
 			ath9k_olc_temp_compensation(ah);
 		ath9k_hw_getnf(ah, chan);
 		ath9k_hw_loadnf(ah, ah->curchan);
@@ -929,8 +929,11 @@ bool ath9k_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan)
 			return false;
 	} else {
 		if (AR_SREV_9280_10_OR_LATER(ah)) {
-			REG_CLR_BIT(ah, AR_PHY_ADC_CTL, AR_PHY_ADC_CTL_OFF_PWDADC);
-			REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_FLTR_CAL);
+			if (!AR_SREV_9287_10_OR_LATER(ah))
+				REG_CLR_BIT(ah, AR_PHY_ADC_CTL,
+					    AR_PHY_ADC_CTL_OFF_PWDADC);
+			REG_SET_BIT(ah, AR_PHY_AGC_CONTROL,
+				    AR_PHY_AGC_CONTROL_FLTR_CAL);
 		}
 
 		/* Calibrate the AGC */
@@ -948,8 +951,11 @@ bool ath9k_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan)
 		}
 
 		if (AR_SREV_9280_10_OR_LATER(ah)) {
-			REG_SET_BIT(ah, AR_PHY_ADC_CTL, AR_PHY_ADC_CTL_OFF_PWDADC);
-			REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_FLTR_CAL);
+			if (!AR_SREV_9287_10_OR_LATER(ah))
+				REG_SET_BIT(ah, AR_PHY_ADC_CTL,
+					    AR_PHY_ADC_CTL_OFF_PWDADC);
+			REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL,
+				    AR_PHY_AGC_CONTROL_FLTR_CAL);
 		}
 	}
 
drivers/net/wireless/ath/ath9k/eeprom.c +1201 -2

1,212 lines not on this page · raw message

drivers/net/wireless/ath/ath9k/eeprom.h +162 -1

205 lines not on this page · raw message

drivers/net/wireless/ath/ath9k/hw.c +96 -14

173 lines not on this page · raw message

drivers/net/wireless/ath/ath9k/hw.h +4 -0
index 6126b99..0ebdec0 100644
@@ -42,6 +42,9 @@
 #define AR_SUBVENDOR_ID_NEW_A	0x7065
 #define AR5416_MAGIC		0x19641014
 
+#define AR5416_DEVID_AR9287_PCI  0x002D
+#define AR5416_DEVID_AR9287_PCIE 0x002E
+
 /* Register read/write primitives */
 #define REG_WRITE(_ah, _reg, _val) ath9k_iowrite32((_ah), (_reg), (_val))
 #define REG_READ(_ah, _reg) ath9k_ioread32((_ah), (_reg))
@@ -399,6 +402,7 @@ struct ath_hw {
 	union {
 		struct ar5416_eeprom_def def;
 		struct ar5416_eeprom_4k map4k;
+		struct ar9287_eeprom_t map9287;
 	} eeprom;
 	const struct eeprom_ops *eep_ops;
 	enum ath9k_eep_map eep_map;
drivers/net/wireless/ath/ath9k/main.c +2 -1
index 2528571..b041b4e 100644
@@ -2784,7 +2784,8 @@ static struct {
 	{ AR_SREV_VERSION_9100,		"9100" },
 	{ AR_SREV_VERSION_9160,		"9160" },
 	{ AR_SREV_VERSION_9280,		"9280" },
-	{ AR_SREV_VERSION_9285,		"9285" }
+	{ AR_SREV_VERSION_9285,		"9285" },
+	{ AR_SREV_VERSION_9287,         "9287" }
 };
 
 static struct {
drivers/net/wireless/ath/ath9k/pci.c +2 -0
index 4d5865c..8ba8902 100644
@@ -25,6 +25,8 @@ static struct pci_device_id ath_pci_id_table[] __devinitdata = {
 	{ PCI_VDEVICE(ATHEROS, 0x0029) }, /* PCI   */
 	{ PCI_VDEVICE(ATHEROS, 0x002A) }, /* PCI-E */
 	{ PCI_VDEVICE(ATHEROS, 0x002B) }, /* PCI-E */
+	{ PCI_VDEVICE(ATHEROS, 0x002D) }, /* PCI   */
+	{ PCI_VDEVICE(ATHEROS, 0x002E) }, /* PCI-E */
 	{ 0 }
 };
 
drivers/net/wireless/ath/ath9k/phy.h +1 -0
index c70f530..de4fada 100644
@@ -375,6 +375,7 @@ bool ath9k_hw_init_rf(struct ath_hw *ah,
 #define AR_PHY_CHAN_INFO_GAIN          0x9CFC
 
 #define AR_PHY_MODE         0xA200
+#define AR_PHY_MODE_ASYNCFIFO 0x80
 #define AR_PHY_MODE_AR2133  0x08
 #define AR_PHY_MODE_AR5111  0x00
 #define AR_PHY_MODE_AR5112  0x08
Signature · 1 line
1.6.0.1
#1 lore raw

drivers/net/wireless/ath/ath9k/calib.c static void ath9k_hw_do_getnf(struct ath_hw *ah, · line 119

Quoted 11 lines · Vivek Natarajan
drivers/net/wireless/ath/ath9k/calib.c +1 -1
index 1f0c5fe..d1bbb02 100644
@@ -116,7 +116,7 @@ static void ath9k_hw_do_getnf(struct ath_hw *ah,
 				"NF calibrated [ctl] [chain 1] is %d\n", nf);
 		nfarray[1] = nf;
 
-		if (!AR_SREV_9280(ah)) {
+		if (!AR_SREV_9280(ah) && !AR_SREV_9287(ah)) {

This looks like it needs a helper function like IS_AR_SREV_928x(ah)

drivers/net/wireless/ath/ath9k/calib.c static void ath9k_hw_do_getnf(struct ath_hw *ah, · line 122

Quoted 3 lines
drivers/net/wireless/ath/ath9k/calib.c +3 -0
+		if (!AR_SREV_9280(ah) && !AR_SREV_9287(ah)) {
+	else if (AR_SREV_9280(ah) || AR_SREV_9287(ah))
+		if (OLC_FOR_AR9280_20_LATER || OLC_FOR_AR9287_10_LATER)

etc

#2 lore raw
Quoted 10 lines · Joe Perches
Quoted 9 lines · Vivek Natarajan
drivers/net/wireless/ath/ath9k/calib.c +0 -0
index 1f0c5fe..d1bbb02 100644
@@ -116,7 +116,7 @@ static void ath9k_hw_do_getnf(struct ath_hw *ah,
                               "NF calibrated [ctl] [chain 1] is %d\n", nf);
               nfarray[1] = nf;
 
Quoted 4 lines

drivers/net/wireless/ath/ath9k/calib.c static void ath9k_hw_do_getnf(struct ath_hw *ah, · line 119

Quoted 2 lines
drivers/net/wireless/ath/ath9k/calib.c +1 -1
-             if (!AR_SREV_9280(ah)) {
+             if (!AR_SREV_9280(ah) && !AR_SREV_9287(ah)) {

This looks like it needs a helper function like IS_AR_SREV_928x(ah)

928X is not needed in this case as there is some other chipset AR9285 which has different capabilities compared to AR9280 and AR9287.

Vivek.