mt6630_reg.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. /*
  2. ** Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/mt6630_reg.h#1
  3. */
  4. /*! \file "mt6630_reg.h"
  5. \brief The common register definition of MT6630
  6. N/A
  7. */
  8. /*
  9. ** Log: mt6630_reg.h
  10. **
  11. ** 07 23 2013 cp.wu
  12. ** [BORA00002227] [MT6630 Wi-Fi][Driver] Update for Makefile and HIFSYS modifications
  13. ** 1. build success for win32 port
  14. ** 2. add SDIO test read/write pattern for HQA tests (default off)
  15. **
  16. ** 03 18 2013 cp.wu
  17. ** [BORA00002227] [MT6630 Wi-Fi][Driver] Update for Makefile and HIFSYS modifications
  18. ** use RX default maximum length to 16 (max. 64)
  19. **
  20. ** 10 25 2012 cp.wu
  21. ** [BORA00002227] [MT6630 Wi-Fi][Driver] Update for Makefile and HIFSYS modifications
  22. ** sync with MT6630 HIFSYS update.
  23. **
  24. *
  25. */
  26. #ifndef _MT6630_REG_H
  27. #define _MT6630_REG_H
  28. /*******************************************************************************
  29. * C O M P I L E R F L A G S
  30. ********************************************************************************
  31. */
  32. /*******************************************************************************
  33. * E X T E R N A L R E F E R E N C E S
  34. ********************************************************************************
  35. */
  36. /*******************************************************************************
  37. * C O N S T A N T S
  38. ********************************************************************************
  39. */
  40. /*******************************************************************************
  41. * D A T A T Y P E S
  42. ********************************************************************************
  43. */
  44. /*******************************************************************************
  45. * P U B L I C D A T A
  46. ********************************************************************************
  47. */
  48. /*******************************************************************************
  49. * P R I V A T E D A T A
  50. ********************************************************************************
  51. */
  52. /*******************************************************************************
  53. * M A C R O S
  54. ********************************************************************************
  55. */
  56. /*******************************************************************************
  57. * F U N C T I O N D E C L A R A T I O N S
  58. ********************************************************************************
  59. */
  60. /*******************************************************************************
  61. * F U N C T I O N S
  62. ********************************************************************************
  63. */
  64. /* 1 MT6630 MCR Definition */
  65. /* 2 Host Interface */
  66. /* 4 CHIP ID Register */
  67. #define MCR_WCIR 0x0000
  68. /* 4 HIF Low Power Control Register */
  69. #define MCR_WHLPCR 0x0004
  70. /* 4 Control Status Register */
  71. #define MCR_WSDIOCSR 0x0008
  72. /* 4 HIF Control Register */
  73. #define MCR_WHCR 0x000C
  74. /* 4 HIF Interrupt Status Register */
  75. #define MCR_WHISR 0x0010
  76. /* 4 HIF Interrupt Enable Register */
  77. #define MCR_WHIER 0x0014
  78. /* 4 Abnormal Status Register */
  79. #define MCR_WASR 0x0020
  80. /* 4 WLAN Software Interrupt Control Register */
  81. #define MCR_WSICR 0x0024
  82. /* 4 WLAN TX Data Register 1 */
  83. #define MCR_WTDR1 0x0034
  84. /* 4 WLAN RX Data Register 0 */
  85. #define MCR_WRDR0 0x0050
  86. /* 4 WLAN RX Data Register 1 */
  87. #define MCR_WRDR1 0x0054
  88. /* 4 Host to Device Send Mailbox 0 Register */
  89. #define MCR_H2DSM0R 0x0070
  90. /* 4 Host to Device Send Mailbox 1 Register */
  91. #define MCR_H2DSM1R 0x0074
  92. /* 4 Device to Host Receive Mailbox 0 Register */
  93. #define MCR_D2HRM0R 0x0078
  94. /* 4 Device to Host Receive Mailbox 1 Register */
  95. #define MCR_D2HRM1R 0x007c
  96. /* 4 WLAN RX Packet Length Register */
  97. #define MCR_WRPLR 0x0090
  98. /* 4 Test Mode Data Port */
  99. #define MCR_WTMDR 0x00b0
  100. /* 4 Test Mode Control Register */
  101. #define MCR_WTMCR 0x00b4
  102. /* 4 Test Mode Data Pattern Control Register #0 */
  103. #define MCR_WTMDPCR0 0x00b8
  104. /* 4 Test Mode Data Pattern Control Register #1 */
  105. #define MCR_WTMDPCR1 0x00bc
  106. /* 4 WLAN Packet Length Report Control Register */
  107. #define MCR_WPLRCR 0x00d4
  108. /* 4 WLAN Snapshot Register */
  109. #define MCR_WSR 0x00D8
  110. /* 4 Clock Pad Macro IO Control Register */
  111. #define MCR_CLKIOCR 0x0100
  112. /* 4 Command Pad Macro IO Control Register */
  113. #define MCR_CMDIOCR 0x0104
  114. /* 4 Data 0 Pad Macro IO Control Register */
  115. #define MCR_DAT0IOCR 0x0108
  116. /* 4 Data 1 Pad Macro IO Control Register */
  117. #define MCR_DAT1IOCR 0x010C
  118. /* 4 Data 2 Pad Macro IO Control Register */
  119. #define MCR_DAT2IOCR 0x0110
  120. /* 4 Data 3 Pad Macro IO Control Register */
  121. #define MCR_DAT3IOCR 0x0114
  122. /* 4 Clock Pad Macro Delay Chain Control Register */
  123. #define MCR_CLKDLYCR 0x0118
  124. /* 4 Command Pad Macro Delay Chain Control Register */
  125. #define MCR_CMDDLYCR 0x011C
  126. /* 4 SDIO Output Data Delay Chain Control Register */
  127. #define MCR_ODATDLYCR 0x0120
  128. /* 4 SDIO Input Data Delay Chain Control Register 1 */
  129. #define MCR_IDATDLYCR1 0x0124
  130. /* 4 SDIO Input Data Delay Chain Control Register 2 */
  131. #define MCR_IDATDLYCR2 0x0128
  132. /* 4 SDIO Input Data Latch Time Control Register */
  133. #define MCR_ILCHCR 0x012C
  134. /* 4 WLAN TXQ Count Register 0 */
  135. #define MCR_WTQCR0 0x0130
  136. /* 4 WLAN TXQ Count Register 1 */
  137. #define MCR_WTQCR1 0x0134
  138. /* 4 WLAN TXQ Count Register 2 */
  139. #define MCR_WTQCR2 0x0138
  140. /* 4 WLAN TXQ Count Register 3 */
  141. #define MCR_WTQCR3 0x013C
  142. /* 4 WLAN TXQ Count Register 4 */
  143. #define MCR_WTQCR4 0x0140
  144. /* 4 WLAN TXQ Count Register 5 */
  145. #define MCR_WTQCR5 0x0144
  146. /* 4 WLAN TXQ Count Register 6 */
  147. #define MCR_WTQCR6 0x0148
  148. /* 4 WLAN TXQ Count Register 7 */
  149. #define MCR_WTQCR7 0x014C
  150. /* #if CFG_SDIO_INTR_ENHANCE */
  151. typedef struct _ENHANCE_MODE_DATA_STRUCT_T {
  152. UINT_32 u4WHISR;
  153. union {
  154. struct {
  155. UINT_16 u2TQ0Cnt;
  156. UINT_16 u2TQ1Cnt;
  157. UINT_16 u2TQ2Cnt;
  158. UINT_16 u2TQ3Cnt;
  159. UINT_16 u2TQ4Cnt;
  160. UINT_16 u2TQ5Cnt;
  161. UINT_16 u2TQ6Cnt;
  162. UINT_16 u2TQ7Cnt;
  163. UINT_16 u2TQ8Cnt;
  164. UINT_16 u2TQ9Cnt;
  165. UINT_16 u2TQ10Cnt;
  166. UINT_16 u2TQ11Cnt;
  167. UINT_16 u2TQ12Cnt;
  168. UINT_16 u2TQ13Cnt;
  169. UINT_16 u2TQ14Cnt;
  170. UINT_16 u2TQ15Cnt;
  171. } u;
  172. UINT_32 au4WTSR[8];
  173. } rTxInfo;
  174. union {
  175. struct {
  176. UINT_16 u2NumValidRx0Len;
  177. UINT_16 u2NumValidRx1Len;
  178. UINT_16 au2Rx0Len[16];
  179. UINT_16 au2Rx1Len[16];
  180. } u;
  181. UINT_32 au4RxStatusRaw[17];
  182. } rRxInfo;
  183. UINT_32 u4RcvMailbox0;
  184. UINT_32 u4RcvMailbox1;
  185. } ENHANCE_MODE_DATA_STRUCT_T, *P_ENHANCE_MODE_DATA_STRUCT_T;
  186. /* #endif *//* ENHANCE_MODE_DATA_STRUCT_T */
  187. /* 2 Definition in each register */
  188. /* 3 WCIR 0x0000 */
  189. #define WCIR_WLAN_READY BIT(21)
  190. #define WCIR_POR_INDICATOR BIT(20)
  191. #define WCIR_REVISION_ID BITS(16, 19)
  192. #define WCIR_CHIP_ID BITS(0, 15)
  193. #define MTK_CHIP_REV 0x00006630
  194. #define MTK_CHIP_MP_REVERSION_ID 0x0
  195. /* 3 WHLPCR 0x0004 */
  196. #define WHLPCR_FW_OWN_REQ_CLR BIT(9)
  197. #define WHLPCR_FW_OWN_REQ_SET BIT(8)
  198. #define WHLPCR_IS_DRIVER_OWN BIT(8)
  199. #define WHLPCR_INT_EN_CLR BIT(1)
  200. #define WHLPCR_INT_EN_SET BIT(0)
  201. /* 3 WSDIOCSR 0x0008 */
  202. #define WSDIOCSR_DB_CMD7_RESELECT_DIS BIT(4)
  203. #define WSDIOCSR_DB_WR_BUSY_EN BIT(3)
  204. #define WSDIOCSR_DB_RD_BUSY_EN BIT(2)
  205. #define WSDIOCSR_SDIO_INT_CTL BIT(1)
  206. #define WSDIOCSR_SDIO_RE_INIT_EN BIT(0)
  207. /* 3 WHCR 0x000C */
  208. #define WHCR_RX_ENHANCE_MODE_EN BIT(16)
  209. #define WHCR_MAX_HIF_RX_LEN_NUM BITS(8, 13)
  210. #define WHCR_RPT_OWN_RX_PACKET_LEN BIT(3)
  211. #define WHCR_RECV_MAILBOX_RD_CLR_EN BIT(2)
  212. #define WHCR_W_INT_CLR_CTRL BIT(1)
  213. #define WHCR_MCU_DBG_EN BIT(0)
  214. #define WHCR_OFFSET_MAX_HIF_RX_LEN_NUM 8
  215. /* 3 WHISR 0x0010 */
  216. #define WHISR_D2H_SW_INT BITS(8, 31)
  217. #define WHISR_D2H_SW_ASSERT_INFO_INT BIT(31)
  218. #define WHISR_FW_OWN_BACK_INT BIT(7)
  219. #define WHISR_ABNORMAL_INT BIT(6)
  220. #define WHISR_RX1_DONE_INT BIT(2)
  221. #define WHISR_RX0_DONE_INT BIT(1)
  222. #define WHISR_TX_DONE_INT BIT(0)
  223. /* 3 WHIER 0x0014 */
  224. #define WHIER_D2H_SW_INT BITS(8, 31)
  225. #define WHIER_FW_OWN_BACK_INT_EN BIT(7)
  226. #define WHIER_ABNORMAL_INT_EN BIT(6)
  227. #define WHIER_RX1_DONE_INT_EN BIT(2)
  228. #define WHIER_RX0_DONE_INT_EN BIT(1)
  229. #define WHIER_TX_DONE_INT_EN BIT(0)
  230. #define WHIER_DEFAULT (WHIER_RX0_DONE_INT_EN | \
  231. WHIER_RX1_DONE_INT_EN | \
  232. WHIER_TX_DONE_INT_EN | \
  233. WHIER_ABNORMAL_INT_EN | \
  234. WHIER_D2H_SW_INT \
  235. )
  236. /* 3 WASR 0x0020 */
  237. #define WASR_FW_OWN_INVALID_ACCESS BIT(16)
  238. #define WASR_RX1_UNDER_FLOW BIT(9)
  239. #define WASR_RX0_UNDER_FLOW BIT(8)
  240. #define WASR_TX1_OVER_FLOW BIT(1)
  241. /* 3 WSICR 0x0024 */
  242. #define WSICR_H2D_SW_INT_SET BITS(16, 31)
  243. /* 3 WRPLR 0x0090 */
  244. #define WRPLR_RX1_PACKET_LENGTH BITS(16, 31)
  245. #define WRPLR_RX0_PACKET_LENGTH BITS(0, 15)
  246. /* 3 WTMCR 0x00b4 */
  247. #define WMTCR_TEST_MODE_FW_OWN BIT(24)
  248. #define WMTCR_PRBS_INIT_VAL BITS(16, 23)
  249. #define WMTCR_TEST_MODE_STATUS BIT(8)
  250. #define WMTCR_TEST_MODE_SELECT BITS(0, 1)
  251. #endif /* _MT6628_REG_H */