rtl8192e_spec.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  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. #ifndef __RTL8192E_SPEC_H__
  20. #define __RTL8192E_SPEC_H__
  21. #include <drv_conf.h>
  22. #define HAL_NAV_UPPER_UNIT_8192E 128 /* micro-second */
  23. /* ************************************************************
  24. * 8192E Regsiter offset definition
  25. * ************************************************************ */
  26. /* ************************************************************
  27. *
  28. * ************************************************************ */
  29. /* -----------------------------------------------------
  30. *
  31. * 0x0000h ~ 0x00FFh System Configuration
  32. *
  33. * ----------------------------------------------------- */
  34. #define REG_SYS_SWR_CTRL1_8192E 0x0010 /* 1 Byte */
  35. #define REG_SYS_SWR_CTRL2_8192E 0x0014 /* 1 Byte */
  36. #define REG_AFE_CTRL1_8192E 0x0024
  37. #define REG_AFE_CTRL2_8192E 0x0028
  38. #define REG_AFE_CTRL3_8192E 0x002c
  39. #define REG_PAD_CTRL1_8192E 0x0064
  40. #define REG_SDIO_CTRL_8192E 0x0070
  41. #define REG_OPT_CTRL_8192E 0x0074
  42. #define REG_RF_B_CTRL_8192E 0x0076
  43. #define REG_AFE_CTRL4_8192E 0x0078
  44. #define REG_LDO_SWR_CTRL 0x007C
  45. #define REG_FW_DRV_MSG_8192E 0x0088
  46. #define REG_HMEBOX_E2_E3_8192E 0x008C
  47. #define REG_HIMR0_8192E 0x00B0
  48. #define REG_HISR0_8192E 0x00B4
  49. #define REG_HIMR1_8192E 0x00B8
  50. #define REG_HISR1_8192E 0x00BC
  51. #define REG_SYS_CFG1_8192E 0x00F0
  52. #define REG_SYS_CFG2_8192E 0x00FC
  53. /* -----------------------------------------------------
  54. *
  55. * 0x0100h ~ 0x01FFh MACTOP General Configuration
  56. *
  57. * ----------------------------------------------------- */
  58. #define REG_PKTBUF_DBG_ADDR (REG_PKTBUF_DBG_CTRL)
  59. #define REG_RXPKTBUF_DBG (REG_PKTBUF_DBG_CTRL+2)
  60. #define REG_TXPKTBUF_DBG (REG_PKTBUF_DBG_CTRL+3)
  61. #define REG_WOWLAN_WAKE_REASON REG_MCUTST_WOWLAN
  62. #define REG_RSVD3_8192E 0x0168
  63. #define REG_C2HEVT_CMD_SEQ_88XX 0x01A1
  64. #define REG_C2hEVT_CMD_CONTENT_88XX 0x01A2
  65. #define REG_C2HEVT_CMD_LEN_88XX 0x01AE
  66. #define REG_HMEBOX_EXT0_8192E 0x01F0
  67. #define REG_HMEBOX_EXT1_8192E 0x01F4
  68. #define REG_HMEBOX_EXT2_8192E 0x01F8
  69. #define REG_HMEBOX_EXT3_8192E 0x01FC
  70. /* -----------------------------------------------------
  71. *
  72. * 0x0200h ~ 0x027Fh TXDMA Configuration
  73. *
  74. * ----------------------------------------------------- */
  75. #define REG_DWBCN0_CTRL 0x0208
  76. #define REG_DWBCN1_CTRL 0x0228
  77. /* -----------------------------------------------------
  78. *
  79. * 0x0280h ~ 0x02FFh RXDMA Configuration
  80. *
  81. * ----------------------------------------------------- */
  82. #define REG_RXDMA_8192E 0x0290
  83. #define REG_EARLY_MODE_CONTROL_8192E 0x02BC
  84. #define REG_RSVD5_8192E 0x02F0
  85. #define REG_RSVD6_8192E 0x02F4
  86. #define REG_RSVD7_8192E 0x02F8
  87. #define REG_RSVD8_8192E 0x02FC
  88. /* -----------------------------------------------------
  89. *
  90. * 0x0300h ~ 0x03FFh PCIe
  91. *
  92. * ----------------------------------------------------- */
  93. #define REG_PCIE_CTRL_REG_8192E 0x0300
  94. #define REG_INT_MIG_8192E 0x0304 /* Interrupt Migration */
  95. #define REG_BCNQ_TXBD_DESA_8192E 0x0308 /* TX Beacon Descriptor Address */
  96. #define REG_MGQ_TXBD_DESA_8192E 0x0310 /* TX Manage Queue Descriptor Address */
  97. #define REG_VOQ_TXBD_DESA_8192E 0x0318 /* TX VO Queue Descriptor Address */
  98. #define REG_VIQ_TXBD_DESA_8192E 0x0320 /* TX VI Queue Descriptor Address */
  99. #define REG_BEQ_TXBD_DESA_8192E 0x0328 /* TX BE Queue Descriptor Address */
  100. #define REG_BKQ_TXBD_DESA_8192E 0x0330 /* TX BK Queue Descriptor Address */
  101. #define REG_RXQ_RXBD_DESA_8192E 0x0338 /* RX Queue Descriptor Address */
  102. #define REG_HI0Q_TXBD_DESA_8192E 0x0340
  103. #define REG_HI1Q_TXBD_DESA_8192E 0x0348
  104. #define REG_HI2Q_TXBD_DESA_8192E 0x0350
  105. #define REG_HI3Q_TXBD_DESA_8192E 0x0358
  106. #define REG_HI4Q_TXBD_DESA_8192E 0x0360
  107. #define REG_HI5Q_TXBD_DESA_8192E 0x0368
  108. #define REG_HI6Q_TXBD_DESA_8192E 0x0370
  109. #define REG_HI7Q_TXBD_DESA_8192E 0x0378
  110. #define REG_MGQ_TXBD_NUM_8192E 0x0380
  111. #define REG_RX_RXBD_NUM_8192E 0x0382
  112. #define REG_VOQ_TXBD_NUM_8192E 0x0384
  113. #define REG_VIQ_TXBD_NUM_8192E 0x0386
  114. #define REG_BEQ_TXBD_NUM_8192E 0x0388
  115. #define REG_BKQ_TXBD_NUM_8192E 0x038A
  116. #define REG_HI0Q_TXBD_NUM_8192E 0x038C
  117. #define REG_HI1Q_TXBD_NUM_8192E 0x038E
  118. #define REG_HI2Q_TXBD_NUM_8192E 0x0390
  119. #define REG_HI3Q_TXBD_NUM_8192E 0x0392
  120. #define REG_HI4Q_TXBD_NUM_8192E 0x0394
  121. #define REG_HI5Q_TXBD_NUM_8192E 0x0396
  122. #define REG_HI6Q_TXBD_NUM_8192E 0x0398
  123. #define REG_HI7Q_TXBD_NUM_8192E 0x039A
  124. #define REG_TSFTIMER_HCI_8192E 0x039C
  125. /* Read Write Point */
  126. #define REG_VOQ_TXBD_IDX_8192E 0x03A0
  127. #define REG_VIQ_TXBD_IDX_8192E 0x03A4
  128. #define REG_BEQ_TXBD_IDX_8192E 0x03A8
  129. #define REG_BKQ_TXBD_IDX_8192E 0x03AC
  130. #define REG_MGQ_TXBD_IDX_8192E 0x03B0
  131. #define REG_RXQ_TXBD_IDX_8192E 0x03B4
  132. #define REG_HI0Q_TXBD_IDX_8192E 0x03B8
  133. #define REG_HI1Q_TXBD_IDX_8192E 0x03BC
  134. #define REG_HI2Q_TXBD_IDX_8192E 0x03C0
  135. #define REG_HI3Q_TXBD_IDX_8192E 0x03C4
  136. #define REG_HI4Q_TXBD_IDX_8192E 0x03C8
  137. #define REG_HI5Q_TXBD_IDX_8192E 0x03CC
  138. #define REG_HI6Q_TXBD_IDX_8192E 0x03D0
  139. #define REG_HI7Q_TXBD_IDX_8192E 0x03D4
  140. #define REG_PCIE_HCPWM_8192EE 0x03D8 /* ?????? */
  141. #define REG_PCIE_HRPWM_8192EE 0x03DC /* PCIe RPWM */ /* ?????? */
  142. #define REG_DBI_WDATA_V1_8192E 0x03E8
  143. #define REG_DBI_RDATA_V1_8192E 0x03EC
  144. #define REG_DBI_FLAG_V1_8192E 0x03F0
  145. #define REG_MDIO_V1_8192E 0x3F4
  146. #define REG_PCIE_MIX_CFG_8192E 0x3F8
  147. /* -----------------------------------------------------
  148. *
  149. * 0x0400h ~ 0x047Fh Protocol Configuration
  150. *
  151. * ----------------------------------------------------- */
  152. #define REG_TXBF_CTRL_8192E 0x042C
  153. #define REG_ARFR0_8192E 0x0444
  154. #define REG_ARFR1_8192E 0x044C
  155. #define REG_CCK_CHECK_8192E 0x0454
  156. #define REG_AMPDU_MAX_TIME_8192E 0x0456
  157. #define REG_BCNQ1_BDNY_8192E 0x0457
  158. #define REG_AMPDU_MAX_LENGTH_8192E 0x0458
  159. #define REG_WMAC_LBK_BUF_HD_8192E 0x045D
  160. #define REG_NDPA_OPT_CTRL_8192E 0x045F
  161. #define REG_DATA_SC_8192E 0x0483
  162. #ifdef CONFIG_WOWLAN
  163. #define REG_TXPKTBUF_IV_LOW 0x0484
  164. #define REG_TXPKTBUF_IV_HIGH 0x0488
  165. #endif
  166. #define REG_ARFR2_8192E 0x048C
  167. #define REG_ARFR3_8192E 0x0494
  168. #define REG_TXRPT_START_OFFSET 0x04AC
  169. #define REG_AMPDU_BURST_MODE_8192E 0x04BC
  170. #define REG_HT_SINGLE_AMPDU_8192E 0x04C7
  171. #define REG_MACID_PKT_DROP0_8192E 0x04D0
  172. /* -----------------------------------------------------
  173. *
  174. * 0x0500h ~ 0x05FFh EDCA Configuration
  175. *
  176. * ----------------------------------------------------- */
  177. #define REG_CTWND_8192E 0x0572
  178. #define REG_SECONDARY_CCA_CTRL_8192E 0x0577
  179. #define REG_SCH_TXCMD_8192E 0x05F8
  180. /* -----------------------------------------------------
  181. *
  182. * 0x0600h ~ 0x07FFh WMAC Configuration
  183. *
  184. * ----------------------------------------------------- */
  185. #define REG_MAC_CR_8192E 0x0600
  186. #define REG_MAC_TX_SM_STATE_8192E 0x06B4
  187. /* Power */
  188. #define REG_BFMER0_INFO_8192E 0x06E4
  189. #define REG_BFMER1_INFO_8192E 0x06EC
  190. #define REG_CSI_RPT_PARAM_BW20_8192E 0x06F4
  191. #define REG_CSI_RPT_PARAM_BW40_8192E 0x06F8
  192. #define REG_CSI_RPT_PARAM_BW80_8192E 0x06FC
  193. /* Hardware Port 2 */
  194. #define REG_BFMEE_SEL_8192E 0x0714
  195. #define REG_SND_PTCL_CTRL_8192E 0x0718
  196. /* -----------------------------------------------------
  197. *
  198. * Redifine register definition for compatibility
  199. *
  200. * ----------------------------------------------------- */
  201. /* TODO: use these definition when using REG_xxx naming rule.
  202. * NOTE: DO NOT Remove these definition. Use later. */
  203. #define ISR_8192E REG_HISR0_8192E
  204. /* ----------------------------------------------------------------------------
  205. * 8192E IMR/ISR bits (offset 0xB0, 8bits)
  206. * ---------------------------------------------------------------------------- */
  207. #define IMR_DISABLED_8192E 0
  208. /* IMR DW0(0x00B0-00B3) Bit 0-31 */
  209. #define IMR_TIMER2_8192E BIT(31) /* Timeout interrupt 2 */
  210. #define IMR_TIMER1_8192E BIT(30) /* Timeout interrupt 1 */
  211. #define IMR_PSTIMEOUT_8192E BIT(29) /* Power Save Time Out Interrupt */
  212. #define IMR_GTINT4_8192E BIT(28) /* When GTIMER4 expires, this bit is set to 1 */
  213. #define IMR_GTINT3_8192E BIT(27) /* When GTIMER3 expires, this bit is set to 1 */
  214. #define IMR_TXBCN0ERR_8192E BIT(26) /* Transmit Beacon0 Error */
  215. #define IMR_TXBCN0OK_8192E BIT(25) /* Transmit Beacon0 OK */
  216. #define IMR_TSF_BIT32_TOGGLE_8192E BIT(24) /* TSF Timer BIT(32) toggle indication interrupt */
  217. #define IMR_BCNDMAINT0_8192E BIT(20) /* Beacon DMA Interrupt 0 */
  218. #define IMR_BCNDERR0_8192E BIT(16) /* Beacon Queue DMA OK0 */
  219. #define IMR_HSISR_IND_ON_INT_8192E BIT(15) /* HSISR Indicator (HSIMR & HSISR is true, this bit is set to 1) */
  220. #define IMR_BCNDMAINT_E_8192E BIT(14) /* Beacon DMA Interrupt Extension for Win7 */
  221. #define IMR_ATIMEND_8192E BIT(12) /* CTWidnow End or ATIM Window End */
  222. #define IMR_C2HCMD_8192E BIT(10) /* CPU to Host Command INT Status, Write 1 clear */
  223. #define IMR_CPWM2_8192E BIT(9) /* CPU power Mode exchange INT Status, Write 1 clear */
  224. #define IMR_CPWM_8192E BIT(8) /* CPU power Mode exchange INT Status, Write 1 clear */
  225. #define IMR_HIGHDOK_8192E BIT(7) /* High Queue DMA OK */
  226. #define IMR_MGNTDOK_8192E BIT(6) /* Management Queue DMA OK */
  227. #define IMR_BKDOK_8192E BIT(5) /* AC_BK DMA OK */
  228. #define IMR_BEDOK_8192E BIT(4) /* AC_BE DMA OK */
  229. #define IMR_VIDOK_8192E BIT(3) /* AC_VI DMA OK */
  230. #define IMR_VODOK_8192E BIT(2) /* AC_VO DMA OK */
  231. #define IMR_RDU_8192E BIT(1) /* Rx Descriptor Unavailable */
  232. #define IMR_ROK_8192E BIT(0) /* Receive DMA OK */
  233. /* IMR DW1(0x00B4-00B7) Bit 0-31 */
  234. #define IMR_BCNDMAINT7_8192E BIT(27) /* Beacon DMA Interrupt 7 */
  235. #define IMR_BCNDMAINT6_8192E BIT(26) /* Beacon DMA Interrupt 6 */
  236. #define IMR_BCNDMAINT5_8192E BIT(25) /* Beacon DMA Interrupt 5 */
  237. #define IMR_BCNDMAINT4_8192E BIT(24) /* Beacon DMA Interrupt 4 */
  238. #define IMR_BCNDMAINT3_8192E BIT(23) /* Beacon DMA Interrupt 3 */
  239. #define IMR_BCNDMAINT2_8192E BIT(22) /* Beacon DMA Interrupt 2 */
  240. #define IMR_BCNDMAINT1_8192E BIT(21) /* Beacon DMA Interrupt 1 */
  241. #define IMR_BCNDOK7_8192E BIT(20) /* Beacon Queue DMA OK Interrupt 7 */
  242. #define IMR_BCNDOK6_8192E BIT(19) /* Beacon Queue DMA OK Interrupt 6 */
  243. #define IMR_BCNDOK5_8192E BIT(18) /* Beacon Queue DMA OK Interrupt 5 */
  244. #define IMR_BCNDOK4_8192E BIT(17) /* Beacon Queue DMA OK Interrupt 4 */
  245. #define IMR_BCNDOK3_8192E BIT(16) /* Beacon Queue DMA OK Interrupt 3 */
  246. #define IMR_BCNDOK2_8192E BIT(15) /* Beacon Queue DMA OK Interrupt 2 */
  247. #define IMR_BCNDOK1_8192E BIT(14) /* Beacon Queue DMA OK Interrupt 1 */
  248. #define IMR_ATIMEND_E_8192E BIT(13) /* ATIM Window End Extension for Win7 */
  249. #define IMR_TXERR_8192E BIT(11) /* Tx Error Flag Interrupt Status, write 1 clear. */
  250. #define IMR_RXERR_8192E BIT(10) /* Rx Error Flag INT Status, Write 1 clear */
  251. #define IMR_TXFOVW_8192E BIT(9) /* Transmit FIFO Overflow */
  252. #define IMR_RXFOVW_8192E BIT(8) /* Receive FIFO Overflow */
  253. /* ----------------------------------------------------------------------------
  254. * 8192E Auto LLT bits (offset 0x224, 8bits)
  255. * ----------------------------------------------------------------------------
  256. * 224 REG_AUTO_LLT
  257. * move to hal_com_reg.h */
  258. /* ----------------------------------------------------------------------------
  259. * 8192E Auto LLT bits (offset 0x290, 32bits)
  260. * ---------------------------------------------------------------------------- */
  261. #define BIT_DMA_MODE BIT(1)
  262. #define BIT_USB_RXDMA_AGG_EN BIT(31)
  263. /* ----------------------------------------------------------------------------
  264. * 8192E REG_SYS_CFG1 (offset 0xF0, 32bits)
  265. * ---------------------------------------------------------------------------- */
  266. #define BIT_SPSLDO_SEL BIT(24)
  267. /* ----------------------------------------------------------------------------
  268. * 8192E REG_CCK_CHECK (offset 0x454, 8bits)
  269. * ---------------------------------------------------------------------------- */
  270. #define BIT_BCN_PORT_SEL BIT(5)
  271. /* ****************************************************************************
  272. * Regsiter Bit and Content definition
  273. * **************************************************************************** */
  274. /* 2 ACMHWCTRL 0x05C0 */
  275. #define AcmHw_HwEn_8192E BIT(0)
  276. #define AcmHw_VoqEn_8192E BIT(1)
  277. #define AcmHw_ViqEn_8192E BIT(2)
  278. #define AcmHw_BeqEn_8192E BIT(3)
  279. #define AcmHw_VoqStatus_8192E BIT(5)
  280. #define AcmHw_ViqStatus_8192E BIT(6)
  281. #define AcmHw_BeqStatus_8192E BIT(7)
  282. #endif /* __RTL8192E_SPEC_H__ */