Hal8812PhyReg.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of version 2 of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
  17. *
  18. *
  19. ******************************************************************************/
  20. #ifndef __INC_HAL8812PHYREG_H__
  21. #define __INC_HAL8812PHYREG_H__
  22. /*--------------------------Define Parameters-------------------------------*/
  23. /*
  24. * BB-PHY register PMAC 0x100 PHY 0x800 - 0xEFF
  25. * 1. PMAC duplicate register due to connection: RF_Mode, TRxRN, NumOf L-STF
  26. * 2. 0x800/0x900/0xA00/0xC00/0xD00/0xE00
  27. * 3. RF register 0x00-2E
  28. * 4. Bit Mask for BB/RF register
  29. * 5. Other defintion for BB/RF R/W
  30. * */
  31. /* BB Register Definition */
  32. #define rCCAonSec_Jaguar 0x838
  33. #define rPwed_TH_Jaguar 0x830
  34. /* BW and sideband setting */
  35. #define rBWIndication_Jaguar 0x834
  36. #define rL1PeakTH_Jaguar 0x848
  37. #define rFPGA0_XA_LSSIReadBack 0x8a0 /*Tranceiver LSSI Readback*/
  38. #define rRFMOD_Jaguar 0x8ac /* RF mode */
  39. #define rADC_Buf_Clk_Jaguar 0x8c4
  40. #define rRFECTRL_Jaguar 0x900
  41. #define bRFMOD_Jaguar 0xc3
  42. #define rCCK_System_Jaguar 0xa00 /* for cck sideband */
  43. #define bCCK_System_Jaguar 0x10
  44. /* Block & Path enable */
  45. #define rOFDMCCKEN_Jaguar 0x808 /* OFDM/CCK block enable */
  46. #define bOFDMEN_Jaguar 0x20000000
  47. #define bCCKEN_Jaguar 0x10000000
  48. #define rRxPath_Jaguar 0x808 /* Rx antenna */
  49. #define bRxPath_Jaguar 0xff
  50. #define rTxPath_Jaguar 0x80c /* Tx antenna */
  51. #define bTxPath_Jaguar 0x0fffffff
  52. #define rCCK_RX_Jaguar 0xa04 /* for cck rx path selection */
  53. #define bCCK_RX_Jaguar 0x0c000000
  54. #define rVhtlen_Use_Lsig_Jaguar 0x8c3 /* Use LSIG for VHT length */
  55. /* RF read/write-related */
  56. #define rHSSIRead_Jaguar 0x8b0 /* RF read addr */
  57. #define bHSSIRead_addr_Jaguar 0xff
  58. #define bHSSIRead_trigger_Jaguar 0x100
  59. #define rA_PIRead_Jaguar 0xd04 /* RF readback with PI */
  60. #define rB_PIRead_Jaguar 0xd44 /* RF readback with PI */
  61. #define rA_SIRead_Jaguar 0xd08 /* RF readback with SI */
  62. #define rB_SIRead_Jaguar 0xd48 /* RF readback with SI */
  63. #define rRead_data_Jaguar 0xfffff
  64. #define rA_LSSIWrite_Jaguar 0xc90 /* RF write addr */
  65. #define rB_LSSIWrite_Jaguar 0xe90 /* RF write addr */
  66. #define bLSSIWrite_data_Jaguar 0x000fffff
  67. #define bLSSIWrite_addr_Jaguar 0x0ff00000
  68. /* YN: mask the following register definition temporarily */
  69. #define rFPGA0_XA_RFInterfaceOE 0x860 /* RF Channel switch */
  70. #define rFPGA0_XB_RFInterfaceOE 0x864
  71. #define rFPGA0_XAB_RFInterfaceSW 0x870 /* RF Interface Software Control */
  72. #define rFPGA0_XCD_RFInterfaceSW 0x874
  73. /* #define rFPGA0_XAB_RFParameter 0x878 */ /* RF Parameter
  74. * #define rFPGA0_XCD_RFParameter 0x87c */
  75. /* #define rFPGA0_AnalogParameter1 0x880 */ /* Crystal cap setting RF-R/W protection for parameter4??
  76. * #define rFPGA0_AnalogParameter2 0x884
  77. * #define rFPGA0_AnalogParameter3 0x888
  78. * #define rFPGA0_AdDaClockEn 0x888 */ /* enable ad/da clock1 for dual-phy
  79. * #define rFPGA0_AnalogParameter4 0x88c */
  80. /* CCK TX scaling */
  81. #define rCCK_TxFilter1_Jaguar 0xa20
  82. #define bCCK_TxFilter1_C0_Jaguar 0x00ff0000
  83. #define bCCK_TxFilter1_C1_Jaguar 0xff000000
  84. #define rCCK_TxFilter2_Jaguar 0xa24
  85. #define bCCK_TxFilter2_C2_Jaguar 0x000000ff
  86. #define bCCK_TxFilter2_C3_Jaguar 0x0000ff00
  87. #define bCCK_TxFilter2_C4_Jaguar 0x00ff0000
  88. #define bCCK_TxFilter2_C5_Jaguar 0xff000000
  89. #define rCCK_TxFilter3_Jaguar 0xa28
  90. #define bCCK_TxFilter3_C6_Jaguar 0x000000ff
  91. #define bCCK_TxFilter3_C7_Jaguar 0x0000ff00
  92. /* YN: mask the following register definition temporarily
  93. * #define rPdp_AntA 0xb00
  94. * #define rPdp_AntA_4 0xb04
  95. * #define rConfig_Pmpd_AntA 0xb28
  96. * #define rConfig_AntA 0xb68
  97. * #define rConfig_AntB 0xb6c
  98. * #define rPdp_AntB 0xb70
  99. * #define rPdp_AntB_4 0xb74
  100. * #define rConfig_Pmpd_AntB 0xb98
  101. * #define rAPK 0xbd8 */
  102. /* RXIQC */
  103. #define rA_RxIQC_AB_Jaguar 0xc10 /* RxIQ imblance matrix coeff. A & B */
  104. #define rA_RxIQC_CD_Jaguar 0xc14 /* RxIQ imblance matrix coeff. C & D */
  105. #define rA_TxScale_Jaguar 0xc1c /* Pah_A TX scaling factor */
  106. #define rB_TxScale_Jaguar 0xe1c /* Path_B TX scaling factor */
  107. #define rB_RxIQC_AB_Jaguar 0xe10 /* RxIQ imblance matrix coeff. A & B */
  108. #define rB_RxIQC_CD_Jaguar 0xe14 /* RxIQ imblance matrix coeff. C & D */
  109. #define b_RxIQC_AC_Jaguar 0x02ff /* bit mask for IQC matrix element A & C */
  110. #define b_RxIQC_BD_Jaguar 0x02ff0000 /* bit mask for IQC matrix element A & C */
  111. /* DIG-related */
  112. #define rA_IGI_Jaguar 0xc50 /* Initial Gain for path-A */
  113. #define rB_IGI_Jaguar 0xe50 /* Initial Gain for path-B */
  114. #define rOFDM_FalseAlarm1_Jaguar 0xf48 /* counter for break */
  115. #define rOFDM_FalseAlarm2_Jaguar 0xf4c /* counter for spoofing */
  116. #define rCCK_FalseAlarm_Jaguar 0xa5c /* counter for cck false alarm */
  117. #define b_FalseAlarm_Jaguar 0xffff
  118. #define rCCK_CCA_Jaguar 0xa08 /* cca threshold */
  119. #define bCCK_CCA_Jaguar 0x00ff0000
  120. /* Tx Power Ttraining-related */
  121. #define rA_TxPwrTraing_Jaguar 0xc54
  122. #define rB_TxPwrTraing_Jaguar 0xe54
  123. /* Report-related */
  124. #define rOFDM_ShortCFOAB_Jaguar 0xf60
  125. #define rOFDM_LongCFOAB_Jaguar 0xf64
  126. #define rOFDM_EndCFOAB_Jaguar 0xf70
  127. #define rOFDM_AGCReport_Jaguar 0xf84
  128. #define rOFDM_RxSNR_Jaguar 0xf88
  129. #define rOFDM_RxEVMCSI_Jaguar 0xf8c
  130. #define rOFDM_SIGReport_Jaguar 0xf90
  131. /* Misc functions */
  132. #define rEDCCA_Jaguar 0x8a4 /* EDCCA */
  133. #define bEDCCA_Jaguar 0xffff
  134. #define rAGC_table_Jaguar 0x82c /* AGC tabel select */
  135. #define bAGC_table_Jaguar 0x3
  136. #define b_sel5g_Jaguar 0x1000 /* sel5g */
  137. #define b_LNA_sw_Jaguar 0x8000 /* HW/WS control for LNA */
  138. #define rFc_area_Jaguar 0x860 /* fc_area */
  139. #define bFc_area_Jaguar 0x1ffe000
  140. #define rSingleTone_ContTx_Jaguar 0x914
  141. /* RFE */
  142. #define rA_RFE_Pinmux_Jaguar 0xcb0 /* Path_A RFE cotrol pinmux */
  143. #define rB_RFE_Pinmux_Jaguar 0xeb0 /* Path_B RFE control pinmux */
  144. #define rA_RFE_Inv_Jaguar 0xcb4 /* Path_A RFE cotrol */
  145. #define rB_RFE_Inv_Jaguar 0xeb4 /* Path_B RFE control */
  146. #define rA_RFE_Jaguar 0xcb8 /* Path_A RFE cotrol */
  147. #define rB_RFE_Jaguar 0xeb8 /* Path_B RFE control */
  148. #define r_ANTSEL_SW_Jaguar 0x900 /* ANTSEL SW Control */
  149. #define bMask_RFEInv_Jaguar 0x3ff00000
  150. #define bMask_AntselPathFollow_Jaguar 0x00030000
  151. /* TX AGC */
  152. #define rTxAGC_A_CCK11_CCK1_JAguar 0xc20
  153. #define rTxAGC_A_Ofdm18_Ofdm6_JAguar 0xc24
  154. #define rTxAGC_A_Ofdm54_Ofdm24_JAguar 0xc28
  155. #define rTxAGC_A_MCS3_MCS0_JAguar 0xc2c
  156. #define rTxAGC_A_MCS7_MCS4_JAguar 0xc30
  157. #define rTxAGC_A_MCS11_MCS8_JAguar 0xc34
  158. #define rTxAGC_A_MCS15_MCS12_JAguar 0xc38
  159. #define rTxAGC_A_Nss1Index3_Nss1Index0_JAguar 0xc3c
  160. #define rTxAGC_A_Nss1Index7_Nss1Index4_JAguar 0xc40
  161. #define rTxAGC_A_Nss2Index1_Nss1Index8_JAguar 0xc44
  162. #define rTxAGC_A_Nss2Index5_Nss2Index2_JAguar 0xc48
  163. #define rTxAGC_A_Nss2Index9_Nss2Index6_JAguar 0xc4c
  164. #define rTxAGC_B_CCK11_CCK1_JAguar 0xe20
  165. #define rTxAGC_B_Ofdm18_Ofdm6_JAguar 0xe24
  166. #define rTxAGC_B_Ofdm54_Ofdm24_JAguar 0xe28
  167. #define rTxAGC_B_MCS3_MCS0_JAguar 0xe2c
  168. #define rTxAGC_B_MCS7_MCS4_JAguar 0xe30
  169. #define rTxAGC_B_MCS11_MCS8_JAguar 0xe34
  170. #define rTxAGC_B_MCS15_MCS12_JAguar 0xe38
  171. #define rTxAGC_B_Nss1Index3_Nss1Index0_JAguar 0xe3c
  172. #define rTxAGC_B_Nss1Index7_Nss1Index4_JAguar 0xe40
  173. #define rTxAGC_B_Nss2Index1_Nss1Index8_JAguar 0xe44
  174. #define rTxAGC_B_Nss2Index5_Nss2Index2_JAguar 0xe48
  175. #define rTxAGC_B_Nss2Index9_Nss2Index6_JAguar 0xe4c
  176. #define bTxAGC_byte0_Jaguar 0xff
  177. #define bTxAGC_byte1_Jaguar 0xff00
  178. #define bTxAGC_byte2_Jaguar 0xff0000
  179. #define bTxAGC_byte3_Jaguar 0xff000000
  180. /* IQK YN: temporaily mask this part
  181. * #define rFPGA0_IQK 0xe28
  182. * #define rTx_IQK_Tone_A 0xe30
  183. * #define rRx_IQK_Tone_A 0xe34
  184. * #define rTx_IQK_PI_A 0xe38
  185. * #define rRx_IQK_PI_A 0xe3c */
  186. /* #define rTx_IQK 0xe40 */
  187. /* #define rRx_IQK 0xe44 */
  188. /* #define rIQK_AGC_Pts 0xe48 */
  189. /* #define rIQK_AGC_Rsp 0xe4c */
  190. /* #define rTx_IQK_Tone_B 0xe50 */
  191. /* #define rRx_IQK_Tone_B 0xe54 */
  192. /* #define rTx_IQK_PI_B 0xe58 */
  193. /* #define rRx_IQK_PI_B 0xe5c */
  194. /* #define rIQK_AGC_Cont 0xe60 */
  195. /* AFE-related */
  196. #define rA_AFEPwr1_Jaguar 0xc60 /* dynamic AFE power control */
  197. #define rA_AFEPwr2_Jaguar 0xc64 /* dynamic AFE power control */
  198. #define rA_Rx_WaitCCA_Tx_CCKRFON_Jaguar 0xc68
  199. #define rA_Tx_CCKBBON_OFDMRFON_Jaguar 0xc6c
  200. #define rA_Tx_OFDMBBON_Tx2Rx_Jaguar 0xc70
  201. #define rA_Tx2Tx_RXCCK_Jaguar 0xc74
  202. #define rA_Rx_OFDM_WaitRIFS_Jaguar 0xc78
  203. #define rA_Rx2Rx_BT_Jaguar 0xc7c
  204. #define rA_sleep_nav_Jaguar 0xc80
  205. #define rA_pmpd_Jaguar 0xc84
  206. #define rB_AFEPwr1_Jaguar 0xe60 /* dynamic AFE power control */
  207. #define rB_AFEPwr2_Jaguar 0xe64 /* dynamic AFE power control */
  208. #define rB_Rx_WaitCCA_Tx_CCKRFON_Jaguar 0xe68
  209. #define rB_Tx_CCKBBON_OFDMRFON_Jaguar 0xe6c
  210. #define rB_Tx_OFDMBBON_Tx2Rx_Jaguar 0xe70
  211. #define rB_Tx2Tx_RXCCK_Jaguar 0xe74
  212. #define rB_Rx_OFDM_WaitRIFS_Jaguar 0xe78
  213. #define rB_Rx2Rx_BT_Jaguar 0xe7c
  214. #define rB_sleep_nav_Jaguar 0xe80
  215. #define rB_pmpd_Jaguar 0xe84
  216. /* YN: mask these registers temporaily
  217. * #define rTx_Power_Before_IQK_A 0xe94
  218. * #define rTx_Power_After_IQK_A 0xe9c */
  219. /* #define rRx_Power_Before_IQK_A 0xea0 */
  220. /* #define rRx_Power_Before_IQK_A_2 0xea4 */
  221. /* #define rRx_Power_After_IQK_A 0xea8 */
  222. /* #define rRx_Power_After_IQK_A_2 0xeac */
  223. /* #define rTx_Power_Before_IQK_B 0xeb4 */
  224. /* #define rTx_Power_After_IQK_B 0xebc */
  225. /* #define rRx_Power_Before_IQK_B 0xec0 */
  226. /* #define rRx_Power_Before_IQK_B_2 0xec4 */
  227. /* #define rRx_Power_After_IQK_B 0xec8 */
  228. /* #define rRx_Power_After_IQK_B_2 0xecc */
  229. /* RSSI Dump */
  230. #define rA_RSSIDump_Jaguar 0xBF0
  231. #define rB_RSSIDump_Jaguar 0xBF1
  232. #define rS1_RXevmDump_Jaguar 0xBF4
  233. #define rS2_RXevmDump_Jaguar 0xBF5
  234. #define rA_RXsnrDump_Jaguar 0xBF6
  235. #define rB_RXsnrDump_Jaguar 0xBF7
  236. #define rA_CfoShortDump_Jaguar 0xBF8
  237. #define rB_CfoShortDump_Jaguar 0xBFA
  238. #define rA_CfoLongDump_Jaguar 0xBEC
  239. #define rB_CfoLongDump_Jaguar 0xBEE
  240. /* RF Register
  241. * */
  242. #define RF_AC_Jaguar 0x00 /* */
  243. #define RF_RF_Top_Jaguar 0x07 /* */
  244. #define RF_TXLOK_Jaguar 0x08 /* */
  245. #define RF_TXAPK_Jaguar 0x0B
  246. #define RF_CHNLBW_Jaguar 0x18 /* RF channel and BW switch */
  247. #define RF_RCK1_Jaguar 0x1c /* */
  248. #define RF_RCK2_Jaguar 0x1d
  249. #define RF_RCK3_Jaguar 0x1e
  250. #define RF_ModeTableAddr 0x30
  251. #define RF_ModeTableData0 0x31
  252. #define RF_ModeTableData1 0x32
  253. #define RF_TxLCTank_Jaguar 0x54
  254. #define RF_APK_Jaguar 0x63
  255. #define RF_LCK 0xB4
  256. #define RF_WeLut_Jaguar 0xEF
  257. #define bRF_CHNLBW_MOD_AG_Jaguar 0x70300
  258. #define bRF_CHNLBW_BW 0xc00
  259. /*
  260. * RL6052 Register definition
  261. * */
  262. #define RF_AC 0x00 /* */
  263. #define RF_IPA_A 0x0C /* */
  264. #define RF_TXBIAS_A 0x0D
  265. #define RF_BS_PA_APSET_G9_G11 0x0E
  266. #define RF_MODE1 0x10 /* */
  267. #define RF_MODE2 0x11 /* */
  268. #define RF_CHNLBW 0x18 /* RF channel and BW switch */
  269. #define RF_RCK_OS 0x30 /* RF TX PA control */
  270. #define RF_TXPA_G1 0x31 /* RF TX PA control */
  271. #define RF_TXPA_G2 0x32 /* RF TX PA control */
  272. #define RF_TXPA_G3 0x33 /* RF TX PA control */
  273. #define RF_0x52 0x52
  274. #define RF_WE_LUT 0xEF
  275. #define RF_TX_GAIN_OFFSET_8812A(_val) ((abs((_val)) << 1) | (((_val) > 0) ? BIT0 : 0))
  276. #define RF_TX_GAIN_OFFSET_8821A(_val) ((abs((_val)) << 1) | (((_val) > 0) ? BIT0 : 0))
  277. /*
  278. * Bit Mask
  279. *
  280. * 1. Page1(0x100) */
  281. #define bBBResetB 0x100 /* Useless now? */
  282. #define bGlobalResetB 0x200
  283. #define bOFDMTxStart 0x4
  284. #define bCCKTxStart 0x8
  285. #define bCRC32Debug 0x100
  286. #define bPMACLoopback 0x10
  287. #define bTxLSIG 0xffffff
  288. #define bOFDMTxRate 0xf
  289. #define bOFDMTxReserved 0x10
  290. #define bOFDMTxLength 0x1ffe0
  291. #define bOFDMTxParity 0x20000
  292. #define bTxHTSIG1 0xffffff
  293. #define bTxHTMCSRate 0x7f
  294. #define bTxHTBW 0x80
  295. #define bTxHTLength 0xffff00
  296. #define bTxHTSIG2 0xffffff
  297. #define bTxHTSmoothing 0x1
  298. #define bTxHTSounding 0x2
  299. #define bTxHTReserved 0x4
  300. #define bTxHTAggreation 0x8
  301. #define bTxHTSTBC 0x30
  302. #define bTxHTAdvanceCoding 0x40
  303. #define bTxHTShortGI 0x80
  304. #define bTxHTNumberHT_LTF 0x300
  305. #define bTxHTCRC8 0x3fc00
  306. #define bCounterReset 0x10000
  307. #define bNumOfOFDMTx 0xffff
  308. #define bNumOfCCKTx 0xffff0000
  309. #define bTxIdleInterval 0xffff
  310. #define bOFDMService 0xffff0000
  311. #define bTxMACHeader 0xffffffff
  312. #define bTxDataInit 0xff
  313. #define bTxHTMode 0x100
  314. #define bTxDataType 0x30000
  315. #define bTxRandomSeed 0xffffffff
  316. #define bCCKTxPreamble 0x1
  317. #define bCCKTxSFD 0xffff0000
  318. #define bCCKTxSIG 0xff
  319. #define bCCKTxService 0xff00
  320. #define bCCKLengthExt 0x8000
  321. #define bCCKTxLength 0xffff0000
  322. #define bCCKTxCRC16 0xffff
  323. #define bCCKTxStatus 0x1
  324. #define bOFDMTxStatus 0x2
  325. /*
  326. * 1. PMAC duplicate register due to connection: RF_Mode, TRxRN, NumOf L-STF
  327. * 1. Page1(0x100)
  328. * */
  329. #define rPMAC_Reset 0x100
  330. #define rPMAC_TxStart 0x104
  331. #define rPMAC_TxLegacySIG 0x108
  332. #define rPMAC_TxHTSIG1 0x10c
  333. #define rPMAC_TxHTSIG2 0x110
  334. #define rPMAC_PHYDebug 0x114
  335. #define rPMAC_TxPacketNum 0x118
  336. #define rPMAC_TxIdle 0x11c
  337. #define rPMAC_TxMACHeader0 0x120
  338. #define rPMAC_TxMACHeader1 0x124
  339. #define rPMAC_TxMACHeader2 0x128
  340. #define rPMAC_TxMACHeader3 0x12c
  341. #define rPMAC_TxMACHeader4 0x130
  342. #define rPMAC_TxMACHeader5 0x134
  343. #define rPMAC_TxDataType 0x138
  344. #define rPMAC_TxRandomSeed 0x13c
  345. #define rPMAC_CCKPLCPPreamble 0x140
  346. #define rPMAC_CCKPLCPHeader 0x144
  347. #define rPMAC_CCKCRC16 0x148
  348. #define rPMAC_OFDMRxCRC32OK 0x170
  349. #define rPMAC_OFDMRxCRC32Er 0x174
  350. #define rPMAC_OFDMRxParityEr 0x178
  351. #define rPMAC_OFDMRxCRC8Er 0x17c
  352. #define rPMAC_CCKCRxRC16Er 0x180
  353. #define rPMAC_CCKCRxRC32Er 0x184
  354. #define rPMAC_CCKCRxRC32OK 0x188
  355. #define rPMAC_TxStatus 0x18c
  356. /*
  357. * 3. Page8(0x800)
  358. * */
  359. #define rFPGA0_RFMOD 0x800 /* RF mode & CCK TxSC */ /* RF BW Setting?? */
  360. #define rFPGA0_TxInfo 0x804 /* Status report?? */
  361. #define rFPGA0_PSDFunction 0x808
  362. #define rFPGA0_TxGainStage 0x80c /* Set TX PWR init gain? */
  363. #define rFPGA0_XA_HSSIParameter1 0x820 /* RF 3 wire register */
  364. #define rFPGA0_XA_HSSIParameter2 0x824
  365. #define rFPGA0_XB_HSSIParameter1 0x828
  366. #define rFPGA0_XB_HSSIParameter2 0x82c
  367. #define rFPGA0_XAB_SwitchControl 0x858 /* RF Channel switch */
  368. #define rFPGA0_XCD_SwitchControl 0x85c
  369. #define rFPGA0_XAB_RFParameter 0x878 /* RF Parameter */
  370. #define rFPGA0_XCD_RFParameter 0x87c
  371. #define rFPGA0_AnalogParameter1 0x880 /* Crystal cap setting RF-R/W protection for parameter4?? */
  372. #define rFPGA0_AnalogParameter2 0x884
  373. #define rFPGA0_AnalogParameter3 0x888
  374. #define rFPGA0_AdDaClockEn 0x888 /* enable ad/da clock1 for dual-phy */
  375. #define rFPGA0_AnalogParameter4 0x88c
  376. #define rFPGA0_XB_LSSIReadBack 0x8a4
  377. #define rFPGA0_XCD_RFPara 0x8b4
  378. /*
  379. * 4. Page9(0x900)
  380. * */
  381. #define rFPGA1_RFMOD 0x900 /* RF mode & OFDM TxSC */ /* RF BW Setting?? */
  382. #define rFPGA1_TxBlock 0x904 /* Useless now */
  383. #define rFPGA1_DebugSelect 0x908 /* Useless now */
  384. #define rFPGA1_TxInfo 0x90c /* Useless now */ /* Status report?? */
  385. /*
  386. * PageA(0xA00)
  387. * */
  388. #define rCCK0_System 0xa00
  389. #define rCCK0_AFESetting 0xa04 /* Disable init gain now */ /* Select RX path by RSSI */
  390. #define rCCK0_DSPParameter2 0xa1c /* SQ threshold */
  391. #define rCCK0_TxFilter1 0xa20
  392. #define rCCK0_TxFilter2 0xa24
  393. #define rCCK0_DebugPort 0xa28 /* debug port and Tx filter3 */
  394. #define rCCK0_FalseAlarmReport 0xa2c /* 0xa2d useless now 0xa30-a4f channel report */
  395. /*
  396. * PageB(0xB00)
  397. * */
  398. #define rPdp_AntA 0xb00
  399. #define rPdp_AntA_4 0xb04
  400. #define rConfig_Pmpd_AntA 0xb28
  401. #define rConfig_AntA 0xb68
  402. #define rConfig_AntB 0xb6c
  403. #define rPdp_AntB 0xb70
  404. #define rPdp_AntB_4 0xb74
  405. #define rConfig_Pmpd_AntB 0xb98
  406. #define rAPK 0xbd8
  407. /*
  408. * 6. PageC(0xC00)
  409. * */
  410. #define rOFDM0_LSTF 0xc00
  411. #define rOFDM0_TRxPathEnable 0xc04
  412. #define rOFDM0_TRMuxPar 0xc08
  413. #define rOFDM0_TRSWIsolation 0xc0c
  414. #define rOFDM0_XARxAFE 0xc10 /* RxIQ DC offset, Rx digital filter, DC notch filter */
  415. #define rOFDM0_XARxIQImbalance 0xc14 /* RxIQ imblance matrix */
  416. #define rOFDM0_XBRxAFE 0xc18
  417. #define rOFDM0_XBRxIQImbalance 0xc1c
  418. #define rOFDM0_XCRxAFE 0xc20
  419. #define rOFDM0_XCRxIQImbalance 0xc24
  420. #define rOFDM0_XDRxAFE 0xc28
  421. #define rOFDM0_XDRxIQImbalance 0xc2c
  422. #define rOFDM0_RxDetector1 0xc30 /* PD, BW & SBD */ /* DM tune init gain */
  423. #define rOFDM0_RxDetector2 0xc34 /* SBD & Fame Sync. */
  424. #define rOFDM0_RxDetector3 0xc38 /* Frame Sync. */
  425. #define rOFDM0_RxDetector4 0xc3c /* PD, SBD, Frame Sync & Short-GI */
  426. #define rOFDM0_RxDSP 0xc40 /* Rx Sync Path */
  427. #define rOFDM0_CFOandDAGC 0xc44 /* CFO & DAGC */
  428. #define rOFDM0_CCADropThreshold 0xc48 /* CCA Drop threshold */
  429. #define rOFDM0_ECCAThreshold 0xc4c /* energy CCA */
  430. #define rOFDM0_XAAGCCore1 0xc50 /* DIG */
  431. #define rOFDM0_XAAGCCore2 0xc54
  432. #define rOFDM0_XBAGCCore1 0xc58
  433. #define rOFDM0_XBAGCCore2 0xc5c
  434. #define rOFDM0_XCAGCCore1 0xc60
  435. #define rOFDM0_XCAGCCore2 0xc64
  436. #define rOFDM0_XDAGCCore1 0xc68
  437. #define rOFDM0_XDAGCCore2 0xc6c
  438. #define rOFDM0_AGCParameter1 0xc70
  439. #define rOFDM0_AGCParameter2 0xc74
  440. #define rOFDM0_AGCRSSITable 0xc78
  441. #define rOFDM0_HTSTFAGC 0xc7c
  442. #define rOFDM0_XATxIQImbalance 0xc80 /* TX PWR TRACK and DIG */
  443. #define rOFDM0_XATxAFE 0xc84
  444. #define rOFDM0_XBTxIQImbalance 0xc88
  445. #define rOFDM0_XBTxAFE 0xc8c
  446. #define rOFDM0_XCTxIQImbalance 0xc90
  447. #define rOFDM0_XCTxAFE 0xc94
  448. #define rOFDM0_XDTxIQImbalance 0xc98
  449. #define rOFDM0_XDTxAFE 0xc9c
  450. #define rOFDM0_RxIQExtAnta 0xca0
  451. #define rOFDM0_TxCoeff1 0xca4
  452. #define rOFDM0_TxCoeff2 0xca8
  453. #define rOFDM0_TxCoeff3 0xcac
  454. #define rOFDM0_TxCoeff4 0xcb0
  455. #define rOFDM0_TxCoeff5 0xcb4
  456. #define rOFDM0_TxCoeff6 0xcb8
  457. #define rOFDM0_RxHPParameter 0xce0
  458. #define rOFDM0_TxPseudoNoiseWgt 0xce4
  459. #define rOFDM0_FrameSync 0xcf0
  460. #define rOFDM0_DFSReport 0xcf4
  461. /*
  462. * 7. PageD(0xD00)
  463. * */
  464. #define rOFDM1_LSTF 0xd00
  465. #define rOFDM1_TRxPathEnable 0xd04
  466. /*
  467. * 8. PageE(0xE00)
  468. * */
  469. #define rTxAGC_A_Rate18_06 0xe00
  470. #define rTxAGC_A_Rate54_24 0xe04
  471. #define rTxAGC_A_CCK1_Mcs32 0xe08
  472. #define rTxAGC_A_Mcs03_Mcs00 0xe10
  473. #define rTxAGC_A_Mcs07_Mcs04 0xe14
  474. #define rTxAGC_A_Mcs11_Mcs08 0xe18
  475. #define rTxAGC_A_Mcs15_Mcs12 0xe1c
  476. #define rTxAGC_B_Rate18_06 0x830
  477. #define rTxAGC_B_Rate54_24 0x834
  478. #define rTxAGC_B_CCK1_55_Mcs32 0x838
  479. #define rTxAGC_B_Mcs03_Mcs00 0x83c
  480. #define rTxAGC_B_Mcs07_Mcs04 0x848
  481. #define rTxAGC_B_Mcs11_Mcs08 0x84c
  482. #define rTxAGC_B_Mcs15_Mcs12 0x868
  483. #define rTxAGC_B_CCK11_A_CCK2_11 0x86c
  484. #define rFPGA0_IQK 0xe28
  485. #define rTx_IQK_Tone_A 0xe30
  486. #define rRx_IQK_Tone_A 0xe34
  487. #define rTx_IQK_PI_A 0xe38
  488. #define rRx_IQK_PI_A 0xe3c
  489. #define rTx_IQK 0xe40
  490. #define rRx_IQK 0xe44
  491. #define rIQK_AGC_Pts 0xe48
  492. #define rIQK_AGC_Rsp 0xe4c
  493. #define rTx_IQK_Tone_B 0xe50
  494. #define rRx_IQK_Tone_B 0xe54
  495. #define rTx_IQK_PI_B 0xe58
  496. #define rRx_IQK_PI_B 0xe5c
  497. #define rIQK_AGC_Cont 0xe60
  498. #define rBlue_Tooth 0xe6c
  499. #define rRx_Wait_CCA 0xe70
  500. #define rTx_CCK_RFON 0xe74
  501. #define rTx_CCK_BBON 0xe78
  502. #define rTx_OFDM_RFON 0xe7c
  503. #define rTx_OFDM_BBON 0xe80
  504. #define rTx_To_Rx 0xe84
  505. #define rTx_To_Tx 0xe88
  506. #define rRx_CCK 0xe8c
  507. #define rTx_Power_Before_IQK_A 0xe94
  508. #define rTx_Power_After_IQK_A 0xe9c
  509. #define rRx_Power_Before_IQK_A 0xea0
  510. #define rRx_Power_Before_IQK_A_2 0xea4
  511. #define rRx_Power_After_IQK_A 0xea8
  512. #define rRx_Power_After_IQK_A_2 0xeac
  513. #define rTx_Power_Before_IQK_B 0xeb4
  514. #define rTx_Power_After_IQK_B 0xebc
  515. #define rRx_Power_Before_IQK_B 0xec0
  516. #define rRx_Power_Before_IQK_B_2 0xec4
  517. #define rRx_Power_After_IQK_B 0xec8
  518. #define rRx_Power_After_IQK_B_2 0xecc
  519. #define rRx_OFDM 0xed0
  520. #define rRx_Wait_RIFS 0xed4
  521. #define rRx_TO_Rx 0xed8
  522. #define rStandby 0xedc
  523. #define rSleep 0xee0
  524. #define rPMPD_ANAEN 0xeec
  525. /* 2. Page8(0x800) */
  526. #define bRFMOD 0x1 /* Reg 0x800 rFPGA0_RFMOD */
  527. #define bJapanMode 0x2
  528. #define bCCKTxSC 0x30
  529. #define bCCKEn 0x1000000
  530. #define bOFDMEn 0x2000000
  531. #define bXBTxAGC 0xf00 /* Reg 80c rFPGA0_TxGainStage */
  532. #define bXCTxAGC 0xf000
  533. #define bXDTxAGC 0xf0000
  534. /* 4. PageA(0xA00) */
  535. #define bCCKBBMode 0x3 /* Useless */
  536. #define bCCKTxPowerSaving 0x80
  537. #define bCCKRxPowerSaving 0x40
  538. #define bCCKSideBand 0x10 /* Reg 0xa00 rCCK0_System 20/40 switch */
  539. #define bCCKScramble 0x8 /* Useless */
  540. #define bCCKAntDiversity 0x8000
  541. #define bCCKCarrierRecovery 0x4000
  542. #define bCCKTxRate 0x3000
  543. #define bCCKDCCancel 0x0800
  544. #define bCCKISICancel 0x0400
  545. #define bCCKMatchFilter 0x0200
  546. #define bCCKEqualizer 0x0100
  547. #define bCCKPreambleDetect 0x800000
  548. #define bCCKFastFalseCCA 0x400000
  549. #define bCCKChEstStart 0x300000
  550. #define bCCKCCACount 0x080000
  551. #define bCCKcs_lim 0x070000
  552. #define bCCKBistMode 0x80000000
  553. #define bCCKCCAMask 0x40000000
  554. #define bCCKTxDACPhase 0x4
  555. #define bCCKRxADCPhase 0x20000000 /* r_rx_clk */
  556. #define bCCKr_cp_mode0 0x0100
  557. #define bCCKTxDCOffset 0xf0
  558. #define bCCKRxDCOffset 0xf
  559. #define bCCKCCAMode 0xc000
  560. #define bCCKFalseCS_lim 0x3f00
  561. #define bCCKCS_ratio 0xc00000
  562. #define bCCKCorgBit_sel 0x300000
  563. #define bCCKPD_lim 0x0f0000
  564. #define bCCKNewCCA 0x80000000
  565. #define bCCKRxHPofIG 0x8000
  566. #define bCCKRxIG 0x7f00
  567. #define bCCKLNAPolarity 0x800000
  568. #define bCCKRx1stGain 0x7f0000
  569. #define bCCKRFExtend 0x20000000 /* CCK Rx Iinital gain polarity */
  570. #define bCCKRxAGCSatLevel 0x1f000000
  571. #define bCCKRxAGCSatCount 0xe0
  572. #define bCCKRxRFSettle 0x1f /* AGCsamp_dly */
  573. #define bCCKFixedRxAGC 0x8000
  574. /* #define bCCKRxAGCFormat 0x4000 */ /* remove to HSSI register 0x824 */
  575. #define bCCKAntennaPolarity 0x2000
  576. #define bCCKTxFilterType 0x0c00
  577. #define bCCKRxAGCReportType 0x0300
  578. #define bCCKRxDAGCEn 0x80000000
  579. #define bCCKRxDAGCPeriod 0x20000000
  580. #define bCCKRxDAGCSatLevel 0x1f000000
  581. #define bCCKTimingRecovery 0x800000
  582. #define bCCKTxC0 0x3f0000
  583. #define bCCKTxC1 0x3f000000
  584. #define bCCKTxC2 0x3f
  585. #define bCCKTxC3 0x3f00
  586. #define bCCKTxC4 0x3f0000
  587. #define bCCKTxC5 0x3f000000
  588. #define bCCKTxC6 0x3f
  589. #define bCCKTxC7 0x3f00
  590. #define bCCKDebugPort 0xff0000
  591. #define bCCKDACDebug 0x0f000000
  592. #define bCCKFalseAlarmEnable 0x8000
  593. #define bCCKFalseAlarmRead 0x4000
  594. #define bCCKTRSSI 0x7f
  595. #define bCCKRxAGCReport 0xfe
  596. #define bCCKRxReport_AntSel 0x80000000
  597. #define bCCKRxReport_MFOff 0x40000000
  598. #define bCCKRxRxReport_SQLoss 0x20000000
  599. #define bCCKRxReport_Pktloss 0x10000000
  600. #define bCCKRxReport_Lockedbit 0x08000000
  601. #define bCCKRxReport_RateError 0x04000000
  602. #define bCCKRxReport_RxRate 0x03000000
  603. #define bCCKRxFACounterLower 0xff
  604. #define bCCKRxFACounterUpper 0xff000000
  605. #define bCCKRxHPAGCStart 0xe000
  606. #define bCCKRxHPAGCFinal 0x1c00
  607. #define bCCKRxFalseAlarmEnable 0x8000
  608. #define bCCKFACounterFreeze 0x4000
  609. #define bCCKTxPathSel 0x10000000
  610. #define bCCKDefaultRxPath 0xc000000
  611. #define bCCKOptionRxPath 0x3000000
  612. /* 6. PageE(0xE00) */
  613. #define bSTBCEn 0x4 /* Useless */
  614. #define bAntennaMapping 0x10
  615. #define bNss 0x20
  616. #define bCFOAntSumD 0x200
  617. #define bPHYCounterReset 0x8000000
  618. #define bCFOReportGet 0x4000000
  619. #define bOFDMContinueTx 0x10000000
  620. #define bOFDMSingleCarrier 0x20000000
  621. #define bOFDMSingleTone 0x40000000
  622. /*
  623. * Other Definition
  624. * */
  625. #define bEnable 0x1 /* Useless */
  626. #define bDisable 0x0
  627. /* byte endable for srwrite */
  628. #define bByte0 0x1 /* Useless */
  629. #define bByte1 0x2
  630. #define bByte2 0x4
  631. #define bByte3 0x8
  632. #define bWord0 0x3
  633. #define bWord1 0xc
  634. #define bDWord 0xf
  635. /* for PutRegsetting & GetRegSetting BitMask */
  636. #define bMaskByte0 0xff /* Reg 0xc50 rOFDM0_XAAGCCore~0xC6f */
  637. #define bMaskByte1 0xff00
  638. #define bMaskByte2 0xff0000
  639. #define bMaskByte3 0xff000000
  640. #define bMaskHWord 0xffff0000
  641. #define bMaskLWord 0x0000ffff
  642. #define bMaskDWord 0xffffffff
  643. #define bMaskH3Bytes 0xffffff00
  644. #define bMask12Bits 0xfff
  645. #define bMaskH4Bits 0xf0000000
  646. #define bMaskOFDM_D 0xffc00000
  647. #define bMaskCCK 0x3f3f3f3f
  648. /*--------------------------Define Parameters-------------------------------*/
  649. #endif