Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 1 | /* |
Sujith Manoharan | 5b68138 | 2011-05-17 13:36:18 +0530 | [diff] [blame] | 2 | * Copyright (c) 2010-2011 Atheros Communications, Inc. |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 3 | * |
| 4 | * Permission to use, copy, modify, and/or distribute this software for any |
| 5 | * purpose with or without fee is hereby granted, provided that the above |
| 6 | * copyright notice and this permission notice appear in all copies. |
| 7 | * |
| 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 15 | */ |
| 16 | |
| 17 | #ifndef AR9003_PHY_H |
| 18 | #define AR9003_PHY_H |
| 19 | |
| 20 | /* |
| 21 | * Channel Register Map |
| 22 | */ |
| 23 | #define AR_CHAN_BASE 0x9800 |
| 24 | |
| 25 | #define AR_PHY_TIMING1 (AR_CHAN_BASE + 0x0) |
| 26 | #define AR_PHY_TIMING2 (AR_CHAN_BASE + 0x4) |
| 27 | #define AR_PHY_TIMING3 (AR_CHAN_BASE + 0x8) |
| 28 | #define AR_PHY_TIMING4 (AR_CHAN_BASE + 0xc) |
| 29 | #define AR_PHY_TIMING5 (AR_CHAN_BASE + 0x10) |
| 30 | #define AR_PHY_TIMING6 (AR_CHAN_BASE + 0x14) |
| 31 | #define AR_PHY_TIMING11 (AR_CHAN_BASE + 0x18) |
| 32 | #define AR_PHY_SPUR_REG (AR_CHAN_BASE + 0x1c) |
| 33 | #define AR_PHY_RX_IQCAL_CORR_B0 (AR_CHAN_BASE + 0xdc) |
| 34 | #define AR_PHY_TX_IQCAL_CONTROL_3 (AR_CHAN_BASE + 0xb0) |
Bala Shanmugam | b55f6bb | 2012-10-15 15:29:48 +0530 | [diff] [blame] | 35 | #define AR_PHY_TIMING_CONTROL4_DO_GAIN_DC_IQ_CAL_SHIFT 16 |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 36 | |
Luis R. Rodriguez | 1547da3 | 2010-04-15 17:39:15 -0400 | [diff] [blame] | 37 | #define AR_PHY_TIMING11_SPUR_FREQ_SD 0x3FF00000 |
| 38 | #define AR_PHY_TIMING11_SPUR_FREQ_SD_S 20 |
| 39 | |
| 40 | #define AR_PHY_TIMING11_SPUR_DELTA_PHASE 0x000FFFFF |
| 41 | #define AR_PHY_TIMING11_SPUR_DELTA_PHASE_S 0 |
| 42 | |
| 43 | #define AR_PHY_TIMING11_USE_SPUR_FILTER_IN_AGC 0x40000000 |
| 44 | #define AR_PHY_TIMING11_USE_SPUR_FILTER_IN_AGC_S 30 |
| 45 | |
| 46 | #define AR_PHY_TIMING11_USE_SPUR_FILTER_IN_SELFCOR 0x80000000 |
| 47 | #define AR_PHY_TIMING11_USE_SPUR_FILTER_IN_SELFCOR_S 31 |
| 48 | |
| 49 | #define AR_PHY_SPUR_REG_ENABLE_NF_RSSI_SPUR_MIT 0x4000000 |
| 50 | #define AR_PHY_SPUR_REG_ENABLE_NF_RSSI_SPUR_MIT_S 26 |
| 51 | |
| 52 | #define AR_PHY_SPUR_REG_ENABLE_MASK_PPM 0x20000 /* bins move with freq offset */ |
| 53 | #define AR_PHY_SPUR_REG_ENABLE_MASK_PPM_S 17 |
| 54 | #define AR_PHY_SPUR_REG_SPUR_RSSI_THRESH 0x000000FF |
| 55 | #define AR_PHY_SPUR_REG_SPUR_RSSI_THRESH_S 0 |
| 56 | #define AR_PHY_SPUR_REG_EN_VIT_SPUR_RSSI 0x00000100 |
| 57 | #define AR_PHY_SPUR_REG_EN_VIT_SPUR_RSSI_S 8 |
| 58 | #define AR_PHY_SPUR_REG_MASK_RATE_CNTL 0x03FC0000 |
| 59 | #define AR_PHY_SPUR_REG_MASK_RATE_CNTL_S 18 |
| 60 | |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 61 | #define AR_PHY_RX_IQCAL_CORR_B0_LOOPBACK_IQCORR_EN 0x20000000 |
| 62 | #define AR_PHY_RX_IQCAL_CORR_B0_LOOPBACK_IQCORR_EN_S 29 |
| 63 | |
| 64 | #define AR_PHY_TX_IQCAL_CONTROL_3_IQCORR_EN 0x80000000 |
| 65 | #define AR_PHY_TX_IQCAL_CONTROL_3_IQCORR_EN_S 31 |
| 66 | |
| 67 | #define AR_PHY_FIND_SIG_LOW (AR_CHAN_BASE + 0x20) |
| 68 | |
| 69 | #define AR_PHY_SFCORR (AR_CHAN_BASE + 0x24) |
| 70 | #define AR_PHY_SFCORR_LOW (AR_CHAN_BASE + 0x28) |
| 71 | #define AR_PHY_SFCORR_EXT (AR_CHAN_BASE + 0x2c) |
| 72 | |
| 73 | #define AR_PHY_EXT_CCA (AR_CHAN_BASE + 0x30) |
| 74 | #define AR_PHY_RADAR_0 (AR_CHAN_BASE + 0x34) |
| 75 | #define AR_PHY_RADAR_1 (AR_CHAN_BASE + 0x38) |
| 76 | #define AR_PHY_RADAR_EXT (AR_CHAN_BASE + 0x3c) |
| 77 | #define AR_PHY_MULTICHAIN_CTRL (AR_CHAN_BASE + 0x80) |
| 78 | #define AR_PHY_PERCHAIN_CSD (AR_CHAN_BASE + 0x84) |
| 79 | |
| 80 | #define AR_PHY_TX_PHASE_RAMP_0 (AR_CHAN_BASE + 0xd0) |
| 81 | #define AR_PHY_ADC_GAIN_DC_CORR_0 (AR_CHAN_BASE + 0xd4) |
| 82 | #define AR_PHY_IQ_ADC_MEAS_0_B0 (AR_CHAN_BASE + 0xc0) |
| 83 | #define AR_PHY_IQ_ADC_MEAS_1_B0 (AR_CHAN_BASE + 0xc4) |
| 84 | #define AR_PHY_IQ_ADC_MEAS_2_B0 (AR_CHAN_BASE + 0xc8) |
| 85 | #define AR_PHY_IQ_ADC_MEAS_3_B0 (AR_CHAN_BASE + 0xcc) |
| 86 | |
| 87 | /* The following registers changed position from AR9300 1.0 to AR9300 2.0 */ |
| 88 | #define AR_PHY_TX_PHASE_RAMP_0_9300_10 (AR_CHAN_BASE + 0xd0 - 0x10) |
| 89 | #define AR_PHY_ADC_GAIN_DC_CORR_0_9300_10 (AR_CHAN_BASE + 0xd4 - 0x10) |
| 90 | #define AR_PHY_IQ_ADC_MEAS_0_B0_9300_10 (AR_CHAN_BASE + 0xc0 + 0x8) |
| 91 | #define AR_PHY_IQ_ADC_MEAS_1_B0_9300_10 (AR_CHAN_BASE + 0xc4 + 0x8) |
| 92 | #define AR_PHY_IQ_ADC_MEAS_2_B0_9300_10 (AR_CHAN_BASE + 0xc8 + 0x8) |
| 93 | #define AR_PHY_IQ_ADC_MEAS_3_B0_9300_10 (AR_CHAN_BASE + 0xcc + 0x8) |
| 94 | |
| 95 | #define AR_PHY_TX_CRC (AR_CHAN_BASE + 0xa0) |
| 96 | #define AR_PHY_TST_DAC_CONST (AR_CHAN_BASE + 0xa4) |
| 97 | #define AR_PHY_SPUR_REPORT_0 (AR_CHAN_BASE + 0xa8) |
| 98 | #define AR_PHY_CHAN_INFO_TAB_0 (AR_CHAN_BASE + 0x300) |
| 99 | |
| 100 | /* |
| 101 | * Channel Field Definitions |
| 102 | */ |
| 103 | #define AR_PHY_TIMING2_USE_FORCE_PPM 0x00001000 |
| 104 | #define AR_PHY_TIMING2_FORCE_PPM_VAL 0x00000fff |
| 105 | #define AR_PHY_TIMING3_DSC_MAN 0xFFFE0000 |
| 106 | #define AR_PHY_TIMING3_DSC_MAN_S 17 |
| 107 | #define AR_PHY_TIMING3_DSC_EXP 0x0001E000 |
| 108 | #define AR_PHY_TIMING3_DSC_EXP_S 13 |
| 109 | #define AR_PHY_TIMING4_IQCAL_LOG_COUNT_MAX 0xF000 |
| 110 | #define AR_PHY_TIMING4_IQCAL_LOG_COUNT_MAX_S 12 |
| 111 | #define AR_PHY_TIMING4_DO_CAL 0x10000 |
Luis R. Rodriguez | 1547da3 | 2010-04-15 17:39:15 -0400 | [diff] [blame] | 112 | |
| 113 | #define AR_PHY_TIMING4_ENABLE_PILOT_MASK 0x10000000 |
| 114 | #define AR_PHY_TIMING4_ENABLE_PILOT_MASK_S 28 |
| 115 | #define AR_PHY_TIMING4_ENABLE_CHAN_MASK 0x20000000 |
| 116 | #define AR_PHY_TIMING4_ENABLE_CHAN_MASK_S 29 |
| 117 | |
| 118 | #define AR_PHY_TIMING4_ENABLE_SPUR_FILTER 0x40000000 |
| 119 | #define AR_PHY_TIMING4_ENABLE_SPUR_FILTER_S 30 |
| 120 | #define AR_PHY_TIMING4_ENABLE_SPUR_RSSI 0x80000000 |
| 121 | #define AR_PHY_TIMING4_ENABLE_SPUR_RSSI_S 31 |
| 122 | |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 123 | #define AR_PHY_NEW_ADC_GAIN_CORR_ENABLE 0x40000000 |
| 124 | #define AR_PHY_NEW_ADC_DC_OFFSET_CORR_ENABLE 0x80000000 |
| 125 | #define AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW 0x00000001 |
| 126 | #define AR_PHY_SFCORR_LOW_M2COUNT_THR_LOW 0x00003F00 |
| 127 | #define AR_PHY_SFCORR_LOW_M2COUNT_THR_LOW_S 8 |
| 128 | #define AR_PHY_SFCORR_LOW_M1_THRESH_LOW 0x001FC000 |
| 129 | #define AR_PHY_SFCORR_LOW_M1_THRESH_LOW_S 14 |
| 130 | #define AR_PHY_SFCORR_LOW_M2_THRESH_LOW 0x0FE00000 |
| 131 | #define AR_PHY_SFCORR_LOW_M2_THRESH_LOW_S 21 |
| 132 | #define AR_PHY_SFCORR_M2COUNT_THR 0x0000001F |
| 133 | #define AR_PHY_SFCORR_M2COUNT_THR_S 0 |
| 134 | #define AR_PHY_SFCORR_M1_THRESH 0x00FE0000 |
| 135 | #define AR_PHY_SFCORR_M1_THRESH_S 17 |
| 136 | #define AR_PHY_SFCORR_M2_THRESH 0x7F000000 |
| 137 | #define AR_PHY_SFCORR_M2_THRESH_S 24 |
| 138 | #define AR_PHY_SFCORR_EXT_M1_THRESH 0x0000007F |
| 139 | #define AR_PHY_SFCORR_EXT_M1_THRESH_S 0 |
| 140 | #define AR_PHY_SFCORR_EXT_M2_THRESH 0x00003F80 |
| 141 | #define AR_PHY_SFCORR_EXT_M2_THRESH_S 7 |
| 142 | #define AR_PHY_SFCORR_EXT_M1_THRESH_LOW 0x001FC000 |
| 143 | #define AR_PHY_SFCORR_EXT_M1_THRESH_LOW_S 14 |
| 144 | #define AR_PHY_SFCORR_EXT_M2_THRESH_LOW 0x0FE00000 |
| 145 | #define AR_PHY_SFCORR_EXT_M2_THRESH_LOW_S 21 |
Luis R. Rodriguez | 1547da3 | 2010-04-15 17:39:15 -0400 | [diff] [blame] | 146 | #define AR_PHY_SFCORR_EXT_SPUR_SUBCHANNEL_SD 0x10000000 |
| 147 | #define AR_PHY_SFCORR_EXT_SPUR_SUBCHANNEL_SD_S 28 |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 148 | #define AR_PHY_SFCORR_SPUR_SUBCHNL_SD_S 28 |
| 149 | #define AR_PHY_EXT_CCA_THRESH62 0x007F0000 |
| 150 | #define AR_PHY_EXT_CCA_THRESH62_S 16 |
Sujith Manoharan | e083a42 | 2013-08-19 11:04:01 +0530 | [diff] [blame] | 151 | #define AR_PHY_EXTCHN_PWRTHR1_ANT_DIV_ALT_ANT_MINGAINIDX 0x0000FF00 |
| 152 | #define AR_PHY_EXTCHN_PWRTHR1_ANT_DIV_ALT_ANT_MINGAINIDX_S 8 |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 153 | #define AR_PHY_EXT_MINCCA_PWR 0x01FF0000 |
| 154 | #define AR_PHY_EXT_MINCCA_PWR_S 16 |
Luis R. Rodriguez | 7ca710d | 2010-06-12 00:33:43 -0400 | [diff] [blame] | 155 | #define AR_PHY_EXT_CYCPWR_THR1 0x0000FE00L |
| 156 | #define AR_PHY_EXT_CYCPWR_THR1_S 9 |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 157 | #define AR_PHY_TIMING5_CYCPWR_THR1 0x000000FE |
| 158 | #define AR_PHY_TIMING5_CYCPWR_THR1_S 1 |
| 159 | #define AR_PHY_TIMING5_CYCPWR_THR1_ENABLE 0x00000001 |
| 160 | #define AR_PHY_TIMING5_CYCPWR_THR1_ENABLE_S 0 |
| 161 | #define AR_PHY_TIMING5_CYCPWR_THR1A 0x007F0000 |
| 162 | #define AR_PHY_TIMING5_CYCPWR_THR1A_S 16 |
| 163 | #define AR_PHY_TIMING5_RSSI_THR1A (0x7F << 16) |
| 164 | #define AR_PHY_TIMING5_RSSI_THR1A_S 16 |
| 165 | #define AR_PHY_TIMING5_RSSI_THR1A_ENA (0x1 << 15) |
| 166 | #define AR_PHY_RADAR_0_ENA 0x00000001 |
| 167 | #define AR_PHY_RADAR_0_FFT_ENA 0x80000000 |
| 168 | #define AR_PHY_RADAR_0_INBAND 0x0000003e |
| 169 | #define AR_PHY_RADAR_0_INBAND_S 1 |
| 170 | #define AR_PHY_RADAR_0_PRSSI 0x00000FC0 |
| 171 | #define AR_PHY_RADAR_0_PRSSI_S 6 |
| 172 | #define AR_PHY_RADAR_0_HEIGHT 0x0003F000 |
| 173 | #define AR_PHY_RADAR_0_HEIGHT_S 12 |
| 174 | #define AR_PHY_RADAR_0_RRSSI 0x00FC0000 |
| 175 | #define AR_PHY_RADAR_0_RRSSI_S 18 |
| 176 | #define AR_PHY_RADAR_0_FIRPWR 0x7F000000 |
| 177 | #define AR_PHY_RADAR_0_FIRPWR_S 24 |
| 178 | #define AR_PHY_RADAR_1_RELPWR_ENA 0x00800000 |
| 179 | #define AR_PHY_RADAR_1_USE_FIR128 0x00400000 |
| 180 | #define AR_PHY_RADAR_1_RELPWR_THRESH 0x003F0000 |
| 181 | #define AR_PHY_RADAR_1_RELPWR_THRESH_S 16 |
| 182 | #define AR_PHY_RADAR_1_BLOCK_CHECK 0x00008000 |
| 183 | #define AR_PHY_RADAR_1_MAX_RRSSI 0x00004000 |
| 184 | #define AR_PHY_RADAR_1_RELSTEP_CHECK 0x00002000 |
| 185 | #define AR_PHY_RADAR_1_RELSTEP_THRESH 0x00001F00 |
| 186 | #define AR_PHY_RADAR_1_RELSTEP_THRESH_S 8 |
| 187 | #define AR_PHY_RADAR_1_MAXLEN 0x000000FF |
| 188 | #define AR_PHY_RADAR_1_MAXLEN_S 0 |
| 189 | #define AR_PHY_RADAR_EXT_ENA 0x00004000 |
| 190 | #define AR_PHY_RADAR_DC_PWR_THRESH 0x007f8000 |
| 191 | #define AR_PHY_RADAR_DC_PWR_THRESH_S 15 |
| 192 | #define AR_PHY_RADAR_LB_DC_CAP 0x7f800000 |
| 193 | #define AR_PHY_RADAR_LB_DC_CAP_S 23 |
| 194 | #define AR_PHY_FIND_SIG_LOW_FIRSTEP_LOW (0x3f << 6) |
| 195 | #define AR_PHY_FIND_SIG_LOW_FIRSTEP_LOW_S 6 |
| 196 | #define AR_PHY_FIND_SIG_LOW_FIRPWR (0x7f << 12) |
| 197 | #define AR_PHY_FIND_SIG_LOW_FIRPWR_S 12 |
| 198 | #define AR_PHY_FIND_SIG_LOW_FIRPWR_SIGN_BIT 19 |
| 199 | #define AR_PHY_FIND_SIG_LOW_RELSTEP 0x1f |
| 200 | #define AR_PHY_FIND_SIG_LOW_RELSTEP_S 0 |
| 201 | #define AR_PHY_FIND_SIG_LOW_RELSTEP_SIGN_BIT 5 |
| 202 | #define AR_PHY_CHAN_INFO_TAB_S2_READ 0x00000008 |
| 203 | #define AR_PHY_CHAN_INFO_TAB_S2_READ_S 3 |
| 204 | #define AR_PHY_RX_IQCAL_CORR_IQCORR_Q_Q_COFF 0x0000007F |
| 205 | #define AR_PHY_RX_IQCAL_CORR_IQCORR_Q_Q_COFF_S 0 |
| 206 | #define AR_PHY_RX_IQCAL_CORR_IQCORR_Q_I_COFF 0x00003F80 |
| 207 | #define AR_PHY_RX_IQCAL_CORR_IQCORR_Q_I_COFF_S 7 |
| 208 | #define AR_PHY_RX_IQCAL_CORR_IQCORR_ENABLE 0x00004000 |
| 209 | #define AR_PHY_RX_IQCAL_CORR_LOOPBACK_IQCORR_Q_Q_COFF 0x003f8000 |
| 210 | #define AR_PHY_RX_IQCAL_CORR_LOOPBACK_IQCORR_Q_Q_COFF_S 15 |
| 211 | #define AR_PHY_RX_IQCAL_CORR_LOOPBACK_IQCORR_Q_I_COFF 0x1fc00000 |
| 212 | #define AR_PHY_RX_IQCAL_CORR_LOOPBACK_IQCORR_Q_I_COFF_S 22 |
| 213 | |
| 214 | /* |
| 215 | * MRC Register Map |
| 216 | */ |
| 217 | #define AR_MRC_BASE 0x9c00 |
| 218 | |
| 219 | #define AR_PHY_TIMING_3A (AR_MRC_BASE + 0x0) |
| 220 | #define AR_PHY_LDPC_CNTL1 (AR_MRC_BASE + 0x4) |
| 221 | #define AR_PHY_LDPC_CNTL2 (AR_MRC_BASE + 0x8) |
| 222 | #define AR_PHY_PILOT_SPUR_MASK (AR_MRC_BASE + 0xc) |
| 223 | #define AR_PHY_CHAN_SPUR_MASK (AR_MRC_BASE + 0x10) |
| 224 | #define AR_PHY_SGI_DELTA (AR_MRC_BASE + 0x14) |
| 225 | #define AR_PHY_ML_CNTL_1 (AR_MRC_BASE + 0x18) |
| 226 | #define AR_PHY_ML_CNTL_2 (AR_MRC_BASE + 0x1c) |
| 227 | #define AR_PHY_TST_ADC (AR_MRC_BASE + 0x20) |
| 228 | |
Sujith Manoharan | d43d04a | 2012-09-10 09:20:20 +0530 | [diff] [blame] | 229 | #define AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_A 0x00000FE0 |
Luis R. Rodriguez | 1547da3 | 2010-04-15 17:39:15 -0400 | [diff] [blame] | 230 | #define AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_A_S 5 |
Sujith Manoharan | d43d04a | 2012-09-10 09:20:20 +0530 | [diff] [blame] | 231 | #define AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_A 0x1F |
| 232 | #define AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_A_S 0 |
| 233 | #define AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_B 0x00FE0000 |
| 234 | #define AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_B_S 17 |
| 235 | #define AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_B 0x0001F000 |
| 236 | #define AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_B_S 12 |
Luis R. Rodriguez | 1547da3 | 2010-04-15 17:39:15 -0400 | [diff] [blame] | 237 | |
| 238 | #define AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_A 0x00000FE0 |
| 239 | #define AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_A_S 5 |
| 240 | #define AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_A 0x1F |
| 241 | #define AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_A_S 0 |
Sujith Manoharan | d43d04a | 2012-09-10 09:20:20 +0530 | [diff] [blame] | 242 | #define AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_B 0x00FE0000 |
| 243 | #define AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_B_S 17 |
| 244 | #define AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_B 0x0001F000 |
| 245 | #define AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_B_S 12 |
| 246 | |
Luis R. Rodriguez | 1547da3 | 2010-04-15 17:39:15 -0400 | [diff] [blame] | 247 | |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 248 | /* |
| 249 | * MRC Feild Definitions |
| 250 | */ |
| 251 | #define AR_PHY_SGI_DSC_MAN 0x0007FFF0 |
| 252 | #define AR_PHY_SGI_DSC_MAN_S 4 |
| 253 | #define AR_PHY_SGI_DSC_EXP 0x0000000F |
| 254 | #define AR_PHY_SGI_DSC_EXP_S 0 |
| 255 | /* |
| 256 | * BBB Register Map |
| 257 | */ |
| 258 | #define AR_BBB_BASE 0x9d00 |
| 259 | |
| 260 | /* |
| 261 | * AGC Register Map |
| 262 | */ |
| 263 | #define AR_AGC_BASE 0x9e00 |
| 264 | |
| 265 | #define AR_PHY_SETTLING (AR_AGC_BASE + 0x0) |
| 266 | #define AR_PHY_FORCEMAX_GAINS_0 (AR_AGC_BASE + 0x4) |
| 267 | #define AR_PHY_GAINS_MINOFF0 (AR_AGC_BASE + 0x8) |
| 268 | #define AR_PHY_DESIRED_SZ (AR_AGC_BASE + 0xc) |
| 269 | #define AR_PHY_FIND_SIG (AR_AGC_BASE + 0x10) |
| 270 | #define AR_PHY_AGC (AR_AGC_BASE + 0x14) |
| 271 | #define AR_PHY_EXT_ATTEN_CTL_0 (AR_AGC_BASE + 0x18) |
| 272 | #define AR_PHY_CCA_0 (AR_AGC_BASE + 0x1c) |
Sujith Manoharan | 3533bf6 | 2013-12-18 09:53:23 +0530 | [diff] [blame] | 273 | #define AR_PHY_CCA_CTRL_0 (AR_AGC_BASE + 0x20) |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 274 | #define AR_PHY_RESTART (AR_AGC_BASE + 0x24) |
Vasanthakumar Thiagarajan | 47e84df | 2010-12-06 04:27:49 -0800 | [diff] [blame] | 275 | |
Mohammed Shafi Shajakhan | c6ba9fe | 2011-05-13 20:29:53 +0530 | [diff] [blame] | 276 | /* |
| 277 | * Antenna Diversity settings |
| 278 | */ |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 279 | #define AR_PHY_MC_GAIN_CTRL (AR_AGC_BASE + 0x28) |
Vasanthakumar Thiagarajan | 47e84df | 2010-12-06 04:27:49 -0800 | [diff] [blame] | 280 | #define AR_ANT_DIV_CTRL_ALL 0x7e000000 |
| 281 | #define AR_ANT_DIV_CTRL_ALL_S 25 |
| 282 | #define AR_ANT_DIV_ENABLE 0x1000000 |
| 283 | #define AR_ANT_DIV_ENABLE_S 24 |
| 284 | |
Mohammed Shafi Shajakhan | c6ba9fe | 2011-05-13 20:29:53 +0530 | [diff] [blame] | 285 | |
Sujith Manoharan | 9aa49ea | 2012-09-11 10:46:38 +0530 | [diff] [blame] | 286 | #define AR_PHY_ANT_FAST_DIV_BIAS 0x00007e00 |
| 287 | #define AR_PHY_ANT_FAST_DIV_BIAS_S 9 |
Sujith Manoharan | 362cd03 | 2012-09-16 08:06:36 +0530 | [diff] [blame] | 288 | #define AR_PHY_ANT_SW_RX_PROT 0x00800000 |
| 289 | #define AR_PHY_ANT_SW_RX_PROT_S 23 |
Sujith Manoharan | 9aa49ea | 2012-09-11 10:46:38 +0530 | [diff] [blame] | 290 | #define AR_PHY_ANT_DIV_LNADIV 0x01000000 |
| 291 | #define AR_PHY_ANT_DIV_LNADIV_S 24 |
| 292 | #define AR_PHY_ANT_DIV_ALT_LNACONF 0x06000000 |
| 293 | #define AR_PHY_ANT_DIV_ALT_LNACONF_S 25 |
| 294 | #define AR_PHY_ANT_DIV_MAIN_LNACONF 0x18000000 |
| 295 | #define AR_PHY_ANT_DIV_MAIN_LNACONF_S 27 |
| 296 | #define AR_PHY_ANT_DIV_ALT_GAINTB 0x20000000 |
| 297 | #define AR_PHY_ANT_DIV_ALT_GAINTB_S 29 |
| 298 | #define AR_PHY_ANT_DIV_MAIN_GAINTB 0x40000000 |
| 299 | #define AR_PHY_ANT_DIV_MAIN_GAINTB_S 30 |
Mohammed Shafi Shajakhan | c6ba9fe | 2011-05-13 20:29:53 +0530 | [diff] [blame] | 300 | |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 301 | #define AR_PHY_EXTCHN_PWRTHR1 (AR_AGC_BASE + 0x2c) |
| 302 | #define AR_PHY_EXT_CHN_WIN (AR_AGC_BASE + 0x30) |
| 303 | #define AR_PHY_20_40_DET_THR (AR_AGC_BASE + 0x34) |
| 304 | #define AR_PHY_RIFS_SRCH (AR_AGC_BASE + 0x38) |
| 305 | #define AR_PHY_PEAK_DET_CTRL_1 (AR_AGC_BASE + 0x3c) |
| 306 | #define AR_PHY_PEAK_DET_CTRL_2 (AR_AGC_BASE + 0x40) |
| 307 | #define AR_PHY_RX_GAIN_BOUNDS_1 (AR_AGC_BASE + 0x44) |
| 308 | #define AR_PHY_RX_GAIN_BOUNDS_2 (AR_AGC_BASE + 0x48) |
| 309 | #define AR_PHY_RSSI_0 (AR_AGC_BASE + 0x180) |
| 310 | #define AR_PHY_SPUR_CCK_REP0 (AR_AGC_BASE + 0x184) |
Vasanthakumar Thiagarajan | 47e84df | 2010-12-06 04:27:49 -0800 | [diff] [blame] | 311 | |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 312 | #define AR_PHY_CCK_DETECT (AR_AGC_BASE + 0x1c0) |
Vasanthakumar Thiagarajan | 47e84df | 2010-12-06 04:27:49 -0800 | [diff] [blame] | 313 | #define AR_FAST_DIV_ENABLE 0x2000 |
| 314 | #define AR_FAST_DIV_ENABLE_S 13 |
| 315 | |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 316 | #define AR_PHY_DAG_CTRLCCK (AR_AGC_BASE + 0x1c4) |
| 317 | #define AR_PHY_IQCORR_CTRL_CCK (AR_AGC_BASE + 0x1c8) |
| 318 | |
| 319 | #define AR_PHY_CCK_SPUR_MIT (AR_AGC_BASE + 0x1cc) |
| 320 | #define AR_PHY_CCK_SPUR_MIT_SPUR_RSSI_THR 0x000001fe |
| 321 | #define AR_PHY_CCK_SPUR_MIT_SPUR_RSSI_THR_S 1 |
| 322 | #define AR_PHY_CCK_SPUR_MIT_SPUR_FILTER_TYPE 0x60000000 |
| 323 | #define AR_PHY_CCK_SPUR_MIT_SPUR_FILTER_TYPE_S 29 |
| 324 | #define AR_PHY_CCK_SPUR_MIT_USE_CCK_SPUR_MIT 0x00000001 |
| 325 | #define AR_PHY_CCK_SPUR_MIT_USE_CCK_SPUR_MIT_S 0 |
| 326 | #define AR_PHY_CCK_SPUR_MIT_CCK_SPUR_FREQ 0x1ffffe00 |
| 327 | #define AR_PHY_CCK_SPUR_MIT_CCK_SPUR_FREQ_S 9 |
| 328 | |
Luis R. Rodriguez | 7ca710d | 2010-06-12 00:33:43 -0400 | [diff] [blame] | 329 | #define AR_PHY_MRC_CCK_CTRL (AR_AGC_BASE + 0x1d0) |
| 330 | #define AR_PHY_MRC_CCK_ENABLE 0x00000001 |
| 331 | #define AR_PHY_MRC_CCK_ENABLE_S 0 |
| 332 | #define AR_PHY_MRC_CCK_MUX_REG 0x00000002 |
| 333 | #define AR_PHY_MRC_CCK_MUX_REG_S 1 |
| 334 | |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 335 | #define AR_PHY_RX_OCGAIN (AR_AGC_BASE + 0x200) |
| 336 | |
Sujith Manoharan | ae245cd | 2012-02-16 11:52:44 +0530 | [diff] [blame] | 337 | #define AR_PHY_CCA_NOM_VAL_9300_2GHZ -110 |
| 338 | #define AR_PHY_CCA_NOM_VAL_9300_5GHZ -115 |
| 339 | #define AR_PHY_CCA_MIN_GOOD_VAL_9300_2GHZ -125 |
| 340 | #define AR_PHY_CCA_MIN_GOOD_VAL_9300_5GHZ -125 |
Sujith Manoharan | 4d6f720 | 2014-01-02 10:06:35 +0530 | [diff] [blame] | 341 | #define AR_PHY_CCA_MAX_GOOD_VAL_9300_2GHZ -60 |
| 342 | #define AR_PHY_CCA_MAX_GOOD_VAL_9300_5GHZ -60 |
Sujith Manoharan | 0c7c2bb | 2013-12-06 16:28:50 +0530 | [diff] [blame] | 343 | #define AR_PHY_CCA_MAX_GOOD_VAL_9300_FCC_2GHZ -95 |
| 344 | #define AR_PHY_CCA_MAX_GOOD_VAL_9300_FCC_5GHZ -100 |
| 345 | |
Sujith Manoharan | ae245cd | 2012-02-16 11:52:44 +0530 | [diff] [blame] | 346 | #define AR_PHY_CCA_NOM_VAL_9462_2GHZ -127 |
| 347 | #define AR_PHY_CCA_MIN_GOOD_VAL_9462_2GHZ -127 |
Sujith Manoharan | d3b371c | 2013-09-03 10:28:55 +0530 | [diff] [blame] | 348 | #define AR_PHY_CCA_MAX_GOOD_VAL_9462_2GHZ -60 |
Sujith Manoharan | ae245cd | 2012-02-16 11:52:44 +0530 | [diff] [blame] | 349 | #define AR_PHY_CCA_NOM_VAL_9462_5GHZ -127 |
| 350 | #define AR_PHY_CCA_MIN_GOOD_VAL_9462_5GHZ -127 |
Sujith Manoharan | d3b371c | 2013-09-03 10:28:55 +0530 | [diff] [blame] | 351 | #define AR_PHY_CCA_MAX_GOOD_VAL_9462_5GHZ -60 |
Sujith Manoharan | ae245cd | 2012-02-16 11:52:44 +0530 | [diff] [blame] | 352 | |
Gabor Juhos | 0c45373 | 2011-06-21 11:23:40 +0200 | [diff] [blame] | 353 | #define AR_PHY_CCA_NOM_VAL_9330_2GHZ -118 |
| 354 | |
Sujith Manoharan | 30d5b70 | 2013-06-10 13:49:38 +0530 | [diff] [blame] | 355 | #define AR9300_EXT_LNA_CTL_GPIO_AR9485 9 |
| 356 | |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 357 | /* |
| 358 | * AGC Field Definitions |
| 359 | */ |
| 360 | #define AR_PHY_EXT_ATTEN_CTL_RXTX_MARGIN 0x00FC0000 |
| 361 | #define AR_PHY_EXT_ATTEN_CTL_RXTX_MARGIN_S 18 |
| 362 | #define AR_PHY_EXT_ATTEN_CTL_BSW_MARGIN 0x00003C00 |
| 363 | #define AR_PHY_EXT_ATTEN_CTL_BSW_MARGIN_S 10 |
| 364 | #define AR_PHY_EXT_ATTEN_CTL_BSW_ATTEN 0x0000001F |
| 365 | #define AR_PHY_EXT_ATTEN_CTL_BSW_ATTEN_S 0 |
| 366 | #define AR_PHY_EXT_ATTEN_CTL_XATTEN2_MARGIN 0x003E0000 |
| 367 | #define AR_PHY_EXT_ATTEN_CTL_XATTEN2_MARGIN_S 17 |
| 368 | #define AR_PHY_EXT_ATTEN_CTL_XATTEN1_MARGIN 0x0001F000 |
| 369 | #define AR_PHY_EXT_ATTEN_CTL_XATTEN1_MARGIN_S 12 |
| 370 | #define AR_PHY_EXT_ATTEN_CTL_XATTEN2_DB 0x00000FC0 |
| 371 | #define AR_PHY_EXT_ATTEN_CTL_XATTEN2_DB_S 6 |
| 372 | #define AR_PHY_EXT_ATTEN_CTL_XATTEN1_DB 0x0000003F |
| 373 | #define AR_PHY_EXT_ATTEN_CTL_XATTEN1_DB_S 0 |
| 374 | #define AR_PHY_RXGAIN_TXRX_ATTEN 0x0003F000 |
| 375 | #define AR_PHY_RXGAIN_TXRX_ATTEN_S 12 |
| 376 | #define AR_PHY_RXGAIN_TXRX_RF_MAX 0x007C0000 |
| 377 | #define AR_PHY_RXGAIN_TXRX_RF_MAX_S 18 |
| 378 | #define AR9280_PHY_RXGAIN_TXRX_ATTEN 0x00003F80 |
| 379 | #define AR9280_PHY_RXGAIN_TXRX_ATTEN_S 7 |
| 380 | #define AR9280_PHY_RXGAIN_TXRX_MARGIN 0x001FC000 |
| 381 | #define AR9280_PHY_RXGAIN_TXRX_MARGIN_S 14 |
| 382 | #define AR_PHY_SETTLING_SWITCH 0x00003F80 |
| 383 | #define AR_PHY_SETTLING_SWITCH_S 7 |
| 384 | #define AR_PHY_DESIRED_SZ_ADC 0x000000FF |
| 385 | #define AR_PHY_DESIRED_SZ_ADC_S 0 |
| 386 | #define AR_PHY_DESIRED_SZ_PGA 0x0000FF00 |
| 387 | #define AR_PHY_DESIRED_SZ_PGA_S 8 |
| 388 | #define AR_PHY_DESIRED_SZ_TOT_DES 0x0FF00000 |
| 389 | #define AR_PHY_DESIRED_SZ_TOT_DES_S 20 |
| 390 | #define AR_PHY_MINCCA_PWR 0x1FF00000 |
| 391 | #define AR_PHY_MINCCA_PWR_S 20 |
| 392 | #define AR_PHY_CCA_THRESH62 0x0007F000 |
| 393 | #define AR_PHY_CCA_THRESH62_S 12 |
| 394 | #define AR9280_PHY_MINCCA_PWR 0x1FF00000 |
| 395 | #define AR9280_PHY_MINCCA_PWR_S 20 |
| 396 | #define AR9280_PHY_CCA_THRESH62 0x000FF000 |
| 397 | #define AR9280_PHY_CCA_THRESH62_S 12 |
| 398 | #define AR_PHY_EXT_CCA0_THRESH62 0x000000FF |
| 399 | #define AR_PHY_EXT_CCA0_THRESH62_S 0 |
Sujith Manoharan | 3533bf6 | 2013-12-18 09:53:23 +0530 | [diff] [blame] | 400 | #define AR_PHY_EXT_CCA0_THRESH62_1 0x000001FF |
| 401 | #define AR_PHY_EXT_CCA0_THRESH62_1_S 0 |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 402 | #define AR_PHY_CCK_DETECT_WEAK_SIG_THR_CCK 0x0000003F |
| 403 | #define AR_PHY_CCK_DETECT_WEAK_SIG_THR_CCK_S 0 |
| 404 | #define AR_PHY_CCK_DETECT_ANT_SWITCH_TIME 0x00001FC0 |
| 405 | #define AR_PHY_CCK_DETECT_ANT_SWITCH_TIME_S 6 |
| 406 | #define AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV 0x2000 |
| 407 | |
| 408 | #define AR_PHY_DAG_CTRLCCK_EN_RSSI_THR 0x00000200 |
| 409 | #define AR_PHY_DAG_CTRLCCK_EN_RSSI_THR_S 9 |
| 410 | #define AR_PHY_DAG_CTRLCCK_RSSI_THR 0x0001FC00 |
| 411 | #define AR_PHY_DAG_CTRLCCK_RSSI_THR_S 10 |
| 412 | |
| 413 | #define AR_PHY_RIFS_INIT_DELAY 0x3ff0000 |
Rajkumar Manoharan | df222ed | 2011-11-08 14:19:32 +0530 | [diff] [blame] | 414 | #define AR_PHY_AGC_QUICK_DROP 0x03c00000 |
| 415 | #define AR_PHY_AGC_QUICK_DROP_S 22 |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 416 | #define AR_PHY_AGC_COARSE_LOW 0x00007F80 |
| 417 | #define AR_PHY_AGC_COARSE_LOW_S 7 |
| 418 | #define AR_PHY_AGC_COARSE_HIGH 0x003F8000 |
| 419 | #define AR_PHY_AGC_COARSE_HIGH_S 15 |
| 420 | #define AR_PHY_AGC_COARSE_PWR_CONST 0x0000007F |
| 421 | #define AR_PHY_AGC_COARSE_PWR_CONST_S 0 |
| 422 | #define AR_PHY_FIND_SIG_FIRSTEP 0x0003F000 |
| 423 | #define AR_PHY_FIND_SIG_FIRSTEP_S 12 |
| 424 | #define AR_PHY_FIND_SIG_FIRPWR 0x03FC0000 |
| 425 | #define AR_PHY_FIND_SIG_FIRPWR_S 18 |
| 426 | #define AR_PHY_FIND_SIG_FIRPWR_SIGN_BIT 25 |
| 427 | #define AR_PHY_FIND_SIG_RELPWR (0x1f << 6) |
| 428 | #define AR_PHY_FIND_SIG_RELPWR_S 6 |
| 429 | #define AR_PHY_FIND_SIG_RELPWR_SIGN_BIT 11 |
| 430 | #define AR_PHY_FIND_SIG_RELSTEP 0x1f |
| 431 | #define AR_PHY_FIND_SIG_RELSTEP_S 0 |
| 432 | #define AR_PHY_FIND_SIG_RELSTEP_SIGN_BIT 5 |
Sujith Manoharan | 362cd03 | 2012-09-16 08:06:36 +0530 | [diff] [blame] | 433 | #define AR_PHY_RESTART_ENABLE_DIV_M2FLAG 0x00200000 |
| 434 | #define AR_PHY_RESTART_ENABLE_DIV_M2FLAG_S 21 |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 435 | #define AR_PHY_RESTART_DIV_GC 0x001C0000 |
| 436 | #define AR_PHY_RESTART_DIV_GC_S 18 |
| 437 | #define AR_PHY_RESTART_ENA 0x01 |
| 438 | #define AR_PHY_DC_RESTART_DIS 0x40000000 |
| 439 | |
| 440 | #define AR_PHY_TPC_OLPC_GAIN_DELTA_PAL_ON 0xFF000000 |
| 441 | #define AR_PHY_TPC_OLPC_GAIN_DELTA_PAL_ON_S 24 |
| 442 | #define AR_PHY_TPC_OLPC_GAIN_DELTA 0x00FF0000 |
| 443 | #define AR_PHY_TPC_OLPC_GAIN_DELTA_S 16 |
| 444 | |
| 445 | #define AR_PHY_TPC_6_ERROR_EST_MODE 0x03000000 |
| 446 | #define AR_PHY_TPC_6_ERROR_EST_MODE_S 24 |
| 447 | |
| 448 | /* |
| 449 | * SM Register Map |
| 450 | */ |
| 451 | #define AR_SM_BASE 0xa200 |
| 452 | |
| 453 | #define AR_PHY_D2_CHIP_ID (AR_SM_BASE + 0x0) |
| 454 | #define AR_PHY_GEN_CTRL (AR_SM_BASE + 0x4) |
| 455 | #define AR_PHY_MODE (AR_SM_BASE + 0x8) |
| 456 | #define AR_PHY_ACTIVE (AR_SM_BASE + 0xc) |
Miaoqing Pan | df476df | 2014-12-19 06:33:58 +0530 | [diff] [blame] | 457 | #define AR_PHY_SPUR_MASK_A (AR_SM_BASE + (AR_SREV_9561(ah) ? 0x18 : 0x20)) |
Miaoqing Pan | fa5b8c8 | 2015-07-15 15:54:06 +0800 | [diff] [blame] | 458 | #define AR_PHY_SPUR_MASK_B (AR_SM_BASE + (AR_SREV_9561(ah) ? 0x1c : 0x24)) |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 459 | #define AR_PHY_SPECTRAL_SCAN (AR_SM_BASE + 0x28) |
| 460 | #define AR_PHY_RADAR_BW_FILTER (AR_SM_BASE + 0x2c) |
| 461 | #define AR_PHY_SEARCH_START_DELAY (AR_SM_BASE + 0x30) |
| 462 | #define AR_PHY_MAX_RX_LEN (AR_SM_BASE + 0x34) |
| 463 | #define AR_PHY_FRAME_CTL (AR_SM_BASE + 0x38) |
| 464 | #define AR_PHY_RFBUS_REQ (AR_SM_BASE + 0x3c) |
| 465 | #define AR_PHY_RFBUS_GRANT (AR_SM_BASE + 0x40) |
| 466 | #define AR_PHY_RIFS (AR_SM_BASE + 0x44) |
| 467 | #define AR_PHY_RX_CLR_DELAY (AR_SM_BASE + 0x50) |
| 468 | #define AR_PHY_RX_DELAY (AR_SM_BASE + 0x54) |
| 469 | |
| 470 | #define AR_PHY_XPA_TIMING_CTL (AR_SM_BASE + 0x64) |
| 471 | #define AR_PHY_MISC_PA_CTL (AR_SM_BASE + 0x80) |
| 472 | #define AR_PHY_SWITCH_CHAIN_0 (AR_SM_BASE + 0x84) |
| 473 | #define AR_PHY_SWITCH_COM (AR_SM_BASE + 0x88) |
| 474 | #define AR_PHY_SWITCH_COM_2 (AR_SM_BASE + 0x8c) |
| 475 | #define AR_PHY_RX_CHAINMASK (AR_SM_BASE + 0xa0) |
| 476 | #define AR_PHY_CAL_CHAINMASK (AR_SM_BASE + 0xc0) |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 477 | #define AR_PHY_CALMODE (AR_SM_BASE + 0xc8) |
| 478 | #define AR_PHY_FCAL_1 (AR_SM_BASE + 0xcc) |
| 479 | #define AR_PHY_FCAL_2_0 (AR_SM_BASE + 0xd0) |
| 480 | #define AR_PHY_DFT_TONE_CTL_0 (AR_SM_BASE + 0xd4) |
| 481 | #define AR_PHY_CL_CAL_CTL (AR_SM_BASE + 0xd8) |
| 482 | #define AR_PHY_CL_TAB_0 (AR_SM_BASE + 0x100) |
| 483 | #define AR_PHY_SYNTH_CONTROL (AR_SM_BASE + 0x140) |
| 484 | #define AR_PHY_ADDAC_CLK_SEL (AR_SM_BASE + 0x144) |
| 485 | #define AR_PHY_PLL_CTL (AR_SM_BASE + 0x148) |
| 486 | #define AR_PHY_ANALOG_SWAP (AR_SM_BASE + 0x14c) |
| 487 | #define AR_PHY_ADDAC_PARA_CTL (AR_SM_BASE + 0x150) |
| 488 | #define AR_PHY_XPA_CFG (AR_SM_BASE + 0x158) |
| 489 | |
Miaoqing Pan | 25c0f30 | 2016-02-18 17:20:02 +0800 | [diff] [blame] | 490 | #define AR_PHY_FLC_PWR_THRESH 7 |
| 491 | #define AR_PHY_FLC_PWR_THRESH_S 0 |
| 492 | |
Felix Fietkau | 3e61d3f | 2012-04-19 21:18:25 +0200 | [diff] [blame] | 493 | #define AR_PHY_FRAME_CTL_CF_OVERLAP_WINDOW 3 |
| 494 | #define AR_PHY_FRAME_CTL_CF_OVERLAP_WINDOW_S 0 |
| 495 | |
Luis R. Rodriguez | 1547da3 | 2010-04-15 17:39:15 -0400 | [diff] [blame] | 496 | #define AR_PHY_SPUR_MASK_A_CF_PUNC_MASK_IDX_A 0x0001FC00 |
| 497 | #define AR_PHY_SPUR_MASK_A_CF_PUNC_MASK_IDX_A_S 10 |
| 498 | #define AR_PHY_SPUR_MASK_A_CF_PUNC_MASK_A 0x3FF |
| 499 | #define AR_PHY_SPUR_MASK_A_CF_PUNC_MASK_A_S 0 |
| 500 | |
Miaoqing Pan | fa5b8c8 | 2015-07-15 15:54:06 +0800 | [diff] [blame] | 501 | #define AR_PHY_TEST (AR_SM_BASE + (AR_SREV_9561(ah) ? 0x15c : 0x160)) |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 502 | |
| 503 | #define AR_PHY_TEST_BBB_OBS_SEL 0x780000 |
| 504 | #define AR_PHY_TEST_BBB_OBS_SEL_S 19 |
| 505 | |
| 506 | #define AR_PHY_TEST_RX_OBS_SEL_BIT5_S 23 |
| 507 | #define AR_PHY_TEST_RX_OBS_SEL_BIT5 (1 << AR_PHY_TEST_RX_OBS_SEL_BIT5_S) |
| 508 | |
| 509 | #define AR_PHY_TEST_CHAIN_SEL 0xC0000000 |
| 510 | #define AR_PHY_TEST_CHAIN_SEL_S 30 |
| 511 | |
Miaoqing Pan | df476df | 2014-12-19 06:33:58 +0530 | [diff] [blame] | 512 | #define AR_PHY_TEST_CTL_STATUS (AR_SM_BASE + (AR_SREV_9561(ah) ? 0x160 : 0x164)) |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 513 | #define AR_PHY_TEST_CTL_TSTDAC_EN 0x1 |
| 514 | #define AR_PHY_TEST_CTL_TSTDAC_EN_S 0 |
| 515 | #define AR_PHY_TEST_CTL_TX_OBS_SEL 0x1C |
| 516 | #define AR_PHY_TEST_CTL_TX_OBS_SEL_S 2 |
| 517 | #define AR_PHY_TEST_CTL_TX_OBS_MUX_SEL 0x60 |
| 518 | #define AR_PHY_TEST_CTL_TX_OBS_MUX_SEL_S 5 |
| 519 | #define AR_PHY_TEST_CTL_TSTADC_EN 0x100 |
| 520 | #define AR_PHY_TEST_CTL_TSTADC_EN_S 8 |
| 521 | #define AR_PHY_TEST_CTL_RX_OBS_SEL 0x3C00 |
| 522 | #define AR_PHY_TEST_CTL_RX_OBS_SEL_S 10 |
Mohammed Shafi Shajakhan | 2ee4bd1 | 2011-11-30 10:41:13 +0530 | [diff] [blame] | 523 | #define AR_PHY_TEST_CTL_DEBUGPORT_SEL 0xe0000000 |
| 524 | #define AR_PHY_TEST_CTL_DEBUGPORT_SEL_S 29 |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 525 | |
| 526 | |
Miaoqing Pan | fa5b8c8 | 2015-07-15 15:54:06 +0800 | [diff] [blame] | 527 | #define AR_PHY_TSTDAC (AR_SM_BASE + (AR_SREV_9561(ah) ? 0x164 : 0x168)) |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 528 | |
Miaoqing Pan | fa5b8c8 | 2015-07-15 15:54:06 +0800 | [diff] [blame] | 529 | #define AR_PHY_CHAN_STATUS (AR_SM_BASE + (AR_SREV_9561(ah) ? 0x168 : 0x16c)) |
Felix Fietkau | ab33449 | 2010-06-12 00:33:58 -0400 | [diff] [blame] | 530 | |
Miaoqing Pan | df476df | 2014-12-19 06:33:58 +0530 | [diff] [blame] | 531 | #define AR_PHY_CHAN_INFO_MEMORY (AR_SM_BASE + (AR_SREV_9561(ah) ? 0x16c : 0x170)) |
Felix Fietkau | ab33449 | 2010-06-12 00:33:58 -0400 | [diff] [blame] | 532 | #define AR_PHY_CHAN_INFO_MEMORY_CHANINFOMEM_S2_READ 0x00000008 |
| 533 | #define AR_PHY_CHAN_INFO_MEMORY_CHANINFOMEM_S2_READ_S 3 |
| 534 | |
Miaoqing Pan | fa5b8c8 | 2015-07-15 15:54:06 +0800 | [diff] [blame] | 535 | #define AR_PHY_CHNINFO_NOISEPWR (AR_SM_BASE + (AR_SREV_9561(ah) ? 0x170 : 0x174)) |
| 536 | #define AR_PHY_CHNINFO_GAINDIFF (AR_SM_BASE + (AR_SREV_9561(ah) ? 0x174 : 0x178)) |
| 537 | #define AR_PHY_CHNINFO_FINETIM (AR_SM_BASE + (AR_SREV_9561(ah) ? 0x178 : 0x17c)) |
| 538 | #define AR_PHY_CHAN_INFO_GAIN_0 (AR_SM_BASE + (AR_SREV_9561(ah) ? 0x17c : 0x180)) |
| 539 | #define AR_PHY_SCRAMBLER_SEED (AR_SM_BASE + (AR_SREV_9561(ah) ? 0x184 : 0x190)) |
| 540 | #define AR_PHY_CCK_TX_CTRL (AR_SM_BASE + (AR_SREV_9561(ah) ? 0x188 : 0x194)) |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 541 | |
Miaoqing Pan | df476df | 2014-12-19 06:33:58 +0530 | [diff] [blame] | 542 | #define AR_PHY_HEAVYCLIP_CTL (AR_SM_BASE + (AR_SREV_9561(ah) ? 0x198 : 0x1a4)) |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 543 | #define AR_PHY_HEAVYCLIP_20 (AR_SM_BASE + 0x1a8) |
| 544 | #define AR_PHY_HEAVYCLIP_40 (AR_SM_BASE + 0x1ac) |
Miaoqing Pan | fa5b8c8 | 2015-07-15 15:54:06 +0800 | [diff] [blame] | 545 | #define AR_PHY_HEAVYCLIP_1 (AR_SM_BASE + 0x19c) |
| 546 | #define AR_PHY_HEAVYCLIP_2 (AR_SM_BASE + 0x1a0) |
| 547 | #define AR_PHY_HEAVYCLIP_3 (AR_SM_BASE + 0x1a4) |
| 548 | #define AR_PHY_HEAVYCLIP_4 (AR_SM_BASE + 0x1a8) |
| 549 | #define AR_PHY_HEAVYCLIP_5 (AR_SM_BASE + 0x1ac) |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 550 | #define AR_PHY_ILLEGAL_TXRATE (AR_SM_BASE + 0x1b0) |
| 551 | |
Felix Fietkau | 4a4fdf2 | 2011-01-21 18:46:35 +0100 | [diff] [blame] | 552 | #define AR_PHY_POWER_TX_RATE(_d) (AR_SM_BASE + 0x1c0 + ((_d) << 2)) |
| 553 | |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 554 | #define AR_PHY_PWRTX_MAX (AR_SM_BASE + 0x1f0) |
| 555 | #define AR_PHY_POWER_TX_SUB (AR_SM_BASE + 0x1f4) |
| 556 | |
Felix Fietkau | ab33449 | 2010-06-12 00:33:58 -0400 | [diff] [blame] | 557 | #define AR_PHY_TPC_1 (AR_SM_BASE + 0x1f8) |
| 558 | #define AR_PHY_TPC_1_FORCED_DAC_GAIN 0x0000003e |
| 559 | #define AR_PHY_TPC_1_FORCED_DAC_GAIN_S 1 |
| 560 | #define AR_PHY_TPC_1_FORCE_DAC_GAIN 0x00000001 |
| 561 | #define AR_PHY_TPC_1_FORCE_DAC_GAIN_S 0 |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 562 | |
Felix Fietkau | ab33449 | 2010-06-12 00:33:58 -0400 | [diff] [blame] | 563 | #define AR_PHY_TPC_4_B0 (AR_SM_BASE + 0x204) |
| 564 | #define AR_PHY_TPC_5_B0 (AR_SM_BASE + 0x208) |
| 565 | #define AR_PHY_TPC_6_B0 (AR_SM_BASE + 0x20c) |
| 566 | |
| 567 | #define AR_PHY_TPC_11_B0 (AR_SM_BASE + 0x220) |
| 568 | #define AR_PHY_TPC_11_B1 (AR_SM1_BASE + 0x220) |
| 569 | #define AR_PHY_TPC_11_B2 (AR_SM2_BASE + 0x220) |
| 570 | #define AR_PHY_TPC_11_OLPC_GAIN_DELTA 0x00ff0000 |
| 571 | #define AR_PHY_TPC_11_OLPC_GAIN_DELTA_S 16 |
| 572 | |
| 573 | #define AR_PHY_TPC_12 (AR_SM_BASE + 0x224) |
| 574 | #define AR_PHY_TPC_12_DESIRED_SCALE_HT40_5 0x3e000000 |
| 575 | #define AR_PHY_TPC_12_DESIRED_SCALE_HT40_5_S 25 |
| 576 | |
| 577 | #define AR_PHY_TPC_18 (AR_SM_BASE + 0x23c) |
| 578 | #define AR_PHY_TPC_18_THERM_CAL_VALUE 0x000000ff |
| 579 | #define AR_PHY_TPC_18_THERM_CAL_VALUE_S 0 |
| 580 | #define AR_PHY_TPC_18_VOLT_CAL_VALUE 0x0000ff00 |
| 581 | #define AR_PHY_TPC_18_VOLT_CAL_VALUE_S 8 |
| 582 | |
| 583 | #define AR_PHY_TPC_19 (AR_SM_BASE + 0x240) |
| 584 | #define AR_PHY_TPC_19_ALPHA_VOLT 0x001f0000 |
| 585 | #define AR_PHY_TPC_19_ALPHA_VOLT_S 16 |
| 586 | #define AR_PHY_TPC_19_ALPHA_THERM 0xff |
| 587 | #define AR_PHY_TPC_19_ALPHA_THERM_S 0 |
| 588 | |
| 589 | #define AR_PHY_TX_FORCED_GAIN (AR_SM_BASE + 0x258) |
| 590 | #define AR_PHY_TX_FORCED_GAIN_FORCE_TX_GAIN 0x00000001 |
| 591 | #define AR_PHY_TX_FORCED_GAIN_FORCE_TX_GAIN_S 0 |
| 592 | #define AR_PHY_TX_FORCED_GAIN_FORCED_TXBB1DBGAIN 0x0000000e |
| 593 | #define AR_PHY_TX_FORCED_GAIN_FORCED_TXBB1DBGAIN_S 1 |
| 594 | #define AR_PHY_TX_FORCED_GAIN_FORCED_TXBB6DBGAIN 0x00000030 |
| 595 | #define AR_PHY_TX_FORCED_GAIN_FORCED_TXBB6DBGAIN_S 4 |
| 596 | #define AR_PHY_TX_FORCED_GAIN_FORCED_TXMXRGAIN 0x000003c0 |
| 597 | #define AR_PHY_TX_FORCED_GAIN_FORCED_TXMXRGAIN_S 6 |
| 598 | #define AR_PHY_TX_FORCED_GAIN_FORCED_PADRVGNA 0x00003c00 |
| 599 | #define AR_PHY_TX_FORCED_GAIN_FORCED_PADRVGNA_S 10 |
| 600 | #define AR_PHY_TX_FORCED_GAIN_FORCED_PADRVGNB 0x0003c000 |
| 601 | #define AR_PHY_TX_FORCED_GAIN_FORCED_PADRVGNB_S 14 |
| 602 | #define AR_PHY_TX_FORCED_GAIN_FORCED_PADRVGNC 0x003c0000 |
| 603 | #define AR_PHY_TX_FORCED_GAIN_FORCED_PADRVGNC_S 18 |
| 604 | #define AR_PHY_TX_FORCED_GAIN_FORCED_PADRVGND 0x00c00000 |
| 605 | #define AR_PHY_TX_FORCED_GAIN_FORCED_PADRVGND_S 22 |
| 606 | #define AR_PHY_TX_FORCED_GAIN_FORCED_ENABLE_PAL 0x01000000 |
| 607 | #define AR_PHY_TX_FORCED_GAIN_FORCED_ENABLE_PAL_S 24 |
| 608 | |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 609 | |
| 610 | #define AR_PHY_PDADC_TAB_0 (AR_SM_BASE + 0x280) |
| 611 | |
Felix Fietkau | ab33449 | 2010-06-12 00:33:58 -0400 | [diff] [blame] | 612 | #define AR_PHY_TXGAIN_TABLE (AR_SM_BASE + 0x300) |
| 613 | |
Rajkumar Manoharan | 52d6d4e | 2011-10-20 14:22:43 +0530 | [diff] [blame] | 614 | #define AR_PHY_TX_IQCAL_CONTROL_0 (AR_SM_BASE + (AR_SREV_9485(ah) ? \ |
| 615 | 0x3c4 : 0x444)) |
| 616 | #define AR_PHY_TX_IQCAL_CONTROL_1 (AR_SM_BASE + (AR_SREV_9485(ah) ? \ |
| 617 | 0x3c8 : 0x448)) |
| 618 | #define AR_PHY_TX_IQCAL_START (AR_SM_BASE + (AR_SREV_9485(ah) ? \ |
| 619 | 0x3c4 : 0x440)) |
| 620 | #define AR_PHY_TX_IQCAL_STATUS_B0 (AR_SM_BASE + (AR_SREV_9485(ah) ? \ |
| 621 | 0x3f0 : 0x48c)) |
Vasanthakumar Thiagarajan | 31faff8 | 2010-12-06 04:27:55 -0800 | [diff] [blame] | 622 | #define AR_PHY_TX_IQCAL_CORR_COEFF_B0(_i) (AR_SM_BASE + \ |
| 623 | (AR_SREV_9485(ah) ? \ |
| 624 | 0x3d0 : 0x450) + ((_i) << 2)) |
Senthil Balasubramanian | ce407af | 2011-09-13 22:38:16 +0530 | [diff] [blame] | 625 | #define AR_PHY_RTT_CTRL (AR_SM_BASE + 0x380) |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 626 | |
Luis R. Rodriguez | aea702b | 2010-05-13 13:33:43 -0400 | [diff] [blame] | 627 | #define AR_PHY_WATCHDOG_STATUS (AR_SM_BASE + 0x5c0) |
| 628 | #define AR_PHY_WATCHDOG_CTL_1 (AR_SM_BASE + 0x5c4) |
| 629 | #define AR_PHY_WATCHDOG_CTL_2 (AR_SM_BASE + 0x5c8) |
| 630 | #define AR_PHY_WATCHDOG_CTL (AR_SM_BASE + 0x5cc) |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 631 | #define AR_PHY_ONLY_WARMRESET (AR_SM_BASE + 0x5d0) |
| 632 | #define AR_PHY_ONLY_CTL (AR_SM_BASE + 0x5d4) |
| 633 | #define AR_PHY_ECO_CTRL (AR_SM_BASE + 0x5dc) |
Felix Fietkau | ab33449 | 2010-06-12 00:33:58 -0400 | [diff] [blame] | 634 | |
| 635 | #define AR_PHY_BB_THERM_ADC_1 (AR_SM_BASE + 0x248) |
| 636 | #define AR_PHY_BB_THERM_ADC_1_INIT_THERM 0x000000ff |
| 637 | #define AR_PHY_BB_THERM_ADC_1_INIT_THERM_S 0 |
| 638 | |
Rajkumar Manoharan | 80fe43f | 2012-09-07 12:15:16 +0530 | [diff] [blame] | 639 | #define AR_PHY_BB_THERM_ADC_3 (AR_SM_BASE + 0x250) |
| 640 | #define AR_PHY_BB_THERM_ADC_3_THERM_ADC_SCALE_GAIN 0x0001ff00 |
| 641 | #define AR_PHY_BB_THERM_ADC_3_THERM_ADC_SCALE_GAIN_S 8 |
| 642 | #define AR_PHY_BB_THERM_ADC_3_THERM_ADC_OFFSET 0x000000ff |
| 643 | #define AR_PHY_BB_THERM_ADC_3_THERM_ADC_OFFSET_S 0 |
| 644 | |
Felix Fietkau | ab33449 | 2010-06-12 00:33:58 -0400 | [diff] [blame] | 645 | #define AR_PHY_BB_THERM_ADC_4 (AR_SM_BASE + 0x254) |
| 646 | #define AR_PHY_BB_THERM_ADC_4_LATEST_THERM_VALUE 0x000000ff |
| 647 | #define AR_PHY_BB_THERM_ADC_4_LATEST_THERM_VALUE_S 0 |
| 648 | #define AR_PHY_BB_THERM_ADC_4_LATEST_VOLT_VALUE 0x0000ff00 |
| 649 | #define AR_PHY_BB_THERM_ADC_4_LATEST_VOLT_VALUE_S 8 |
| 650 | |
Felix Fietkau | 381c726 | 2012-08-27 17:00:05 +0200 | [diff] [blame] | 651 | #define AR_PHY_65NM_CH0_TXRF3 0x16048 |
| 652 | #define AR_PHY_65NM_CH0_TXRF3_CAPDIV2G 0x0000001e |
| 653 | #define AR_PHY_65NM_CH0_TXRF3_CAPDIV2G_S 1 |
| 654 | |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 655 | #define AR_PHY_65NM_CH0_SYNTH4 0x1608c |
Sujith Manoharan | a4a2954 | 2012-09-10 09:20:03 +0530 | [diff] [blame] | 656 | #define AR_PHY_SYNTH4_LONG_SHIFT_SELECT ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x00000001 : 0x00000002) |
| 657 | #define AR_PHY_SYNTH4_LONG_SHIFT_SELECT_S ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0 : 1) |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 658 | #define AR_PHY_65NM_CH0_SYNTH7 0x16098 |
Sujith Manoharan | 6fcbe53 | 2013-11-14 15:26:06 +0530 | [diff] [blame] | 659 | #define AR_PHY_65NM_CH0_SYNTH12 0x160ac |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 660 | #define AR_PHY_65NM_CH0_BIAS1 0x160c0 |
| 661 | #define AR_PHY_65NM_CH0_BIAS2 0x160c4 |
| 662 | #define AR_PHY_65NM_CH0_BIAS4 0x160cc |
Sujith Manoharan | 6fcbe53 | 2013-11-14 15:26:06 +0530 | [diff] [blame] | 663 | #define AR_PHY_65NM_CH0_RXTX2 0x16104 |
| 664 | #define AR_PHY_65NM_CH1_RXTX2 0x16504 |
| 665 | #define AR_PHY_65NM_CH2_RXTX2 0x16904 |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 666 | #define AR_PHY_65NM_CH0_RXTX4 0x1610c |
Felix Fietkau | 3e2ea54 | 2012-07-15 19:53:39 +0200 | [diff] [blame] | 667 | #define AR_PHY_65NM_CH1_RXTX4 0x1650c |
| 668 | #define AR_PHY_65NM_CH2_RXTX4 0x1690c |
Senthil Balasubramanian | ce407af | 2011-09-13 22:38:16 +0530 | [diff] [blame] | 669 | |
Sujith Manoharan | 42dd98b | 2014-01-02 10:06:21 +0530 | [diff] [blame] | 670 | #define AR_PHY_65NM_CH0_BB1 0x16140 |
| 671 | #define AR_PHY_65NM_CH0_BB2 0x16144 |
| 672 | #define AR_PHY_65NM_CH0_BB3 0x16148 |
| 673 | #define AR_PHY_65NM_CH1_BB1 0x16540 |
| 674 | #define AR_PHY_65NM_CH1_BB2 0x16544 |
| 675 | #define AR_PHY_65NM_CH1_BB3 0x16548 |
| 676 | #define AR_PHY_65NM_CH2_BB1 0x16940 |
| 677 | #define AR_PHY_65NM_CH2_BB2 0x16944 |
| 678 | #define AR_PHY_65NM_CH2_BB3 0x16948 |
| 679 | |
Sujith Manoharan | 6fcbe53 | 2013-11-14 15:26:06 +0530 | [diff] [blame] | 680 | #define AR_PHY_65NM_CH0_SYNTH12_VREFMUL3 0x00780000 |
| 681 | #define AR_PHY_65NM_CH0_SYNTH12_VREFMUL3_S 19 |
| 682 | #define AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK 0x00000004 |
| 683 | #define AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK_S 2 |
| 684 | #define AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK 0x00000008 |
| 685 | #define AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK_S 3 |
| 686 | |
Senthil Balasubramanian | b54af8a | 2011-09-13 22:38:19 +0530 | [diff] [blame] | 687 | #define AR_CH0_TOP (AR_SREV_9300(ah) ? 0x16288 : \ |
Sujith Manoharan | a4a2954 | 2012-09-10 09:20:03 +0530 | [diff] [blame] | 688 | (((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x1628c : 0x16280))) |
Gabor Juhos | 4b09172 | 2012-07-03 19:13:25 +0200 | [diff] [blame] | 689 | #define AR_CH0_TOP_XPABIASLVL (AR_SREV_9550(ah) ? 0x3c0 : 0x300) |
| 690 | #define AR_CH0_TOP_XPABIASLVL_S (AR_SREV_9550(ah) ? 6 : 8) |
Senthil Balasubramanian | b54af8a | 2011-09-13 22:38:19 +0530 | [diff] [blame] | 691 | |
| 692 | #define AR_CH0_THERM (AR_SREV_9300(ah) ? 0x16290 : \ |
| 693 | ((AR_SREV_9485(ah) ? 0x1628c : 0x16294))) |
| 694 | #define AR_CH0_THERM_XPABIASLVL_MSB 0x3 |
| 695 | #define AR_CH0_THERM_XPABIASLVL_MSB_S 0 |
| 696 | #define AR_CH0_THERM_XPASHORT2GND 0x4 |
| 697 | #define AR_CH0_THERM_XPASHORT2GND_S 2 |
| 698 | |
| 699 | #define AR_SWITCH_TABLE_COM_ALL (0xffff) |
| 700 | #define AR_SWITCH_TABLE_COM_ALL_S (0) |
Rajkumar Manoharan | 423e38e | 2011-10-13 11:00:44 +0530 | [diff] [blame] | 701 | #define AR_SWITCH_TABLE_COM_AR9462_ALL (0xffffff) |
| 702 | #define AR_SWITCH_TABLE_COM_AR9462_ALL_S (0) |
Gabor Juhos | 2d00de4 | 2012-07-03 19:13:26 +0200 | [diff] [blame] | 703 | #define AR_SWITCH_TABLE_COM_AR9550_ALL (0xffffff) |
| 704 | #define AR_SWITCH_TABLE_COM_AR9550_ALL_S (0) |
Senthil Balasubramanian | b54af8a | 2011-09-13 22:38:19 +0530 | [diff] [blame] | 705 | #define AR_SWITCH_TABLE_COM_SPDT (0x00f00000) |
| 706 | #define AR_SWITCH_TABLE_COM_SPDT_ALL (0x0000fff0) |
| 707 | #define AR_SWITCH_TABLE_COM_SPDT_ALL_S (4) |
| 708 | |
| 709 | #define AR_SWITCH_TABLE_COM2_ALL (0xffffff) |
| 710 | #define AR_SWITCH_TABLE_COM2_ALL_S (0) |
| 711 | |
| 712 | #define AR_SWITCH_TABLE_ALL (0xfff) |
| 713 | #define AR_SWITCH_TABLE_ALL_S (0) |
Senthil Balasubramanian | ce407af | 2011-09-13 22:38:16 +0530 | [diff] [blame] | 714 | |
| 715 | #define AR_PHY_65NM_CH0_THERM (AR_SREV_9300(ah) ? 0x16290 :\ |
Sujith Manoharan | a4a2954 | 2012-09-10 09:20:03 +0530 | [diff] [blame] | 716 | ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x16294 : 0x1628c)) |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 717 | |
| 718 | #define AR_PHY_65NM_CH0_THERM_LOCAL 0x80000000 |
| 719 | #define AR_PHY_65NM_CH0_THERM_LOCAL_S 31 |
| 720 | #define AR_PHY_65NM_CH0_THERM_START 0x20000000 |
| 721 | #define AR_PHY_65NM_CH0_THERM_START_S 29 |
| 722 | #define AR_PHY_65NM_CH0_THERM_SAR_ADC_OUT 0x0000ff00 |
| 723 | #define AR_PHY_65NM_CH0_THERM_SAR_ADC_OUT_S 8 |
| 724 | |
Senthil Balasubramanian | ce407af | 2011-09-13 22:38:16 +0530 | [diff] [blame] | 725 | #define AR_CH0_TOP2 (AR_SREV_9300(ah) ? 0x1628c : \ |
Rajkumar Manoharan | fd26981 | 2011-10-21 12:53:51 +0530 | [diff] [blame] | 726 | (AR_SREV_9462(ah) ? 0x16290 : 0x16284)) |
Miaoqing Pan | df476df | 2014-12-19 06:33:58 +0530 | [diff] [blame] | 727 | #define AR_CH0_TOP2_XPABIASLVL (AR_SREV_9561(ah) ? 0x1e00 : 0xf000) |
Vasanthakumar Thiagarajan | 9936e65 | 2010-12-06 04:27:48 -0800 | [diff] [blame] | 728 | #define AR_CH0_TOP2_XPABIASLVL_S 12 |
| 729 | |
Senthil Balasubramanian | ce407af | 2011-09-13 22:38:16 +0530 | [diff] [blame] | 730 | #define AR_CH0_XTAL (AR_SREV_9300(ah) ? 0x16294 : \ |
Miaoqing Pan | df476df | 2014-12-19 06:33:58 +0530 | [diff] [blame] | 731 | ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x16298 : \ |
| 732 | (AR_SREV_9561(ah) ? 0x162c0 : 0x16290))) |
Vasanthakumar Thiagarajan | dd040f7 | 2010-12-06 04:27:52 -0800 | [diff] [blame] | 733 | #define AR_CH0_XTAL_CAPINDAC 0x7f000000 |
| 734 | #define AR_CH0_XTAL_CAPINDAC_S 24 |
| 735 | #define AR_CH0_XTAL_CAPOUTDAC 0x00fe0000 |
| 736 | #define AR_CH0_XTAL_CAPOUTDAC_S 17 |
| 737 | |
Miaoqing Pan | df476df | 2014-12-19 06:33:58 +0530 | [diff] [blame] | 738 | #define AR_PHY_PMU1 ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x16340 : \ |
| 739 | (AR_SREV_9561(ah) ? 0x16cc0 : 0x16c40)) |
Vasanthakumar Thiagarajan | ab09b5b | 2010-12-07 02:20:39 -0800 | [diff] [blame] | 740 | #define AR_PHY_PMU1_PWD 0x1 |
| 741 | #define AR_PHY_PMU1_PWD_S 0 |
| 742 | |
Miaoqing Pan | df476df | 2014-12-19 06:33:58 +0530 | [diff] [blame] | 743 | #define AR_PHY_PMU2 ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x16344 : \ |
| 744 | (AR_SREV_9561(ah) ? 0x16cc4 : 0x16c44)) |
Vasanthakumar Thiagarajan | ab09b5b | 2010-12-07 02:20:39 -0800 | [diff] [blame] | 745 | #define AR_PHY_PMU2_PGM 0x00200000 |
| 746 | #define AR_PHY_PMU2_PGM_S 21 |
| 747 | |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 748 | #define AR_PHY_RX1DB_BIQUAD_LONG_SHIFT 0x00380000 |
| 749 | #define AR_PHY_RX1DB_BIQUAD_LONG_SHIFT_S 19 |
| 750 | #define AR_PHY_RX6DB_BIQUAD_LONG_SHIFT 0x00c00000 |
| 751 | #define AR_PHY_RX6DB_BIQUAD_LONG_SHIFT_S 22 |
| 752 | #define AR_PHY_LNAGAIN_LONG_SHIFT 0xe0000000 |
| 753 | #define AR_PHY_LNAGAIN_LONG_SHIFT_S 29 |
| 754 | #define AR_PHY_MXRGAIN_LONG_SHIFT 0x03000000 |
| 755 | #define AR_PHY_MXRGAIN_LONG_SHIFT_S 24 |
| 756 | #define AR_PHY_VGAGAIN_LONG_SHIFT 0x1c000000 |
| 757 | #define AR_PHY_VGAGAIN_LONG_SHIFT_S 26 |
| 758 | #define AR_PHY_SCFIR_GAIN_LONG_SHIFT 0x00000001 |
| 759 | #define AR_PHY_SCFIR_GAIN_LONG_SHIFT_S 0 |
| 760 | #define AR_PHY_MANRXGAIN_LONG_SHIFT 0x00000002 |
| 761 | #define AR_PHY_MANRXGAIN_LONG_SHIFT_S 1 |
| 762 | |
| 763 | /* |
| 764 | * SM Field Definitions |
| 765 | */ |
| 766 | #define AR_PHY_CL_CAL_ENABLE 0x00000002 |
| 767 | #define AR_PHY_PARALLEL_CAL_ENABLE 0x00000001 |
| 768 | #define AR_PHY_TPCRG1_PD_CAL_ENABLE 0x00400000 |
| 769 | #define AR_PHY_TPCRG1_PD_CAL_ENABLE_S 22 |
| 770 | |
| 771 | #define AR_PHY_ADDAC_PARACTL_OFF_PWDADC 0x00008000 |
| 772 | |
| 773 | #define AR_PHY_FCAL20_CAP_STATUS_0 0x01f00000 |
| 774 | #define AR_PHY_FCAL20_CAP_STATUS_0_S 20 |
| 775 | |
| 776 | #define AR_PHY_RFBUS_REQ_EN 0x00000001 /* request for RF bus */ |
| 777 | #define AR_PHY_RFBUS_GRANT_EN 0x00000001 /* RF bus granted */ |
| 778 | #define AR_PHY_GC_TURBO_MODE 0x00000001 /* set turbo mode bits */ |
| 779 | #define AR_PHY_GC_TURBO_SHORT 0x00000002 /* set short symbols to turbo mode setting */ |
| 780 | #define AR_PHY_GC_DYN2040_EN 0x00000004 /* enable dyn 20/40 mode */ |
| 781 | #define AR_PHY_GC_DYN2040_PRI_ONLY 0x00000008 /* dyn 20/40 - primary only */ |
| 782 | #define AR_PHY_GC_DYN2040_PRI_CH 0x00000010 /* dyn 20/40 - primary ch offset (0=+10MHz, 1=-10MHz)*/ |
Luis R. Rodriguez | 1547da3 | 2010-04-15 17:39:15 -0400 | [diff] [blame] | 783 | #define AR_PHY_GC_DYN2040_PRI_CH_S 4 |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 784 | #define AR_PHY_GC_DYN2040_EXT_CH 0x00000020 /* dyn 20/40 - ext ch spacing (0=20MHz/ 1=25MHz) */ |
| 785 | #define AR_PHY_GC_HT_EN 0x00000040 /* ht enable */ |
| 786 | #define AR_PHY_GC_SHORT_GI_40 0x00000080 /* allow short GI for HT 40 */ |
| 787 | #define AR_PHY_GC_WALSH 0x00000100 /* walsh spatial spreading for 2 chains,2 streams TX */ |
| 788 | #define AR_PHY_GC_SINGLE_HT_LTF1 0x00000200 /* single length (4us) 1st HT long training symbol */ |
| 789 | #define AR_PHY_GC_GF_DETECT_EN 0x00000400 /* enable Green Field detection. Only affects rx, not tx */ |
| 790 | #define AR_PHY_GC_ENABLE_DAC_FIFO 0x00000800 /* fifo between bb and dac */ |
| 791 | #define AR_PHY_RX_DELAY_DELAY 0x00003FFF /* delay from wakeup to rx ena */ |
| 792 | |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 793 | #define AR_PHY_CALMODE_IQ 0x00000000 |
| 794 | #define AR_PHY_CALMODE_ADC_GAIN 0x00000001 |
| 795 | #define AR_PHY_CALMODE_ADC_DC_PER 0x00000002 |
| 796 | #define AR_PHY_CALMODE_ADC_DC_INIT 0x00000003 |
| 797 | #define AR_PHY_SWAP_ALT_CHAIN 0x00000040 |
| 798 | #define AR_PHY_MODE_OFDM 0x00000000 |
| 799 | #define AR_PHY_MODE_CCK 0x00000001 |
| 800 | #define AR_PHY_MODE_DYNAMIC 0x00000004 |
Luis R. Rodriguez | 1547da3 | 2010-04-15 17:39:15 -0400 | [diff] [blame] | 801 | #define AR_PHY_MODE_DYNAMIC_S 2 |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 802 | #define AR_PHY_MODE_HALF 0x00000020 |
| 803 | #define AR_PHY_MODE_QUARTER 0x00000040 |
| 804 | #define AR_PHY_MAC_CLK_MODE 0x00000080 |
| 805 | #define AR_PHY_MODE_DYN_CCK_DISABLE 0x00000100 |
| 806 | #define AR_PHY_MODE_SVD_HALF 0x00000200 |
| 807 | #define AR_PHY_ACTIVE_EN 0x00000001 |
| 808 | #define AR_PHY_ACTIVE_DIS 0x00000000 |
| 809 | #define AR_PHY_FORCE_XPA_CFG 0x000000001 |
| 810 | #define AR_PHY_FORCE_XPA_CFG_S 0 |
| 811 | #define AR_PHY_XPA_TIMING_CTL_TX_END_XPAB_OFF 0xFF000000 |
| 812 | #define AR_PHY_XPA_TIMING_CTL_TX_END_XPAB_OFF_S 24 |
| 813 | #define AR_PHY_XPA_TIMING_CTL_TX_END_XPAA_OFF 0x00FF0000 |
| 814 | #define AR_PHY_XPA_TIMING_CTL_TX_END_XPAA_OFF_S 16 |
| 815 | #define AR_PHY_XPA_TIMING_CTL_FRAME_XPAB_ON 0x0000FF00 |
| 816 | #define AR_PHY_XPA_TIMING_CTL_FRAME_XPAB_ON_S 8 |
| 817 | #define AR_PHY_XPA_TIMING_CTL_FRAME_XPAA_ON 0x000000FF |
| 818 | #define AR_PHY_XPA_TIMING_CTL_FRAME_XPAA_ON_S 0 |
| 819 | #define AR_PHY_TX_END_TO_A2_RX_ON 0x00FF0000 |
| 820 | #define AR_PHY_TX_END_TO_A2_RX_ON_S 16 |
| 821 | #define AR_PHY_TX_END_DATA_START 0x000000FF |
| 822 | #define AR_PHY_TX_END_DATA_START_S 0 |
| 823 | #define AR_PHY_TX_END_PA_ON 0x0000FF00 |
| 824 | #define AR_PHY_TX_END_PA_ON_S 8 |
| 825 | #define AR_PHY_TPCRG5_PD_GAIN_OVERLAP 0x0000000F |
| 826 | #define AR_PHY_TPCRG5_PD_GAIN_OVERLAP_S 0 |
| 827 | #define AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_1 0x000003F0 |
| 828 | #define AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_1_S 4 |
| 829 | #define AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_2 0x0000FC00 |
| 830 | #define AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_2_S 10 |
| 831 | #define AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_3 0x003F0000 |
| 832 | #define AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_3_S 16 |
| 833 | #define AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_4 0x0FC00000 |
| 834 | #define AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_4_S 22 |
| 835 | #define AR_PHY_TPCRG1_NUM_PD_GAIN 0x0000c000 |
| 836 | #define AR_PHY_TPCRG1_NUM_PD_GAIN_S 14 |
| 837 | #define AR_PHY_TPCRG1_PD_GAIN_1 0x00030000 |
| 838 | #define AR_PHY_TPCRG1_PD_GAIN_1_S 16 |
| 839 | #define AR_PHY_TPCRG1_PD_GAIN_2 0x000C0000 |
| 840 | #define AR_PHY_TPCRG1_PD_GAIN_2_S 18 |
| 841 | #define AR_PHY_TPCRG1_PD_GAIN_3 0x00300000 |
| 842 | #define AR_PHY_TPCRG1_PD_GAIN_3_S 20 |
| 843 | #define AR_PHY_TPCGR1_FORCED_DAC_GAIN 0x0000003e |
| 844 | #define AR_PHY_TPCGR1_FORCED_DAC_GAIN_S 1 |
| 845 | #define AR_PHY_TPCGR1_FORCE_DAC_GAIN 0x00000001 |
| 846 | #define AR_PHY_TXGAIN_FORCE 0x00000001 |
Vasanthakumar Thiagarajan | 858b7e3 | 2010-12-06 04:27:56 -0800 | [diff] [blame] | 847 | #define AR_PHY_TXGAIN_FORCE_S 0 |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 848 | #define AR_PHY_TXGAIN_FORCED_PADVGNRA 0x00003c00 |
| 849 | #define AR_PHY_TXGAIN_FORCED_PADVGNRA_S 10 |
| 850 | #define AR_PHY_TXGAIN_FORCED_PADVGNRB 0x0003c000 |
| 851 | #define AR_PHY_TXGAIN_FORCED_PADVGNRB_S 14 |
| 852 | #define AR_PHY_TXGAIN_FORCED_PADVGNRD 0x00c00000 |
| 853 | #define AR_PHY_TXGAIN_FORCED_PADVGNRD_S 22 |
| 854 | #define AR_PHY_TXGAIN_FORCED_TXMXRGAIN 0x000003c0 |
| 855 | #define AR_PHY_TXGAIN_FORCED_TXMXRGAIN_S 6 |
| 856 | #define AR_PHY_TXGAIN_FORCED_TXBB1DBGAIN 0x0000000e |
| 857 | #define AR_PHY_TXGAIN_FORCED_TXBB1DBGAIN_S 1 |
| 858 | |
| 859 | #define AR_PHY_POWER_TX_RATE1 0x9934 |
| 860 | #define AR_PHY_POWER_TX_RATE2 0x9938 |
| 861 | #define AR_PHY_POWER_TX_RATE_MAX 0x993c |
| 862 | #define AR_PHY_POWER_TX_RATE_MAX_TPC_ENABLE 0x00000040 |
| 863 | #define PHY_AGC_CLR 0x10000000 |
| 864 | #define RFSILENT_BB 0x00002000 |
| 865 | #define AR_PHY_CHAN_INFO_GAIN_DIFF_PPM_MASK 0xFFF |
| 866 | #define AR_PHY_CHAN_INFO_GAIN_DIFF_PPM_SIGNED_BIT 0x800 |
| 867 | #define AR_PHY_CHAN_INFO_GAIN_DIFF_UPPER_LIMIT 320 |
| 868 | #define AR_PHY_CHAN_INFO_MEMORY_CAPTURE_MASK 0x0001 |
| 869 | #define AR_PHY_RX_DELAY_DELAY 0x00003FFF |
| 870 | #define AR_PHY_CCK_TX_CTRL_JAPAN 0x00000010 |
Zefir Kurtisi | 620a556 | 2012-05-23 13:34:31 +0200 | [diff] [blame] | 871 | |
| 872 | #define AR_PHY_SPECTRAL_SCAN_ENABLE 0x00000001 |
| 873 | #define AR_PHY_SPECTRAL_SCAN_ENABLE_S 0 |
| 874 | #define AR_PHY_SPECTRAL_SCAN_ACTIVE 0x00000002 |
| 875 | #define AR_PHY_SPECTRAL_SCAN_ACTIVE_S 1 |
| 876 | #define AR_PHY_SPECTRAL_SCAN_FFT_PERIOD 0x000000F0 |
| 877 | #define AR_PHY_SPECTRAL_SCAN_FFT_PERIOD_S 4 |
| 878 | #define AR_PHY_SPECTRAL_SCAN_PERIOD 0x0000FF00 |
| 879 | #define AR_PHY_SPECTRAL_SCAN_PERIOD_S 8 |
| 880 | #define AR_PHY_SPECTRAL_SCAN_COUNT 0x0FFF0000 |
| 881 | #define AR_PHY_SPECTRAL_SCAN_COUNT_S 16 |
| 882 | #define AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT 0x10000000 |
| 883 | #define AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT_S 28 |
| 884 | #define AR_PHY_SPECTRAL_SCAN_PRIORITY 0x20000000 |
| 885 | #define AR_PHY_SPECTRAL_SCAN_PRIORITY_S 29 |
| 886 | #define AR_PHY_SPECTRAL_SCAN_USE_ERR5 0x40000000 |
| 887 | #define AR_PHY_SPECTRAL_SCAN_USE_ERR5_S 30 |
| 888 | #define AR_PHY_SPECTRAL_SCAN_COMPRESSED_RPT 0x80000000 |
| 889 | #define AR_PHY_SPECTRAL_SCAN_COMPRESSED_RPT_S 31 |
| 890 | |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 891 | #define AR_PHY_CHANNEL_STATUS_RX_CLEAR 0x00000004 |
Rajkumar Manoharan | 324c74a | 2011-10-13 11:00:41 +0530 | [diff] [blame] | 892 | #define AR_PHY_RTT_CTRL_ENA_RADIO_RETENTION 0x00000001 |
| 893 | #define AR_PHY_RTT_CTRL_ENA_RADIO_RETENTION_S 0 |
| 894 | #define AR_PHY_RTT_CTRL_RESTORE_MASK 0x0000007E |
| 895 | #define AR_PHY_RTT_CTRL_RESTORE_MASK_S 1 |
| 896 | #define AR_PHY_RTT_CTRL_FORCE_RADIO_RESTORE 0x00000080 |
| 897 | #define AR_PHY_RTT_CTRL_FORCE_RADIO_RESTORE_S 7 |
| 898 | #define AR_PHY_RTT_SW_RTT_TABLE_ACCESS 0x00000001 |
| 899 | #define AR_PHY_RTT_SW_RTT_TABLE_ACCESS_S 0 |
| 900 | #define AR_PHY_RTT_SW_RTT_TABLE_WRITE 0x00000002 |
| 901 | #define AR_PHY_RTT_SW_RTT_TABLE_WRITE_S 1 |
| 902 | #define AR_PHY_RTT_SW_RTT_TABLE_ADDR 0x0000001C |
| 903 | #define AR_PHY_RTT_SW_RTT_TABLE_ADDR_S 2 |
| 904 | #define AR_PHY_RTT_SW_RTT_TABLE_DATA 0xFFFFFFF0 |
| 905 | #define AR_PHY_RTT_SW_RTT_TABLE_DATA_S 4 |
Rajkumar Manoharan | 5f0c04e | 2011-10-13 11:00:35 +0530 | [diff] [blame] | 906 | #define AR_PHY_TX_IQCAL_CONTROL_0_ENABLE_TXIQ_CAL 0x80000000 |
Rajkumar Manoharan | 8ad74c4 | 2011-10-13 11:00:38 +0530 | [diff] [blame] | 907 | #define AR_PHY_TX_IQCAL_CONTROL_0_ENABLE_TXIQ_CAL_S 31 |
Rajkumar Manoharan | 3782c69 | 2011-04-24 21:34:39 +0530 | [diff] [blame] | 908 | #define AR_PHY_TX_IQCAL_CONTROL_1_IQCORR_I_Q_COFF_DELPT 0x01fc0000 |
| 909 | #define AR_PHY_TX_IQCAL_CONTROL_1_IQCORR_I_Q_COFF_DELPT_S 18 |
| 910 | #define AR_PHY_TX_IQCAL_START_DO_CAL 0x00000001 |
| 911 | #define AR_PHY_TX_IQCAL_START_DO_CAL_S 0 |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 912 | |
| 913 | #define AR_PHY_TX_IQCAL_STATUS_FAILED 0x00000001 |
Vasanthakumar Thiagarajan | 858b7e3 | 2010-12-06 04:27:56 -0800 | [diff] [blame] | 914 | #define AR_PHY_CALIBRATED_GAINS_0 0x3e |
| 915 | #define AR_PHY_CALIBRATED_GAINS_0_S 1 |
| 916 | |
| 917 | #define AR_PHY_TX_IQCAL_CORR_COEFF_00_COEFF_TABLE 0x00003fff |
| 918 | #define AR_PHY_TX_IQCAL_CORR_COEFF_00_COEFF_TABLE_S 0 |
| 919 | #define AR_PHY_TX_IQCAL_CORR_COEFF_01_COEFF_TABLE 0x0fffc000 |
| 920 | #define AR_PHY_TX_IQCAL_CORR_COEFF_01_COEFF_TABLE_S 14 |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 921 | |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 922 | #define AR_PHY_65NM_CH0_RXTX4_THERM_ON 0x10000000 |
| 923 | #define AR_PHY_65NM_CH0_RXTX4_THERM_ON_S 28 |
Rajkumar Manoharan | 02eba42 | 2012-09-07 12:15:15 +0530 | [diff] [blame] | 924 | #define AR_PHY_65NM_CH0_RXTX4_THERM_ON_OVR 0x20000000 |
| 925 | #define AR_PHY_65NM_CH0_RXTX4_THERM_ON_OVR_S 29 |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 926 | |
Felix Fietkau | 3e2ea54 | 2012-07-15 19:53:39 +0200 | [diff] [blame] | 927 | #define AR_PHY_65NM_RXTX4_XLNA_BIAS 0xC0000000 |
| 928 | #define AR_PHY_65NM_RXTX4_XLNA_BIAS_S 30 |
| 929 | |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 930 | /* |
| 931 | * Channel 1 Register Map |
| 932 | */ |
| 933 | #define AR_CHAN1_BASE 0xa800 |
| 934 | |
| 935 | #define AR_PHY_EXT_CCA_1 (AR_CHAN1_BASE + 0x30) |
| 936 | #define AR_PHY_TX_PHASE_RAMP_1 (AR_CHAN1_BASE + 0xd0) |
| 937 | #define AR_PHY_ADC_GAIN_DC_CORR_1 (AR_CHAN1_BASE + 0xd4) |
| 938 | |
| 939 | #define AR_PHY_SPUR_REPORT_1 (AR_CHAN1_BASE + 0xa8) |
| 940 | #define AR_PHY_CHAN_INFO_TAB_1 (AR_CHAN1_BASE + 0x300) |
| 941 | #define AR_PHY_RX_IQCAL_CORR_B1 (AR_CHAN1_BASE + 0xdc) |
| 942 | |
| 943 | /* |
| 944 | * Channel 1 Field Definitions |
| 945 | */ |
| 946 | #define AR_PHY_CH1_EXT_MINCCA_PWR 0x01FF0000 |
| 947 | #define AR_PHY_CH1_EXT_MINCCA_PWR_S 16 |
| 948 | |
| 949 | /* |
| 950 | * AGC 1 Register Map |
| 951 | */ |
| 952 | #define AR_AGC1_BASE 0xae00 |
| 953 | |
| 954 | #define AR_PHY_FORCEMAX_GAINS_1 (AR_AGC1_BASE + 0x4) |
| 955 | #define AR_PHY_EXT_ATTEN_CTL_1 (AR_AGC1_BASE + 0x18) |
| 956 | #define AR_PHY_CCA_1 (AR_AGC1_BASE + 0x1c) |
| 957 | #define AR_PHY_CCA_CTRL_1 (AR_AGC1_BASE + 0x20) |
| 958 | #define AR_PHY_RSSI_1 (AR_AGC1_BASE + 0x180) |
| 959 | #define AR_PHY_SPUR_CCK_REP_1 (AR_AGC1_BASE + 0x184) |
| 960 | #define AR_PHY_RX_OCGAIN_2 (AR_AGC1_BASE + 0x200) |
| 961 | |
| 962 | /* |
| 963 | * AGC 1 Field Definitions |
| 964 | */ |
| 965 | #define AR_PHY_CH1_MINCCA_PWR 0x1FF00000 |
| 966 | #define AR_PHY_CH1_MINCCA_PWR_S 20 |
| 967 | |
| 968 | /* |
| 969 | * SM 1 Register Map |
| 970 | */ |
| 971 | #define AR_SM1_BASE 0xb200 |
| 972 | |
Senthil Balasubramanian | ce407af | 2011-09-13 22:38:16 +0530 | [diff] [blame] | 973 | #define AR_PHY_SWITCH_CHAIN_1 (AR_SM1_BASE + 0x84) |
| 974 | #define AR_PHY_FCAL_2_1 (AR_SM1_BASE + 0xd0) |
| 975 | #define AR_PHY_DFT_TONE_CTL_1 (AR_SM1_BASE + 0xd4) |
| 976 | #define AR_PHY_CL_TAB_1 (AR_SM1_BASE + 0x100) |
| 977 | #define AR_PHY_CHAN_INFO_GAIN_1 (AR_SM1_BASE + 0x180) |
| 978 | #define AR_PHY_TPC_4_B1 (AR_SM1_BASE + 0x204) |
| 979 | #define AR_PHY_TPC_5_B1 (AR_SM1_BASE + 0x208) |
| 980 | #define AR_PHY_TPC_6_B1 (AR_SM1_BASE + 0x20c) |
| 981 | #define AR_PHY_TPC_11_B1 (AR_SM1_BASE + 0x220) |
Sujith Manoharan | 2b5e54e | 2013-06-24 18:18:46 +0530 | [diff] [blame] | 982 | #define AR_PHY_PDADC_TAB_1 (AR_SM1_BASE + (AR_SREV_9462_20_OR_LATER(ah) ? \ |
Rajkumar Manoharan | fd26981 | 2011-10-21 12:53:51 +0530 | [diff] [blame] | 983 | 0x280 : 0x240)) |
Senthil Balasubramanian | ce407af | 2011-09-13 22:38:16 +0530 | [diff] [blame] | 984 | #define AR_PHY_TPC_19_B1 (AR_SM1_BASE + 0x240) |
| 985 | #define AR_PHY_TPC_19_B1_ALPHA_THERM 0xff |
| 986 | #define AR_PHY_TPC_19_B1_ALPHA_THERM_S 0 |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 987 | #define AR_PHY_TX_IQCAL_STATUS_B1 (AR_SM1_BASE + 0x48c) |
Alex Hacker | 118c9db | 2011-08-04 13:47:32 +0600 | [diff] [blame] | 988 | #define AR_PHY_TX_IQCAL_CORR_COEFF_B1(_i) (AR_SM1_BASE + 0x450 + ((_i) << 2)) |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 989 | |
Rajkumar Manoharan | 52d6d4e | 2011-10-20 14:22:43 +0530 | [diff] [blame] | 990 | #define AR_PHY_RTT_TABLE_SW_INTF_B(i) (0x384 + ((i) ? \ |
| 991 | AR_SM1_BASE : AR_SM_BASE)) |
| 992 | #define AR_PHY_RTT_TABLE_SW_INTF_1_B(i) (0x388 + ((i) ? \ |
| 993 | AR_SM1_BASE : AR_SM_BASE)) |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 994 | /* |
| 995 | * Channel 2 Register Map |
| 996 | */ |
| 997 | #define AR_CHAN2_BASE 0xb800 |
| 998 | |
| 999 | #define AR_PHY_EXT_CCA_2 (AR_CHAN2_BASE + 0x30) |
| 1000 | #define AR_PHY_TX_PHASE_RAMP_2 (AR_CHAN2_BASE + 0xd0) |
| 1001 | #define AR_PHY_ADC_GAIN_DC_CORR_2 (AR_CHAN2_BASE + 0xd4) |
| 1002 | |
| 1003 | #define AR_PHY_SPUR_REPORT_2 (AR_CHAN2_BASE + 0xa8) |
| 1004 | #define AR_PHY_CHAN_INFO_TAB_2 (AR_CHAN2_BASE + 0x300) |
| 1005 | #define AR_PHY_RX_IQCAL_CORR_B2 (AR_CHAN2_BASE + 0xdc) |
| 1006 | |
| 1007 | /* |
| 1008 | * Channel 2 Field Definitions |
| 1009 | */ |
| 1010 | #define AR_PHY_CH2_EXT_MINCCA_PWR 0x01FF0000 |
| 1011 | #define AR_PHY_CH2_EXT_MINCCA_PWR_S 16 |
| 1012 | /* |
| 1013 | * AGC 2 Register Map |
| 1014 | */ |
| 1015 | #define AR_AGC2_BASE 0xbe00 |
| 1016 | |
| 1017 | #define AR_PHY_FORCEMAX_GAINS_2 (AR_AGC2_BASE + 0x4) |
| 1018 | #define AR_PHY_EXT_ATTEN_CTL_2 (AR_AGC2_BASE + 0x18) |
| 1019 | #define AR_PHY_CCA_2 (AR_AGC2_BASE + 0x1c) |
| 1020 | #define AR_PHY_CCA_CTRL_2 (AR_AGC2_BASE + 0x20) |
| 1021 | #define AR_PHY_RSSI_2 (AR_AGC2_BASE + 0x180) |
| 1022 | |
| 1023 | /* |
| 1024 | * AGC 2 Field Definitions |
| 1025 | */ |
| 1026 | #define AR_PHY_CH2_MINCCA_PWR 0x1FF00000 |
| 1027 | #define AR_PHY_CH2_MINCCA_PWR_S 20 |
| 1028 | |
| 1029 | /* |
| 1030 | * SM 2 Register Map |
| 1031 | */ |
| 1032 | #define AR_SM2_BASE 0xc200 |
| 1033 | |
| 1034 | #define AR_PHY_SWITCH_CHAIN_2 (AR_SM2_BASE + 0x84) |
| 1035 | #define AR_PHY_FCAL_2_2 (AR_SM2_BASE + 0xd0) |
| 1036 | #define AR_PHY_DFT_TONE_CTL_2 (AR_SM2_BASE + 0xd4) |
| 1037 | #define AR_PHY_CL_TAB_2 (AR_SM2_BASE + 0x100) |
| 1038 | #define AR_PHY_CHAN_INFO_GAIN_2 (AR_SM2_BASE + 0x180) |
| 1039 | #define AR_PHY_TPC_4_B2 (AR_SM2_BASE + 0x204) |
| 1040 | #define AR_PHY_TPC_5_B2 (AR_SM2_BASE + 0x208) |
| 1041 | #define AR_PHY_TPC_6_B2 (AR_SM2_BASE + 0x20c) |
| 1042 | #define AR_PHY_TPC_11_B2 (AR_SM2_BASE + 0x220) |
Sujith Manoharan | 2d7caef | 2013-01-08 20:57:52 +0530 | [diff] [blame] | 1043 | #define AR_PHY_TPC_19_B2 (AR_SM2_BASE + 0x240) |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 1044 | #define AR_PHY_TX_IQCAL_STATUS_B2 (AR_SM2_BASE + 0x48c) |
Vasanthakumar Thiagarajan | 31faff8 | 2010-12-06 04:27:55 -0800 | [diff] [blame] | 1045 | #define AR_PHY_TX_IQCAL_CORR_COEFF_B2(_i) (AR_SM2_BASE + 0x450 + ((_i) << 2)) |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 1046 | |
| 1047 | #define AR_PHY_TX_IQCAL_STATUS_B2_FAILED 0x00000001 |
| 1048 | |
| 1049 | /* |
| 1050 | * AGC 3 Register Map |
| 1051 | */ |
| 1052 | #define AR_AGC3_BASE 0xce00 |
| 1053 | |
| 1054 | #define AR_PHY_RSSI_3 (AR_AGC3_BASE + 0x180) |
| 1055 | |
Senthil Balasubramanian | ce407af | 2011-09-13 22:38:16 +0530 | [diff] [blame] | 1056 | /* GLB Registers */ |
| 1057 | #define AR_GLB_BASE 0x20000 |
Mohammed Shafi Shajakhan | 2ee4bd1 | 2011-11-30 10:41:13 +0530 | [diff] [blame] | 1058 | #define AR_GLB_GPIO_CONTROL (AR_GLB_BASE) |
Senthil Balasubramanian | ce407af | 2011-09-13 22:38:16 +0530 | [diff] [blame] | 1059 | #define AR_PHY_GLB_CONTROL (AR_GLB_BASE + 0x44) |
| 1060 | #define AR_GLB_SCRATCH(_ah) (AR_GLB_BASE + \ |
Sujith Manoharan | 2b5e54e | 2013-06-24 18:18:46 +0530 | [diff] [blame] | 1061 | (AR_SREV_9462_20_OR_LATER(_ah) ? 0x4c : 0x50)) |
Senthil Balasubramanian | ce407af | 2011-09-13 22:38:16 +0530 | [diff] [blame] | 1062 | #define AR_GLB_STATUS (AR_GLB_BASE + 0x48) |
| 1063 | |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 1064 | /* |
| 1065 | * Misc helper defines |
| 1066 | */ |
| 1067 | #define AR_PHY_CHAIN_OFFSET (AR_CHAN1_BASE - AR_CHAN_BASE) |
| 1068 | |
| 1069 | #define AR_PHY_NEW_ADC_DC_GAIN_CORR(_i) (AR_PHY_ADC_GAIN_DC_CORR_0 + (AR_PHY_CHAIN_OFFSET * (_i))) |
| 1070 | #define AR_PHY_NEW_ADC_DC_GAIN_CORR_9300_10(_i) (AR_PHY_ADC_GAIN_DC_CORR_0_9300_10 + (AR_PHY_CHAIN_OFFSET * (_i))) |
| 1071 | #define AR_PHY_SWITCH_CHAIN(_i) (AR_PHY_SWITCH_CHAIN_0 + (AR_PHY_CHAIN_OFFSET * (_i))) |
| 1072 | #define AR_PHY_EXT_ATTEN_CTL(_i) (AR_PHY_EXT_ATTEN_CTL_0 + (AR_PHY_CHAIN_OFFSET * (_i))) |
| 1073 | |
| 1074 | #define AR_PHY_RXGAIN(_i) (AR_PHY_FORCEMAX_GAINS_0 + (AR_PHY_CHAIN_OFFSET * (_i))) |
| 1075 | #define AR_PHY_TPCRG5(_i) (AR_PHY_TPC_5_B0 + (AR_PHY_CHAIN_OFFSET * (_i))) |
| 1076 | #define AR_PHY_PDADC_TAB(_i) (AR_PHY_PDADC_TAB_0 + (AR_PHY_CHAIN_OFFSET * (_i))) |
| 1077 | |
| 1078 | #define AR_PHY_CAL_MEAS_0(_i) (AR_PHY_IQ_ADC_MEAS_0_B0 + (AR_PHY_CHAIN_OFFSET * (_i))) |
| 1079 | #define AR_PHY_CAL_MEAS_1(_i) (AR_PHY_IQ_ADC_MEAS_1_B0 + (AR_PHY_CHAIN_OFFSET * (_i))) |
| 1080 | #define AR_PHY_CAL_MEAS_2(_i) (AR_PHY_IQ_ADC_MEAS_2_B0 + (AR_PHY_CHAIN_OFFSET * (_i))) |
| 1081 | #define AR_PHY_CAL_MEAS_3(_i) (AR_PHY_IQ_ADC_MEAS_3_B0 + (AR_PHY_CHAIN_OFFSET * (_i))) |
| 1082 | #define AR_PHY_CAL_MEAS_0_9300_10(_i) (AR_PHY_IQ_ADC_MEAS_0_B0_9300_10 + (AR_PHY_CHAIN_OFFSET * (_i))) |
| 1083 | #define AR_PHY_CAL_MEAS_1_9300_10(_i) (AR_PHY_IQ_ADC_MEAS_1_B0_9300_10 + (AR_PHY_CHAIN_OFFSET * (_i))) |
| 1084 | #define AR_PHY_CAL_MEAS_2_9300_10(_i) (AR_PHY_IQ_ADC_MEAS_2_B0_9300_10 + (AR_PHY_CHAIN_OFFSET * (_i))) |
| 1085 | #define AR_PHY_CAL_MEAS_3_9300_10(_i) (AR_PHY_IQ_ADC_MEAS_3_B0_9300_10 + (AR_PHY_CHAIN_OFFSET * (_i))) |
| 1086 | |
Luis R. Rodriguez | aea702b | 2010-05-13 13:33:43 -0400 | [diff] [blame] | 1087 | #define AR_PHY_WATCHDOG_NON_IDLE_ENABLE 0x00000001 |
| 1088 | #define AR_PHY_WATCHDOG_IDLE_ENABLE 0x00000002 |
| 1089 | #define AR_PHY_WATCHDOG_IDLE_MASK 0xFFFF0000 |
| 1090 | #define AR_PHY_WATCHDOG_NON_IDLE_MASK 0x0000FFFC |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 1091 | |
Luis R. Rodriguez | aea702b | 2010-05-13 13:33:43 -0400 | [diff] [blame] | 1092 | #define AR_PHY_WATCHDOG_RST_ENABLE 0x00000002 |
| 1093 | #define AR_PHY_WATCHDOG_IRQ_ENABLE 0x00000004 |
| 1094 | #define AR_PHY_WATCHDOG_CNTL2_MASK 0xFFFFFFF9 |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 1095 | |
Luis R. Rodriguez | aea702b | 2010-05-13 13:33:43 -0400 | [diff] [blame] | 1096 | #define AR_PHY_WATCHDOG_INFO 0x00000007 |
| 1097 | #define AR_PHY_WATCHDOG_INFO_S 0 |
| 1098 | #define AR_PHY_WATCHDOG_DET_HANG 0x00000008 |
| 1099 | #define AR_PHY_WATCHDOG_DET_HANG_S 3 |
| 1100 | #define AR_PHY_WATCHDOG_RADAR_SM 0x000000F0 |
| 1101 | #define AR_PHY_WATCHDOG_RADAR_SM_S 4 |
| 1102 | #define AR_PHY_WATCHDOG_RX_OFDM_SM 0x00000F00 |
| 1103 | #define AR_PHY_WATCHDOG_RX_OFDM_SM_S 8 |
| 1104 | #define AR_PHY_WATCHDOG_RX_CCK_SM 0x0000F000 |
| 1105 | #define AR_PHY_WATCHDOG_RX_CCK_SM_S 12 |
| 1106 | #define AR_PHY_WATCHDOG_TX_OFDM_SM 0x000F0000 |
| 1107 | #define AR_PHY_WATCHDOG_TX_OFDM_SM_S 16 |
| 1108 | #define AR_PHY_WATCHDOG_TX_CCK_SM 0x00F00000 |
| 1109 | #define AR_PHY_WATCHDOG_TX_CCK_SM_S 20 |
| 1110 | #define AR_PHY_WATCHDOG_AGC_SM 0x0F000000 |
| 1111 | #define AR_PHY_WATCHDOG_AGC_SM_S 24 |
| 1112 | #define AR_PHY_WATCHDOG_SRCH_SM 0xF0000000 |
| 1113 | #define AR_PHY_WATCHDOG_SRCH_SM_S 28 |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 1114 | |
Luis R. Rodriguez | aea702b | 2010-05-13 13:33:43 -0400 | [diff] [blame] | 1115 | #define AR_PHY_WATCHDOG_STATUS_CLR 0x00000008 |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 1116 | |
Felix Fietkau | ab33449 | 2010-06-12 00:33:58 -0400 | [diff] [blame] | 1117 | /* |
| 1118 | * PAPRD registers |
| 1119 | */ |
| 1120 | #define AR_PHY_XPA_TIMING_CTL (AR_SM_BASE + 0x64) |
| 1121 | |
| 1122 | #define AR_PHY_PAPRD_AM2AM (AR_CHAN_BASE + 0xe4) |
| 1123 | #define AR_PHY_PAPRD_AM2AM_MASK 0x01ffffff |
| 1124 | #define AR_PHY_PAPRD_AM2AM_MASK_S 0 |
| 1125 | |
| 1126 | #define AR_PHY_PAPRD_AM2PM (AR_CHAN_BASE + 0xe8) |
| 1127 | #define AR_PHY_PAPRD_AM2PM_MASK 0x01ffffff |
| 1128 | #define AR_PHY_PAPRD_AM2PM_MASK_S 0 |
| 1129 | |
| 1130 | #define AR_PHY_PAPRD_HT40 (AR_CHAN_BASE + 0xec) |
| 1131 | #define AR_PHY_PAPRD_HT40_MASK 0x01ffffff |
| 1132 | #define AR_PHY_PAPRD_HT40_MASK_S 0 |
| 1133 | |
| 1134 | #define AR_PHY_PAPRD_CTRL0_B0 (AR_CHAN_BASE + 0xf0) |
| 1135 | #define AR_PHY_PAPRD_CTRL0_B1 (AR_CHAN1_BASE + 0xf0) |
| 1136 | #define AR_PHY_PAPRD_CTRL0_B2 (AR_CHAN2_BASE + 0xf0) |
| 1137 | #define AR_PHY_PAPRD_CTRL0_PAPRD_ENABLE 0x00000001 |
| 1138 | #define AR_PHY_PAPRD_CTRL0_PAPRD_ENABLE_S 0 |
| 1139 | #define AR_PHY_PAPRD_CTRL0_USE_SINGLE_TABLE_MASK 0x00000002 |
| 1140 | #define AR_PHY_PAPRD_CTRL0_USE_SINGLE_TABLE_MASK_S 1 |
| 1141 | #define AR_PHY_PAPRD_CTRL0_PAPRD_MAG_THRSH 0xf8000000 |
| 1142 | #define AR_PHY_PAPRD_CTRL0_PAPRD_MAG_THRSH_S 27 |
| 1143 | |
| 1144 | #define AR_PHY_PAPRD_CTRL1_B0 (AR_CHAN_BASE + 0xf4) |
| 1145 | #define AR_PHY_PAPRD_CTRL1_B1 (AR_CHAN1_BASE + 0xf4) |
| 1146 | #define AR_PHY_PAPRD_CTRL1_B2 (AR_CHAN2_BASE + 0xf4) |
| 1147 | #define AR_PHY_PAPRD_CTRL1_ADAPTIVE_SCALING_ENA 0x00000001 |
| 1148 | #define AR_PHY_PAPRD_CTRL1_ADAPTIVE_SCALING_ENA_S 0 |
| 1149 | #define AR_PHY_PAPRD_CTRL1_ADAPTIVE_AM2AM_ENABLE 0x00000002 |
| 1150 | #define AR_PHY_PAPRD_CTRL1_ADAPTIVE_AM2AM_ENABLE_S 1 |
| 1151 | #define AR_PHY_PAPRD_CTRL1_ADAPTIVE_AM2PM_ENABLE 0x00000004 |
| 1152 | #define AR_PHY_PAPRD_CTRL1_ADAPTIVE_AM2PM_ENABLE_S 2 |
| 1153 | #define AR_PHY_PAPRD_CTRL1_PAPRD_POWER_AT_AM2AM_CAL 0x000001f8 |
| 1154 | #define AR_PHY_PAPRD_CTRL1_PAPRD_POWER_AT_AM2AM_CAL_S 3 |
| 1155 | #define AR_PHY_PAPRD_CTRL1_PA_GAIN_SCALE_FACT_MASK 0x0001fe00 |
| 1156 | #define AR_PHY_PAPRD_CTRL1_PA_GAIN_SCALE_FACT_MASK_S 9 |
| 1157 | #define AR_PHY_PAPRD_CTRL1_PAPRD_MAG_SCALE_FACT 0x0ffe0000 |
| 1158 | #define AR_PHY_PAPRD_CTRL1_PAPRD_MAG_SCALE_FACT_S 17 |
| 1159 | |
Sujith Manoharan | b8a95db | 2012-12-10 07:22:31 +0530 | [diff] [blame] | 1160 | #define AR_PHY_PAPRD_TRAINER_CNTL1 (AR_SM_BASE + (AR_SREV_9485(ah) ? 0x580 : 0x490)) |
| 1161 | |
Felix Fietkau | ab33449 | 2010-06-12 00:33:58 -0400 | [diff] [blame] | 1162 | #define AR_PHY_PAPRD_TRAINER_CNTL1_CF_CF_PAPRD_TRAIN_ENABLE 0x00000001 |
| 1163 | #define AR_PHY_PAPRD_TRAINER_CNTL1_CF_CF_PAPRD_TRAIN_ENABLE_S 0 |
| 1164 | #define AR_PHY_PAPRD_TRAINER_CNTL1_CF_PAPRD_AGC2_SETTLING 0x0000007e |
| 1165 | #define AR_PHY_PAPRD_TRAINER_CNTL1_CF_PAPRD_AGC2_SETTLING_S 1 |
| 1166 | #define AR_PHY_PAPRD_TRAINER_CNTL1_CF_PAPRD_IQCORR_ENABLE 0x00000100 |
| 1167 | #define AR_PHY_PAPRD_TRAINER_CNTL1_CF_PAPRD_IQCORR_ENABLE_S 8 |
| 1168 | #define AR_PHY_PAPRD_TRAINER_CNTL1_CF_PAPRD_RX_BB_GAIN_FORCE 0x00000200 |
| 1169 | #define AR_PHY_PAPRD_TRAINER_CNTL1_CF_PAPRD_RX_BB_GAIN_FORCE_S 9 |
| 1170 | #define AR_PHY_PAPRD_TRAINER_CNTL1_CF_PAPRD_TX_GAIN_FORCE 0x00000400 |
| 1171 | #define AR_PHY_PAPRD_TRAINER_CNTL1_CF_PAPRD_TX_GAIN_FORCE_S 10 |
| 1172 | #define AR_PHY_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_ENABLE 0x00000800 |
| 1173 | #define AR_PHY_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_ENABLE_S 11 |
| 1174 | #define AR_PHY_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_SKIP 0x0003f000 |
| 1175 | #define AR_PHY_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_SKIP_S 12 |
| 1176 | |
Sujith Manoharan | b8a95db | 2012-12-10 07:22:31 +0530 | [diff] [blame] | 1177 | #define AR_PHY_PAPRD_TRAINER_CNTL2 (AR_SM_BASE + (AR_SREV_9485(ah) ? 0x584 : 0x494)) |
| 1178 | |
Felix Fietkau | ab33449 | 2010-06-12 00:33:58 -0400 | [diff] [blame] | 1179 | #define AR_PHY_PAPRD_TRAINER_CNTL2_CF_PAPRD_INIT_RX_BB_GAIN 0xFFFFFFFF |
| 1180 | #define AR_PHY_PAPRD_TRAINER_CNTL2_CF_PAPRD_INIT_RX_BB_GAIN_S 0 |
| 1181 | |
Sujith Manoharan | b8a95db | 2012-12-10 07:22:31 +0530 | [diff] [blame] | 1182 | #define AR_PHY_PAPRD_TRAINER_CNTL3 (AR_SM_BASE + (AR_SREV_9485(ah) ? 0x588 : 0x498)) |
| 1183 | |
Felix Fietkau | ab33449 | 2010-06-12 00:33:58 -0400 | [diff] [blame] | 1184 | #define AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_ADC_DESIRED_SIZE 0x0000003f |
| 1185 | #define AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_ADC_DESIRED_SIZE_S 0 |
| 1186 | #define AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP 0x00000fc0 |
| 1187 | #define AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP_S 6 |
| 1188 | #define AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_MIN_LOOPBACK_DEL 0x0001f000 |
| 1189 | #define AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_MIN_LOOPBACK_DEL_S 12 |
| 1190 | #define AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_NUM_CORR_STAGES 0x000e0000 |
| 1191 | #define AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_NUM_CORR_STAGES_S 17 |
| 1192 | #define AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_COARSE_CORR_LEN 0x00f00000 |
| 1193 | #define AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_COARSE_CORR_LEN_S 20 |
| 1194 | #define AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_FINE_CORR_LEN 0x0f000000 |
| 1195 | #define AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_FINE_CORR_LEN_S 24 |
| 1196 | #define AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_BBTXMIX_DISABLE 0x20000000 |
| 1197 | #define AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_BBTXMIX_DISABLE_S 29 |
| 1198 | |
Sujith Manoharan | b8a95db | 2012-12-10 07:22:31 +0530 | [diff] [blame] | 1199 | #define AR_PHY_PAPRD_TRAINER_CNTL4 (AR_SM_BASE + (AR_SREV_9485(ah) ? 0x58c : 0x49c)) |
| 1200 | |
Felix Fietkau | ab33449 | 2010-06-12 00:33:58 -0400 | [diff] [blame] | 1201 | #define AR_PHY_PAPRD_TRAINER_CNTL4_CF_PAPRD_NUM_TRAIN_SAMPLES 0x03ff0000 |
| 1202 | #define AR_PHY_PAPRD_TRAINER_CNTL4_CF_PAPRD_NUM_TRAIN_SAMPLES_S 16 |
| 1203 | #define AR_PHY_PAPRD_TRAINER_CNTL4_CF_PAPRD_SAFETY_DELTA 0x0000f000 |
| 1204 | #define AR_PHY_PAPRD_TRAINER_CNTL4_CF_PAPRD_SAFETY_DELTA_S 12 |
| 1205 | #define AR_PHY_PAPRD_TRAINER_CNTL4_CF_PAPRD_MIN_CORR 0x00000fff |
| 1206 | #define AR_PHY_PAPRD_TRAINER_CNTL4_CF_PAPRD_MIN_CORR_S 0 |
| 1207 | |
| 1208 | #define AR_PHY_PAPRD_PRE_POST_SCALE_0_B0 (AR_CHAN_BASE + 0x100) |
| 1209 | #define AR_PHY_PAPRD_PRE_POST_SCALE_1_B0 (AR_CHAN_BASE + 0x104) |
| 1210 | #define AR_PHY_PAPRD_PRE_POST_SCALE_2_B0 (AR_CHAN_BASE + 0x108) |
| 1211 | #define AR_PHY_PAPRD_PRE_POST_SCALE_3_B0 (AR_CHAN_BASE + 0x10c) |
| 1212 | #define AR_PHY_PAPRD_PRE_POST_SCALE_4_B0 (AR_CHAN_BASE + 0x110) |
| 1213 | #define AR_PHY_PAPRD_PRE_POST_SCALE_5_B0 (AR_CHAN_BASE + 0x114) |
| 1214 | #define AR_PHY_PAPRD_PRE_POST_SCALE_6_B0 (AR_CHAN_BASE + 0x118) |
| 1215 | #define AR_PHY_PAPRD_PRE_POST_SCALE_7_B0 (AR_CHAN_BASE + 0x11c) |
| 1216 | #define AR_PHY_PAPRD_PRE_POST_SCALING 0x3FFFF |
| 1217 | #define AR_PHY_PAPRD_PRE_POST_SCALING_S 0 |
| 1218 | |
Sujith Manoharan | b8a95db | 2012-12-10 07:22:31 +0530 | [diff] [blame] | 1219 | #define AR_PHY_PAPRD_TRAINER_STAT1 (AR_SM_BASE + (AR_SREV_9485(ah) ? 0x590 : 0x4a0)) |
| 1220 | |
Felix Fietkau | ab33449 | 2010-06-12 00:33:58 -0400 | [diff] [blame] | 1221 | #define AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE 0x00000001 |
| 1222 | #define AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE_S 0 |
| 1223 | #define AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_INCOMPLETE 0x00000002 |
| 1224 | #define AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_INCOMPLETE_S 1 |
| 1225 | #define AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_CORR_ERR 0x00000004 |
| 1226 | #define AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_CORR_ERR_S 2 |
| 1227 | #define AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_ACTIVE 0x00000008 |
| 1228 | #define AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_ACTIVE_S 3 |
| 1229 | #define AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_RX_GAIN_IDX 0x000001f0 |
| 1230 | #define AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_RX_GAIN_IDX_S 4 |
| 1231 | #define AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_AGC2_PWR 0x0001fe00 |
| 1232 | #define AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_AGC2_PWR_S 9 |
| 1233 | |
Sujith Manoharan | b8a95db | 2012-12-10 07:22:31 +0530 | [diff] [blame] | 1234 | #define AR_PHY_PAPRD_TRAINER_STAT2 (AR_SM_BASE + (AR_SREV_9485(ah) ? 0x594 : 0x4a4)) |
| 1235 | |
Felix Fietkau | ab33449 | 2010-06-12 00:33:58 -0400 | [diff] [blame] | 1236 | #define AR_PHY_PAPRD_TRAINER_STAT2_PAPRD_FINE_VAL 0x0000ffff |
| 1237 | #define AR_PHY_PAPRD_TRAINER_STAT2_PAPRD_FINE_VAL_S 0 |
| 1238 | #define AR_PHY_PAPRD_TRAINER_STAT2_PAPRD_COARSE_IDX 0x001f0000 |
| 1239 | #define AR_PHY_PAPRD_TRAINER_STAT2_PAPRD_COARSE_IDX_S 16 |
| 1240 | #define AR_PHY_PAPRD_TRAINER_STAT2_PAPRD_FINE_IDX 0x00600000 |
| 1241 | #define AR_PHY_PAPRD_TRAINER_STAT2_PAPRD_FINE_IDX_S 21 |
| 1242 | |
Sujith Manoharan | b8a95db | 2012-12-10 07:22:31 +0530 | [diff] [blame] | 1243 | #define AR_PHY_PAPRD_TRAINER_STAT3 (AR_SM_BASE + (AR_SREV_9485(ah) ? 0x598 : 0x4a8)) |
| 1244 | |
Felix Fietkau | ab33449 | 2010-06-12 00:33:58 -0400 | [diff] [blame] | 1245 | #define AR_PHY_PAPRD_TRAINER_STAT3_PAPRD_TRAIN_SAMPLES_CNT 0x000fffff |
| 1246 | #define AR_PHY_PAPRD_TRAINER_STAT3_PAPRD_TRAIN_SAMPLES_CNT_S 0 |
| 1247 | |
| 1248 | #define AR_PHY_PAPRD_MEM_TAB_B0 (AR_CHAN_BASE + 0x120) |
| 1249 | #define AR_PHY_PAPRD_MEM_TAB_B1 (AR_CHAN1_BASE + 0x120) |
| 1250 | #define AR_PHY_PAPRD_MEM_TAB_B2 (AR_CHAN2_BASE + 0x120) |
| 1251 | |
| 1252 | #define AR_PHY_PA_GAIN123_B0 (AR_CHAN_BASE + 0xf8) |
| 1253 | #define AR_PHY_PA_GAIN123_B1 (AR_CHAN1_BASE + 0xf8) |
| 1254 | #define AR_PHY_PA_GAIN123_B2 (AR_CHAN2_BASE + 0xf8) |
| 1255 | #define AR_PHY_PA_GAIN123_PA_GAIN1 0x3FF |
| 1256 | #define AR_PHY_PA_GAIN123_PA_GAIN1_S 0 |
| 1257 | |
| 1258 | #define AR_PHY_POWERTX_RATE5 (AR_SM_BASE + 0x1d0) |
| 1259 | #define AR_PHY_POWERTX_RATE5_POWERTXHT20_0 0x3F |
| 1260 | #define AR_PHY_POWERTX_RATE5_POWERTXHT20_0_S 0 |
| 1261 | |
Felix Fietkau | 1bf3866 | 2010-12-13 08:40:54 +0100 | [diff] [blame] | 1262 | #define AR_PHY_POWERTX_RATE6 (AR_SM_BASE + 0x1d4) |
| 1263 | #define AR_PHY_POWERTX_RATE6_POWERTXHT20_5 0x3F00 |
| 1264 | #define AR_PHY_POWERTX_RATE6_POWERTXHT20_5_S 8 |
| 1265 | |
| 1266 | #define AR_PHY_POWERTX_RATE8 (AR_SM_BASE + 0x1dc) |
| 1267 | #define AR_PHY_POWERTX_RATE8_POWERTXHT40_5 0x3F00 |
| 1268 | #define AR_PHY_POWERTX_RATE8_POWERTXHT40_5_S 8 |
| 1269 | |
Mohammed Shafi Shajakhan | f68e20f | 2011-06-23 20:03:38 +0530 | [diff] [blame] | 1270 | #define AR_PHY_CL_TAB_CL_GAIN_MOD 0x1f |
| 1271 | #define AR_PHY_CL_TAB_CL_GAIN_MOD_S 0 |
| 1272 | |
Sujith Manoharan | 362cd03 | 2012-09-16 08:06:36 +0530 | [diff] [blame] | 1273 | #define AR_BTCOEX_WL_LNADIV 0x1a64 |
| 1274 | #define AR_BTCOEX_WL_LNADIV_PREDICTED_PERIOD 0x00003FFF |
| 1275 | #define AR_BTCOEX_WL_LNADIV_PREDICTED_PERIOD_S 0 |
| 1276 | #define AR_BTCOEX_WL_LNADIV_DPDT_IGNORE_PRIORITY 0x00004000 |
| 1277 | #define AR_BTCOEX_WL_LNADIV_DPDT_IGNORE_PRIORITY_S 14 |
| 1278 | #define AR_BTCOEX_WL_LNADIV_FORCE_ON 0x00008000 |
| 1279 | #define AR_BTCOEX_WL_LNADIV_FORCE_ON_S 15 |
| 1280 | #define AR_BTCOEX_WL_LNADIV_MODE_OPTION 0x00030000 |
| 1281 | #define AR_BTCOEX_WL_LNADIV_MODE_OPTION_S 16 |
| 1282 | #define AR_BTCOEX_WL_LNADIV_MODE 0x007c0000 |
| 1283 | #define AR_BTCOEX_WL_LNADIV_MODE_S 18 |
| 1284 | #define AR_BTCOEX_WL_LNADIV_ALLOWED_TX_ANTDIV_WL_TX_REQ 0x00800000 |
| 1285 | #define AR_BTCOEX_WL_LNADIV_ALLOWED_TX_ANTDIV_WL_TX_REQ_S 23 |
| 1286 | #define AR_BTCOEX_WL_LNADIV_DISABLE_TX_ANTDIV_ENABLE 0x01000000 |
| 1287 | #define AR_BTCOEX_WL_LNADIV_DISABLE_TX_ANTDIV_ENABLE_S 24 |
| 1288 | #define AR_BTCOEX_WL_LNADIV_CONTINUOUS_BT_ACTIVE_PROTECT 0x02000000 |
| 1289 | #define AR_BTCOEX_WL_LNADIV_CONTINUOUS_BT_ACTIVE_PROTECT_S 25 |
| 1290 | #define AR_BTCOEX_WL_LNADIV_BT_INACTIVE_THRESHOLD 0xFC000000 |
| 1291 | #define AR_BTCOEX_WL_LNADIV_BT_INACTIVE_THRESHOLD_S 26 |
| 1292 | |
Rajkumar Manoharan | 0b6eb36 | 2012-11-09 14:51:30 +0530 | [diff] [blame] | 1293 | /* Manual Peak detector calibration */ |
| 1294 | #define AR_PHY_65NM_BASE 0x16000 |
| 1295 | #define AR_PHY_65NM_RXRF_GAINSTAGES(i) (AR_PHY_65NM_BASE + \ |
| 1296 | (i * 0x400) + 0x8) |
| 1297 | #define AR_PHY_65NM_RXRF_GAINSTAGES_RX_OVERRIDE 0x80000000 |
| 1298 | #define AR_PHY_65NM_RXRF_GAINSTAGES_RX_OVERRIDE_S 31 |
| 1299 | #define AR_PHY_65NM_RXRF_GAINSTAGES_LNAON_CALDC 0x00000002 |
| 1300 | #define AR_PHY_65NM_RXRF_GAINSTAGES_LNAON_CALDC_S 1 |
| 1301 | #define AR_PHY_65NM_RXRF_GAINSTAGES_LNA2G_GAIN_OVR 0x70000000 |
| 1302 | #define AR_PHY_65NM_RXRF_GAINSTAGES_LNA2G_GAIN_OVR_S 28 |
| 1303 | #define AR_PHY_65NM_RXRF_GAINSTAGES_LNA5G_GAIN_OVR 0x03800000 |
| 1304 | #define AR_PHY_65NM_RXRF_GAINSTAGES_LNA5G_GAIN_OVR_S 23 |
| 1305 | |
| 1306 | #define AR_PHY_65NM_RXTX2(i) (AR_PHY_65NM_BASE + \ |
| 1307 | (i * 0x400) + 0x104) |
| 1308 | #define AR_PHY_65NM_RXTX2_RXON_OVR 0x00001000 |
| 1309 | #define AR_PHY_65NM_RXTX2_RXON_OVR_S 12 |
| 1310 | #define AR_PHY_65NM_RXTX2_RXON 0x00000800 |
| 1311 | #define AR_PHY_65NM_RXTX2_RXON_S 11 |
| 1312 | |
| 1313 | #define AR_PHY_65NM_RXRF_AGC(i) (AR_PHY_65NM_BASE + \ |
| 1314 | (i * 0x400) + 0xc) |
| 1315 | #define AR_PHY_65NM_RXRF_AGC_AGC_OVERRIDE 0x80000000 |
| 1316 | #define AR_PHY_65NM_RXRF_AGC_AGC_OVERRIDE_S 31 |
| 1317 | #define AR_PHY_65NM_RXRF_AGC_AGC_ON_OVR 0x40000000 |
| 1318 | #define AR_PHY_65NM_RXRF_AGC_AGC_ON_OVR_S 30 |
| 1319 | #define AR_PHY_65NM_RXRF_AGC_AGC_CAL_OVR 0x20000000 |
| 1320 | #define AR_PHY_65NM_RXRF_AGC_AGC_CAL_OVR_S 29 |
| 1321 | #define AR_PHY_65NM_RXRF_AGC_AGC2G_DBDAC_OVR 0x1E000000 |
| 1322 | #define AR_PHY_65NM_RXRF_AGC_AGC2G_DBDAC_OVR_S 25 |
| 1323 | #define AR_PHY_65NM_RXRF_AGC_AGC5G_DBDAC_OVR 0x00078000 |
| 1324 | #define AR_PHY_65NM_RXRF_AGC_AGC5G_DBDAC_OVR_S 15 |
| 1325 | #define AR_PHY_65NM_RXRF_AGC_AGC2G_CALDAC_OVR 0x01F80000 |
| 1326 | #define AR_PHY_65NM_RXRF_AGC_AGC2G_CALDAC_OVR_S 19 |
| 1327 | #define AR_PHY_65NM_RXRF_AGC_AGC5G_CALDAC_OVR 0x00007e00 |
| 1328 | #define AR_PHY_65NM_RXRF_AGC_AGC5G_CALDAC_OVR_S 9 |
| 1329 | #define AR_PHY_65NM_RXRF_AGC_AGC_OUT 0x00000004 |
| 1330 | #define AR_PHY_65NM_RXRF_AGC_AGC_OUT_S 2 |
| 1331 | |
Sujith Manoharan | d88527d | 2013-12-24 10:44:23 +0530 | [diff] [blame] | 1332 | #define AR9300_DFS_FIRPWR -28 |
| 1333 | |
Felix Fietkau | da6f1d7 | 2010-04-15 17:38:31 -0400 | [diff] [blame] | 1334 | #endif /* AR9003_PHY_H */ |