diff options
author | Vivek Natarajan <vnatarajan@atheros.com> | 2010-04-05 05:18:04 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-04-07 14:37:57 -0400 |
commit | 53bc7aa08b48e5cd745f986731cc7dc24eef2a9f (patch) | |
tree | 5ddee6375615343ff30a63878ef4765b2cd2921c | |
parent | d5cdfacb35ed886271d1ccfffbded98d3447da17 (diff) |
ath9k: Add support for newer AR9285 chipsets.
This patch adds support for a modified newer version of AR9285
chipsets.
Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/ath9k/calib.c | 59 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 29 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/initvals.h | 109 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/phy.h | 14 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/reg.h | 13 |
5 files changed, 201 insertions, 23 deletions
diff --git a/drivers/net/wireless/ath/ath9k/calib.c b/drivers/net/wireless/ath/ath9k/calib.c index d5026e4f484b..064f5b51dfcd 100644 --- a/drivers/net/wireless/ath/ath9k/calib.c +++ b/drivers/net/wireless/ath/ath9k/calib.c | |||
@@ -18,6 +18,7 @@ | |||
18 | 18 | ||
19 | /* We can tune this as we go by monitoring really low values */ | 19 | /* We can tune this as we go by monitoring really low values */ |
20 | #define ATH9K_NF_TOO_LOW -60 | 20 | #define ATH9K_NF_TOO_LOW -60 |
21 | #define AR9285_CLCAL_REDO_THRESH 1 | ||
21 | 22 | ||
22 | /* AR5416 may return very high value (like -31 dBm), in those cases the nf | 23 | /* AR5416 may return very high value (like -31 dBm), in those cases the nf |
23 | * is incorrect and we should use the static NF value. Later we can try to | 24 | * is incorrect and we should use the static NF value. Later we can try to |
@@ -1091,7 +1092,7 @@ bool ath9k_hw_calibrate(struct ath_hw *ah, struct ath9k_channel *chan, | |||
1091 | EXPORT_SYMBOL(ath9k_hw_calibrate); | 1092 | EXPORT_SYMBOL(ath9k_hw_calibrate); |
1092 | 1093 | ||
1093 | /* Carrier leakage Calibration fix */ | 1094 | /* Carrier leakage Calibration fix */ |
1094 | static bool ar9285_clc(struct ath_hw *ah, struct ath9k_channel *chan) | 1095 | static bool ar9285_cl_cal(struct ath_hw *ah, struct ath9k_channel *chan) |
1095 | { | 1096 | { |
1096 | struct ath_common *common = ath9k_hw_common(ah); | 1097 | struct ath_common *common = ath9k_hw_common(ah); |
1097 | 1098 | ||
@@ -1132,6 +1133,62 @@ static bool ar9285_clc(struct ath_hw *ah, struct ath9k_channel *chan) | |||
1132 | return true; | 1133 | return true; |
1133 | } | 1134 | } |
1134 | 1135 | ||
1136 | static bool ar9285_clc(struct ath_hw *ah, struct ath9k_channel *chan) | ||
1137 | { | ||
1138 | int i; | ||
1139 | u_int32_t txgain_max; | ||
1140 | u_int32_t clc_gain, gain_mask = 0, clc_num = 0; | ||
1141 | u_int32_t reg_clc_I0, reg_clc_Q0; | ||
1142 | u_int32_t i0_num = 0; | ||
1143 | u_int32_t q0_num = 0; | ||
1144 | u_int32_t total_num = 0; | ||
1145 | u_int32_t reg_rf2g5_org; | ||
1146 | bool retv = true; | ||
1147 | |||
1148 | if (!(ar9285_cl_cal(ah, chan))) | ||
1149 | return false; | ||
1150 | |||
1151 | txgain_max = MS(REG_READ(ah, AR_PHY_TX_PWRCTRL7), | ||
1152 | AR_PHY_TX_PWRCTRL_TX_GAIN_TAB_MAX); | ||
1153 | |||
1154 | for (i = 0; i < (txgain_max+1); i++) { | ||
1155 | clc_gain = (REG_READ(ah, (AR_PHY_TX_GAIN_TBL1+(i<<2))) & | ||
1156 | AR_PHY_TX_GAIN_CLC) >> AR_PHY_TX_GAIN_CLC_S; | ||
1157 | if (!(gain_mask & (1 << clc_gain))) { | ||
1158 | gain_mask |= (1 << clc_gain); | ||
1159 | clc_num++; | ||
1160 | } | ||
1161 | } | ||
1162 | |||
1163 | for (i = 0; i < clc_num; i++) { | ||
1164 | reg_clc_I0 = (REG_READ(ah, (AR_PHY_CLC_TBL1 + (i << 2))) | ||
1165 | & AR_PHY_CLC_I0) >> AR_PHY_CLC_I0_S; | ||
1166 | reg_clc_Q0 = (REG_READ(ah, (AR_PHY_CLC_TBL1 + (i << 2))) | ||
1167 | & AR_PHY_CLC_Q0) >> AR_PHY_CLC_Q0_S; | ||
1168 | if (reg_clc_I0 == 0) | ||
1169 | i0_num++; | ||
1170 | |||
1171 | if (reg_clc_Q0 == 0) | ||
1172 | q0_num++; | ||
1173 | } | ||
1174 | total_num = i0_num + q0_num; | ||
1175 | if (total_num > AR9285_CLCAL_REDO_THRESH) { | ||
1176 | reg_rf2g5_org = REG_READ(ah, AR9285_RF2G5); | ||
1177 | if (AR_SREV_9285E_20(ah)) { | ||
1178 | REG_WRITE(ah, AR9285_RF2G5, | ||
1179 | (reg_rf2g5_org & AR9285_RF2G5_IC50TX) | | ||
1180 | AR9285_RF2G5_IC50TX_XE_SET); | ||
1181 | } else { | ||
1182 | REG_WRITE(ah, AR9285_RF2G5, | ||
1183 | (reg_rf2g5_org & AR9285_RF2G5_IC50TX) | | ||
1184 | AR9285_RF2G5_IC50TX_SET); | ||
1185 | } | ||
1186 | retv = ar9285_cl_cal(ah, chan); | ||
1187 | REG_WRITE(ah, AR9285_RF2G5, reg_rf2g5_org); | ||
1188 | } | ||
1189 | return retv; | ||
1190 | } | ||
1191 | |||
1135 | bool ath9k_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan) | 1192 | bool ath9k_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan) |
1136 | { | 1193 | { |
1137 | struct ath_common *common = ath9k_hw_common(ah); | 1194 | struct ath_common *common = ath9k_hw_common(ah); |
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index feae55a8124d..81965b2d263b 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -815,15 +815,30 @@ static void ath9k_hw_init_mode_gain_regs(struct ath_hw *ah) | |||
815 | 815 | ||
816 | /* txgain table */ | 816 | /* txgain table */ |
817 | if (txgain_type == AR5416_EEP_TXGAIN_HIGH_POWER) { | 817 | if (txgain_type == AR5416_EEP_TXGAIN_HIGH_POWER) { |
818 | INIT_INI_ARRAY(&ah->iniModesTxGain, | 818 | if (AR_SREV_9285E_20(ah)) { |
819 | ar9285Modes_high_power_tx_gain_9285_1_2, | 819 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
820 | ARRAY_SIZE(ar9285Modes_high_power_tx_gain_9285_1_2), 6); | 820 | ar9285Modes_XE2_0_high_power, |
821 | ARRAY_SIZE( | ||
822 | ar9285Modes_XE2_0_high_power), 6); | ||
823 | } else { | ||
824 | INIT_INI_ARRAY(&ah->iniModesTxGain, | ||
825 | ar9285Modes_high_power_tx_gain_9285_1_2, | ||
826 | ARRAY_SIZE( | ||
827 | ar9285Modes_high_power_tx_gain_9285_1_2), 6); | ||
828 | } | ||
821 | } else { | 829 | } else { |
822 | INIT_INI_ARRAY(&ah->iniModesTxGain, | 830 | if (AR_SREV_9285E_20(ah)) { |
823 | ar9285Modes_original_tx_gain_9285_1_2, | 831 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
824 | ARRAY_SIZE(ar9285Modes_original_tx_gain_9285_1_2), 6); | 832 | ar9285Modes_XE2_0_normal_power, |
833 | ARRAY_SIZE( | ||
834 | ar9285Modes_XE2_0_normal_power), 6); | ||
835 | } else { | ||
836 | INIT_INI_ARRAY(&ah->iniModesTxGain, | ||
837 | ar9285Modes_original_tx_gain_9285_1_2, | ||
838 | ARRAY_SIZE( | ||
839 | ar9285Modes_original_tx_gain_9285_1_2), 6); | ||
840 | } | ||
825 | } | 841 | } |
826 | |||
827 | } | 842 | } |
828 | } | 843 | } |
829 | 844 | ||
diff --git a/drivers/net/wireless/ath/ath9k/initvals.h b/drivers/net/wireless/ath/ath9k/initvals.h index 177bdeb84ad7..455e9d3b3f13 100644 --- a/drivers/net/wireless/ath/ath9k/initvals.h +++ b/drivers/net/wireless/ath/ath9k/initvals.h | |||
@@ -4184,7 +4184,7 @@ static const u_int32_t ar9285Modes_9285_1_2[][6] = { | |||
4184 | { 0x00009a44, 0x00000000, 0x00000000, 0x000581a8, 0x000581a8, 0x00000000 }, | 4184 | { 0x00009a44, 0x00000000, 0x00000000, 0x000581a8, 0x000581a8, 0x00000000 }, |
4185 | { 0x00009a48, 0x00000000, 0x00000000, 0x00058284, 0x00058284, 0x00000000 }, | 4185 | { 0x00009a48, 0x00000000, 0x00000000, 0x00058284, 0x00058284, 0x00000000 }, |
4186 | { 0x00009a4c, 0x00000000, 0x00000000, 0x00058288, 0x00058288, 0x00000000 }, | 4186 | { 0x00009a4c, 0x00000000, 0x00000000, 0x00058288, 0x00058288, 0x00000000 }, |
4187 | { 0x00009a50, 0x00000000, 0x00000000, 0x00058220, 0x00058220, 0x00000000 }, | 4187 | { 0x00009a50, 0x00000000, 0x00000000, 0x00058224, 0x00058224, 0x00000000 }, |
4188 | { 0x00009a54, 0x00000000, 0x00000000, 0x00058290, 0x00058290, 0x00000000 }, | 4188 | { 0x00009a54, 0x00000000, 0x00000000, 0x00058290, 0x00058290, 0x00000000 }, |
4189 | { 0x00009a58, 0x00000000, 0x00000000, 0x00058300, 0x00058300, 0x00000000 }, | 4189 | { 0x00009a58, 0x00000000, 0x00000000, 0x00058300, 0x00058300, 0x00000000 }, |
4190 | { 0x00009a5c, 0x00000000, 0x00000000, 0x00058304, 0x00058304, 0x00000000 }, | 4190 | { 0x00009a5c, 0x00000000, 0x00000000, 0x00058304, 0x00058304, 0x00000000 }, |
@@ -4198,8 +4198,8 @@ static const u_int32_t ar9285Modes_9285_1_2[][6] = { | |||
4198 | { 0x00009a7c, 0x00000000, 0x00000000, 0x0006870c, 0x0006870c, 0x00000000 }, | 4198 | { 0x00009a7c, 0x00000000, 0x00000000, 0x0006870c, 0x0006870c, 0x00000000 }, |
4199 | { 0x00009a80, 0x00000000, 0x00000000, 0x00068780, 0x00068780, 0x00000000 }, | 4199 | { 0x00009a80, 0x00000000, 0x00000000, 0x00068780, 0x00068780, 0x00000000 }, |
4200 | { 0x00009a84, 0x00000000, 0x00000000, 0x00068784, 0x00068784, 0x00000000 }, | 4200 | { 0x00009a84, 0x00000000, 0x00000000, 0x00068784, 0x00068784, 0x00000000 }, |
4201 | { 0x00009a88, 0x00000000, 0x00000000, 0x00078b04, 0x00078b04, 0x00000000 }, | 4201 | { 0x00009a88, 0x00000000, 0x00000000, 0x00078b00, 0x00078b00, 0x00000000 }, |
4202 | { 0x00009a8c, 0x00000000, 0x00000000, 0x00078b08, 0x00078b08, 0x00000000 }, | 4202 | { 0x00009a8c, 0x00000000, 0x00000000, 0x00078b04, 0x00078b04, 0x00000000 }, |
4203 | { 0x00009a90, 0x00000000, 0x00000000, 0x00078b08, 0x00078b08, 0x00000000 }, | 4203 | { 0x00009a90, 0x00000000, 0x00000000, 0x00078b08, 0x00078b08, 0x00000000 }, |
4204 | { 0x00009a94, 0x00000000, 0x00000000, 0x00078b0c, 0x00078b0c, 0x00000000 }, | 4204 | { 0x00009a94, 0x00000000, 0x00000000, 0x00078b0c, 0x00078b0c, 0x00000000 }, |
4205 | { 0x00009a98, 0x00000000, 0x00000000, 0x00078b80, 0x00078b80, 0x00000000 }, | 4205 | { 0x00009a98, 0x00000000, 0x00000000, 0x00078b80, 0x00078b80, 0x00000000 }, |
@@ -4312,7 +4312,7 @@ static const u_int32_t ar9285Modes_9285_1_2[][6] = { | |||
4312 | { 0x0000aa44, 0x00000000, 0x00000000, 0x000581a8, 0x000581a8, 0x00000000 }, | 4312 | { 0x0000aa44, 0x00000000, 0x00000000, 0x000581a8, 0x000581a8, 0x00000000 }, |
4313 | { 0x0000aa48, 0x00000000, 0x00000000, 0x00058284, 0x00058284, 0x00000000 }, | 4313 | { 0x0000aa48, 0x00000000, 0x00000000, 0x00058284, 0x00058284, 0x00000000 }, |
4314 | { 0x0000aa4c, 0x00000000, 0x00000000, 0x00058288, 0x00058288, 0x00000000 }, | 4314 | { 0x0000aa4c, 0x00000000, 0x00000000, 0x00058288, 0x00058288, 0x00000000 }, |
4315 | { 0x0000aa50, 0x00000000, 0x00000000, 0x00058220, 0x00058220, 0x00000000 }, | 4315 | { 0x0000aa50, 0x00000000, 0x00000000, 0x00058224, 0x00058224, 0x00000000 }, |
4316 | { 0x0000aa54, 0x00000000, 0x00000000, 0x00058290, 0x00058290, 0x00000000 }, | 4316 | { 0x0000aa54, 0x00000000, 0x00000000, 0x00058290, 0x00058290, 0x00000000 }, |
4317 | { 0x0000aa58, 0x00000000, 0x00000000, 0x00058300, 0x00058300, 0x00000000 }, | 4317 | { 0x0000aa58, 0x00000000, 0x00000000, 0x00058300, 0x00058300, 0x00000000 }, |
4318 | { 0x0000aa5c, 0x00000000, 0x00000000, 0x00058304, 0x00058304, 0x00000000 }, | 4318 | { 0x0000aa5c, 0x00000000, 0x00000000, 0x00058304, 0x00058304, 0x00000000 }, |
@@ -4326,8 +4326,8 @@ static const u_int32_t ar9285Modes_9285_1_2[][6] = { | |||
4326 | { 0x0000aa7c, 0x00000000, 0x00000000, 0x0006870c, 0x0006870c, 0x00000000 }, | 4326 | { 0x0000aa7c, 0x00000000, 0x00000000, 0x0006870c, 0x0006870c, 0x00000000 }, |
4327 | { 0x0000aa80, 0x00000000, 0x00000000, 0x00068780, 0x00068780, 0x00000000 }, | 4327 | { 0x0000aa80, 0x00000000, 0x00000000, 0x00068780, 0x00068780, 0x00000000 }, |
4328 | { 0x0000aa84, 0x00000000, 0x00000000, 0x00068784, 0x00068784, 0x00000000 }, | 4328 | { 0x0000aa84, 0x00000000, 0x00000000, 0x00068784, 0x00068784, 0x00000000 }, |
4329 | { 0x0000aa88, 0x00000000, 0x00000000, 0x00078b04, 0x00078b04, 0x00000000 }, | 4329 | { 0x0000aa88, 0x00000000, 0x00000000, 0x00078b00, 0x00078b00, 0x00000000 }, |
4330 | { 0x0000aa8c, 0x00000000, 0x00000000, 0x00078b08, 0x00078b08, 0x00000000 }, | 4330 | { 0x0000aa8c, 0x00000000, 0x00000000, 0x00078b04, 0x00078b04, 0x00000000 }, |
4331 | { 0x0000aa90, 0x00000000, 0x00000000, 0x00078b08, 0x00078b08, 0x00000000 }, | 4331 | { 0x0000aa90, 0x00000000, 0x00000000, 0x00078b08, 0x00078b08, 0x00000000 }, |
4332 | { 0x0000aa94, 0x00000000, 0x00000000, 0x00078b0c, 0x00078b0c, 0x00000000 }, | 4332 | { 0x0000aa94, 0x00000000, 0x00000000, 0x00078b0c, 0x00078b0c, 0x00000000 }, |
4333 | { 0x0000aa98, 0x00000000, 0x00000000, 0x00078b80, 0x00078b80, 0x00000000 }, | 4333 | { 0x0000aa98, 0x00000000, 0x00000000, 0x00078b80, 0x00078b80, 0x00000000 }, |
@@ -4731,17 +4731,12 @@ static const u_int32_t ar9285Common_9285_1_2[][2] = { | |||
4731 | { 0x00007808, 0x54214514 }, | 4731 | { 0x00007808, 0x54214514 }, |
4732 | { 0x0000780c, 0x02025830 }, | 4732 | { 0x0000780c, 0x02025830 }, |
4733 | { 0x00007810, 0x71c0d388 }, | 4733 | { 0x00007810, 0x71c0d388 }, |
4734 | { 0x00007814, 0x924934a8 }, | ||
4735 | { 0x0000781c, 0x00000000 }, | 4734 | { 0x0000781c, 0x00000000 }, |
4736 | { 0x00007824, 0x00d86fff }, | 4735 | { 0x00007824, 0x00d86fff }, |
4737 | { 0x00007828, 0x26d2491b }, | ||
4738 | { 0x0000782c, 0x6e36d97b }, | 4736 | { 0x0000782c, 0x6e36d97b }, |
4739 | { 0x00007830, 0xedb6d96e }, | ||
4740 | { 0x00007834, 0x71400087 }, | 4737 | { 0x00007834, 0x71400087 }, |
4741 | { 0x0000783c, 0x0001fffe }, | ||
4742 | { 0x00007840, 0xffeb1a20 }, | ||
4743 | { 0x00007844, 0x000c0db6 }, | 4738 | { 0x00007844, 0x000c0db6 }, |
4744 | { 0x00007848, 0x6db61b6f }, | 4739 | { 0x00007848, 0x6db6246f }, |
4745 | { 0x0000784c, 0x6d9b66db }, | 4740 | { 0x0000784c, 0x6d9b66db }, |
4746 | { 0x00007850, 0x6d8c6dba }, | 4741 | { 0x00007850, 0x6d8c6dba }, |
4747 | { 0x00007854, 0x00040000 }, | 4742 | { 0x00007854, 0x00040000 }, |
@@ -4777,7 +4772,12 @@ static const u_int32_t ar9285Modes_high_power_tx_gain_9285_1_2[][6] = { | |||
4777 | { 0x0000a34c, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, | 4772 | { 0x0000a34c, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, |
4778 | { 0x0000a350, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, | 4773 | { 0x0000a350, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, |
4779 | { 0x0000a354, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, | 4774 | { 0x0000a354, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, |
4775 | { 0x00007814, 0x924934a8, 0x924934a8, 0x924934a8, 0x924934a8, 0x924934a8 }, | ||
4776 | { 0x00007828, 0x26d2491b, 0x26d2491b, 0x26d2491b, 0x26d2491b, 0x26d2491b }, | ||
4777 | { 0x00007830, 0xedb6d96e, 0xedb6d96e, 0xedb6d96e, 0xedb6d96e, 0xedb6d96e }, | ||
4780 | { 0x00007838, 0xfac68803, 0xfac68803, 0xfac68803, 0xfac68803, 0xfac68803 }, | 4778 | { 0x00007838, 0xfac68803, 0xfac68803, 0xfac68803, 0xfac68803, 0xfac68803 }, |
4779 | { 0x0000783c, 0x0001fffe, 0x0001fffe, 0x0001fffe, 0x0001fffe, 0x0001fffe }, | ||
4780 | { 0x00007840, 0xffeb1a20, 0xffeb1a20, 0xffeb1a20, 0xffeb1a20, 0xffeb1a20 }, | ||
4781 | { 0x0000786c, 0x08609ebe, 0x08609ebe, 0x08609ebe, 0x08609ebe, 0x08609ebe }, | 4781 | { 0x0000786c, 0x08609ebe, 0x08609ebe, 0x08609ebe, 0x08609ebe, 0x08609ebe }, |
4782 | { 0x00007820, 0x00000c00, 0x00000c00, 0x00000c00, 0x00000c00, 0x00000c00 }, | 4782 | { 0x00007820, 0x00000c00, 0x00000c00, 0x00000c00, 0x00000c00, 0x00000c00 }, |
4783 | { 0x0000a274, 0x0a22a652, 0x0a22a652, 0x0a216652, 0x0a216652, 0x0a22a652 }, | 4783 | { 0x0000a274, 0x0a22a652, 0x0a22a652, 0x0a216652, 0x0a216652, 0x0a22a652 }, |
@@ -4813,7 +4813,12 @@ static const u_int32_t ar9285Modes_original_tx_gain_9285_1_2[][6] = { | |||
4813 | { 0x0000a34c, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, | 4813 | { 0x0000a34c, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, |
4814 | { 0x0000a350, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, | 4814 | { 0x0000a350, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, |
4815 | { 0x0000a354, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, | 4815 | { 0x0000a354, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, |
4816 | { 0x00007814, 0x924934a8, 0x924934a8, 0x924934a8, 0x924934a8, 0x924934a8 }, | ||
4817 | { 0x00007828, 0x26d2491b, 0x26d2491b, 0x26d2491b, 0x26d2491b, 0x26d2491b }, | ||
4818 | { 0x00007830, 0xedb6d96e, 0xedb6d96e, 0xedb6d96e, 0xedb6d96e, 0xedb6d96e }, | ||
4816 | { 0x00007838, 0xfac68801, 0xfac68801, 0xfac68801, 0xfac68801, 0xfac68801 }, | 4819 | { 0x00007838, 0xfac68801, 0xfac68801, 0xfac68801, 0xfac68801, 0xfac68801 }, |
4820 | { 0x0000783c, 0x0001fffe, 0x0001fffe, 0x0001fffe, 0x0001fffe, 0x0001fffe }, | ||
4821 | { 0x00007840, 0xffeb1a20, 0xffeb1a20, 0xffeb1a20, 0xffeb1a20, 0xffeb1a20 }, | ||
4817 | { 0x0000786c, 0x48609eb4, 0x48609eb4, 0x48609eb4, 0x48609eb4, 0x48609eb4 }, | 4822 | { 0x0000786c, 0x48609eb4, 0x48609eb4, 0x48609eb4, 0x48609eb4, 0x48609eb4 }, |
4818 | { 0x00007820, 0x00000c04, 0x00000c04, 0x00000c04, 0x00000c04, 0x00000c04 }, | 4823 | { 0x00007820, 0x00000c04, 0x00000c04, 0x00000c04, 0x00000c04, 0x00000c04 }, |
4819 | { 0x0000a274, 0x0a21c652, 0x0a21c652, 0x0a21a652, 0x0a21a652, 0x0a22a652 }, | 4824 | { 0x0000a274, 0x0a21c652, 0x0a21c652, 0x0a21a652, 0x0a21a652, 0x0a22a652 }, |
@@ -4825,6 +4830,86 @@ static const u_int32_t ar9285Modes_original_tx_gain_9285_1_2[][6] = { | |||
4825 | { 0x0000a3e0, 0x0000039c, 0x0000039c, 0x0000039c, 0x0000039c, 0x0000039c }, | 4830 | { 0x0000a3e0, 0x0000039c, 0x0000039c, 0x0000039c, 0x0000039c, 0x0000039c }, |
4826 | }; | 4831 | }; |
4827 | 4832 | ||
4833 | static const u_int32_t ar9285Modes_XE2_0_normal_power[][6] = { | ||
4834 | { 0x0000a300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, | ||
4835 | { 0x0000a304, 0x00000000, 0x00000000, 0x00009200, 0x00009200, 0x00000000 }, | ||
4836 | { 0x0000a308, 0x00000000, 0x00000000, 0x00010208, 0x00010208, 0x00000000 }, | ||
4837 | { 0x0000a30c, 0x00000000, 0x00000000, 0x00019608, 0x00019608, 0x00000000 }, | ||
4838 | { 0x0000a310, 0x00000000, 0x00000000, 0x00022618, 0x00022618, 0x00000000 }, | ||
4839 | { 0x0000a314, 0x00000000, 0x00000000, 0x0002a6c9, 0x0002a6c9, 0x00000000 }, | ||
4840 | { 0x0000a318, 0x00000000, 0x00000000, 0x00031710, 0x00031710, 0x00000000 }, | ||
4841 | { 0x0000a31c, 0x00000000, 0x00000000, 0x00035718, 0x00035718, 0x00000000 }, | ||
4842 | { 0x0000a320, 0x00000000, 0x00000000, 0x00038758, 0x00038758, 0x00000000 }, | ||
4843 | { 0x0000a324, 0x00000000, 0x00000000, 0x0003c75a, 0x0003c75a, 0x00000000 }, | ||
4844 | { 0x0000a328, 0x00000000, 0x00000000, 0x0004075c, 0x0004075c, 0x00000000 }, | ||
4845 | { 0x0000a32c, 0x00000000, 0x00000000, 0x0004475e, 0x0004475e, 0x00000000 }, | ||
4846 | { 0x0000a330, 0x00000000, 0x00000000, 0x0004679f, 0x0004679f, 0x00000000 }, | ||
4847 | { 0x0000a334, 0x00000000, 0x00000000, 0x000487df, 0x000487df, 0x00000000 }, | ||
4848 | { 0x0000a338, 0x0003891e, 0x0003891e, 0x0003891e, 0x0003891e, 0x00000000 }, | ||
4849 | { 0x0000a33c, 0x0003a95e, 0x0003a95e, 0x0003a95e, 0x0003a95e, 0x00000000 }, | ||
4850 | { 0x0000a340, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, | ||
4851 | { 0x0000a344, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, | ||
4852 | { 0x0000a348, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, | ||
4853 | { 0x0000a34c, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, | ||
4854 | { 0x0000a350, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, | ||
4855 | { 0x0000a354, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, | ||
4856 | { 0x00007814, 0x92497ca8, 0x92497ca8, 0x92497ca8, 0x92497ca8, 0x92497ca8 }, | ||
4857 | { 0x00007828, 0x4ad2491b, 0x4ad2491b, 0x2ad2491b, 0x4ad2491b, 0x4ad2491b }, | ||
4858 | { 0x00007830, 0xedb6da6e, 0xedb6da6e, 0xedb6da6e, 0xedb6da6e, 0xedb6dbae }, | ||
4859 | { 0x00007838, 0xdac71441, 0xdac71441, 0xdac71441, 0xdac71441, 0xdac71441 }, | ||
4860 | { 0x0000783c, 0x2481f6fe, 0x2481f6fe, 0x2481f6fe, 0x2481f6fe, 0x2481f6fe }, | ||
4861 | { 0x00007840, 0xba5f638c, 0xba5f638c, 0xba5f638c, 0xba5f638c, 0xba5f638c }, | ||
4862 | { 0x0000786c, 0x48609eb4, 0x48609eb4, 0x48609eb4, 0x48609eb4, 0x48609eb4 }, | ||
4863 | { 0x00007820, 0x00000c04, 0x00000c04, 0x00000c04, 0x00000c04, 0x00000c04 }, | ||
4864 | { 0x0000a274, 0x0a21c652, 0x0a21c652, 0x0a21a652, 0x0a21a652, 0x0a22a652 }, | ||
4865 | { 0x0000a278, 0x39ce739c, 0x39ce739c, 0x39ce739c, 0x39ce739c, 0x39ce739c }, | ||
4866 | { 0x0000a27c, 0x050e039c, 0x050e039c, 0x050e039c, 0x050e039c, 0x050e039c }, | ||
4867 | { 0x0000a394, 0x39ce739c, 0x39ce739c, 0x39ce739c, 0x39ce739c, 0x39ce739c }, | ||
4868 | { 0x0000a398, 0x0000039c, 0x0000039c, 0x0000039c, 0x0000039c, 0x0000039c }, | ||
4869 | { 0x0000a3dc, 0x39ce739c, 0x39ce739c, 0x39ce739c, 0x39ce739c, 0x39ce739c }, | ||
4870 | { 0x0000a3e0, 0x0000039c, 0x0000039c, 0x0000039c, 0x0000039c, 0x0000039c }, | ||
4871 | }; | ||
4872 | |||
4873 | static const u_int32_t ar9285Modes_XE2_0_high_power[][6] = { | ||
4874 | { 0x0000a300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, | ||
4875 | { 0x0000a304, 0x00000000, 0x00000000, 0x00006200, 0x00006200, 0x00000000 }, | ||
4876 | { 0x0000a308, 0x00000000, 0x00000000, 0x00008201, 0x00008201, 0x00000000 }, | ||
4877 | { 0x0000a30c, 0x00000000, 0x00000000, 0x0000b240, 0x0000b240, 0x00000000 }, | ||
4878 | { 0x0000a310, 0x00000000, 0x00000000, 0x0000d241, 0x0000d241, 0x00000000 }, | ||
4879 | { 0x0000a314, 0x00000000, 0x00000000, 0x0000f600, 0x0000f600, 0x00000000 }, | ||
4880 | { 0x0000a318, 0x00000000, 0x00000000, 0x00012800, 0x00012800, 0x00000000 }, | ||
4881 | { 0x0000a31c, 0x00000000, 0x00000000, 0x00016802, 0x00016802, 0x00000000 }, | ||
4882 | { 0x0000a320, 0x00000000, 0x00000000, 0x0001b805, 0x0001b805, 0x00000000 }, | ||
4883 | { 0x0000a324, 0x00000000, 0x00000000, 0x00021a80, 0x00021a80, 0x00000000 }, | ||
4884 | { 0x0000a328, 0x00000000, 0x00000000, 0x00028b00, 0x00028b00, 0x00000000 }, | ||
4885 | { 0x0000a32c, 0x00000000, 0x00000000, 0x0002ab40, 0x0002ab40, 0x00000000 }, | ||
4886 | { 0x0000a330, 0x00000000, 0x00000000, 0x0002cd80, 0x0002cd80, 0x00000000 }, | ||
4887 | { 0x0000a334, 0x00000000, 0x00000000, 0x00033d82, 0x00033d82, 0x00000000 }, | ||
4888 | { 0x0000a338, 0x0003891e, 0x0003891e, 0x0003891e, 0x0003891e, 0x00000000 }, | ||
4889 | { 0x0000a33c, 0x0003a95e, 0x0003a95e, 0x0003a95e, 0x0003a95e, 0x00000000 }, | ||
4890 | { 0x0000a340, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, | ||
4891 | { 0x0000a344, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, | ||
4892 | { 0x0000a348, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, | ||
4893 | { 0x0000a34c, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, | ||
4894 | { 0x0000a350, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, | ||
4895 | { 0x0000a354, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, | ||
4896 | { 0x00007814, 0x92497ca8, 0x92497ca8, 0x92497ca8, 0x92497ca8, 0x92497ca8 }, | ||
4897 | { 0x00007828, 0x4ad2491b, 0x4ad2491b, 0x2ad2491b, 0x4ad2491b, 0x4ad2491b }, | ||
4898 | { 0x00007830, 0xedb6da6e, 0xedb6da6e, 0xedb6da6e, 0xedb6da6e, 0xedb6da6e }, | ||
4899 | { 0x00007838, 0xdac71443, 0xdac71443, 0xdac71443, 0xdac71443, 0xdac71443 }, | ||
4900 | { 0x0000783c, 0x2481f6fe, 0x2481f6fe, 0x2481f6fe, 0x2481f6fe, 0x2481f6fe }, | ||
4901 | { 0x00007840, 0xba5f638c, 0xba5f638c, 0xba5f638c, 0xba5f638c, 0xba5f638c }, | ||
4902 | { 0x0000786c, 0x08609ebe, 0x08609ebe, 0x08609ebe, 0x08609ebe, 0x08609ebe }, | ||
4903 | { 0x00007820, 0x00000c00, 0x00000c00, 0x00000c00, 0x00000c00, 0x00000c00 }, | ||
4904 | { 0x0000a274, 0x0a22a652, 0x0a22a652, 0x0a216652, 0x0a216652, 0x0a22a652 }, | ||
4905 | { 0x0000a278, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7 }, | ||
4906 | { 0x0000a27c, 0x050380e7, 0x050380e7, 0x050380e7, 0x050380e7, 0x050380e7 }, | ||
4907 | { 0x0000a394, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7 }, | ||
4908 | { 0x0000a398, 0x000000e7, 0x000000e7, 0x000000e7, 0x000000e7, 0x000000e7 }, | ||
4909 | { 0x0000a3dc, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7 }, | ||
4910 | { 0x0000a3e0, 0x000000e7, 0x000000e7, 0x000000e7, 0x000000e7, 0x000000e7 }, | ||
4911 | }; | ||
4912 | |||
4828 | static const u_int32_t ar9285PciePhy_clkreq_always_on_L1_9285_1_2[][2] = { | 4913 | static const u_int32_t ar9285PciePhy_clkreq_always_on_L1_9285_1_2[][2] = { |
4829 | {0x00004040, 0x9248fd00 }, | 4914 | {0x00004040, 0x9248fd00 }, |
4830 | {0x00004040, 0x24924924 }, | 4915 | {0x00004040, 0x24924924 }, |
diff --git a/drivers/net/wireless/ath/ath9k/phy.h b/drivers/net/wireless/ath/ath9k/phy.h index 0999a495fd46..0132e4c9a9f9 100644 --- a/drivers/net/wireless/ath/ath9k/phy.h +++ b/drivers/net/wireless/ath/ath9k/phy.h | |||
@@ -503,6 +503,8 @@ bool ath9k_hw_set_rf_regs(struct ath_hw *ah, | |||
503 | #define AR_PHY_TX_PWRCTRL_ERR_EST_MODE_S 24 | 503 | #define AR_PHY_TX_PWRCTRL_ERR_EST_MODE_S 24 |
504 | 504 | ||
505 | #define AR_PHY_TX_PWRCTRL7 0xa274 | 505 | #define AR_PHY_TX_PWRCTRL7 0xa274 |
506 | #define AR_PHY_TX_PWRCTRL_TX_GAIN_TAB_MAX 0x0007E000 | ||
507 | #define AR_PHY_TX_PWRCTRL_TX_GAIN_TAB_MAX_S 13 | ||
506 | #define AR_PHY_TX_PWRCTRL_INIT_TX_GAIN 0x01F80000 | 508 | #define AR_PHY_TX_PWRCTRL_INIT_TX_GAIN 0x01F80000 |
507 | #define AR_PHY_TX_PWRCTRL_INIT_TX_GAIN_S 19 | 509 | #define AR_PHY_TX_PWRCTRL_INIT_TX_GAIN_S 19 |
508 | 510 | ||
@@ -513,8 +515,16 @@ bool ath9k_hw_set_rf_regs(struct ath_hw *ah, | |||
513 | #define AR_PHY_TX_PWRCTRL9_RES_DC_REMOVAL_S 31 | 515 | #define AR_PHY_TX_PWRCTRL9_RES_DC_REMOVAL_S 31 |
514 | 516 | ||
515 | #define AR_PHY_TX_GAIN_TBL1 0xa300 | 517 | #define AR_PHY_TX_GAIN_TBL1 0xa300 |
516 | #define AR_PHY_TX_GAIN 0x0007F000 | 518 | #define AR_PHY_TX_GAIN_CLC 0x0000001E |
517 | #define AR_PHY_TX_GAIN_S 12 | 519 | #define AR_PHY_TX_GAIN_CLC_S 1 |
520 | #define AR_PHY_TX_GAIN 0x0007F000 | ||
521 | #define AR_PHY_TX_GAIN_S 12 | ||
522 | |||
523 | #define AR_PHY_CLC_TBL1 0xa35c | ||
524 | #define AR_PHY_CLC_I0 0x07ff0000 | ||
525 | #define AR_PHY_CLC_I0_S 16 | ||
526 | #define AR_PHY_CLC_Q0 0x0000ffd0 | ||
527 | #define AR_PHY_CLC_Q0_S 5 | ||
518 | 528 | ||
519 | #define AR_PHY_CH0_TX_PWRCTRL11 0xa398 | 529 | #define AR_PHY_CH0_TX_PWRCTRL11 0xa398 |
520 | #define AR_PHY_CH1_TX_PWRCTRL11 0xb398 | 530 | #define AR_PHY_CH1_TX_PWRCTRL11 0xb398 |
diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h index 198e41dd38a6..7e36ad7421b7 100644 --- a/drivers/net/wireless/ath/ath9k/reg.h +++ b/drivers/net/wireless/ath/ath9k/reg.h | |||
@@ -679,7 +679,7 @@ | |||
679 | 679 | ||
680 | #define AR_WA 0x4004 | 680 | #define AR_WA 0x4004 |
681 | #define AR_WA_D3_L1_DISABLE (1 << 14) | 681 | #define AR_WA_D3_L1_DISABLE (1 << 14) |
682 | #define AR9285_WA_DEFAULT 0x004a05cb | 682 | #define AR9285_WA_DEFAULT 0x004a050b |
683 | #define AR9280_WA_DEFAULT 0x0040073b | 683 | #define AR9280_WA_DEFAULT 0x0040073b |
684 | #define AR_WA_DEFAULT 0x0000073f | 684 | #define AR_WA_DEFAULT 0x0000073f |
685 | 685 | ||
@@ -845,6 +845,10 @@ | |||
845 | (AR_SREV_9271(_ah) && \ | 845 | (AR_SREV_9271(_ah) && \ |
846 | ((_ah)->hw_version.macRev == AR_SREV_REVISION_9271_11)) | 846 | ((_ah)->hw_version.macRev == AR_SREV_REVISION_9271_11)) |
847 | 847 | ||
848 | #define AR_SREV_9285E_20(_ah) \ | ||
849 | (AR_SREV_9285_12_OR_LATER(_ah) && \ | ||
850 | ((REG_READ(_ah, AR_AN_SYNTH9) & 0x7) == 0x1)) | ||
851 | |||
848 | #define AR_RADIO_SREV_MAJOR 0xf0 | 852 | #define AR_RADIO_SREV_MAJOR 0xf0 |
849 | #define AR_RAD5133_SREV_MAJOR 0xc0 | 853 | #define AR_RAD5133_SREV_MAJOR 0xc0 |
850 | #define AR_RAD2133_SREV_MAJOR 0xd0 | 854 | #define AR_RAD2133_SREV_MAJOR 0xd0 |
@@ -1181,6 +1185,13 @@ enum { | |||
1181 | #define AR9285_AN_RF2G4_DB2_4 0x00003800 | 1185 | #define AR9285_AN_RF2G4_DB2_4 0x00003800 |
1182 | #define AR9285_AN_RF2G4_DB2_4_S 11 | 1186 | #define AR9285_AN_RF2G4_DB2_4_S 11 |
1183 | 1187 | ||
1188 | #define AR9285_RF2G5 0x7830 | ||
1189 | #define AR9285_RF2G5_IC50TX 0xfffff8ff | ||
1190 | #define AR9285_RF2G5_IC50TX_SET 0x00000400 | ||
1191 | #define AR9285_RF2G5_IC50TX_XE_SET 0x00000500 | ||
1192 | #define AR9285_RF2G5_IC50TX_CLEAR 0x00000700 | ||
1193 | #define AR9285_RF2G5_IC50TX_CLEAR_S 8 | ||
1194 | |||
1184 | /* AR9271 : 0x7828, 0x782c different setting from AR9285 */ | 1195 | /* AR9271 : 0x7828, 0x782c different setting from AR9285 */ |
1185 | #define AR9271_AN_RF2G3_OB_cck 0x001C0000 | 1196 | #define AR9271_AN_RF2G3_OB_cck 0x001C0000 |
1186 | #define AR9271_AN_RF2G3_OB_cck_S 18 | 1197 | #define AR9271_AN_RF2G3_OB_cck_S 18 |