2011-07-04 06:11:04

by Felix Fietkau

[permalink] [raw]
Subject: [PATCH 1/8] ath5k: add missing checks for rfgain probe

rfgain probe is only necessary for OFDM operation on AR5112 and no other
radio chips

Signed-off-by: Felix Fietkau <[email protected]>
---
drivers/net/wireless/ath/ath5k/phy.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
index 5544191..c774468 100644
--- a/drivers/net/wireless/ath/ath5k/phy.c
+++ b/drivers/net/wireless/ath/ath5k/phy.c
@@ -1604,11 +1604,12 @@ int ath5k_hw_phy_calibrate(struct ath5k_hw *ah,
int ret;

if (ah->ah_radio == AR5K_RF5110)
- ret = ath5k_hw_rf5110_calibrate(ah, channel);
- else {
- ret = ath5k_hw_rf511x_iq_calibrate(ah);
+ return ath5k_hw_rf5110_calibrate(ah, channel);
+
+ ret = ath5k_hw_rf511x_iq_calibrate(ah);
+
+ if (ah->ah_radio == AR5K_RF5112 && (channel->hw_value & CHANNEL_OFDM))
ath5k_hw_request_rfgain_probe(ah);
- }

return ret;
}
--
1.7.3.2



2011-07-04 10:27:29

by Nick Kossifidis

[permalink] [raw]
Subject: Re: [PATCH 3/8] ath5k: fix reference clock frequency for spur mitigation on AR2413

2011/7/4 Felix Fietkau <[email protected]>:
> AR2413 uses the same reference clock as AR5413
>
> Signed-off-by: Felix Fietkau <[email protected]>
> ---
>  drivers/net/wireless/ath/ath5k/phy.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
> index f66124a..c65c33a 100644
> --- a/drivers/net/wireless/ath/ath5k/phy.c
> +++ b/drivers/net/wireless/ath/ath5k/phy.c
> @@ -105,6 +105,7 @@ bool ath5k_hw_chan_has_spur_noise(struct ath5k_hw *ah,
>
>        if ((ah->ah_radio == AR5K_RF5112) ||
>        (ah->ah_radio == AR5K_RF5413) ||
> +       (ah->ah_radio == AR5K_RF2413) ||
>        (ah->ah_mac_version == (AR5K_SREV_AR2417 >> 4)))
>                refclk_freq = 40;
>        else
> --
> 1.7.3.2
>

If that's true we should also change it on set_sleep_clock (patch 6 on
your series).



--
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick

2011-07-04 10:29:06

by Nick Kossifidis

[permalink] [raw]
Subject: Re: [ath5k-devel] [PATCH 2/8] ath5k: apply the synth voltage tweak only on AR5112 rev 2

MjAxMS83LzQgRmVsaXggRmlldGthdSA8bmJkQG9wZW53cnQub3JnPjoKPiBNaWdodCBmaXggc29t
ZSBzdGFiaWxpdHkgaXNzdWVzIG9uIG5ld2VyIGNoaXBzCj4KPiBTaWduZWQtb2ZmLWJ5OiBGZWxp
eCBGaWV0a2F1IDxuYmRAb3BlbndydC5vcmc+Cj4gLS0tCj4gwqBkcml2ZXJzL25ldC93aXJlbGVz
cy9hdGgvYXRoNWsvcGh5LmMgfCDCoCAxOSArKysrKysrKysrKy0tLS0tLS0tCj4gwqAxIGZpbGVz
IGNoYW5nZWQsIDExIGluc2VydGlvbnMoKyksIDggZGVsZXRpb25zKC0pCj4KPiBkaWZmIC0tZ2l0
IGEvZHJpdmVycy9uZXQvd2lyZWxlc3MvYXRoL2F0aDVrL3BoeS5jIGIvZHJpdmVycy9uZXQvd2ly
ZWxlc3MvYXRoL2F0aDVrL3BoeS5jCj4gaW5kZXggYzc3NDQ2OC4uZjY2MTI0YSAxMDA2NDQKPiAt
LS0gYS9kcml2ZXJzL25ldC93aXJlbGVzcy9hdGgvYXRoNWsvcGh5LmMKPiArKysgYi9kcml2ZXJz
L25ldC93aXJlbGVzcy9hdGgvYXRoNWsvcGh5LmMKPiBAQCAtOTcwLDE3ICs5NzAsMjAgQEAgc3Rh
dGljIGludCBhdGg1a19od19yZnJlZ3NfaW5pdChzdHJ1Y3QgYXRoNWtfaHcgKmFoLAo+IMKgIMKg
IMKgIMKgIMKgIMKg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MKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKg
IEFSNUtfUkZfUFVTSF9VUCwgdHJ1ZSk7Cj4gKyDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDC
oCDCoCB9Cj4KPiDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoC8qIERlY3JlYXNl
IHBvd2VyIGNvbnN1bXB0aW9uIG9uIDUyMTMrIEJhc2VCYW5kICovCj4gwqAgwqAgwqAgwqAgwqAg
wqAgwqAgwqAgwqAgwqAgwqAgwqBpZiAoYWgtPmFoX3BoeV9yZXZpc2lvbiA+PSBBUjVLX1NSRVZf
UEhZXzUyMTJBKSB7CgpBY2tlZC1ieTogTmljayBLb3NzaWZpZGlzIDxtaWNrZmxlbW1AZ21haWwu
Y29tPgoKCi0tIApHUEcgSUQ6IDB4RDIxREIyREIKQXMgeW91IHJlYWQgdGhpcyBwb3N0IGdsb2Jh
bCBlbnRyb3B5IHJpc2VzLiBIYXZlIEZ1biA7LSkKTmljawo=

2011-07-04 09:48:49

by Nick Kossifidis

[permalink] [raw]
Subject: Re: [PATCH 1/8] ath5k: add missing checks for rfgain probe

2011/7/4 Felix Fietkau <[email protected]>:
> rfgain probe is only necessary for OFDM operation on AR5112 and no other
> radio chips
>

It's also available on RF5111 (with AR5211 or AR5212)...

--
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick

2011-07-04 06:11:03

by Felix Fietkau

[permalink] [raw]
Subject: [PATCH 3/8] ath5k: fix reference clock frequency for spur mitigation on AR2413

AR2413 uses the same reference clock as AR5413

Signed-off-by: Felix Fietkau <[email protected]>
---
drivers/net/wireless/ath/ath5k/phy.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
index f66124a..c65c33a 100644
--- a/drivers/net/wireless/ath/ath5k/phy.c
+++ b/drivers/net/wireless/ath/ath5k/phy.c
@@ -105,6 +105,7 @@ bool ath5k_hw_chan_has_spur_noise(struct ath5k_hw *ah,

if ((ah->ah_radio == AR5K_RF5112) ||
(ah->ah_radio == AR5K_RF5413) ||
+ (ah->ah_radio == AR5K_RF2413) ||
(ah->ah_mac_version == (AR5K_SREV_AR2417 >> 4)))
refclk_freq = 40;
else
--
1.7.3.2


2011-07-04 09:56:38

by Felix Fietkau

[permalink] [raw]
Subject: Re: [PATCH 1/8] ath5k: add missing checks for rfgain probe

On 2011-07-04 4:48 PM, Nick Kossifidis wrote:
> 2011/7/4 Felix Fietkau<[email protected]>:
>> rfgain probe is only necessary for OFDM operation on AR5112 and no other
>> radio chips
>>
>
> It's also available on RF5111 (with AR5211 or AR5212)...
Oh, right, missed that. Will send a v2.

- Felix

2011-07-04 06:11:04

by Felix Fietkau

[permalink] [raw]
Subject: [PATCH 2/8] ath5k: apply the synth voltage tweak only on AR5112 rev 2

Might fix some stability issues on newer chips

Signed-off-by: Felix Fietkau <[email protected]>
---
drivers/net/wireless/ath/ath5k/phy.c | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
index c774468..f66124a 100644
--- a/drivers/net/wireless/ath/ath5k/phy.c
+++ b/drivers/net/wireless/ath/ath5k/phy.c
@@ -970,17 +970,20 @@ static int ath5k_hw_rfregs_init(struct ath5k_hw *ah,
}

/* Lower synth voltage on Rev 2 */
- ath5k_hw_rfb_op(ah, rf_regs, 2,
- AR5K_RF_HIGH_VC_CP, true);
+ if (ah->ah_radio == AR5K_RF5112 &&
+ (ah->ah_radio_5ghz_revision & AR5K_SREV_REV) > 0) {
+ ath5k_hw_rfb_op(ah, rf_regs, 2,
+ AR5K_RF_HIGH_VC_CP, true);

- ath5k_hw_rfb_op(ah, rf_regs, 2,
- AR5K_RF_MID_VC_CP, true);
+ ath5k_hw_rfb_op(ah, rf_regs, 2,
+ AR5K_RF_MID_VC_CP, true);

- ath5k_hw_rfb_op(ah, rf_regs, 2,
- AR5K_RF_LOW_VC_CP, true);
+ ath5k_hw_rfb_op(ah, rf_regs, 2,
+ AR5K_RF_LOW_VC_CP, true);

- ath5k_hw_rfb_op(ah, rf_regs, 2,
- AR5K_RF_PUSH_UP, true);
+ ath5k_hw_rfb_op(ah, rf_regs, 2,
+ AR5K_RF_PUSH_UP, true);
+ }

/* Decrease power consumption on 5213+ BaseBand */
if (ah->ah_phy_revision >= AR5K_SREV_PHY_5212A) {
--
1.7.3.2