rtl8192e_spec.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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. //============================================================
  23. // 8192E Regsiter offset definition
  24. //============================================================
  25. //============================================================
  26. //
  27. //============================================================
  28. //-----------------------------------------------------
  29. //
  30. // 0x0000h ~ 0x00FFh System Configuration
  31. //
  32. //-----------------------------------------------------
  33. #define REG_AFE_CTRL1_8192E 0x0024
  34. #define REG_AFE_CTRL2_8192E 0x0028
  35. #define REG_AFE_CTRL3_8192E 0x002c
  36. #define REG_SDIO_CTRL_8192E 0x0070
  37. #define REG_OPT_CTRL_8192E 0x0074
  38. #define REG_RF_B_CTRL_8192E 0x0076
  39. #define REG_AFE_CTRL4_8192E 0x0078
  40. #define REG_LDO_SWR_CTRL 0x007C
  41. #define REG_FW_DRV_MSG_8192E 0x0088
  42. #define REG_HMEBOX_E2_E3_8192E 0x008C
  43. #define REG_HIMR0_8192E 0x00B0
  44. #define REG_HISR0_8192E 0x00B4
  45. #define REG_HIMR1_8192E 0x00B8
  46. #define REG_HISR1_8192E 0x00BC
  47. #define REG_SYS_CFG1_8192E 0x00F0
  48. #define REG_SYS_CFG2_8192E 0x00FC
  49. //-----------------------------------------------------
  50. //
  51. // 0x0100h ~ 0x01FFh MACTOP General Configuration
  52. //
  53. //-----------------------------------------------------
  54. #define REG_PKTBUF_DBG_ADDR (REG_PKTBUF_DBG_CTRL)
  55. #define REG_RXPKTBUF_DBG (REG_PKTBUF_DBG_CTRL+2)
  56. #define REG_TXPKTBUF_DBG (REG_PKTBUF_DBG_CTRL+3)
  57. #define REG_RSVD3_8192E 0x0168
  58. #define REG_C2HEVT_CMD_SEQ_88XX 0x01A1
  59. #define REG_C2hEVT_CMD_CONTENT_88XX 0x01A2
  60. #define REG_C2HEVT_CMD_LEN_88XX 0x01AE
  61. #define REG_HMEBOX_EXT0_8192E 0x01F0
  62. #define REG_HMEBOX_EXT1_8192E 0x01F4
  63. #define REG_HMEBOX_EXT2_8192E 0x01F8
  64. #define REG_HMEBOX_EXT3_8192E 0x01FC
  65. //-----------------------------------------------------
  66. //
  67. // 0x0200h ~ 0x027Fh TXDMA Configuration
  68. //
  69. //-----------------------------------------------------
  70. #define REG_DWBCN0_CTRL 0x0208
  71. #define REG_AUTO_LLT 0x0224
  72. #define REG_DWBCN1_CTRL 0x0228
  73. //-----------------------------------------------------
  74. //
  75. // 0x0280h ~ 0x02FFh RXDMA Configuration
  76. //
  77. //-----------------------------------------------------
  78. #define REG_RXDMA_8192E 0x0290
  79. #define REG_EARLY_MODE_CONTROL_8192E 0x02BC
  80. #define REG_RSVD5_8192E 0x02F0
  81. #define REG_RSVD6_8192E 0x02F4
  82. #define REG_RSVD7_8192E 0x02F8
  83. #define REG_RSVD8_8192E 0x02FC
  84. //-----------------------------------------------------
  85. //
  86. // 0x0300h ~ 0x03FFh PCIe
  87. //
  88. //-----------------------------------------------------
  89. #define REG_PCIE_MULTIFET_CTRL_8192E 0x036A //PCIE Multi-Fethc Control
  90. //-----------------------------------------------------
  91. //
  92. // 0x0400h ~ 0x047Fh Protocol Configuration
  93. //
  94. //-----------------------------------------------------
  95. #define REG_TXBF_CTRL_8192E 0x042C
  96. #define REG_ARFR1_8192E 0x044C
  97. #define REG_CCK_CHECK_8192E 0x0454
  98. #define REG_AMPDU_MAX_TIME_8192E 0x0456
  99. #define REG_BCNQ1_BDNY_8192E 0x0457
  100. #define REG_AMPDU_MAX_LENGTH_8192E 0x0458
  101. #define REG_NDPA_OPT_CTRL_8192E 0x045F
  102. #define REG_DATA_SC_8192E 0x0483
  103. #define REG_TXRPT_START_OFFSET 0x04AC
  104. #define REG_AMPDU_BURST_MODE_8192E 0x04BC
  105. #define REG_HT_SINGLE_AMPDU_8192E 0x04C7
  106. #define REG_MACID_PKT_DROP0_8192E 0x04D0
  107. //-----------------------------------------------------
  108. //
  109. // 0x0500h ~ 0x05FFh EDCA Configuration
  110. //
  111. //-----------------------------------------------------
  112. #define REG_CTWND_8192E 0x0572
  113. #define REG_SECONDARY_CCA_CTRL_8192E 0x0577
  114. #define REG_SCH_TXCMD_8192E 0x05F8
  115. //-----------------------------------------------------
  116. //
  117. // 0x0600h ~ 0x07FFh WMAC Configuration
  118. //
  119. //-----------------------------------------------------
  120. #define REG_MAC_CR_8192E 0x0600
  121. #define REG_MAC_TX_SM_STATE_8192E 0x06B4
  122. // Power
  123. #define REG_BFMER0_INFO_8192E 0x06E4
  124. #define REG_BFMER1_INFO_8192E 0x06EC
  125. #define REG_CSI_RPT_PARAM_BW20_8192E 0x06F4
  126. #define REG_CSI_RPT_PARAM_BW40_8192E 0x06F8
  127. #define REG_CSI_RPT_PARAM_BW80_8192E 0x06FC
  128. // Hardware Port 2
  129. #define REG_BFMEE_SEL_8192E 0x0714
  130. #define REG_SND_PTCL_CTRL_8192E 0x0718
  131. //-----------------------------------------------------
  132. //
  133. // Redifine register definition for compatibility
  134. //
  135. //-----------------------------------------------------
  136. // TODO: use these definition when using REG_xxx naming rule.
  137. // NOTE: DO NOT Remove these definition. Use later.
  138. #define ISR_8192E REG_HISR0_8192E
  139. //----------------------------------------------------------------------------
  140. // 8192E IMR/ISR bits (offset 0xB0, 8bits)
  141. //----------------------------------------------------------------------------
  142. #define IMR_DISABLED_8192E 0
  143. // IMR DW0(0x00B0-00B3) Bit 0-31
  144. #define IMR_TIMER2_8192E BIT31 // Timeout interrupt 2
  145. #define IMR_TIMER1_8192E BIT30 // Timeout interrupt 1
  146. #define IMR_PSTIMEOUT_8192E BIT29 // Power Save Time Out Interrupt
  147. #define IMR_GTINT4_8192E BIT28 // When GTIMER4 expires, this bit is set to 1
  148. #define IMR_GTINT3_8192E BIT27 // When GTIMER3 expires, this bit is set to 1
  149. #define IMR_TXBCN0ERR_8192E BIT26 // Transmit Beacon0 Error
  150. #define IMR_TXBCN0OK_8192E BIT25 // Transmit Beacon0 OK
  151. #define IMR_TSF_BIT32_TOGGLE_8192E BIT24 // TSF Timer BIT32 toggle indication interrupt
  152. #define IMR_BCNDMAINT0_8192E BIT20 // Beacon DMA Interrupt 0
  153. #define IMR_BCNDERR0_8192E BIT16 // Beacon Queue DMA OK0
  154. #define IMR_HSISR_IND_ON_INT_8192E BIT15 // HSISR Indicator (HSIMR & HSISR is true, this bit is set to 1)
  155. #define IMR_BCNDMAINT_E_8192E BIT14 // Beacon DMA Interrupt Extension for Win7
  156. #define IMR_ATIMEND_8192E BIT12 // CTWidnow End or ATIM Window End
  157. #define IMR_C2HCMD_8192E BIT10 // CPU to Host Command INT Status, Write 1 clear
  158. #define IMR_CPWM2_8192E BIT9 // CPU power Mode exchange INT Status, Write 1 clear
  159. #define IMR_CPWM_8192E BIT8 // CPU power Mode exchange INT Status, Write 1 clear
  160. #define IMR_HIGHDOK_8192E BIT7 // High Queue DMA OK
  161. #define IMR_MGNTDOK_8192E BIT6 // Management Queue DMA OK
  162. #define IMR_BKDOK_8192E BIT5 // AC_BK DMA OK
  163. #define IMR_BEDOK_8192E BIT4 // AC_BE DMA OK
  164. #define IMR_VIDOK_8192E BIT3 // AC_VI DMA OK
  165. #define IMR_VODOK_8192E BIT2 // AC_VO DMA OK
  166. #define IMR_RDU_8192E BIT1 // Rx Descriptor Unavailable
  167. #define IMR_ROK_8192E BIT0 // Receive DMA OK
  168. // IMR DW1(0x00B4-00B7) Bit 0-31
  169. #define IMR_BCNDMAINT7_8192E BIT27 // Beacon DMA Interrupt 7
  170. #define IMR_BCNDMAINT6_8192E BIT26 // Beacon DMA Interrupt 6
  171. #define IMR_BCNDMAINT5_8192E BIT25 // Beacon DMA Interrupt 5
  172. #define IMR_BCNDMAINT4_8192E BIT24 // Beacon DMA Interrupt 4
  173. #define IMR_BCNDMAINT3_8192E BIT23 // Beacon DMA Interrupt 3
  174. #define IMR_BCNDMAINT2_8192E BIT22 // Beacon DMA Interrupt 2
  175. #define IMR_BCNDMAINT1_8192E BIT21 // Beacon DMA Interrupt 1
  176. #define IMR_BCNDOK7_8192E BIT20 // Beacon Queue DMA OK Interrup 7
  177. #define IMR_BCNDOK6_8192E BIT19 // Beacon Queue DMA OK Interrup 6
  178. #define IMR_BCNDOK5_8192E BIT18 // Beacon Queue DMA OK Interrup 5
  179. #define IMR_BCNDOK4_8192E BIT17 // Beacon Queue DMA OK Interrup 4
  180. #define IMR_BCNDOK3_8192E BIT16 // Beacon Queue DMA OK Interrup 3
  181. #define IMR_BCNDOK2_8192E BIT15 // Beacon Queue DMA OK Interrup 2
  182. #define IMR_BCNDOK1_8192E BIT14 // Beacon Queue DMA OK Interrup 1
  183. #define IMR_ATIMEND_E_8192E BIT13 // ATIM Window End Extension for Win7
  184. #define IMR_TXERR_8192E BIT11 // Tx Error Flag Interrupt Status, write 1 clear.
  185. #define IMR_RXERR_8192E BIT10 // Rx Error Flag INT Status, Write 1 clear
  186. #define IMR_TXFOVW_8192E BIT9 // Transmit FIFO Overflow
  187. #define IMR_RXFOVW_8192E BIT8 // Receive FIFO Overflow
  188. //----------------------------------------------------------------------------
  189. // 8192E Auto LLT bits (offset 0x224, 8bits)
  190. //----------------------------------------------------------------------------
  191. //224 REG_AUTO_LLT
  192. #define BIT_SHIFT_TXPKTNUM 24
  193. #define BIT_MASK_TXPKTNUM 0xff
  194. #define BIT_TXPKTNUM(x) (((x) & BIT_MASK_TXPKTNUM) << BIT_SHIFT_TXPKTNUM)
  195. #define BIT_TDE_DBG_SEL BIT(23)
  196. #define BIT_AUTO_INIT_LLT BIT(16)
  197. #define BIT_SHIFT_Tx_OQT_free_space 8
  198. #define BIT_MASK_Tx_OQT_free_space 0xff
  199. #define BIT_Tx_OQT_free_space(x) (((x) & BIT_MASK_Tx_OQT_free_space) << BIT_SHIFT_Tx_OQT_free_space)
  200. //----------------------------------------------------------------------------
  201. // 8192E Auto LLT bits (offset 0x290, 32bits)
  202. //----------------------------------------------------------------------------
  203. #define BIT_DMA_MODE BIT1
  204. #define BIT_USB_RXDMA_AGG_EN BIT31
  205. //----------------------------------------------------------------------------
  206. // 8192E REG_SYS_CFG1 (offset 0xF0, 32bits)
  207. //----------------------------------------------------------------------------
  208. #define BIT_SPSLDO_SEL BIT24
  209. //----------------------------------------------------------------------------
  210. // 8192E REG_CCK_CHECK (offset 0x454, 8bits)
  211. //----------------------------------------------------------------------------
  212. #define BIT_BCN_PORT_SEL BIT5
  213. //============================================================================
  214. // Regsiter Bit and Content definition
  215. //============================================================================
  216. //2 ACMHWCTRL 0x05C0
  217. #define AcmHw_HwEn_8192E BIT(0)
  218. #define AcmHw_VoqEn_8192E BIT(1)
  219. #define AcmHw_ViqEn_8192E BIT(2)
  220. #define AcmHw_BeqEn_8192E BIT(3)
  221. #define AcmHw_VoqStatus_8192E BIT(5)
  222. #define AcmHw_ViqStatus_8192E BIT(6)
  223. #define AcmHw_BeqStatus_8192E BIT(7)
  224. #endif //__RTL8192E_SPEC_H__