Hal8812PhyReg.h 24 KB

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