reg_mci.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. /*
  2. * Copyright (c) 2015 Qualcomm Atheros Inc.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef REG_MCI_H
  17. #define REG_MCI_H
  18. #define AR_MCI_COMMAND0 0x1800
  19. #define AR_MCI_COMMAND0_HEADER 0xFF
  20. #define AR_MCI_COMMAND0_HEADER_S 0
  21. #define AR_MCI_COMMAND0_LEN 0x1f00
  22. #define AR_MCI_COMMAND0_LEN_S 8
  23. #define AR_MCI_COMMAND0_DISABLE_TIMESTAMP 0x2000
  24. #define AR_MCI_COMMAND0_DISABLE_TIMESTAMP_S 13
  25. #define AR_MCI_COMMAND1 0x1804
  26. #define AR_MCI_COMMAND2 0x1808
  27. #define AR_MCI_COMMAND2_RESET_TX 0x01
  28. #define AR_MCI_COMMAND2_RESET_TX_S 0
  29. #define AR_MCI_COMMAND2_RESET_RX 0x02
  30. #define AR_MCI_COMMAND2_RESET_RX_S 1
  31. #define AR_MCI_COMMAND2_RESET_RX_NUM_CYCLES 0x3FC
  32. #define AR_MCI_COMMAND2_RESET_RX_NUM_CYCLES_S 2
  33. #define AR_MCI_COMMAND2_RESET_REQ_WAKEUP 0x400
  34. #define AR_MCI_COMMAND2_RESET_REQ_WAKEUP_S 10
  35. #define AR_MCI_RX_CTRL 0x180c
  36. #define AR_MCI_TX_CTRL 0x1810
  37. /*
  38. * 0 = no division,
  39. * 1 = divide by 2,
  40. * 2 = divide by 4,
  41. * 3 = divide by 8
  42. */
  43. #define AR_MCI_TX_CTRL_CLK_DIV 0x03
  44. #define AR_MCI_TX_CTRL_CLK_DIV_S 0
  45. #define AR_MCI_TX_CTRL_DISABLE_LNA_UPDATE 0x04
  46. #define AR_MCI_TX_CTRL_DISABLE_LNA_UPDATE_S 2
  47. #define AR_MCI_TX_CTRL_GAIN_UPDATE_FREQ 0xFFFFF8
  48. #define AR_MCI_TX_CTRL_GAIN_UPDATE_FREQ_S 3
  49. #define AR_MCI_TX_CTRL_GAIN_UPDATE_NUM 0xF000000
  50. #define AR_MCI_TX_CTRL_GAIN_UPDATE_NUM_S 24
  51. #define AR_MCI_MSG_ATTRIBUTES_TABLE 0x1814
  52. #define AR_MCI_MSG_ATTRIBUTES_TABLE_CHECKSUM 0xFFFF
  53. #define AR_MCI_MSG_ATTRIBUTES_TABLE_CHECKSUM_S 0
  54. #define AR_MCI_MSG_ATTRIBUTES_TABLE_INVALID_HDR 0xFFFF0000
  55. #define AR_MCI_MSG_ATTRIBUTES_TABLE_INVALID_HDR_S 16
  56. #define AR_MCI_SCHD_TABLE_0 0x1818
  57. #define AR_MCI_SCHD_TABLE_1 0x181c
  58. #define AR_MCI_GPM_0 0x1820
  59. #define AR_MCI_GPM_1 0x1824
  60. #define AR_MCI_GPM_WRITE_PTR 0xFFFF0000
  61. #define AR_MCI_GPM_WRITE_PTR_S 16
  62. #define AR_MCI_GPM_BUF_LEN 0x0000FFFF
  63. #define AR_MCI_GPM_BUF_LEN_S 0
  64. #define AR_MCI_INTERRUPT_RAW 0x1828
  65. #define AR_MCI_INTERRUPT_EN 0x182c
  66. #define AR_MCI_INTERRUPT_SW_MSG_DONE 0x00000001
  67. #define AR_MCI_INTERRUPT_SW_MSG_DONE_S 0
  68. #define AR_MCI_INTERRUPT_CPU_INT_MSG 0x00000002
  69. #define AR_MCI_INTERRUPT_CPU_INT_MSG_S 1
  70. #define AR_MCI_INTERRUPT_RX_CKSUM_FAIL 0x00000004
  71. #define AR_MCI_INTERRUPT_RX_CKSUM_FAIL_S 2
  72. #define AR_MCI_INTERRUPT_RX_INVALID_HDR 0x00000008
  73. #define AR_MCI_INTERRUPT_RX_INVALID_HDR_S 3
  74. #define AR_MCI_INTERRUPT_RX_HW_MSG_FAIL 0x00000010
  75. #define AR_MCI_INTERRUPT_RX_HW_MSG_FAIL_S 4
  76. #define AR_MCI_INTERRUPT_RX_SW_MSG_FAIL 0x00000020
  77. #define AR_MCI_INTERRUPT_RX_SW_MSG_FAIL_S 5
  78. #define AR_MCI_INTERRUPT_TX_HW_MSG_FAIL 0x00000080
  79. #define AR_MCI_INTERRUPT_TX_HW_MSG_FAIL_S 7
  80. #define AR_MCI_INTERRUPT_TX_SW_MSG_FAIL 0x00000100
  81. #define AR_MCI_INTERRUPT_TX_SW_MSG_FAIL_S 8
  82. #define AR_MCI_INTERRUPT_RX_MSG 0x00000200
  83. #define AR_MCI_INTERRUPT_RX_MSG_S 9
  84. #define AR_MCI_INTERRUPT_REMOTE_SLEEP_UPDATE 0x00000400
  85. #define AR_MCI_INTERRUPT_REMOTE_SLEEP_UPDATE_S 10
  86. #define AR_MCI_INTERRUPT_BT_PRI 0x07fff800
  87. #define AR_MCI_INTERRUPT_BT_PRI_S 11
  88. #define AR_MCI_INTERRUPT_BT_PRI_THRESH 0x08000000
  89. #define AR_MCI_INTERRUPT_BT_PRI_THRESH_S 27
  90. #define AR_MCI_INTERRUPT_BT_FREQ 0x10000000
  91. #define AR_MCI_INTERRUPT_BT_FREQ_S 28
  92. #define AR_MCI_INTERRUPT_BT_STOMP 0x20000000
  93. #define AR_MCI_INTERRUPT_BT_STOMP_S 29
  94. #define AR_MCI_INTERRUPT_BB_AIC_IRQ 0x40000000
  95. #define AR_MCI_INTERRUPT_BB_AIC_IRQ_S 30
  96. #define AR_MCI_INTERRUPT_CONT_INFO_TIMEOUT 0x80000000
  97. #define AR_MCI_INTERRUPT_CONT_INFO_TIMEOUT_S 31
  98. #define AR_MCI_REMOTE_CPU_INT 0x1830
  99. #define AR_MCI_REMOTE_CPU_INT_EN 0x1834
  100. #define AR_MCI_INTERRUPT_RX_MSG_RAW 0x1838
  101. #define AR_MCI_INTERRUPT_RX_MSG_EN 0x183c
  102. #define AR_MCI_INTERRUPT_RX_MSG_REMOTE_RESET 0x00000001
  103. #define AR_MCI_INTERRUPT_RX_MSG_REMOTE_RESET_S 0
  104. #define AR_MCI_INTERRUPT_RX_MSG_LNA_CONTROL 0x00000002
  105. #define AR_MCI_INTERRUPT_RX_MSG_LNA_CONTROL_S 1
  106. #define AR_MCI_INTERRUPT_RX_MSG_CONT_NACK 0x00000004
  107. #define AR_MCI_INTERRUPT_RX_MSG_CONT_NACK_S 2
  108. #define AR_MCI_INTERRUPT_RX_MSG_CONT_INFO 0x00000008
  109. #define AR_MCI_INTERRUPT_RX_MSG_CONT_INFO_S 3
  110. #define AR_MCI_INTERRUPT_RX_MSG_CONT_RST 0x00000010
  111. #define AR_MCI_INTERRUPT_RX_MSG_CONT_RST_S 4
  112. #define AR_MCI_INTERRUPT_RX_MSG_SCHD_INFO 0x00000020
  113. #define AR_MCI_INTERRUPT_RX_MSG_SCHD_INFO_S 5
  114. #define AR_MCI_INTERRUPT_RX_MSG_CPU_INT 0x00000040
  115. #define AR_MCI_INTERRUPT_RX_MSG_CPU_INT_S 6
  116. #define AR_MCI_INTERRUPT_RX_MSG_GPM 0x00000100
  117. #define AR_MCI_INTERRUPT_RX_MSG_GPM_S 8
  118. #define AR_MCI_INTERRUPT_RX_MSG_LNA_INFO 0x00000200
  119. #define AR_MCI_INTERRUPT_RX_MSG_LNA_INFO_S 9
  120. #define AR_MCI_INTERRUPT_RX_MSG_SYS_SLEEPING 0x00000400
  121. #define AR_MCI_INTERRUPT_RX_MSG_SYS_SLEEPING_S 10
  122. #define AR_MCI_INTERRUPT_RX_MSG_SYS_WAKING 0x00000800
  123. #define AR_MCI_INTERRUPT_RX_MSG_SYS_WAKING_S 11
  124. #define AR_MCI_INTERRUPT_RX_MSG_REQ_WAKE 0x00001000
  125. #define AR_MCI_INTERRUPT_RX_MSG_REQ_WAKE_S 12
  126. #define AR_MCI_CPU_INT 0x1840
  127. #define AR_MCI_RX_STATUS 0x1844
  128. #define AR_MCI_RX_LAST_SCHD_MSG_INDEX 0x00000F00
  129. #define AR_MCI_RX_LAST_SCHD_MSG_INDEX_S 8
  130. #define AR_MCI_RX_REMOTE_SLEEP 0x00001000
  131. #define AR_MCI_RX_REMOTE_SLEEP_S 12
  132. #define AR_MCI_RX_MCI_CLK_REQ 0x00002000
  133. #define AR_MCI_RX_MCI_CLK_REQ_S 13
  134. #define AR_MCI_CONT_STATUS 0x1848
  135. #define AR_MCI_CONT_RSSI_POWER 0x000000FF
  136. #define AR_MCI_CONT_RSSI_POWER_S 0
  137. #define AR_MCI_CONT_PRIORITY 0x0000FF00
  138. #define AR_MCI_CONT_PRIORITY_S 8
  139. #define AR_MCI_CONT_TXRX 0x00010000
  140. #define AR_MCI_CONT_TXRX_S 16
  141. #define AR_MCI_BT_PRI0 0x184c
  142. #define AR_MCI_BT_PRI1 0x1850
  143. #define AR_MCI_BT_PRI2 0x1854
  144. #define AR_MCI_BT_PRI3 0x1858
  145. #define AR_MCI_BT_PRI 0x185c
  146. #define AR_MCI_WL_FREQ0 0x1860
  147. #define AR_MCI_WL_FREQ1 0x1864
  148. #define AR_MCI_WL_FREQ2 0x1868
  149. #define AR_MCI_GAIN 0x186c
  150. #define AR_MCI_WBTIMER1 0x1870
  151. #define AR_MCI_WBTIMER2 0x1874
  152. #define AR_MCI_WBTIMER3 0x1878
  153. #define AR_MCI_WBTIMER4 0x187c
  154. #define AR_MCI_MAXGAIN 0x1880
  155. #define AR_MCI_HW_SCHD_TBL_CTL 0x1884
  156. #define AR_MCI_HW_SCHD_TBL_D0 0x1888
  157. #define AR_MCI_HW_SCHD_TBL_D1 0x188c
  158. #define AR_MCI_HW_SCHD_TBL_D2 0x1890
  159. #define AR_MCI_HW_SCHD_TBL_D3 0x1894
  160. #define AR_MCI_TX_PAYLOAD0 0x1898
  161. #define AR_MCI_TX_PAYLOAD1 0x189c
  162. #define AR_MCI_TX_PAYLOAD2 0x18a0
  163. #define AR_MCI_TX_PAYLOAD3 0x18a4
  164. #define AR_BTCOEX_WBTIMER 0x18a8
  165. #define AR_BTCOEX_CTRL 0x18ac
  166. #define AR_BTCOEX_CTRL_AR9462_MODE 0x00000001
  167. #define AR_BTCOEX_CTRL_AR9462_MODE_S 0
  168. #define AR_BTCOEX_CTRL_WBTIMER_EN 0x00000002
  169. #define AR_BTCOEX_CTRL_WBTIMER_EN_S 1
  170. #define AR_BTCOEX_CTRL_MCI_MODE_EN 0x00000004
  171. #define AR_BTCOEX_CTRL_MCI_MODE_EN_S 2
  172. #define AR_BTCOEX_CTRL_LNA_SHARED 0x00000008
  173. #define AR_BTCOEX_CTRL_LNA_SHARED_S 3
  174. #define AR_BTCOEX_CTRL_PA_SHARED 0x00000010
  175. #define AR_BTCOEX_CTRL_PA_SHARED_S 4
  176. #define AR_BTCOEX_CTRL_ONE_STEP_LOOK_AHEAD_EN 0x00000020
  177. #define AR_BTCOEX_CTRL_ONE_STEP_LOOK_AHEAD_EN_S 5
  178. #define AR_BTCOEX_CTRL_TIME_TO_NEXT_BT_THRESH_EN 0x00000040
  179. #define AR_BTCOEX_CTRL_TIME_TO_NEXT_BT_THRESH_EN_S 6
  180. #define AR_BTCOEX_CTRL_NUM_ANTENNAS 0x00000180
  181. #define AR_BTCOEX_CTRL_NUM_ANTENNAS_S 7
  182. #define AR_BTCOEX_CTRL_RX_CHAIN_MASK 0x00000E00
  183. #define AR_BTCOEX_CTRL_RX_CHAIN_MASK_S 9
  184. #define AR_BTCOEX_CTRL_AGGR_THRESH 0x00007000
  185. #define AR_BTCOEX_CTRL_AGGR_THRESH_S 12
  186. #define AR_BTCOEX_CTRL_1_CHAIN_BCN 0x00080000
  187. #define AR_BTCOEX_CTRL_1_CHAIN_BCN_S 19
  188. #define AR_BTCOEX_CTRL_1_CHAIN_ACK 0x00100000
  189. #define AR_BTCOEX_CTRL_1_CHAIN_ACK_S 20
  190. #define AR_BTCOEX_CTRL_WAIT_BA_MARGIN 0x1FE00000
  191. #define AR_BTCOEX_CTRL_WAIT_BA_MARGIN_S 28
  192. #define AR_BTCOEX_CTRL_REDUCE_TXPWR 0x20000000
  193. #define AR_BTCOEX_CTRL_REDUCE_TXPWR_S 29
  194. #define AR_BTCOEX_CTRL_SPDT_ENABLE_10 0x40000000
  195. #define AR_BTCOEX_CTRL_SPDT_ENABLE_10_S 30
  196. #define AR_BTCOEX_CTRL_SPDT_POLARITY 0x80000000
  197. #define AR_BTCOEX_CTRL_SPDT_POLARITY_S 31
  198. #define AR_BTCOEX_WL_WEIGHTS0 0x18b0
  199. #define AR_BTCOEX_WL_WEIGHTS1 0x18b4
  200. #define AR_BTCOEX_WL_WEIGHTS2 0x18b8
  201. #define AR_BTCOEX_WL_WEIGHTS3 0x18bc
  202. #define AR_BTCOEX_MAX_TXPWR(_x) (0x18c0 + ((_x) << 2))
  203. #define AR_BTCOEX_WL_LNA 0x1940
  204. #define AR_BTCOEX_RFGAIN_CTRL 0x1944
  205. #define AR_BTCOEX_WL_LNA_TIMEOUT 0x003FFFFF
  206. #define AR_BTCOEX_WL_LNA_TIMEOUT_S 0
  207. #define AR_BTCOEX_CTRL2 0x1948
  208. #define AR_BTCOEX_CTRL2_TXPWR_THRESH 0x0007F800
  209. #define AR_BTCOEX_CTRL2_TXPWR_THRESH_S 11
  210. #define AR_BTCOEX_CTRL2_TX_CHAIN_MASK 0x00380000
  211. #define AR_BTCOEX_CTRL2_TX_CHAIN_MASK_S 19
  212. #define AR_BTCOEX_CTRL2_RX_DEWEIGHT 0x00400000
  213. #define AR_BTCOEX_CTRL2_RX_DEWEIGHT_S 22
  214. #define AR_BTCOEX_CTRL2_GPIO_OBS_SEL 0x00800000
  215. #define AR_BTCOEX_CTRL2_GPIO_OBS_SEL_S 23
  216. #define AR_BTCOEX_CTRL2_MAC_BB_OBS_SEL 0x01000000
  217. #define AR_BTCOEX_CTRL2_MAC_BB_OBS_SEL_S 24
  218. #define AR_BTCOEX_CTRL2_DESC_BASED_TXPWR_ENABLE 0x02000000
  219. #define AR_BTCOEX_CTRL2_DESC_BASED_TXPWR_ENABLE_S 25
  220. #define AR_BTCOEX_CTRL_SPDT_ENABLE 0x00000001
  221. #define AR_BTCOEX_CTRL_SPDT_ENABLE_S 0
  222. #define AR_BTCOEX_CTRL_BT_OWN_SPDT_CTRL 0x00000002
  223. #define AR_BTCOEX_CTRL_BT_OWN_SPDT_CTRL_S 1
  224. #define AR_BTCOEX_CTRL_USE_LATCHED_BT_ANT 0x00000004
  225. #define AR_BTCOEX_CTRL_USE_LATCHED_BT_ANT_S 2
  226. #define AR_GLB_WLAN_UART_INTF_EN 0x00020000
  227. #define AR_GLB_WLAN_UART_INTF_EN_S 17
  228. #define AR_GLB_DS_JTAG_DISABLE 0x00040000
  229. #define AR_GLB_DS_JTAG_DISABLE_S 18
  230. #define AR_BTCOEX_RC 0x194c
  231. #define AR_BTCOEX_MAX_RFGAIN(_x) (0x1950 + ((_x) << 2))
  232. #define AR_BTCOEX_DBG 0x1a50
  233. #define AR_MCI_LAST_HW_MSG_HDR 0x1a54
  234. #define AR_MCI_LAST_HW_MSG_BDY 0x1a58
  235. #define AR_MCI_SCHD_TABLE_2 0x1a5c
  236. #define AR_MCI_SCHD_TABLE_2_MEM_BASED 0x00000001
  237. #define AR_MCI_SCHD_TABLE_2_MEM_BASED_S 0
  238. #define AR_MCI_SCHD_TABLE_2_HW_BASED 0x00000002
  239. #define AR_MCI_SCHD_TABLE_2_HW_BASED_S 1
  240. #define AR_BTCOEX_CTRL3 0x1a60
  241. #define AR_BTCOEX_CTRL3_CONT_INFO_TIMEOUT 0x00000fff
  242. #define AR_BTCOEX_CTRL3_CONT_INFO_TIMEOUT_S 0
  243. #define AR_GLB_SWREG_DISCONT_MODE 0x2002c
  244. #define AR_GLB_SWREG_DISCONT_EN_BT_WLAN 0x3
  245. #define AR_MCI_MISC 0x1a74
  246. #define AR_MCI_MISC_HW_FIX_EN 0x00000001
  247. #define AR_MCI_MISC_HW_FIX_EN_S 0
  248. #define AR_MCI_DBG_CNT_CTRL 0x1a78
  249. #define AR_MCI_DBG_CNT_CTRL_ENABLE 0x00000001
  250. #define AR_MCI_DBG_CNT_CTRL_ENABLE_S 0
  251. #define AR_MCI_DBG_CNT_CTRL_BT_LINKID 0x000007f8
  252. #define AR_MCI_DBG_CNT_CTRL_BT_LINKID_S 3
  253. #define MCI_STAT_ALL_BT_LINKID 0xffff
  254. #define AR_MCI_INTERRUPT_DEFAULT (AR_MCI_INTERRUPT_SW_MSG_DONE | \
  255. AR_MCI_INTERRUPT_RX_INVALID_HDR | \
  256. AR_MCI_INTERRUPT_RX_HW_MSG_FAIL | \
  257. AR_MCI_INTERRUPT_RX_SW_MSG_FAIL | \
  258. AR_MCI_INTERRUPT_TX_HW_MSG_FAIL | \
  259. AR_MCI_INTERRUPT_TX_SW_MSG_FAIL | \
  260. AR_MCI_INTERRUPT_RX_MSG | \
  261. AR_MCI_INTERRUPT_REMOTE_SLEEP_UPDATE | \
  262. AR_MCI_INTERRUPT_CONT_INFO_TIMEOUT)
  263. #define AR_MCI_INTERRUPT_MSG_FAIL_MASK (AR_MCI_INTERRUPT_RX_HW_MSG_FAIL | \
  264. AR_MCI_INTERRUPT_RX_SW_MSG_FAIL | \
  265. AR_MCI_INTERRUPT_TX_HW_MSG_FAIL | \
  266. AR_MCI_INTERRUPT_TX_SW_MSG_FAIL)
  267. #define AR_MCI_INTERRUPT_RX_HW_MSG_MASK (AR_MCI_INTERRUPT_RX_MSG_SCHD_INFO | \
  268. AR_MCI_INTERRUPT_RX_MSG_LNA_CONTROL | \
  269. AR_MCI_INTERRUPT_RX_MSG_LNA_INFO | \
  270. AR_MCI_INTERRUPT_RX_MSG_CONT_NACK | \
  271. AR_MCI_INTERRUPT_RX_MSG_CONT_INFO | \
  272. AR_MCI_INTERRUPT_RX_MSG_CONT_RST)
  273. #define AR_MCI_INTERRUPT_RX_MSG_DEFAULT (AR_MCI_INTERRUPT_RX_MSG_GPM | \
  274. AR_MCI_INTERRUPT_RX_MSG_REMOTE_RESET | \
  275. AR_MCI_INTERRUPT_RX_MSG_SYS_WAKING | \
  276. AR_MCI_INTERRUPT_RX_MSG_SYS_SLEEPING | \
  277. AR_MCI_INTERRUPT_RX_MSG_REQ_WAKE)
  278. #endif /* REG_MCI_H */