2012-10-15 08:12:41

by Rajkumar Manoharan

[permalink] [raw]
Subject: [PATCH 00/12] BT COEX fixes for AR9565

Hi,

Here is the set of fixes for AR9565 BTCoex issues

-Rajkumar

Bala Shanmugam (2):
ath9k: Set appropriate bit for AR9565 in btc control register
ath9k: turn off RXIQ calibration while re-calibrating radio

Rajkumar Manoharan (10):
ath9k_hw: Enable OSLA hw fix for AR9565
ath9k_hw: Fix selfgen chainmask for 9565
ath9k_hw: Disable MCI stat counter by default for AR9565
ath9k_hw: Fix frequent BT rx recovery
ath9k_hw: program radio_post_sys2ant initval for AR9565
ath9k_hw: Fix max rx rate drop for AR9565
ath9k_hw: Configure new switch table for AR9565 BTCOEX
ath9k_hw: Set default MCI config for AR9565
ath9k: adjust duty cycle for FTP profile for AR9565
ath9k: Add new BT profile info A2DP_Voice

drivers/net/wireless/ath/ath9k/ar9003_calib.c | 5 +++
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 2 +-
drivers/net/wireless/ath/ath9k/ar9003_mci.c | 45 +++++++++++++++++++++++---
drivers/net/wireless/ath/ath9k/ar9003_mci.h | 2 ++
drivers/net/wireless/ath/ath9k/ar9003_phy.c | 5 +--
drivers/net/wireless/ath/ath9k/ar9003_phy.h | 1 +
drivers/net/wireless/ath/ath9k/btcoex.c | 2 +-
drivers/net/wireless/ath/ath9k/btcoex.h | 1 +
drivers/net/wireless/ath/ath9k/mci.c | 2 +-
drivers/net/wireless/ath/ath9k/mci.h | 2 ++
drivers/net/wireless/ath/ath9k/reg.h | 7 ++++
11 files changed, 64 insertions(+), 10 deletions(-)

--
1.7.12.2



2012-10-15 08:12:49

by Rajkumar Manoharan

[permalink] [raw]
Subject: [PATCH 01/12] ath9k_hw: Enable OSLA hw fix for AR9565

Signed-off-by: Rajkumar Manoharan <[email protected]>
---
drivers/net/wireless/ath/ath9k/ar9003_mci.c | 3 +++
drivers/net/wireless/ath/ath9k/reg.h | 4 ++++
2 files changed, 7 insertions(+)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mci.c b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
index 9aa8704..9fa6d22 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mci.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
@@ -799,6 +799,9 @@ static void ar9003_mci_osla_setup(struct ath_hw *ah, bool enable)
REG_RMW_FIELD(ah, AR_MCI_SCHD_TABLE_2,
AR_MCI_SCHD_TABLE_2_MEM_BASED, 1);

+ if (AR_SREV_9565(ah))
+ REG_RMW_FIELD(ah, AR_MCI_MISC, AR_MCI_MISC_HW_FIX_EN, 1);
+
if (!(mci->config & ATH_MCI_CONFIG_DISABLE_AGGR_THRESH)) {
thresh = MS(mci->config, ATH_MCI_CONFIG_AGGR_THRESH);
REG_RMW_FIELD(ah, AR_BTCOEX_CTRL,
diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h
index 4e6760f..c7a9ea7 100644
--- a/drivers/net/wireless/ath/ath9k/reg.h
+++ b/drivers/net/wireless/ath/ath9k/reg.h
@@ -2360,4 +2360,8 @@ enum {
#define AR_GLB_SWREG_DISCONT_MODE 0x2002c
#define AR_GLB_SWREG_DISCONT_EN_BT_WLAN 0x3

+#define AR_MCI_MISC 0x1a74
+#define AR_MCI_MISC_HW_FIX_EN 0x00000001
+#define AR_MCI_MISC_HW_FIX_EN_S 0
+
#endif
--
1.7.12.2


2012-10-15 09:43:20

by Rajkumar Manoharan

[permalink] [raw]
Subject: Re: [PATCH 09/12] ath9k_hw: Configure new switch table for AR9565 BTCOEX

On Mon, Oct 15, 2012 at 02:56:36PM +0530, Sujith Manoharan wrote:
> Rajkumar Manoharan wrote:
> > Signed-off-by: Rajkumar Manoharan <[email protected]>
> > ---
> > drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
> > index f3784eb..8621e37 100644
> > --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
> > +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
> > @@ -3601,7 +3601,7 @@ static void ar9003_hw_ant_ctrl_apply(struct ath_hw *ah, bool is2ghz)
> > * 7:4 R/W SWITCH_TABLE_COM_SPDT_WLAN_IDLE
> > * SWITCH_TABLE_COM_SPDT_WLAN_IDLE
> > */
> > - if (AR_SREV_9462_20_OR_LATER(ah)) {
> > + if (AR_SREV_9462_20_OR_LATER(ah) || AR_SREV_9565(ah)) {
> > value = ar9003_switch_com_spdt_get(ah, is2ghz);
> > REG_RMW_FIELD(ah, AR_PHY_GLB_CONTROL,
> > AR_SWITCH_TABLE_COM_SPDT_ALL, value);
>
> A cleaner way would be to fix the AR_SREV_9462_20_OR_LATER macro to resemble
> all the other *_LATER macros (based on the macVersion).
>
I hate *_LATER macros. Its always confusing. Since SPDT is applicable only for
9462 & 9565, I remove the _LATER in v2.

-Rajkumar

2012-10-15 08:13:34

by Rajkumar Manoharan

[permalink] [raw]
Subject: [PATCH 06/12] ath9k_hw: Fix frequent BT rx recovery

While resuming from S3, BT host issues HCI reset command and it
causes BT firmware to busy with security key calculation. At this
movement, WLAN detects MCI hardware error of MCI_CONT_INFO_TIMEOUT
and then it starts the recovery sequence repeatedly. Too many
recovery sequences would exhaust the BT kernel message pool. This
patch imposes a duration between consecutive BT recovery procedure.
Thus it solves BT firmware panic issue reported in AR9565.

Signed-off-by: Rajkumar Manoharan <[email protected]>
---
drivers/net/wireless/ath/ath9k/ar9003_mci.c | 10 +++++++++-
drivers/net/wireless/ath/ath9k/ar9003_mci.h | 1 +
drivers/net/wireless/ath/ath9k/btcoex.h | 1 +
3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mci.c b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
index 466ac8da..f537f0d 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mci.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
@@ -1209,7 +1209,7 @@ EXPORT_SYMBOL(ar9003_mci_cleanup);
u32 ar9003_mci_state(struct ath_hw *ah, u32 state_type)
{
struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
- u32 value = 0;
+ u32 value = 0, tsf;
u8 query_type;

switch (state_type) {
@@ -1267,6 +1267,14 @@ u32 ar9003_mci_state(struct ath_hw *ah, u32 state_type)
ar9003_mci_send_coex_bt_status_query(ah, true, query_type);
break;
case MCI_STATE_RECOVER_RX:
+ tsf = ath9k_hw_gettsf32(ah);
+ if ((tsf - mci->last_recovery) <= MCI_RECOVERY_DUR_TSF) {
+ ath_dbg(ath9k_hw_common(ah), MCI,
+ "(MCI) ignore Rx recovery\n");
+ break;
+ }
+ ath_dbg(ath9k_hw_common(ah), MCI, "(MCI) RECOVER RX\n");
+ mci->last_recovery = tsf;
ar9003_mci_prep_interface(ah);
mci->query_bt = true;
mci->need_flush_btinfo = true;
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mci.h b/drivers/net/wireless/ath/ath9k/ar9003_mci.h
index 0910310..3e51f54 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mci.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mci.h
@@ -18,6 +18,7 @@
#define AR9003_MCI_H

#define MCI_FLAG_DISABLE_TIMESTAMP 0x00000001 /* Disable time stamp */
+#define MCI_RECOVERY_DUR_TSF (100 * 1000) /* 100 ms */

/* Default remote BT device MCI COEX version */
#define MCI_GPM_COEX_MAJOR_VERSION_DEFAULT 3
diff --git a/drivers/net/wireless/ath/ath9k/btcoex.h b/drivers/net/wireless/ath/ath9k/btcoex.h
index 94e9211..2f84ab2 100644
--- a/drivers/net/wireless/ath/ath9k/btcoex.h
+++ b/drivers/net/wireless/ath/ath9k/btcoex.h
@@ -88,6 +88,7 @@ struct ath9k_hw_mci {
u8 bt_state;
u8 stomp_ftp;
bool concur_tx;
+ u32 last_recovery;
};

struct ath_btcoex_hw {
--
1.7.12.2


2012-10-15 09:31:02

by Sujith Manoharan

[permalink] [raw]
Subject: [PATCH 07/12] ath9k_hw: program radio_post_sys2ant initval for AR9565

Rajkumar Manoharan wrote:
> Signed-off-by: Rajkumar Manoharan <[email protected]>
> ---
> drivers/net/wireless/ath/ath9k/ar9003_phy.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
> index 759f5f5..1d6d6ce 100644
> --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
> +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
> @@ -749,7 +749,8 @@ static int ar9003_hw_process_ini(struct ath_hw *ah,
> ar9003_hw_prog_ini(ah, &ah->iniMac[i], modesIndex);
> ar9003_hw_prog_ini(ah, &ah->iniBB[i], modesIndex);
> ar9003_hw_prog_ini(ah, &ah->iniRadio[i], modesIndex);
> - if (i == ATH_INI_POST && AR_SREV_9462_20(ah))
> + if (i == ATH_INI_POST &&
> + (AR_SREV_9462_20(ah) || AR_SREV_9565(ah)))
> ar9003_hw_prog_ini(ah,
> &ah->ini_radio_post_sys2ant,
> modesIndex);
> @@ -1424,7 +1425,7 @@ static int ar9003_hw_fast_chan_change(struct ath_hw *ah,
> ar9003_hw_prog_ini(ah, &ah->iniBB[ATH_INI_POST], modesIndex);
> ar9003_hw_prog_ini(ah, &ah->iniRadio[ATH_INI_POST], modesIndex);
>
> - if (AR_SREV_9462_20(ah))
> + if (AR_SREV_9462_20(ah) || AR_SREV_9565(ah))
> ar9003_hw_prog_ini(ah, &ah->ini_radio_post_sys2ant,
> modesIndex);

ah->ini_radio_post_sys2ant() is not initialized for AR9565...

Sujith

2012-10-15 09:52:35

by Rajkumar Manoharan

[permalink] [raw]
Subject: Re: [PATCH 09/12] ath9k_hw: Configure new switch table for AR9565 BTCOEX

On Mon, Oct 15, 2012 at 03:12:55PM +0530, Sujith Manoharan wrote:
> Rajkumar Manoharan wrote:
> > I hate *_LATER macros. Its always confusing. Since SPDT is applicable only for
> > 9462 & 9565, I remove the _LATER in v2.
>
> The macros in ath9k are clean enough - they just check the macVersion.
>
I mean AR9462_20_OR_LATER that checks macRev which is different from other *_LATER macros.
So I'll remove AR9462_20_OR_LATER to avoid confusion.

-Rajkumar

2012-10-15 08:13:57

by Rajkumar Manoharan

[permalink] [raw]
Subject: [PATCH 09/12] ath9k_hw: Configure new switch table for AR9565 BTCOEX

Signed-off-by: Rajkumar Manoharan <[email protected]>
---
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index f3784eb..8621e37 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -3601,7 +3601,7 @@ static void ar9003_hw_ant_ctrl_apply(struct ath_hw *ah, bool is2ghz)
* 7:4 R/W SWITCH_TABLE_COM_SPDT_WLAN_IDLE
* SWITCH_TABLE_COM_SPDT_WLAN_IDLE
*/
- if (AR_SREV_9462_20_OR_LATER(ah)) {
+ if (AR_SREV_9462_20_OR_LATER(ah) || AR_SREV_9565(ah)) {
value = ar9003_switch_com_spdt_get(ah, is2ghz);
REG_RMW_FIELD(ah, AR_PHY_GLB_CONTROL,
AR_SWITCH_TABLE_COM_SPDT_ALL, value);
--
1.7.12.2


2012-10-15 08:13:09

by Rajkumar Manoharan

[permalink] [raw]
Subject: [PATCH 07/12] ath9k_hw: program radio_post_sys2ant initval for AR9565

Signed-off-by: Rajkumar Manoharan <[email protected]>
---
drivers/net/wireless/ath/ath9k/ar9003_phy.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
index 759f5f5..1d6d6ce 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -749,7 +749,8 @@ static int ar9003_hw_process_ini(struct ath_hw *ah,
ar9003_hw_prog_ini(ah, &ah->iniMac[i], modesIndex);
ar9003_hw_prog_ini(ah, &ah->iniBB[i], modesIndex);
ar9003_hw_prog_ini(ah, &ah->iniRadio[i], modesIndex);
- if (i == ATH_INI_POST && AR_SREV_9462_20(ah))
+ if (i == ATH_INI_POST &&
+ (AR_SREV_9462_20(ah) || AR_SREV_9565(ah)))
ar9003_hw_prog_ini(ah,
&ah->ini_radio_post_sys2ant,
modesIndex);
@@ -1424,7 +1425,7 @@ static int ar9003_hw_fast_chan_change(struct ath_hw *ah,
ar9003_hw_prog_ini(ah, &ah->iniBB[ATH_INI_POST], modesIndex);
ar9003_hw_prog_ini(ah, &ah->iniRadio[ATH_INI_POST], modesIndex);

- if (AR_SREV_9462_20(ah))
+ if (AR_SREV_9462_20(ah) || AR_SREV_9565(ah))
ar9003_hw_prog_ini(ah, &ah->ini_radio_post_sys2ant,
modesIndex);

--
1.7.12.2


2012-10-15 09:48:39

by Sujith Manoharan

[permalink] [raw]
Subject: Re: [PATCH 09/12] ath9k_hw: Configure new switch table for AR9565 BTCOEX

Rajkumar Manoharan wrote:
> I hate *_LATER macros. Its always confusing. Since SPDT is applicable only for
> 9462 & 9565, I remove the _LATER in v2.

The macros in ath9k are clean enough - they just check the macVersion.

Sujith

2012-10-15 08:14:53

by Rajkumar Manoharan

[permalink] [raw]
Subject: [PATCH 12/12] ath9k: Add new BT profile info A2DP_Voice

When the BT connection is initiated by headset, it's possible that headset
requests to make one A2DP and one Voice connection over the same link.
BT firmware will send a new profile A2DP_Voice in this case. So WLAN
has to take care of this new profile for tuning BTCOEX parameters.

Signed-off-by: Rajkumar Manoharan <[email protected]>
---
drivers/net/wireless/ath/ath9k/ar9003_mci.h | 1 +
drivers/net/wireless/ath/ath9k/mci.h | 2 ++
2 files changed, 3 insertions(+)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mci.h b/drivers/net/wireless/ath/ath9k/ar9003_mci.h
index 3e51f54..66d7ab9 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mci.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mci.h
@@ -126,6 +126,7 @@ enum ath_mci_gpm_coex_profile_type {
MCI_GPM_COEX_PROFILE_HID,
MCI_GPM_COEX_PROFILE_BNEP,
MCI_GPM_COEX_PROFILE_VOICE,
+ MCI_GPM_COEX_PROFILE_A2DPVO,
MCI_GPM_COEX_PROFILE_MAX
};

diff --git a/drivers/net/wireless/ath/ath9k/mci.h b/drivers/net/wireless/ath/ath9k/mci.h
index e5f170a..0695883 100644
--- a/drivers/net/wireless/ath/ath9k/mci.h
+++ b/drivers/net/wireless/ath/ath9k/mci.h
@@ -70,6 +70,7 @@
_mci->num_pan++; \
break; \
case MCI_GPM_COEX_PROFILE_VOICE: \
+ case MCI_GPM_COEX_PROFILE_A2DPVO:\
_mci->num_sco++; \
break; \
default: \
@@ -94,6 +95,7 @@
_mci->num_pan--; \
break; \
case MCI_GPM_COEX_PROFILE_VOICE: \
+ case MCI_GPM_COEX_PROFILE_A2DPVO:\
_mci->num_sco--; \
break; \
default: \
--
1.7.12.2


2012-10-15 09:40:09

by Rajkumar Manoharan

[permalink] [raw]
Subject: Re: [PATCH 07/12] ath9k_hw: program radio_post_sys2ant initval for AR9565

On Mon, Oct 15, 2012 at 02:51:56PM +0530, Sujith Manoharan wrote:
> Rajkumar Manoharan wrote:
> > Signed-off-by: Rajkumar Manoharan <[email protected]>
> > ---
> > drivers/net/wireless/ath/ath9k/ar9003_phy.c | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
> > index 759f5f5..1d6d6ce 100644
> > --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
> > +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
> > @@ -749,7 +749,8 @@ static int ar9003_hw_process_ini(struct ath_hw *ah,
> > ar9003_hw_prog_ini(ah, &ah->iniMac[i], modesIndex);
> > ar9003_hw_prog_ini(ah, &ah->iniBB[i], modesIndex);
> > ar9003_hw_prog_ini(ah, &ah->iniRadio[i], modesIndex);
> > - if (i == ATH_INI_POST && AR_SREV_9462_20(ah))
> > + if (i == ATH_INI_POST &&
> > + (AR_SREV_9462_20(ah) || AR_SREV_9565(ah)))
> > ar9003_hw_prog_ini(ah,
> > &ah->ini_radio_post_sys2ant,
> > modesIndex);
> > @@ -1424,7 +1425,7 @@ static int ar9003_hw_fast_chan_change(struct ath_hw *ah,
> > ar9003_hw_prog_ini(ah, &ah->iniBB[ATH_INI_POST], modesIndex);
> > ar9003_hw_prog_ini(ah, &ah->iniRadio[ATH_INI_POST], modesIndex);
> >
> > - if (AR_SREV_9462_20(ah))
> > + if (AR_SREV_9462_20(ah) || AR_SREV_9565(ah))
> > ar9003_hw_prog_ini(ah, &ah->ini_radio_post_sys2ant,
> > modesIndex);
>
> ah->ini_radio_post_sys2ant() is not initialized for AR9565...
>
Nice. Will drop this in v2.

-Rajkumar

2012-10-15 09:42:03

by Rajkumar Manoharan

[permalink] [raw]
Subject: Re: [PATCH 05/12] ath9k_hw: Disable MCI stat counter by default for AR9565

On Mon, Oct 15, 2012 at 02:50:10PM +0530, Sujith Manoharan wrote:
> Rajkumar Manoharan wrote:
> > Signed-off-by: Rajkumar Manoharan <[email protected]>
> > ---
> > drivers/net/wireless/ath/ath9k/ar9003_mci.c | 11 ++++++++++-
> > drivers/net/wireless/ath/ath9k/reg.h | 3 +++
> > 2 files changed, 13 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mci.c b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
> > index c46d8f1..466ac8da 100644
> > --- a/drivers/net/wireless/ath/ath9k/ar9003_mci.c
> > +++ b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
> > @@ -938,6 +938,9 @@ int ar9003_mci_reset(struct ath_hw *ah, bool en_int, bool is_2g,
> > mci->ready = true;
> > ar9003_mci_prep_interface(ah);
> >
> > + if (AR_SREV_9565(ah))
> > + REG_RMW_FIELD(ah, AR_MCI_DBG_CNT_CTRL,
> > + AR_MCI_DBG_CNT_CTRL_ENABLE, 0);
> > if (en_int)
> > ar9003_mci_enable_interrupt(ah);
> >
> > @@ -1179,13 +1182,19 @@ int ar9003_mci_setup(struct ath_hw *ah, u32 gpm_addr, void *gpm_buf,
> > u16 len, u32 sched_addr)
> > {
> > struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
> > + int ret;
> >
> > mci->gpm_addr = gpm_addr;
> > mci->gpm_buf = gpm_buf;
> > mci->gpm_len = len;
> > mci->sched_addr = sched_addr;
> >
> > - return ar9003_mci_reset(ah, true, true, true);
> > + ret = ar9003_mci_reset(ah, true, true, true);
> > +
> > + if (AR_SREV_9565(ah))
> > + REG_RMW_FIELD(ah, AR_MCI_DBG_CNT_CTRL,
> > + AR_MCI_DBG_CNT_CTRL_ENABLE, 0);
> > + return ret;
>
> Why do this is two different places, when reset() is actually called from
> setup() ?
>
Oops. Thanks

-Rajkumar

2012-10-15 09:37:55

by Sujith Manoharan

[permalink] [raw]
Subject: [PATCH 09/12] ath9k_hw: Configure new switch table for AR9565 BTCOEX

Rajkumar Manoharan wrote:
> Signed-off-by: Rajkumar Manoharan <[email protected]>
> ---
> drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
> index f3784eb..8621e37 100644
> --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
> +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
> @@ -3601,7 +3601,7 @@ static void ar9003_hw_ant_ctrl_apply(struct ath_hw *ah, bool is2ghz)
> * 7:4 R/W SWITCH_TABLE_COM_SPDT_WLAN_IDLE
> * SWITCH_TABLE_COM_SPDT_WLAN_IDLE
> */
> - if (AR_SREV_9462_20_OR_LATER(ah)) {
> + if (AR_SREV_9462_20_OR_LATER(ah) || AR_SREV_9565(ah)) {
> value = ar9003_switch_com_spdt_get(ah, is2ghz);
> REG_RMW_FIELD(ah, AR_PHY_GLB_CONTROL,
> AR_SWITCH_TABLE_COM_SPDT_ALL, value);

A cleaner way would be to fix the AR_SREV_9462_20_OR_LATER macro to resemble
all the other *_LATER macros (based on the macVersion).

Sujith

2012-10-15 08:13:36

by Rajkumar Manoharan

[permalink] [raw]
Subject: [PATCH 10/12] ath9k_hw: Set default MCI config for AR9565

Signed-off-by: Rajkumar Manoharan <[email protected]>
---
drivers/net/wireless/ath/ath9k/btcoex.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/btcoex.c b/drivers/net/wireless/ath/ath9k/btcoex.c
index 05d9be5..c90e9bc 100644
--- a/drivers/net/wireless/ath/ath9k/btcoex.c
+++ b/drivers/net/wireless/ath/ath9k/btcoex.c
@@ -195,7 +195,7 @@ void ath9k_hw_btcoex_init_mci(struct ath_hw *ah)
ah->btcoex_hw.mci.need_flush_btinfo = false;
ah->btcoex_hw.mci.wlan_cal_seq = 0;
ah->btcoex_hw.mci.wlan_cal_done = 0;
- ah->btcoex_hw.mci.config = 0x2201;
+ ah->btcoex_hw.mci.config = (AR_SREV_9462(ah)) ? 0x2201 : 0xa4c1;
}
EXPORT_SYMBOL(ath9k_hw_btcoex_init_mci);

--
1.7.12.2


2012-10-15 08:12:22

by Rajkumar Manoharan

[permalink] [raw]
Subject: [PATCH 02/12] ath9k_hw: Fix selfgen chainmask for 9565

Self generated MCI messages is configured to use chain 1. As
ar9565 is 1x1 solution, It can not use Chain 1. Hence fix
Chain 1 for ar9462 alone. Not doing so, could affect WLAN
connectivity in ar9565 as LNA sharing is not informed by BT.

Signed-off-by: Rajkumar Manoharan <[email protected]>
---
drivers/net/wireless/ath/ath9k/ar9003_mci.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mci.c b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
index 9fa6d22..6fbd376 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mci.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
@@ -1043,7 +1043,9 @@ void ar9003_mci_2g5g_switch(struct ath_hw *ah, bool force)

if (!(mci->config & ATH_MCI_CONFIG_DISABLE_OSLA))
ar9003_mci_osla_setup(ah, true);
- REG_WRITE(ah, AR_SELFGEN_MASK, 0x02);
+
+ if (AR_SREV_9462(ah))
+ REG_WRITE(ah, AR_SELFGEN_MASK, 0x02);
} else {
ar9003_mci_send_lna_take(ah, true);
udelay(5);
--
1.7.12.2


2012-10-15 08:12:39

by Rajkumar Manoharan

[permalink] [raw]
Subject: [PATCH 04/12] ath9k: turn off RXIQ calibration while re-calibrating radio

From: Bala Shanmugam <[email protected]>

TXIQ and RXIQ share the same data path to upload the measurement
result, we should turn off RXIQ calibration while re-calibrating radio

Signed-off-by: Bala Shanmugam <[email protected]>
---
drivers/net/wireless/ath/ath9k/ar9003_mci.c | 6 ++++++
drivers/net/wireless/ath/ath9k/ar9003_phy.h | 1 +
2 files changed, 7 insertions(+)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mci.c b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
index b2b9941..c46d8f1 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mci.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
@@ -750,6 +750,9 @@ int ar9003_mci_end_reset(struct ath_hw *ah, struct ath9k_channel *chan,

mci_hw->bt_state = MCI_BT_AWAKE;

+ REG_CLR_BIT(ah, AR_PHY_TIMING4,
+ 1 << AR_PHY_TIMING_CONTROL4_DO_GAIN_DC_IQ_CAL_SHIFT);
+
if (caldata) {
caldata->done_txiqcal_once = false;
caldata->done_txclcal_once = false;
@@ -759,6 +762,9 @@ int ar9003_mci_end_reset(struct ath_hw *ah, struct ath9k_channel *chan,
if (!ath9k_hw_init_cal(ah, chan))
return -EIO;

+ REG_SET_BIT(ah, AR_PHY_TIMING4,
+ 1 << AR_PHY_TIMING_CONTROL4_DO_GAIN_DC_IQ_CAL_SHIFT);
+
exit:
ar9003_mci_enable_interrupt(ah);
return 0;
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.h b/drivers/net/wireless/ath/ath9k/ar9003_phy.h
index 9a48e3d..8f58523 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.h
@@ -32,6 +32,7 @@
#define AR_PHY_SPUR_REG (AR_CHAN_BASE + 0x1c)
#define AR_PHY_RX_IQCAL_CORR_B0 (AR_CHAN_BASE + 0xdc)
#define AR_PHY_TX_IQCAL_CONTROL_3 (AR_CHAN_BASE + 0xb0)
+#define AR_PHY_TIMING_CONTROL4_DO_GAIN_DC_IQ_CAL_SHIFT 16

#define AR_PHY_TIMING11_SPUR_FREQ_SD 0x3FF00000
#define AR_PHY_TIMING11_SPUR_FREQ_SD_S 20
--
1.7.12.2


2012-10-15 08:14:08

by Rajkumar Manoharan

[permalink] [raw]
Subject: [PATCH 11/12] ath9k: adjust duty cycle for FTP profile for AR9565

Signed-off-by: Rajkumar Manoharan <[email protected]>
---
drivers/net/wireless/ath/ath9k/mci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/mci.c b/drivers/net/wireless/ath/ath9k/mci.c
index 19dbac4..0dd2cbb 100644
--- a/drivers/net/wireless/ath/ath9k/mci.c
+++ b/drivers/net/wireless/ath/ath9k/mci.c
@@ -157,7 +157,7 @@ static void ath_mci_update_scheme(struct ath_softc *sc)
* For single PAN/FTP profile, allocate 35% for BT
* to improve WLAN throughput.
*/
- btcoex->duty_cycle = 35;
+ btcoex->duty_cycle = AR_SREV_9565(sc->sc_ah) ? 40 : 35;
btcoex->btcoex_period = 53;
ath_dbg(common, MCI,
"Single PAN/FTP bt period %d ms dutycycle %d\n",
--
1.7.12.2


2012-10-15 08:13:29

by Rajkumar Manoharan

[permalink] [raw]
Subject: [PATCH 05/12] ath9k_hw: Disable MCI stat counter by default for AR9565

Signed-off-by: Rajkumar Manoharan <[email protected]>
---
drivers/net/wireless/ath/ath9k/ar9003_mci.c | 11 ++++++++++-
drivers/net/wireless/ath/ath9k/reg.h | 3 +++
2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mci.c b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
index c46d8f1..466ac8da 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mci.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
@@ -938,6 +938,9 @@ int ar9003_mci_reset(struct ath_hw *ah, bool en_int, bool is_2g,
mci->ready = true;
ar9003_mci_prep_interface(ah);

+ if (AR_SREV_9565(ah))
+ REG_RMW_FIELD(ah, AR_MCI_DBG_CNT_CTRL,
+ AR_MCI_DBG_CNT_CTRL_ENABLE, 0);
if (en_int)
ar9003_mci_enable_interrupt(ah);

@@ -1179,13 +1182,19 @@ int ar9003_mci_setup(struct ath_hw *ah, u32 gpm_addr, void *gpm_buf,
u16 len, u32 sched_addr)
{
struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
+ int ret;

mci->gpm_addr = gpm_addr;
mci->gpm_buf = gpm_buf;
mci->gpm_len = len;
mci->sched_addr = sched_addr;

- return ar9003_mci_reset(ah, true, true, true);
+ ret = ar9003_mci_reset(ah, true, true, true);
+
+ if (AR_SREV_9565(ah))
+ REG_RMW_FIELD(ah, AR_MCI_DBG_CNT_CTRL,
+ AR_MCI_DBG_CNT_CTRL_ENABLE, 0);
+ return ret;
}
EXPORT_SYMBOL(ar9003_mci_setup);

diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h
index c7a9ea7..8f40dba 100644
--- a/drivers/net/wireless/ath/ath9k/reg.h
+++ b/drivers/net/wireless/ath/ath9k/reg.h
@@ -2363,5 +2363,8 @@ enum {
#define AR_MCI_MISC 0x1a74
#define AR_MCI_MISC_HW_FIX_EN 0x00000001
#define AR_MCI_MISC_HW_FIX_EN_S 0
+#define AR_MCI_DBG_CNT_CTRL 0x1a78
+#define AR_MCI_DBG_CNT_CTRL_ENABLE 0x00000001
+#define AR_MCI_DBG_CNT_CTRL_ENABLE_S 0

#endif
--
1.7.12.2


2012-10-15 08:13:09

by Rajkumar Manoharan

[permalink] [raw]
Subject: [PATCH 03/12] ath9k: Set appropriate bit for AR9565 in btc control register

From: Bala Shanmugam <[email protected]>

Signed-off-by: Bala Shanmugam <[email protected]>
---
drivers/net/wireless/ath/ath9k/ar9003_mci.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mci.c b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
index 6fbd376..b2b9941 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mci.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
@@ -850,11 +850,18 @@ int ar9003_mci_reset(struct ath_hw *ah, bool en_int, bool is_2g,
SM(1, AR_BTCOEX_CTRL_WBTIMER_EN) |
SM(1, AR_BTCOEX_CTRL_PA_SHARED) |
SM(1, AR_BTCOEX_CTRL_LNA_SHARED) |
- SM(2, AR_BTCOEX_CTRL_NUM_ANTENNAS) |
- SM(3, AR_BTCOEX_CTRL_RX_CHAIN_MASK) |
SM(0, AR_BTCOEX_CTRL_1_CHAIN_ACK) |
SM(0, AR_BTCOEX_CTRL_1_CHAIN_BCN) |
SM(0, AR_BTCOEX_CTRL_ONE_STEP_LOOK_AHEAD_EN);
+ if (AR_SREV_9565(ah)) {
+ regval |= SM(1, AR_BTCOEX_CTRL_NUM_ANTENNAS) |
+ SM(1, AR_BTCOEX_CTRL_RX_CHAIN_MASK);
+ REG_RMW_FIELD(ah, AR_BTCOEX_CTRL2,
+ AR_BTCOEX_CTRL2_TX_CHAIN_MASK, 0x1);
+ } else {
+ regval |= SM(2, AR_BTCOEX_CTRL_NUM_ANTENNAS) |
+ SM(3, AR_BTCOEX_CTRL_RX_CHAIN_MASK);
+ }

REG_WRITE(ah, AR_BTCOEX_CTRL, regval);

--
1.7.12.2


2012-10-15 08:13:48

by Rajkumar Manoharan

[permalink] [raw]
Subject: [PATCH 08/12] ath9k_hw: Fix max rx rate drop for AR9565

Whenever i_coff of IQ calibration is too high, AR9565 drops max
rx rate to MCS4. Skipping IQ update at this time can avoid this
problem for AR9565.

Signed-off-by: Rajkumar Manoharan <[email protected]>
---
drivers/net/wireless/ath/ath9k/ar9003_calib.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_calib.c b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
index 84b558d..162401f 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
@@ -276,6 +276,11 @@ static void ar9003_hw_iqcalibrate(struct ath_hw *ah, u8 numChains)
offset_array[i],
REG_READ(ah, offset_array[i]));

+ if (AR_SREV_9565(ah) &&
+ (iCoff == 63 || qCoff == 63 ||
+ iCoff == -63 || qCoff == -63))
+ return;
+
REG_RMW_FIELD(ah, offset_array[i],
AR_PHY_RX_IQCAL_CORR_IQCORR_Q_I_COFF,
iCoff);
--
1.7.12.2


2012-10-15 09:33:19

by Sujith Manoharan

[permalink] [raw]
Subject: [PATCH 05/12] ath9k_hw: Disable MCI stat counter by default for AR9565

Rajkumar Manoharan wrote:
> Signed-off-by: Rajkumar Manoharan <[email protected]>
> ---
> drivers/net/wireless/ath/ath9k/ar9003_mci.c | 11 ++++++++++-
> drivers/net/wireless/ath/ath9k/reg.h | 3 +++
> 2 files changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mci.c b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
> index c46d8f1..466ac8da 100644
> --- a/drivers/net/wireless/ath/ath9k/ar9003_mci.c
> +++ b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
> @@ -938,6 +938,9 @@ int ar9003_mci_reset(struct ath_hw *ah, bool en_int, bool is_2g,
> mci->ready = true;
> ar9003_mci_prep_interface(ah);
>
> + if (AR_SREV_9565(ah))
> + REG_RMW_FIELD(ah, AR_MCI_DBG_CNT_CTRL,
> + AR_MCI_DBG_CNT_CTRL_ENABLE, 0);
> if (en_int)
> ar9003_mci_enable_interrupt(ah);
>
> @@ -1179,13 +1182,19 @@ int ar9003_mci_setup(struct ath_hw *ah, u32 gpm_addr, void *gpm_buf,
> u16 len, u32 sched_addr)
> {
> struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
> + int ret;
>
> mci->gpm_addr = gpm_addr;
> mci->gpm_buf = gpm_buf;
> mci->gpm_len = len;
> mci->sched_addr = sched_addr;
>
> - return ar9003_mci_reset(ah, true, true, true);
> + ret = ar9003_mci_reset(ah, true, true, true);
> +
> + if (AR_SREV_9565(ah))
> + REG_RMW_FIELD(ah, AR_MCI_DBG_CNT_CTRL,
> + AR_MCI_DBG_CNT_CTRL_ENABLE, 0);
> + return ret;

Why do this is two different places, when reset() is actually called from
setup() ?

Sujith