Hal8812PhyReg.h 25 KB

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