rtl8188f_spec.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2017 Realtek Corporation.
  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. *****************************************************************************/
  15. #ifndef __RTL8188F_SPEC_H__
  16. #define __RTL8188F_SPEC_H__
  17. #include <drv_conf.h>
  18. #define HAL_NAV_UPPER_UNIT_8188F 128 /* micro-second */
  19. /* -----------------------------------------------------
  20. *
  21. * 0x0000h ~ 0x00FFh System Configuration
  22. *
  23. * ----------------------------------------------------- */
  24. #define REG_RSV_CTRL_8188F 0x001C /* 3 Byte */
  25. #define REG_BT_WIFI_ANTENNA_SWITCH_8188F 0x0038
  26. #define REG_HSISR_8188F 0x005c
  27. #define REG_PAD_CTRL1_8188F 0x0064
  28. #define REG_AFE_CTRL_4_8188F 0x0078
  29. #define REG_HMEBOX_DBG_0_8188F 0x0088
  30. #define REG_HMEBOX_DBG_1_8188F 0x008A
  31. #define REG_HMEBOX_DBG_2_8188F 0x008C
  32. #define REG_HMEBOX_DBG_3_8188F 0x008E
  33. #define REG_HIMR0_8188F 0x00B0
  34. #define REG_HISR0_8188F 0x00B4
  35. #define REG_HIMR1_8188F 0x00B8
  36. #define REG_HISR1_8188F 0x00BC
  37. #define REG_PMC_DBG_CTRL2_8188F 0x00CC
  38. /* -----------------------------------------------------
  39. *
  40. * 0x0100h ~ 0x01FFh MACTOP General Configuration
  41. *
  42. * ----------------------------------------------------- */
  43. #define REG_C2HEVT_CMD_ID_8188F 0x01A0
  44. #define REG_C2HEVT_CMD_LEN_8188F 0x01AE
  45. #define REG_WOWLAN_WAKE_REASON 0x01C7
  46. #define REG_WOWLAN_GTK_DBG1 0x630
  47. #define REG_WOWLAN_GTK_DBG2 0x634
  48. #define REG_HMEBOX_EXT0_8188F 0x01F0
  49. #define REG_HMEBOX_EXT1_8188F 0x01F4
  50. #define REG_HMEBOX_EXT2_8188F 0x01F8
  51. #define REG_HMEBOX_EXT3_8188F 0x01FC
  52. /* -----------------------------------------------------
  53. *
  54. * 0x0200h ~ 0x027Fh TXDMA Configuration
  55. *
  56. * ----------------------------------------------------- */
  57. /* -----------------------------------------------------
  58. *
  59. * 0x0280h ~ 0x02FFh RXDMA Configuration
  60. *
  61. * ----------------------------------------------------- */
  62. #define REG_RXDMA_CONTROL_8188F 0x0286 /* Control the RX DMA. */
  63. #define REG_RXDMA_MODE_CTRL_8188F 0x0290
  64. /* -----------------------------------------------------
  65. *
  66. * 0x0300h ~ 0x03FFh PCIe
  67. *
  68. * ----------------------------------------------------- */
  69. #define REG_PCIE_CTRL_REG_8188F 0x0300
  70. #define REG_INT_MIG_8188F 0x0304 /* Interrupt Migration */
  71. #define REG_BCNQ_DESA_8188F 0x0308 /* TX Beacon Descriptor Address */
  72. #define REG_HQ_DESA_8188F 0x0310 /* TX High Queue Descriptor Address */
  73. #define REG_MGQ_DESA_8188F 0x0318 /* TX Manage Queue Descriptor Address */
  74. #define REG_VOQ_DESA_8188F 0x0320 /* TX VO Queue Descriptor Address */
  75. #define REG_VIQ_DESA_8188F 0x0328 /* TX VI Queue Descriptor Address */
  76. #define REG_BEQ_DESA_8188F 0x0330 /* TX BE Queue Descriptor Address */
  77. #define REG_BKQ_DESA_8188F 0x0338 /* TX BK Queue Descriptor Address */
  78. #define REG_RX_DESA_8188F 0x0340 /* RX Queue Descriptor Address */
  79. #define REG_DBI_WDATA_8188F 0x0348 /* DBI Write Data */
  80. #define REG_DBI_RDATA_8188F 0x034C /* DBI Read Data */
  81. #define REG_DBI_ADDR_8188F 0x0350 /* DBI Address */
  82. #define REG_DBI_FLAG_8188F 0x0352 /* DBI Read/Write Flag */
  83. #define REG_MDIO_WDATA_8188F 0x0354 /* MDIO for Write PCIE PHY */
  84. #define REG_MDIO_RDATA_8188F 0x0356 /* MDIO for Reads PCIE PHY */
  85. #define REG_MDIO_CTL_8188F 0x0358 /* MDIO for Control */
  86. #define REG_DBG_SEL_8188F 0x0360 /* Debug Selection Register */
  87. #define REG_PCIE_HRPWM_8188F 0x0361 /* PCIe RPWM */
  88. #define REG_PCIE_HCPWM_8188F 0x0363 /* PCIe CPWM */
  89. #define REG_PCIE_MULTIFET_CTRL_8188F 0x036A /* PCIE Multi-Fethc Control */
  90. /* -----------------------------------------------------
  91. *
  92. * 0x0400h ~ 0x047Fh Protocol Configuration
  93. *
  94. * ----------------------------------------------------- */
  95. #define REG_TXPKTBUF_BCNQ_BDNY_8188F 0x0424
  96. #define REG_TXPKTBUF_MGQ_BDNY_8188F 0x0425
  97. #define REG_TXPKTBUF_WMAC_LBK_BF_HD_8188F 0x045D
  98. #ifdef CONFIG_WOWLAN
  99. #define REG_TXPKTBUF_IV_LOW 0x0484
  100. #define REG_TXPKTBUF_IV_HIGH 0x0488
  101. #endif
  102. #define REG_AMPDU_BURST_MODE_8188F 0x04BC
  103. /* -----------------------------------------------------
  104. *
  105. * 0x0500h ~ 0x05FFh EDCA Configuration
  106. *
  107. * ----------------------------------------------------- */
  108. #define REG_SECONDARY_CCA_CTRL_8188F 0x0577
  109. /* -----------------------------------------------------
  110. *
  111. * 0x0600h ~ 0x07FFh WMAC Configuration
  112. *
  113. * ----------------------------------------------------- */
  114. /* ************************************************************
  115. * SDIO Bus Specification
  116. * ************************************************************ */
  117. /* -----------------------------------------------------
  118. * SDIO CMD Address Mapping
  119. * ----------------------------------------------------- */
  120. /* -----------------------------------------------------
  121. * I/O bus domain (Host)
  122. * ----------------------------------------------------- */
  123. /* -----------------------------------------------------
  124. * SDIO register
  125. * ----------------------------------------------------- */
  126. #define SDIO_REG_HIQ_FREEPG_8188F 0x0020
  127. #define SDIO_REG_MID_FREEPG_8188F 0x0022
  128. #define SDIO_REG_LOW_FREEPG_8188F 0x0024
  129. #define SDIO_REG_PUB_FREEPG_8188F 0x0026
  130. #define SDIO_REG_EXQ_FREEPG_8188F 0x0028
  131. #define SDIO_REG_AC_OQT_FREEPG_8188F 0x002A
  132. #define SDIO_REG_NOAC_OQT_FREEPG_8188F 0x002B
  133. #define SDIO_REG_HCPWM1_8188F 0x0038
  134. /* ****************************************************************************
  135. * 8188 Regsiter Bit and Content definition
  136. * **************************************************************************** */
  137. /* 2 HSISR
  138. * interrupt mask which needs to clear */
  139. #define MASK_HSISR_CLEAR (HSISR_GPIO12_0_INT |\
  140. HSISR_SPS_OCP_INT |\
  141. HSISR_RON_INT |\
  142. HSISR_PDNINT |\
  143. HSISR_GPIO9_INT)
  144. /* -----------------------------------------------------
  145. *
  146. * 0x0100h ~ 0x01FFh MACTOP General Configuration
  147. *
  148. * ----------------------------------------------------- */
  149. /* -----------------------------------------------------
  150. *
  151. * 0x0200h ~ 0x027Fh TXDMA Configuration
  152. *
  153. * ----------------------------------------------------- */
  154. /* -----------------------------------------------------
  155. *
  156. * 0x0280h ~ 0x02FFh RXDMA Configuration
  157. *
  158. * ----------------------------------------------------- */
  159. #define BIT_USB_RXDMA_AGG_EN BIT(31)
  160. #define RXDMA_AGG_MODE_EN BIT(1)
  161. #ifdef CONFIG_WOWLAN
  162. #define RXPKT_RELEASE_POLL BIT(16)
  163. #define RXDMA_IDLE BIT(17)
  164. #define RW_RELEASE_EN BIT(18)
  165. #endif
  166. /* -----------------------------------------------------
  167. *
  168. * 0x0400h ~ 0x047Fh Protocol Configuration
  169. *
  170. * ----------------------------------------------------- */
  171. /* ----------------------------------------------------------------------------
  172. * 8188F REG_CCK_CHECK (offset 0x454)
  173. * ---------------------------------------------------------------------------- */
  174. #define BIT_BCN_PORT_SEL BIT(5)
  175. /* -----------------------------------------------------
  176. *
  177. * 0x0500h ~ 0x05FFh EDCA Configuration
  178. *
  179. * ----------------------------------------------------- */
  180. /* -----------------------------------------------------
  181. *
  182. * 0x0600h ~ 0x07FFh WMAC Configuration
  183. *
  184. * ----------------------------------------------------- */
  185. /* ----------------------------------------------------------------------------
  186. * 8195 IMR/ISR bits (offset 0xB0, 8bits)
  187. * ---------------------------------------------------------------------------- */
  188. #define IMR_DISABLED_8188F 0
  189. /* IMR DW0(0x00B0-00B3) Bit 0-31 */
  190. #define IMR_TIMER2_8188F BIT(31) /* Timeout interrupt 2 */
  191. #define IMR_TIMER1_8188F BIT(30) /* Timeout interrupt 1 */
  192. #define IMR_PSTIMEOUT_8188F BIT(29) /* Power Save Time Out Interrupt */
  193. #define IMR_GTINT4_8188F BIT(28) /* When GTIMER4 expires, this bit is set to 1 */
  194. #define IMR_GTINT3_8188F BIT(27) /* When GTIMER3 expires, this bit is set to 1 */
  195. #define IMR_TXBCN0ERR_8188F BIT(26) /* Transmit Beacon0 Error */
  196. #define IMR_TXBCN0OK_8188F BIT(25) /* Transmit Beacon0 OK */
  197. #define IMR_TSF_BIT32_TOGGLE_8188F BIT(24) /* TSF Timer BIT(32) toggle indication interrupt */
  198. #define IMR_BCNDMAINT0_8188F BIT(20) /* Beacon DMA Interrupt 0 */
  199. #define IMR_BCNDERR0_8188F BIT(16) /* Beacon Queue DMA OK0 */
  200. #define IMR_HSISR_IND_ON_INT_8188F BIT(15) /* HSISR Indicator (HSIMR & HSISR is true, this bit is set to 1) */
  201. #define IMR_BCNDMAINT_E_8188F BIT(14) /* Beacon DMA Interrupt Extension for Win7 */
  202. #define IMR_ATIMEND_8188F BIT(12) /* CTWidnow End or ATIM Window End */
  203. #define IMR_C2HCMD_8188F BIT(10) /* CPU to Host Command INT Status, Write 1 clear */
  204. #define IMR_CPWM2_8188F BIT(9) /* CPU power Mode exchange INT Status, Write 1 clear */
  205. #define IMR_CPWM_8188F BIT(8) /* CPU power Mode exchange INT Status, Write 1 clear */
  206. #define IMR_HIGHDOK_8188F BIT(7) /* High Queue DMA OK */
  207. #define IMR_MGNTDOK_8188F BIT(6) /* Management Queue DMA OK */
  208. #define IMR_BKDOK_8188F BIT(5) /* AC_BK DMA OK */
  209. #define IMR_BEDOK_8188F BIT(4) /* AC_BE DMA OK */
  210. #define IMR_VIDOK_8188F BIT(3) /* AC_VI DMA OK */
  211. #define IMR_VODOK_8188F BIT(2) /* AC_VO DMA OK */
  212. #define IMR_RDU_8188F BIT(1) /* Rx Descriptor Unavailable */
  213. #define IMR_ROK_8188F BIT(0) /* Receive DMA OK */
  214. /* IMR DW1(0x00B4-00B7) Bit 0-31 */
  215. #define IMR_BCNDMAINT7_8188F BIT(27) /* Beacon DMA Interrupt 7 */
  216. #define IMR_BCNDMAINT6_8188F BIT(26) /* Beacon DMA Interrupt 6 */
  217. #define IMR_BCNDMAINT5_8188F BIT(25) /* Beacon DMA Interrupt 5 */
  218. #define IMR_BCNDMAINT4_8188F BIT(24) /* Beacon DMA Interrupt 4 */
  219. #define IMR_BCNDMAINT3_8188F BIT(23) /* Beacon DMA Interrupt 3 */
  220. #define IMR_BCNDMAINT2_8188F BIT(22) /* Beacon DMA Interrupt 2 */
  221. #define IMR_BCNDMAINT1_8188F BIT(21) /* Beacon DMA Interrupt 1 */
  222. #define IMR_BCNDOK7_8188F BIT(20) /* Beacon Queue DMA OK Interrupt 7 */
  223. #define IMR_BCNDOK6_8188F BIT(19) /* Beacon Queue DMA OK Interrupt 6 */
  224. #define IMR_BCNDOK5_8188F BIT(18) /* Beacon Queue DMA OK Interrupt 5 */
  225. #define IMR_BCNDOK4_8188F BIT(17) /* Beacon Queue DMA OK Interrupt 4 */
  226. #define IMR_BCNDOK3_8188F BIT(16) /* Beacon Queue DMA OK Interrupt 3 */
  227. #define IMR_BCNDOK2_8188F BIT(15) /* Beacon Queue DMA OK Interrupt 2 */
  228. #define IMR_BCNDOK1_8188F BIT(14) /* Beacon Queue DMA OK Interrupt 1 */
  229. #define IMR_ATIMEND_E_8188F BIT(13) /* ATIM Window End Extension for Win7 */
  230. #define IMR_TXERR_8188F BIT(11) /* Tx Error Flag Interrupt Status, write 1 clear. */
  231. #define IMR_RXERR_8188F BIT(10) /* Rx Error Flag INT Status, Write 1 clear */
  232. #define IMR_TXFOVW_8188F BIT(9) /* Transmit FIFO Overflow */
  233. #define IMR_RXFOVW_8188F BIT(8) /* Receive FIFO Overflow */
  234. #ifdef CONFIG_PCI_HCI
  235. /* #define IMR_RX_MASK (IMR_ROK_8188F|IMR_RDU_8188F|IMR_RXFOVW_8188F) */
  236. #define IMR_TX_MASK (IMR_VODOK_8188F | IMR_VIDOK_8188F | IMR_BEDOK_8188F | IMR_BKDOK_8188F | IMR_MGNTDOK_8188F | IMR_HIGHDOK_8188F)
  237. #define RT_BCN_INT_MASKS (IMR_BCNDMAINT0_8188F | IMR_TXBCN0OK_8188F | IMR_TXBCN0ERR_8188F | IMR_BCNDERR0_8188F)
  238. #define RT_AC_INT_MASKS (IMR_VIDOK_8188F | IMR_VODOK_8188F | IMR_BEDOK_8188F | IMR_BKDOK_8188F)
  239. #endif
  240. #endif /* __RTL8188F_SPEC_H__ */