rtl8812a_spec.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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 __RTL8812A_SPEC_H__
  20. #define __RTL8812A_SPEC_H__
  21. #include <drv_conf.h>
  22. /* ************************************************************
  23. * 8812 Regsiter offset definition
  24. * ************************************************************ */
  25. /* ************************************************************
  26. *
  27. * ************************************************************ */
  28. /* -----------------------------------------------------
  29. *
  30. * 0x0000h ~ 0x00FFh System Configuration
  31. *
  32. * ----------------------------------------------------- */
  33. #define REG_SYS_CLKR_8812A 0x0008
  34. #define REG_AFE_PLL_CTRL_8812A 0x0028
  35. #define REG_HSIMR_8812 0x0058
  36. #define REG_HSISR_8812 0x005c
  37. #define REG_GPIO_EXT_CTRL 0x0060
  38. #define REG_GPIO_STATUS_8812 0x006C
  39. #define REG_SDIO_CTRL_8812 0x0070
  40. #define REG_OPT_CTRL_8812 0x0074
  41. #define REG_RF_B_CTRL_8812 0x0076
  42. #define REG_FW_DRV_MSG_8812 0x0088
  43. #define REG_HMEBOX_E2_E3_8812 0x008C
  44. #define REG_HIMR0_8812 0x00B0
  45. #define REG_HISR0_8812 0x00B4
  46. #define REG_HIMR1_8812 0x00B8
  47. #define REG_HISR1_8812 0x00BC
  48. #define REG_EFUSE_BURN_GNT_8812 0x00CF
  49. #define REG_SYS_CFG1_8812 0x00FC
  50. /* -----------------------------------------------------
  51. *
  52. * 0x0100h ~ 0x01FFh MACTOP General Configuration
  53. *
  54. * ----------------------------------------------------- */
  55. #define REG_CR_8812A 0x100
  56. #define REG_PKTBUF_DBG_ADDR (REG_PKTBUF_DBG_CTRL)
  57. #define REG_RXPKTBUF_DBG (REG_PKTBUF_DBG_CTRL+2)
  58. #define REG_TXPKTBUF_DBG (REG_PKTBUF_DBG_CTRL+3)
  59. #define REG_WOWLAN_WAKE_REASON REG_MCUTST_WOWLAN
  60. #define REG_RSVD3_8812 0x0168
  61. #define REG_C2HEVT_CMD_SEQ_88XX 0x01A1
  62. #define REG_C2hEVT_CMD_CONTENT_88XX 0x01A2
  63. #define REG_C2HEVT_CMD_LEN_88XX 0x01AE
  64. #define REG_HMEBOX_EXT0_8812 0x01F0
  65. #define REG_HMEBOX_EXT1_8812 0x01F4
  66. #define REG_HMEBOX_EXT2_8812 0x01F8
  67. #define REG_HMEBOX_EXT3_8812 0x01FC
  68. /* -----------------------------------------------------
  69. *
  70. * 0x0200h ~ 0x027Fh TXDMA Configuration
  71. *
  72. * ----------------------------------------------------- */
  73. #define REG_DWBCN0_CTRL_8812 REG_TDECTRL
  74. #define REG_DWBCN1_CTRL_8812 0x0228
  75. /* -----------------------------------------------------
  76. *
  77. * 0x0280h ~ 0x02FFh RXDMA Configuration
  78. *
  79. * ----------------------------------------------------- */
  80. #define REG_TDECTRL_8812A 0x0208
  81. #define REG_RXDMA_CONTROL_8812A 0x0286 /*Control the RX DMA.*/
  82. #define REG_RXDMA_PRO_8812 0x0290
  83. #define REG_EARLY_MODE_CONTROL_8812 0x02BC
  84. #define REG_RSVD5_8812 0x02F0
  85. #define REG_RSVD6_8812 0x02F4
  86. #define REG_RSVD7_8812 0x02F8
  87. #define REG_RSVD8_8812 0x02FC
  88. /* -----------------------------------------------------
  89. *
  90. * 0x0300h ~ 0x03FFh PCIe
  91. *
  92. * ----------------------------------------------------- */
  93. #define REG_PCIE_CTRL_REG_8812A 0x0300
  94. #define REG_DBI_WDATA_8812 0x0348 /* DBI Write Data */
  95. #define REG_DBI_RDATA_8812 0x034C /* DBI Read Data */
  96. #define REG_DBI_ADDR_8812 0x0350 /* DBI Address */
  97. #define REG_DBI_FLAG_8812 0x0352 /* DBI Read/Write Flag */
  98. #define REG_MDIO_WDATA_8812 0x0354 /* MDIO for Write PCIE PHY */
  99. #define REG_MDIO_RDATA_8812 0x0356 /* MDIO for Reads PCIE PHY */
  100. #define REG_MDIO_CTL_8812 0x0358 /* MDIO for Control */
  101. #define REG_PCIE_HRPWM_8812A 0x0361 /* PCIe RPWM */
  102. #define REG_PCIE_HCPWM_8812A 0x0363 /* PCIe CPWM */
  103. #define REG_PCIE_MULTIFET_CTRL_8812 0x036A /* PCIE Multi-Fethc Control */
  104. /* -----------------------------------------------------
  105. *
  106. * 0x0400h ~ 0x047Fh Protocol Configuration
  107. *
  108. * ----------------------------------------------------- */
  109. #define REG_TXPKT_EMPTY_8812A 0x041A
  110. #define REG_FWHW_TXQ_CTRL_8812A 0x0420
  111. #define REG_TXBF_CTRL_8812A 0x042C
  112. #define REG_ARFR0_8812 0x0444
  113. #define REG_ARFR1_8812 0x044C
  114. #define REG_CCK_CHECK_8812 0x0454
  115. #define REG_AMPDU_MAX_TIME_8812 0x0456
  116. #define REG_TXPKTBUF_BCNQ_BDNY1_8812 0x0457
  117. #define REG_AMPDU_MAX_LENGTH_8812 0x0458
  118. #define REG_TXPKTBUF_WMAC_LBK_BF_HD_8812 0x045D
  119. #define REG_NDPA_OPT_CTRL_8812A 0x045F
  120. #define REG_DATA_SC_8812 0x0483
  121. #ifdef CONFIG_WOWLAN
  122. #define REG_TXPKTBUF_IV_LOW 0x0484
  123. #define REG_TXPKTBUF_IV_HIGH 0x0488
  124. #endif
  125. #define REG_ARFR2_8812 0x048C
  126. #define REG_ARFR3_8812 0x0494
  127. #define REG_TXRPT_START_OFFSET 0x04AC
  128. #define REG_AMPDU_BURST_MODE_8812 0x04BC
  129. #define REG_HT_SINGLE_AMPDU_8812 0x04C7
  130. #define REG_MACID_PKT_DROP0_8812 0x04D0
  131. /* -----------------------------------------------------
  132. *
  133. * 0x0500h ~ 0x05FFh EDCA Configuration
  134. *
  135. * ----------------------------------------------------- */
  136. #define REG_TXPAUSE_8812A 0x0522
  137. #define REG_CTWND_8812 0x0572
  138. #define REG_SECONDARY_CCA_CTRL_8812 0x0577
  139. #define REG_SCH_TXCMD_8812A 0x05F8
  140. /* -----------------------------------------------------
  141. *
  142. * 0x0600h ~ 0x07FFh WMAC Configuration
  143. *
  144. * ----------------------------------------------------- */
  145. #define REG_MAC_CR_8812 0x0600
  146. #define REG_MAC_TX_SM_STATE_8812 0x06B4
  147. /* Power */
  148. #define REG_BFMER0_INFO_8812A 0x06E4
  149. #define REG_BFMER1_INFO_8812A 0x06EC
  150. #define REG_CSI_RPT_PARAM_BW20_8812A 0x06F4
  151. #define REG_CSI_RPT_PARAM_BW40_8812A 0x06F8
  152. #define REG_CSI_RPT_PARAM_BW80_8812A 0x06FC
  153. /* Hardware Port 2 */
  154. #define REG_BFMEE_SEL_8812A 0x0714
  155. #define REG_SND_PTCL_CTRL_8812A 0x0718
  156. /* -----------------------------------------------------
  157. *
  158. * Redifine register definition for compatibility
  159. *
  160. * ----------------------------------------------------- */
  161. /* TODO: use these definition when using REG_xxx naming rule.
  162. * NOTE: DO NOT Remove these definition. Use later. */
  163. #define ISR_8812 REG_HISR0_8812
  164. /* ----------------------------------------------------------------------------
  165. * 8195 IMR/ISR bits (offset 0xB0, 8bits)
  166. * ---------------------------------------------------------------------------- */
  167. #define IMR_DISABLED_8812 0
  168. /* IMR DW0(0x00B0-00B3) Bit 0-31 */
  169. #define IMR_TIMER2_8812 BIT31 /* Timeout interrupt 2 */
  170. #define IMR_TIMER1_8812 BIT30 /* Timeout interrupt 1 */
  171. #define IMR_PSTIMEOUT_8812 BIT29 /* Power Save Time Out Interrupt */
  172. #define IMR_GTINT4_8812 BIT28 /* When GTIMER4 expires, this bit is set to 1 */
  173. #define IMR_GTINT3_8812 BIT27 /* When GTIMER3 expires, this bit is set to 1 */
  174. #define IMR_TXBCN0ERR_8812 BIT26 /* Transmit Beacon0 Error */
  175. #define IMR_TXBCN0OK_8812 BIT25 /* Transmit Beacon0 OK */
  176. #define IMR_TSF_BIT32_TOGGLE_8812 BIT24 /* TSF Timer BIT32 toggle indication interrupt */
  177. #define IMR_BCNDMAINT0_8812 BIT20 /* Beacon DMA Interrupt 0 */
  178. #define IMR_BCNDERR0_8812 BIT16 /* Beacon Queue DMA OK0 */
  179. #define IMR_HSISR_IND_ON_INT_8812 BIT15 /* HSISR Indicator (HSIMR & HSISR is true, this bit is set to 1) */
  180. #define IMR_BCNDMAINT_E_8812 BIT14 /* Beacon DMA Interrupt Extension for Win7 */
  181. #define IMR_ATIMEND_8812 BIT12 /* CTWidnow End or ATIM Window End */
  182. #define IMR_C2HCMD_8812 BIT10 /* CPU to Host Command INT Status, Write 1 clear */
  183. #define IMR_CPWM2_8812 BIT9 /* CPU power Mode exchange INT Status, Write 1 clear */
  184. #define IMR_CPWM_8812 BIT8 /* CPU power Mode exchange INT Status, Write 1 clear */
  185. #define IMR_HIGHDOK_8812 BIT7 /* High Queue DMA OK */
  186. #define IMR_MGNTDOK_8812 BIT6 /* Management Queue DMA OK */
  187. #define IMR_BKDOK_8812 BIT5 /* AC_BK DMA OK */
  188. #define IMR_BEDOK_8812 BIT4 /* AC_BE DMA OK */
  189. #define IMR_VIDOK_8812 BIT3 /* AC_VI DMA OK */
  190. #define IMR_VODOK_8812 BIT2 /* AC_VO DMA OK */
  191. #define IMR_RDU_8812 BIT1 /* Rx Descriptor Unavailable */
  192. #define IMR_ROK_8812 BIT0 /* Receive DMA OK */
  193. /* IMR DW1(0x00B4-00B7) Bit 0-31 */
  194. #define IMR_BCNDMAINT7_8812 BIT27 /* Beacon DMA Interrupt 7 */
  195. #define IMR_BCNDMAINT6_8812 BIT26 /* Beacon DMA Interrupt 6 */
  196. #define IMR_BCNDMAINT5_8812 BIT25 /* Beacon DMA Interrupt 5 */
  197. #define IMR_BCNDMAINT4_8812 BIT24 /* Beacon DMA Interrupt 4 */
  198. #define IMR_BCNDMAINT3_8812 BIT23 /* Beacon DMA Interrupt 3 */
  199. #define IMR_BCNDMAINT2_8812 BIT22 /* Beacon DMA Interrupt 2 */
  200. #define IMR_BCNDMAINT1_8812 BIT21 /* Beacon DMA Interrupt 1 */
  201. #define IMR_BCNDOK7_8812 BIT20 /* Beacon Queue DMA OK Interrup 7 */
  202. #define IMR_BCNDOK6_8812 BIT19 /* Beacon Queue DMA OK Interrup 6 */
  203. #define IMR_BCNDOK5_8812 BIT18 /* Beacon Queue DMA OK Interrup 5 */
  204. #define IMR_BCNDOK4_8812 BIT17 /* Beacon Queue DMA OK Interrup 4 */
  205. #define IMR_BCNDOK3_8812 BIT16 /* Beacon Queue DMA OK Interrup 3 */
  206. #define IMR_BCNDOK2_8812 BIT15 /* Beacon Queue DMA OK Interrup 2 */
  207. #define IMR_BCNDOK1_8812 BIT14 /* Beacon Queue DMA OK Interrup 1 */
  208. #define IMR_ATIMEND_E_8812 BIT13 /* ATIM Window End Extension for Win7 */
  209. #define IMR_TXERR_8812 BIT11 /* Tx Error Flag Interrupt Status, write 1 clear. */
  210. #define IMR_RXERR_8812 BIT10 /* Rx Error Flag INT Status, Write 1 clear */
  211. #define IMR_TXFOVW_8812 BIT9 /* Transmit FIFO Overflow */
  212. #define IMR_RXFOVW_8812 BIT8 /* Receive FIFO Overflow */
  213. #ifdef CONFIG_PCI_HCI
  214. /* #define IMR_RX_MASK (IMR_ROK_8812|IMR_RDU_8812|IMR_RXFOVW_8812) */
  215. #define IMR_TX_MASK (IMR_VODOK_8812 | IMR_VIDOK_8812 | IMR_BEDOK_8812 | IMR_BKDOK_8812 | IMR_MGNTDOK_8812 | IMR_HIGHDOK_8812)
  216. #define RT_BCN_INT_MASKS (IMR_BCNDMAINT0_8812 | IMR_TXBCN0OK_8812 | IMR_TXBCN0ERR_8812 | IMR_BCNDERR0_8812)
  217. #define RT_AC_INT_MASKS (IMR_VIDOK_8812 | IMR_VODOK_8812 | IMR_BEDOK_8812 | IMR_BKDOK_8812)
  218. #endif
  219. /* ****************************************************************************
  220. * Regsiter Bit and Content definition
  221. * **************************************************************************** */
  222. /* 2 ACMHWCTRL 0x05C0 */
  223. #define AcmHw_HwEn_8812 BIT(0)
  224. #define AcmHw_VoqEn_8812 BIT(1)
  225. #define AcmHw_ViqEn_8812 BIT(2)
  226. #define AcmHw_BeqEn_8812 BIT(3)
  227. #define AcmHw_VoqStatus_8812 BIT(5)
  228. #define AcmHw_ViqStatus_8812 BIT(6)
  229. #define AcmHw_BeqStatus_8812 BIT(7)
  230. #endif /* __RTL8812A_SPEC_H__ */
  231. #ifdef CONFIG_RTL8821A
  232. #include "rtl8821a_spec.h"
  233. #endif /* CONFIG_RTL8821A */