ar9002_phy.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. /*
  2. * Copyright (c) 2008-2011 Atheros Communications Inc.
  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. #ifndef AR9002_PHY_H
  17. #define AR9002_PHY_H
  18. #define AR_PHY_TEST 0x9800
  19. #define PHY_AGC_CLR 0x10000000
  20. #define RFSILENT_BB 0x00002000
  21. #define AR_PHY_TURBO 0x9804
  22. #define AR_PHY_FC_TURBO_MODE 0x00000001
  23. #define AR_PHY_FC_TURBO_SHORT 0x00000002
  24. #define AR_PHY_FC_DYN2040_EN 0x00000004
  25. #define AR_PHY_FC_DYN2040_PRI_ONLY 0x00000008
  26. #define AR_PHY_FC_DYN2040_PRI_CH 0x00000010
  27. /* For 25 MHz channel spacing -- not used but supported by hw */
  28. #define AR_PHY_FC_DYN2040_EXT_CH 0x00000020
  29. #define AR_PHY_FC_HT_EN 0x00000040
  30. #define AR_PHY_FC_SHORT_GI_40 0x00000080
  31. #define AR_PHY_FC_WALSH 0x00000100
  32. #define AR_PHY_FC_SINGLE_HT_LTF1 0x00000200
  33. #define AR_PHY_FC_ENABLE_DAC_FIFO 0x00000800
  34. #define AR_PHY_TEST2 0x9808
  35. #define AR_PHY_TIMING2 0x9810
  36. #define AR_PHY_TIMING3 0x9814
  37. #define AR_PHY_TIMING3_DSC_MAN 0xFFFE0000
  38. #define AR_PHY_TIMING3_DSC_MAN_S 17
  39. #define AR_PHY_TIMING3_DSC_EXP 0x0001E000
  40. #define AR_PHY_TIMING3_DSC_EXP_S 13
  41. #define AR_PHY_CHIP_ID_REV_0 0x80
  42. #define AR_PHY_CHIP_ID_REV_1 0x81
  43. #define AR_PHY_CHIP_ID_9160_REV_0 0xb0
  44. #define AR_PHY_ACTIVE 0x981C
  45. #define AR_PHY_ACTIVE_EN 0x00000001
  46. #define AR_PHY_ACTIVE_DIS 0x00000000
  47. #define AR_PHY_RF_CTL2 0x9824
  48. #define AR_PHY_TX_END_DATA_START 0x000000FF
  49. #define AR_PHY_TX_END_DATA_START_S 0
  50. #define AR_PHY_TX_END_PA_ON 0x0000FF00
  51. #define AR_PHY_TX_END_PA_ON_S 8
  52. #define AR_PHY_RF_CTL3 0x9828
  53. #define AR_PHY_TX_END_TO_A2_RX_ON 0x00FF0000
  54. #define AR_PHY_TX_END_TO_A2_RX_ON_S 16
  55. #define AR_PHY_TX_END_TO_ADC_ON 0xFF000000
  56. #define AR_PHY_TX_END_TO_ADC_ON_S 24
  57. #define AR_PHY_ADC_CTL 0x982C
  58. #define AR_PHY_ADC_CTL_OFF_INBUFGAIN 0x00000003
  59. #define AR_PHY_ADC_CTL_OFF_INBUFGAIN_S 0
  60. #define AR_PHY_ADC_CTL_OFF_PWDDAC 0x00002000
  61. #define AR_PHY_ADC_CTL_OFF_PWDBANDGAP 0x00004000
  62. #define AR_PHY_ADC_CTL_OFF_PWDADC 0x00008000
  63. #define AR_PHY_ADC_CTL_ON_INBUFGAIN 0x00030000
  64. #define AR_PHY_ADC_CTL_ON_INBUFGAIN_S 16
  65. #define AR_PHY_ADC_SERIAL_CTL 0x9830
  66. #define AR_PHY_SEL_INTERNAL_ADDAC 0x00000000
  67. #define AR_PHY_SEL_EXTERNAL_RADIO 0x00000001
  68. #define AR_PHY_RF_CTL4 0x9834
  69. #define AR_PHY_RF_CTL4_TX_END_XPAB_OFF 0xFF000000
  70. #define AR_PHY_RF_CTL4_TX_END_XPAB_OFF_S 24
  71. #define AR_PHY_RF_CTL4_TX_END_XPAA_OFF 0x00FF0000
  72. #define AR_PHY_RF_CTL4_TX_END_XPAA_OFF_S 16
  73. #define AR_PHY_RF_CTL4_FRAME_XPAB_ON 0x0000FF00
  74. #define AR_PHY_RF_CTL4_FRAME_XPAB_ON_S 8
  75. #define AR_PHY_RF_CTL4_FRAME_XPAA_ON 0x000000FF
  76. #define AR_PHY_RF_CTL4_FRAME_XPAA_ON_S 0
  77. #define AR_PHY_TSTDAC_CONST 0x983c
  78. #define AR_PHY_SETTLING 0x9844
  79. #define AR_PHY_SETTLING_SWITCH 0x00003F80
  80. #define AR_PHY_SETTLING_SWITCH_S 7
  81. #define AR_PHY_RXGAIN 0x9848
  82. #define AR_PHY_RXGAIN_TXRX_ATTEN 0x0003F000
  83. #define AR_PHY_RXGAIN_TXRX_ATTEN_S 12
  84. #define AR_PHY_RXGAIN_TXRX_RF_MAX 0x007C0000
  85. #define AR_PHY_RXGAIN_TXRX_RF_MAX_S 18
  86. #define AR9280_PHY_RXGAIN_TXRX_ATTEN 0x00003F80
  87. #define AR9280_PHY_RXGAIN_TXRX_ATTEN_S 7
  88. #define AR9280_PHY_RXGAIN_TXRX_MARGIN 0x001FC000
  89. #define AR9280_PHY_RXGAIN_TXRX_MARGIN_S 14
  90. #define AR_PHY_DESIRED_SZ 0x9850
  91. #define AR_PHY_DESIRED_SZ_ADC 0x000000FF
  92. #define AR_PHY_DESIRED_SZ_ADC_S 0
  93. #define AR_PHY_DESIRED_SZ_PGA 0x0000FF00
  94. #define AR_PHY_DESIRED_SZ_PGA_S 8
  95. #define AR_PHY_DESIRED_SZ_TOT_DES 0x0FF00000
  96. #define AR_PHY_DESIRED_SZ_TOT_DES_S 20
  97. #define AR_PHY_FIND_SIG 0x9858
  98. #define AR_PHY_FIND_SIG_FIRSTEP 0x0003F000
  99. #define AR_PHY_FIND_SIG_FIRSTEP_S 12
  100. #define AR_PHY_FIND_SIG_FIRPWR 0x03FC0000
  101. #define AR_PHY_FIND_SIG_FIRPWR_S 18
  102. #define AR_PHY_FIND_SIG_LOW 0x9840
  103. #define AR_PHY_FIND_SIG_FIRSTEP_LOW 0x00000FC0L
  104. #define AR_PHY_FIND_SIG_FIRSTEP_LOW_S 6
  105. #define AR_PHY_AGC_CTL1 0x985C
  106. #define AR_PHY_AGC_CTL1_COARSE_LOW 0x00007F80
  107. #define AR_PHY_AGC_CTL1_COARSE_LOW_S 7
  108. #define AR_PHY_AGC_CTL1_COARSE_HIGH 0x003F8000
  109. #define AR_PHY_AGC_CTL1_COARSE_HIGH_S 15
  110. #define AR_PHY_CCA 0x9864
  111. #define AR_PHY_MINCCA_PWR 0x0FF80000
  112. #define AR_PHY_MINCCA_PWR_S 19
  113. #define AR_PHY_CCA_THRESH62 0x0007F000
  114. #define AR_PHY_CCA_THRESH62_S 12
  115. #define AR9280_PHY_MINCCA_PWR 0x1FF00000
  116. #define AR9280_PHY_MINCCA_PWR_S 20
  117. #define AR9280_PHY_CCA_THRESH62 0x000FF000
  118. #define AR9280_PHY_CCA_THRESH62_S 12
  119. #define AR_PHY_SFCORR_LOW 0x986C
  120. #define AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW 0x00000001
  121. #define AR_PHY_SFCORR_LOW_M2COUNT_THR_LOW 0x00003F00
  122. #define AR_PHY_SFCORR_LOW_M2COUNT_THR_LOW_S 8
  123. #define AR_PHY_SFCORR_LOW_M1_THRESH_LOW 0x001FC000
  124. #define AR_PHY_SFCORR_LOW_M1_THRESH_LOW_S 14
  125. #define AR_PHY_SFCORR_LOW_M2_THRESH_LOW 0x0FE00000
  126. #define AR_PHY_SFCORR_LOW_M2_THRESH_LOW_S 21
  127. #define AR_PHY_SFCORR 0x9868
  128. #define AR_PHY_SFCORR_M2COUNT_THR 0x0000001F
  129. #define AR_PHY_SFCORR_M2COUNT_THR_S 0
  130. #define AR_PHY_SFCORR_M1_THRESH 0x00FE0000
  131. #define AR_PHY_SFCORR_M1_THRESH_S 17
  132. #define AR_PHY_SFCORR_M2_THRESH 0x7F000000
  133. #define AR_PHY_SFCORR_M2_THRESH_S 24
  134. #define AR_PHY_SLEEP_CTR_CONTROL 0x9870
  135. #define AR_PHY_SLEEP_CTR_LIMIT 0x9874
  136. #define AR_PHY_SYNTH_CONTROL 0x9874
  137. #define AR_PHY_SLEEP_SCAL 0x9878
  138. #define AR_PHY_PLL_CTL 0x987c
  139. #define AR_PHY_PLL_CTL_40 0xaa
  140. #define AR_PHY_PLL_CTL_40_5413 0x04
  141. #define AR_PHY_PLL_CTL_44 0xab
  142. #define AR_PHY_PLL_CTL_44_2133 0xeb
  143. #define AR_PHY_PLL_CTL_40_2133 0xea
  144. #define AR_PHY_SPECTRAL_SCAN 0x9910 /* AR9280 spectral scan configuration register */
  145. #define AR_PHY_SPECTRAL_SCAN_ENABLE 0x1
  146. #define AR_PHY_SPECTRAL_SCAN_ENA 0x00000001 /* Enable spectral scan, reg 68, bit 0 */
  147. #define AR_PHY_SPECTRAL_SCAN_ENA_S 0 /* Enable spectral scan, reg 68, bit 0 */
  148. #define AR_PHY_SPECTRAL_SCAN_ACTIVE 0x00000002 /* Activate spectral scan reg 68, bit 1*/
  149. #define AR_PHY_SPECTRAL_SCAN_ACTIVE_S 1 /* Activate spectral scan reg 68, bit 1*/
  150. #define AR_PHY_SPECTRAL_SCAN_FFT_PERIOD 0x000000F0 /* Interval for FFT reports, reg 68, bits 4-7*/
  151. #define AR_PHY_SPECTRAL_SCAN_FFT_PERIOD_S 4
  152. #define AR_PHY_SPECTRAL_SCAN_PERIOD 0x0000FF00 /* Interval for FFT reports, reg 68, bits 8-15*/
  153. #define AR_PHY_SPECTRAL_SCAN_PERIOD_S 8
  154. #define AR_PHY_SPECTRAL_SCAN_COUNT 0x00FF0000 /* Number of reports, reg 68, bits 16-23*/
  155. #define AR_PHY_SPECTRAL_SCAN_COUNT_S 16
  156. #define AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT 0x01000000 /* Short repeat, reg 68, bit 24*/
  157. #define AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT_S 24 /* Short repeat, reg 68, bit 24*/
  158. #define AR_PHY_RX_DELAY 0x9914
  159. #define AR_PHY_SEARCH_START_DELAY 0x9918
  160. #define AR_PHY_RX_DELAY_DELAY 0x00003FFF
  161. #define AR_PHY_TIMING_CTRL4(_i) (0x9920 + ((_i) << 12))
  162. #define AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF 0x01F
  163. #define AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF_S 0
  164. #define AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF 0x7E0
  165. #define AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF_S 5
  166. #define AR_PHY_TIMING_CTRL4_IQCORR_ENABLE 0x800
  167. #define AR_PHY_TIMING_CTRL4_IQCAL_LOG_COUNT_MAX 0xF000
  168. #define AR_PHY_TIMING_CTRL4_IQCAL_LOG_COUNT_MAX_S 12
  169. #define AR_PHY_TIMING_CTRL4_DO_CAL 0x10000
  170. #define AR_PHY_TIMING_CTRL4_ENABLE_SPUR_RSSI 0x80000000
  171. #define AR_PHY_TIMING_CTRL4_ENABLE_SPUR_FILTER 0x40000000
  172. #define AR_PHY_TIMING_CTRL4_ENABLE_CHAN_MASK 0x20000000
  173. #define AR_PHY_TIMING_CTRL4_ENABLE_PILOT_MASK 0x10000000
  174. #define AR_PHY_TIMING5 0x9924
  175. #define AR_PHY_TIMING5_CYCPWR_THR1 0x000000FE
  176. #define AR_PHY_TIMING5_CYCPWR_THR1_S 1
  177. #define AR_PHY_POWER_TX_RATE1 0x9934
  178. #define AR_PHY_POWER_TX_RATE2 0x9938
  179. #define AR_PHY_POWER_TX_RATE_MAX 0x993c
  180. #define AR_PHY_POWER_TX_RATE_MAX_TPC_ENABLE 0x00000040
  181. #define AR_PHY_FRAME_CTL 0x9944
  182. #define AR_PHY_FRAME_CTL_TX_CLIP 0x00000038
  183. #define AR_PHY_FRAME_CTL_TX_CLIP_S 3
  184. #define AR_PHY_TXPWRADJ 0x994C
  185. #define AR_PHY_TXPWRADJ_CCK_GAIN_DELTA 0x00000FC0
  186. #define AR_PHY_TXPWRADJ_CCK_GAIN_DELTA_S 6
  187. #define AR_PHY_TXPWRADJ_CCK_PCDAC_INDEX 0x00FC0000
  188. #define AR_PHY_TXPWRADJ_CCK_PCDAC_INDEX_S 18
  189. #define AR_PHY_RADAR_EXT 0x9940
  190. #define AR_PHY_RADAR_EXT_ENA 0x00004000
  191. #define AR_PHY_RADAR_0 0x9954
  192. #define AR_PHY_RADAR_0_ENA 0x00000001
  193. #define AR_PHY_RADAR_0_FFT_ENA 0x80000000
  194. #define AR_PHY_RADAR_0_INBAND 0x0000003e
  195. #define AR_PHY_RADAR_0_INBAND_S 1
  196. #define AR_PHY_RADAR_0_PRSSI 0x00000FC0
  197. #define AR_PHY_RADAR_0_PRSSI_S 6
  198. #define AR_PHY_RADAR_0_HEIGHT 0x0003F000
  199. #define AR_PHY_RADAR_0_HEIGHT_S 12
  200. #define AR_PHY_RADAR_0_RRSSI 0x00FC0000
  201. #define AR_PHY_RADAR_0_RRSSI_S 18
  202. #define AR_PHY_RADAR_0_FIRPWR 0x7F000000
  203. #define AR_PHY_RADAR_0_FIRPWR_S 24
  204. #define AR_PHY_RADAR_1 0x9958
  205. #define AR_PHY_RADAR_1_RELPWR_ENA 0x00800000
  206. #define AR_PHY_RADAR_1_USE_FIR128 0x00400000
  207. #define AR_PHY_RADAR_1_RELPWR_THRESH 0x003F0000
  208. #define AR_PHY_RADAR_1_RELPWR_THRESH_S 16
  209. #define AR_PHY_RADAR_1_BLOCK_CHECK 0x00008000
  210. #define AR_PHY_RADAR_1_MAX_RRSSI 0x00004000
  211. #define AR_PHY_RADAR_1_RELSTEP_CHECK 0x00002000
  212. #define AR_PHY_RADAR_1_RELSTEP_THRESH 0x00001F00
  213. #define AR_PHY_RADAR_1_RELSTEP_THRESH_S 8
  214. #define AR_PHY_RADAR_1_MAXLEN 0x000000FF
  215. #define AR_PHY_RADAR_1_MAXLEN_S 0
  216. #define AR_PHY_SWITCH_CHAIN_0 0x9960
  217. #define AR_PHY_SWITCH_COM 0x9964
  218. #define AR_PHY_SIGMA_DELTA 0x996C
  219. #define AR_PHY_SIGMA_DELTA_ADC_SEL 0x00000003
  220. #define AR_PHY_SIGMA_DELTA_ADC_SEL_S 0
  221. #define AR_PHY_SIGMA_DELTA_FILT2 0x000000F8
  222. #define AR_PHY_SIGMA_DELTA_FILT2_S 3
  223. #define AR_PHY_SIGMA_DELTA_FILT1 0x00001F00
  224. #define AR_PHY_SIGMA_DELTA_FILT1_S 8
  225. #define AR_PHY_SIGMA_DELTA_ADC_CLIP 0x01FFE000
  226. #define AR_PHY_SIGMA_DELTA_ADC_CLIP_S 13
  227. #define AR_PHY_RESTART 0x9970
  228. #define AR_PHY_RESTART_DIV_GC 0x001C0000
  229. #define AR_PHY_RESTART_DIV_GC_S 18
  230. #define AR_PHY_RFBUS_REQ 0x997C
  231. #define AR_PHY_RFBUS_REQ_EN 0x00000001
  232. #define AR_PHY_TIMING7 0x9980
  233. #define AR_PHY_TIMING8 0x9984
  234. #define AR_PHY_TIMING8_PILOT_MASK_2 0x000FFFFF
  235. #define AR_PHY_TIMING8_PILOT_MASK_2_S 0
  236. #define AR_PHY_BIN_MASK2_1 0x9988
  237. #define AR_PHY_BIN_MASK2_2 0x998c
  238. #define AR_PHY_BIN_MASK2_3 0x9990
  239. #define AR_PHY_BIN_MASK2_4 0x9994
  240. #define AR_PHY_BIN_MASK_1 0x9900
  241. #define AR_PHY_BIN_MASK_2 0x9904
  242. #define AR_PHY_BIN_MASK_3 0x9908
  243. #define AR_PHY_MASK_CTL 0x990c
  244. #define AR_PHY_BIN_MASK2_4_MASK_4 0x00003FFF
  245. #define AR_PHY_BIN_MASK2_4_MASK_4_S 0
  246. #define AR_PHY_TIMING9 0x9998
  247. #define AR_PHY_TIMING10 0x999c
  248. #define AR_PHY_TIMING10_PILOT_MASK_2 0x000FFFFF
  249. #define AR_PHY_TIMING10_PILOT_MASK_2_S 0
  250. #define AR_PHY_TIMING11 0x99a0
  251. #define AR_PHY_TIMING11_SPUR_DELTA_PHASE 0x000FFFFF
  252. #define AR_PHY_TIMING11_SPUR_DELTA_PHASE_S 0
  253. #define AR_PHY_TIMING11_USE_SPUR_IN_AGC 0x40000000
  254. #define AR_PHY_TIMING11_USE_SPUR_IN_SELFCOR 0x80000000
  255. #define AR_PHY_RX_CHAINMASK 0x99a4
  256. #define AR_PHY_NEW_ADC_DC_GAIN_CORR(_i) (0x99b4 + ((_i) << 12))
  257. #define AR_PHY_NEW_ADC_GAIN_CORR_ENABLE 0x40000000
  258. #define AR_PHY_NEW_ADC_DC_OFFSET_CORR_ENABLE 0x80000000
  259. #define AR_PHY_MULTICHAIN_GAIN_CTL 0x99ac
  260. #define AR_PHY_9285_FAST_DIV_BIAS 0x00007E00
  261. #define AR_PHY_9285_FAST_DIV_BIAS_S 9
  262. #define AR_PHY_9285_ANT_DIV_CTL_ALL 0x7f000000
  263. #define AR_PHY_9285_ANT_DIV_CTL 0x01000000
  264. #define AR_PHY_9285_ANT_DIV_CTL_S 24
  265. #define AR_PHY_9285_ANT_DIV_ALT_LNACONF 0x06000000
  266. #define AR_PHY_9285_ANT_DIV_ALT_LNACONF_S 25
  267. #define AR_PHY_9285_ANT_DIV_MAIN_LNACONF 0x18000000
  268. #define AR_PHY_9285_ANT_DIV_MAIN_LNACONF_S 27
  269. #define AR_PHY_9285_ANT_DIV_ALT_GAINTB 0x20000000
  270. #define AR_PHY_9285_ANT_DIV_ALT_GAINTB_S 29
  271. #define AR_PHY_9285_ANT_DIV_MAIN_GAINTB 0x40000000
  272. #define AR_PHY_9285_ANT_DIV_MAIN_GAINTB_S 30
  273. #define AR_PHY_9285_ANT_DIV_GAINTB_0 0
  274. #define AR_PHY_9285_ANT_DIV_GAINTB_1 1
  275. #define ATH_BT_COEX_ANTDIV_CONTROL1_ENABLE 0x0b
  276. #define ATH_BT_COEX_ANTDIV_CONTROL2_ENABLE 0x09
  277. #define ATH_BT_COEX_ANTDIV_CONTROL1_FIXED_A 0x04
  278. #define ATH_BT_COEX_ANTDIV_CONTROL2_FIXED_A 0x09
  279. #define ATH_BT_COEX_ANT_DIV_SWITCH_COM 0x66666666
  280. #define AR_PHY_EXT_CCA0 0x99b8
  281. #define AR_PHY_EXT_CCA0_THRESH62 0x000000FF
  282. #define AR_PHY_EXT_CCA0_THRESH62_S 0
  283. #define AR_PHY_EXT_CCA 0x99bc
  284. #define AR_PHY_EXT_CCA_CYCPWR_THR1 0x0000FE00
  285. #define AR_PHY_EXT_CCA_CYCPWR_THR1_S 9
  286. #define AR_PHY_EXT_CCA_THRESH62 0x007F0000
  287. #define AR_PHY_EXT_CCA_THRESH62_S 16
  288. #define AR_PHY_EXT_TIMING5_CYCPWR_THR1 0x0000FE00L
  289. #define AR_PHY_EXT_TIMING5_CYCPWR_THR1_S 9
  290. #define AR_PHY_EXT_MINCCA_PWR 0xFF800000
  291. #define AR_PHY_EXT_MINCCA_PWR_S 23
  292. #define AR9280_PHY_EXT_MINCCA_PWR 0x01FF0000
  293. #define AR9280_PHY_EXT_MINCCA_PWR_S 16
  294. #define AR_PHY_SFCORR_EXT 0x99c0
  295. #define AR_PHY_SFCORR_EXT_M1_THRESH 0x0000007F
  296. #define AR_PHY_SFCORR_EXT_M1_THRESH_S 0
  297. #define AR_PHY_SFCORR_EXT_M2_THRESH 0x00003F80
  298. #define AR_PHY_SFCORR_EXT_M2_THRESH_S 7
  299. #define AR_PHY_SFCORR_EXT_M1_THRESH_LOW 0x001FC000
  300. #define AR_PHY_SFCORR_EXT_M1_THRESH_LOW_S 14
  301. #define AR_PHY_SFCORR_EXT_M2_THRESH_LOW 0x0FE00000
  302. #define AR_PHY_SFCORR_EXT_M2_THRESH_LOW_S 21
  303. #define AR_PHY_SFCORR_SPUR_SUBCHNL_SD_S 28
  304. #define AR_PHY_HALFGI 0x99D0
  305. #define AR_PHY_HALFGI_DSC_MAN 0x0007FFF0
  306. #define AR_PHY_HALFGI_DSC_MAN_S 4
  307. #define AR_PHY_HALFGI_DSC_EXP 0x0000000F
  308. #define AR_PHY_HALFGI_DSC_EXP_S 0
  309. #define AR_PHY_CHAN_INFO_MEMORY 0x99DC
  310. #define AR_PHY_CHAN_INFO_MEMORY_CAPTURE_MASK 0x0001
  311. #define AR_PHY_HEAVY_CLIP_ENABLE 0x99E0
  312. #define AR_PHY_HEAVY_CLIP_FACTOR_RIFS 0x99EC
  313. #define AR_PHY_RIFS_INIT_DELAY 0x03ff0000
  314. #define AR_PHY_M_SLEEP 0x99f0
  315. #define AR_PHY_REFCLKDLY 0x99f4
  316. #define AR_PHY_REFCLKPD 0x99f8
  317. #define AR_PHY_CALMODE 0x99f0
  318. #define AR_PHY_CALMODE_IQ 0x00000000
  319. #define AR_PHY_CALMODE_ADC_GAIN 0x00000001
  320. #define AR_PHY_CALMODE_ADC_DC_PER 0x00000002
  321. #define AR_PHY_CALMODE_ADC_DC_INIT 0x00000003
  322. #define AR_PHY_CAL_MEAS_0(_i) (0x9c10 + ((_i) << 12))
  323. #define AR_PHY_CAL_MEAS_1(_i) (0x9c14 + ((_i) << 12))
  324. #define AR_PHY_CAL_MEAS_2(_i) (0x9c18 + ((_i) << 12))
  325. #define AR_PHY_CAL_MEAS_3(_i) (0x9c1c + ((_i) << 12))
  326. #define AR_PHY_CURRENT_RSSI 0x9c1c
  327. #define AR9280_PHY_CURRENT_RSSI 0x9c3c
  328. #define AR_PHY_RFBUS_GRANT 0x9C20
  329. #define AR_PHY_RFBUS_GRANT_EN 0x00000001
  330. #define AR_PHY_CHAN_INFO_GAIN_DIFF 0x9CF4
  331. #define AR_PHY_CHAN_INFO_GAIN_DIFF_UPPER_LIMIT 320
  332. #define AR_PHY_CHAN_INFO_GAIN 0x9CFC
  333. #define AR_PHY_MODE 0xA200
  334. #define AR_PHY_MODE_ASYNCFIFO 0x80
  335. #define AR_PHY_MODE_AR2133 0x08
  336. #define AR_PHY_MODE_AR5111 0x00
  337. #define AR_PHY_MODE_AR5112 0x08
  338. #define AR_PHY_MODE_DYNAMIC 0x04
  339. #define AR_PHY_MODE_RF2GHZ 0x02
  340. #define AR_PHY_MODE_RF5GHZ 0x00
  341. #define AR_PHY_MODE_CCK 0x01
  342. #define AR_PHY_MODE_OFDM 0x00
  343. #define AR_PHY_MODE_DYN_CCK_DISABLE 0x100
  344. #define AR_PHY_CCK_TX_CTRL 0xA204
  345. #define AR_PHY_CCK_TX_CTRL_JAPAN 0x00000010
  346. #define AR_PHY_CCK_TX_CTRL_TX_DAC_SCALE_CCK 0x0000000C
  347. #define AR_PHY_CCK_TX_CTRL_TX_DAC_SCALE_CCK_S 2
  348. #define AR_PHY_CCK_DETECT 0xA208
  349. #define AR_PHY_CCK_DETECT_WEAK_SIG_THR_CCK 0x0000003F
  350. #define AR_PHY_CCK_DETECT_WEAK_SIG_THR_CCK_S 0
  351. /* [12:6] settling time for antenna switch */
  352. #define AR_PHY_CCK_DETECT_ANT_SWITCH_TIME 0x00001FC0
  353. #define AR_PHY_CCK_DETECT_ANT_SWITCH_TIME_S 6
  354. #define AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV 0x2000
  355. #define AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV_S 13
  356. #define AR_PHY_GAIN_2GHZ 0xA20C
  357. #define AR_PHY_GAIN_2GHZ_RXTX_MARGIN 0x00FC0000
  358. #define AR_PHY_GAIN_2GHZ_RXTX_MARGIN_S 18
  359. #define AR_PHY_GAIN_2GHZ_BSW_MARGIN 0x00003C00
  360. #define AR_PHY_GAIN_2GHZ_BSW_MARGIN_S 10
  361. #define AR_PHY_GAIN_2GHZ_BSW_ATTEN 0x0000001F
  362. #define AR_PHY_GAIN_2GHZ_BSW_ATTEN_S 0
  363. #define AR_PHY_GAIN_2GHZ_XATTEN2_MARGIN 0x003E0000
  364. #define AR_PHY_GAIN_2GHZ_XATTEN2_MARGIN_S 17
  365. #define AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN 0x0001F000
  366. #define AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN_S 12
  367. #define AR_PHY_GAIN_2GHZ_XATTEN2_DB 0x00000FC0
  368. #define AR_PHY_GAIN_2GHZ_XATTEN2_DB_S 6
  369. #define AR_PHY_GAIN_2GHZ_XATTEN1_DB 0x0000003F
  370. #define AR_PHY_GAIN_2GHZ_XATTEN1_DB_S 0
  371. #define AR_PHY_CCK_RXCTRL4 0xA21C
  372. #define AR_PHY_CCK_RXCTRL4_FREQ_EST_SHORT 0x01F80000
  373. #define AR_PHY_CCK_RXCTRL4_FREQ_EST_SHORT_S 19
  374. #define AR_PHY_DAG_CTRLCCK 0xA228
  375. #define AR_PHY_DAG_CTRLCCK_EN_RSSI_THR 0x00000200
  376. #define AR_PHY_DAG_CTRLCCK_RSSI_THR 0x0001FC00
  377. #define AR_PHY_DAG_CTRLCCK_RSSI_THR_S 10
  378. #define AR_PHY_FORCE_CLKEN_CCK 0xA22C
  379. #define AR_PHY_FORCE_CLKEN_CCK_MRC_MUX 0x00000040
  380. #define AR_PHY_POWER_TX_RATE3 0xA234
  381. #define AR_PHY_POWER_TX_RATE4 0xA238
  382. #define AR_PHY_SCRM_SEQ_XR 0xA23C
  383. #define AR_PHY_HEADER_DETECT_XR 0xA240
  384. #define AR_PHY_CHIRP_DETECTED_XR 0xA244
  385. #define AR_PHY_BLUETOOTH 0xA254
  386. #define AR_PHY_TPCRG1 0xA258
  387. #define AR_PHY_TPCRG1_NUM_PD_GAIN 0x0000c000
  388. #define AR_PHY_TPCRG1_NUM_PD_GAIN_S 14
  389. #define AR_PHY_TPCRG1_PD_GAIN_1 0x00030000
  390. #define AR_PHY_TPCRG1_PD_GAIN_1_S 16
  391. #define AR_PHY_TPCRG1_PD_GAIN_2 0x000C0000
  392. #define AR_PHY_TPCRG1_PD_GAIN_2_S 18
  393. #define AR_PHY_TPCRG1_PD_GAIN_3 0x00300000
  394. #define AR_PHY_TPCRG1_PD_GAIN_3_S 20
  395. #define AR_PHY_TPCRG1_PD_CAL_ENABLE 0x00400000
  396. #define AR_PHY_TPCRG1_PD_CAL_ENABLE_S 22
  397. #define AR_PHY_TX_PWRCTRL4 0xa264
  398. #define AR_PHY_TX_PWRCTRL_PD_AVG_VALID 0x00000001
  399. #define AR_PHY_TX_PWRCTRL_PD_AVG_VALID_S 0
  400. #define AR_PHY_TX_PWRCTRL_PD_AVG_OUT 0x000001FE
  401. #define AR_PHY_TX_PWRCTRL_PD_AVG_OUT_S 1
  402. #define AR_PHY_TX_PWRCTRL6_0 0xa270
  403. #define AR_PHY_TX_PWRCTRL6_1 0xb270
  404. #define AR_PHY_TX_PWRCTRL_ERR_EST_MODE 0x03000000
  405. #define AR_PHY_TX_PWRCTRL_ERR_EST_MODE_S 24
  406. #define AR_PHY_TX_PWRCTRL7 0xa274
  407. #define AR_PHY_TX_PWRCTRL_INIT_TX_GAIN 0x01F80000
  408. #define AR_PHY_TX_PWRCTRL_INIT_TX_GAIN_S 19
  409. #define AR_PHY_TX_PWRCTRL8 0xa278
  410. #define AR_PHY_TX_PWRCTRL9 0xa27C
  411. #define AR_PHY_TX_PWRCTRL10 0xa394
  412. #define AR_PHY_TX_DESIRED_SCALE_CCK 0x00007C00
  413. #define AR_PHY_TX_DESIRED_SCALE_CCK_S 10
  414. #define AR_PHY_TX_PWRCTRL9_RES_DC_REMOVAL 0x80000000
  415. #define AR_PHY_TX_PWRCTRL9_RES_DC_REMOVAL_S 31
  416. #define AR_PHY_TX_GAIN_TBL1 0xa300
  417. #define AR_PHY_TX_GAIN 0x0007F000
  418. #define AR_PHY_TX_GAIN_S 12
  419. #define AR_PHY_CH0_TX_PWRCTRL11 0xa398
  420. #define AR_PHY_CH1_TX_PWRCTRL11 0xb398
  421. #define AR_PHY_CH0_TX_PWRCTRL12 0xa3dc
  422. #define AR_PHY_CH0_TX_PWRCTRL13 0xa3e0
  423. #define AR_PHY_TX_PWRCTRL_OLPC_TEMP_COMP 0x0000FC00
  424. #define AR_PHY_TX_PWRCTRL_OLPC_TEMP_COMP_S 10
  425. #define AR_PHY_VIT_MASK2_M_46_61 0xa3a0
  426. #define AR_PHY_MASK2_M_31_45 0xa3a4
  427. #define AR_PHY_MASK2_M_16_30 0xa3a8
  428. #define AR_PHY_MASK2_M_00_15 0xa3ac
  429. #define AR_PHY_MASK2_P_15_01 0xa3b8
  430. #define AR_PHY_MASK2_P_30_16 0xa3bc
  431. #define AR_PHY_MASK2_P_45_31 0xa3c0
  432. #define AR_PHY_MASK2_P_61_45 0xa3c4
  433. #define AR_PHY_SPUR_REG 0x994c
  434. #define AR_PHY_SPUR_REG_MASK_RATE_CNTL (0xFF << 18)
  435. #define AR_PHY_SPUR_REG_MASK_RATE_CNTL_S 18
  436. #define AR_PHY_SPUR_REG_ENABLE_MASK_PPM 0x20000
  437. #define AR_PHY_SPUR_REG_MASK_RATE_SELECT (0xFF << 9)
  438. #define AR_PHY_SPUR_REG_MASK_RATE_SELECT_S 9
  439. #define AR_PHY_SPUR_REG_ENABLE_VIT_SPUR_RSSI 0x100
  440. #define AR_PHY_SPUR_REG_SPUR_RSSI_THRESH 0x7F
  441. #define AR_PHY_SPUR_REG_SPUR_RSSI_THRESH_S 0
  442. #define AR_PHY_PILOT_MASK_01_30 0xa3b0
  443. #define AR_PHY_PILOT_MASK_31_60 0xa3b4
  444. #define AR_PHY_CHANNEL_MASK_01_30 0x99d4
  445. #define AR_PHY_CHANNEL_MASK_31_60 0x99d8
  446. #define AR_PHY_ANALOG_SWAP 0xa268
  447. #define AR_PHY_SWAP_ALT_CHAIN 0x00000040
  448. #define AR_PHY_TPCRG5 0xA26C
  449. #define AR_PHY_TPCRG5_PD_GAIN_OVERLAP 0x0000000F
  450. #define AR_PHY_TPCRG5_PD_GAIN_OVERLAP_S 0
  451. #define AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_1 0x000003F0
  452. #define AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_1_S 4
  453. #define AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_2 0x0000FC00
  454. #define AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_2_S 10
  455. #define AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_3 0x003F0000
  456. #define AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_3_S 16
  457. #define AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_4 0x0FC00000
  458. #define AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_4_S 22
  459. /* Carrier leak calibration control, do it after AGC calibration */
  460. #define AR_PHY_CL_CAL_CTL 0xA358
  461. #define AR_PHY_CL_CAL_ENABLE 0x00000002
  462. #define AR_PHY_PARALLEL_CAL_ENABLE 0x00000001
  463. #define AR_PHY_POWER_TX_RATE5 0xA38C
  464. #define AR_PHY_POWER_TX_RATE6 0xA390
  465. #define AR_PHY_CAL_CHAINMASK 0xA39C
  466. #define AR_PHY_POWER_TX_SUB 0xA3C8
  467. #define AR_PHY_POWER_TX_RATE7 0xA3CC
  468. #define AR_PHY_POWER_TX_RATE8 0xA3D0
  469. #define AR_PHY_POWER_TX_RATE9 0xA3D4
  470. #define AR_PHY_XPA_CFG 0xA3D8
  471. #define AR_PHY_FORCE_XPA_CFG 0x000000001
  472. #define AR_PHY_FORCE_XPA_CFG_S 0
  473. #define AR_PHY_CH1_CCA 0xa864
  474. #define AR_PHY_CH1_MINCCA_PWR 0x0FF80000
  475. #define AR_PHY_CH1_MINCCA_PWR_S 19
  476. #define AR9280_PHY_CH1_MINCCA_PWR 0x1FF00000
  477. #define AR9280_PHY_CH1_MINCCA_PWR_S 20
  478. #define AR_PHY_CH2_CCA 0xb864
  479. #define AR_PHY_CH2_MINCCA_PWR 0x0FF80000
  480. #define AR_PHY_CH2_MINCCA_PWR_S 19
  481. #define AR_PHY_CH1_EXT_CCA 0xa9bc
  482. #define AR_PHY_CH1_EXT_MINCCA_PWR 0xFF800000
  483. #define AR_PHY_CH1_EXT_MINCCA_PWR_S 23
  484. #define AR9280_PHY_CH1_EXT_MINCCA_PWR 0x01FF0000
  485. #define AR9280_PHY_CH1_EXT_MINCCA_PWR_S 16
  486. #define AR_PHY_CH2_EXT_CCA 0xb9bc
  487. #define AR_PHY_CH2_EXT_MINCCA_PWR 0xFF800000
  488. #define AR_PHY_CH2_EXT_MINCCA_PWR_S 23
  489. #define AR_PHY_CCA_NOM_VAL_5416_2GHZ -90
  490. #define AR_PHY_CCA_NOM_VAL_5416_5GHZ -100
  491. #define AR_PHY_CCA_MIN_GOOD_VAL_5416_2GHZ -100
  492. #define AR_PHY_CCA_MIN_GOOD_VAL_5416_5GHZ -110
  493. #define AR_PHY_CCA_MAX_GOOD_VAL_5416_2GHZ -80
  494. #define AR_PHY_CCA_MAX_GOOD_VAL_5416_5GHZ -90
  495. #define AR_PHY_CCA_NOM_VAL_9280_2GHZ -112
  496. #define AR_PHY_CCA_NOM_VAL_9280_5GHZ -112
  497. #define AR_PHY_CCA_MIN_GOOD_VAL_9280_2GHZ -127
  498. #define AR_PHY_CCA_MIN_GOOD_VAL_9280_5GHZ -122
  499. #define AR_PHY_CCA_MAX_GOOD_VAL_9280_2GHZ -97
  500. #define AR_PHY_CCA_MAX_GOOD_VAL_9280_5GHZ -102
  501. #define AR_PHY_CCA_NOM_VAL_9285_2GHZ -118
  502. #define AR_PHY_CCA_MIN_GOOD_VAL_9285_2GHZ -127
  503. #define AR_PHY_CCA_MAX_GOOD_VAL_9285_2GHZ -108
  504. #define AR_PHY_CCA_NOM_VAL_9271_2GHZ -118
  505. #define AR_PHY_CCA_MIN_GOOD_VAL_9271_2GHZ -127
  506. #define AR_PHY_CCA_MAX_GOOD_VAL_9271_2GHZ -116
  507. #define AR_PHY_CCA_NOM_VAL_9287_2GHZ -112
  508. #define AR_PHY_CCA_MIN_GOOD_VAL_9287_2GHZ -127
  509. #define AR_PHY_CCA_MAX_GOOD_VAL_9287_2GHZ -97
  510. #endif