slc_register.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. //Generated at 2012-10-23 19:55:03
  2. /*
  3. * ESPRSSIF MIT License
  4. *
  5. * Copyright (c) 2016 <ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD>
  6. *
  7. * Permission is hereby granted for use on ESPRESSIF SYSTEMS ESP8266 only, in which case,
  8. * it is free of charge, to any person obtaining a copy of this software and associated
  9. * documentation files (the "Software"), to deal in the Software without restriction, including
  10. * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
  11. * and/or sell copies of the Software, and to permit persons to whom the Software is furnished
  12. * to do so, subject to the following conditions:
  13. *
  14. * The above copyright notice and this permission notice shall be included in all copies or
  15. * substantial portions of the Software.
  16. *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  19. * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  20. * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  21. * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  22. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23. *
  24. */
  25. #ifndef SLC_REGISTER_H_
  26. #define SLC_REGISTER_H_
  27. #define REG_SLC_BASE 0x60000B00
  28. //version value:32'h091700
  29. #define SLC_CONF0 (REG_SLC_BASE + 0x0)
  30. #ifndef ESP_MAC_5
  31. #define SLC_MODE 0x00000003
  32. #define SLC_MODE_S 12
  33. #endif
  34. #define SLC_DATA_BURST_EN (BIT(9))
  35. #define SLC_DSCR_BURST_EN (BIT(8))
  36. #define SLC_RX_NO_RESTART_CLR (BIT(7))
  37. #define SLC_RX_AUTO_WRBACK (BIT(6))
  38. #define SLC_RX_LOOP_TEST (BIT(5))
  39. #define SLC_TX_LOOP_TEST (BIT(4))
  40. #define SLC_AHBM_RST (BIT(3))
  41. #define SLC_AHBM_FIFO_RST (BIT(2))
  42. #define SLC_RXLINK_RST (BIT(1))
  43. #define SLC_TXLINK_RST (BIT(0))
  44. #define SLC_INT_RAW (REG_SLC_BASE + 0x4)
  45. #define SLC_TX_DSCR_EMPTY_INT_RAW (BIT(21))
  46. #define SLC_RX_DSCR_ERR_INT_RAW (BIT(20))
  47. #define SLC_TX_DSCR_ERR_INT_RAW (BIT(19))
  48. #define SLC_TOHOST_INT_RAW (BIT(18))
  49. #define SLC_RX_EOF_INT_RAW (BIT(17))
  50. #define SLC_RX_DONE_INT_RAW (BIT(16))
  51. #define SLC_TX_EOF_INT_RAW (BIT(15))
  52. #define SLC_TX_DONE_INT_RAW (BIT(14))
  53. #define SLC_TOKEN1_1TO0_INT_RAW (BIT(13))
  54. #define SLC_TOKEN0_1TO0_INT_RAW (BIT(12))
  55. #define SLC_TX_OVF_INT_RAW (BIT(11))
  56. #define SLC_RX_UDF_INT_RAW (BIT(10))
  57. #define SLC_TX_START_INT_RAW (BIT(9))
  58. #define SLC_RX_START_INT_RAW (BIT(8))
  59. #define SLC_FRHOST_BIT7_INT_RAW (BIT(7))
  60. #define SLC_FRHOST_BIT6_INT_RAW (BIT(6))
  61. #define SLC_FRHOST_BIT5_INT_RAW (BIT(5))
  62. #define SLC_FRHOST_BIT4_INT_RAW (BIT(4))
  63. #define SLC_FRHOST_BIT3_INT_RAW (BIT(3))
  64. #define SLC_FRHOST_BIT2_INT_RAW (BIT(2))
  65. #define SLC_FRHOST_BIT1_INT_RAW (BIT(1))
  66. #define SLC_FRHOST_BIT0_INT_RAW (BIT(0))
  67. #define SLC_INT_STATUS (REG_SLC_BASE + 0x8)
  68. #define SLC_TX_DSCR_EMPTY_INT_ST (BIT(21))
  69. #define SLC_RX_DSCR_ERR_INT_ST (BIT(20))
  70. #define SLC_TX_DSCR_ERR_INT_ST (BIT(19))
  71. #define SLC_TOHOST_INT_ST (BIT(18))
  72. #define SLC_RX_EOF_INT_ST (BIT(17))
  73. #define SLC_RX_DONE_INT_ST (BIT(16))
  74. #define SLC_TX_EOF_INT_ST (BIT(15))
  75. #define SLC_TX_DONE_INT_ST (BIT(14))
  76. #define SLC_TOKEN1_1TO0_INT_ST (BIT(13))
  77. #define SLC_TOKEN0_1TO0_INT_ST (BIT(12))
  78. #define SLC_TX_OVF_INT_ST (BIT(11))
  79. #define SLC_RX_UDF_INT_ST (BIT(10))
  80. #define SLC_TX_START_INT_ST (BIT(9))
  81. #define SLC_RX_START_INT_ST (BIT(8))
  82. #define SLC_FRHOST_BIT7_INT_ST (BIT(7))
  83. #define SLC_FRHOST_BIT6_INT_ST (BIT(6))
  84. #define SLC_FRHOST_BIT5_INT_ST (BIT(5))
  85. #define SLC_FRHOST_BIT4_INT_ST (BIT(4))
  86. #define SLC_FRHOST_BIT3_INT_ST (BIT(3))
  87. #define SLC_FRHOST_BIT2_INT_ST (BIT(2))
  88. #define SLC_FRHOST_BIT1_INT_ST (BIT(1))
  89. #define SLC_FRHOST_BIT0_INT_ST (BIT(0))
  90. #define SLC_INT_ENA (REG_SLC_BASE + 0xC)
  91. #define SLC_TX_DSCR_EMPTY_INT_ENA (BIT(21))
  92. #define SLC_RX_DSCR_ERR_INT_ENA (BIT(20))
  93. #define SLC_TX_DSCR_ERR_INT_ENA (BIT(19))
  94. #define SLC_TOHOST_INT_ENA (BIT(18))
  95. #define SLC_RX_EOF_INT_ENA (BIT(17))
  96. #define SLC_RX_DONE_INT_ENA (BIT(16))
  97. #define SLC_TX_EOF_INT_ENA (BIT(15))
  98. #define SLC_TX_DONE_INT_ENA (BIT(14))
  99. #define SLC_TOKEN1_1TO0_INT_ENA (BIT(13))
  100. #define SLC_TOKEN0_1TO0_INT_ENA (BIT(12))
  101. #define SLC_TX_OVF_INT_ENA (BIT(11))
  102. #define SLC_RX_UDF_INT_ENA (BIT(10))
  103. #define SLC_TX_START_INT_ENA (BIT(9))
  104. #define SLC_RX_START_INT_ENA (BIT(8))
  105. #define SLC_FRHOST_BIT7_INT_ENA (BIT(7))
  106. #define SLC_FRHOST_BIT6_INT_ENA (BIT(6))
  107. #define SLC_FRHOST_BIT5_INT_ENA (BIT(5))
  108. #define SLC_FRHOST_BIT4_INT_ENA (BIT(4))
  109. #define SLC_FRHOST_BIT3_INT_ENA (BIT(3))
  110. #define SLC_FRHOST_BIT2_INT_ENA (BIT(2))
  111. #define SLC_FRHOST_BIT1_INT_ENA (BIT(1))
  112. #define SLC_FRHOST_BIT0_INT_ENA (BIT(0))
  113. #define SLC_FRHOST_BIT_INT_ENA_ALL 0xff
  114. #define SLC_INT_CLR (REG_SLC_BASE + 0x10)
  115. #define SLC_TX_DSCR_EMPTY_INT_CLR (BIT(21))
  116. #define SLC_RX_DSCR_ERR_INT_CLR (BIT(20))
  117. #define SLC_TX_DSCR_ERR_INT_CLR (BIT(19))
  118. #define SLC_TOHOST_INT_CLR (BIT(18))
  119. #define SLC_RX_EOF_INT_CLR (BIT(17))
  120. #define SLC_RX_DONE_INT_CLR (BIT(16))
  121. #define SLC_TX_EOF_INT_CLR (BIT(15))
  122. #define SLC_TX_DONE_INT_CLR (BIT(14))
  123. #define SLC_TOKEN1_1TO0_INT_CLR (BIT(13))
  124. #define SLC_TOKEN0_1TO0_INT_CLR (BIT(12))
  125. #define SLC_TX_OVF_INT_CLR (BIT(11))
  126. #define SLC_RX_UDF_INT_CLR (BIT(10))
  127. #define SLC_TX_START_INT_CLR (BIT(9))
  128. #define SLC_RX_START_INT_CLR (BIT(8))
  129. #define SLC_FRHOST_BIT7_INT_CLR (BIT(7))
  130. #define SLC_FRHOST_BIT6_INT_CLR (BIT(6))
  131. #define SLC_FRHOST_BIT5_INT_CLR (BIT(5))
  132. #define SLC_FRHOST_BIT4_INT_CLR (BIT(4))
  133. #define SLC_FRHOST_BIT3_INT_CLR (BIT(3))
  134. #define SLC_FRHOST_BIT2_INT_CLR (BIT(2))
  135. #define SLC_FRHOST_BIT1_INT_CLR (BIT(1))
  136. #define SLC_FRHOST_BIT0_INT_CLR (BIT(0))
  137. #define SLC_RX_STATUS (REG_SLC_BASE + 0x14)
  138. #define SLC_RX_EMPTY (BIT(1))
  139. #define SLC_RX_FULL (BIT(0))
  140. #define SLC_RX_FIFO_PUSH (REG_SLC_BASE + 0x18)
  141. #define SLC_RXFIFO_PUSH (BIT(16))
  142. #define SLC_RXFIFO_WDATA 0x000001FF
  143. #define SLC_RXFIFO_WDATA_S 0
  144. #define SLC_TX_STATUS (REG_SLC_BASE + 0x1C)
  145. #define SLC_TX_EMPTY (BIT(1))
  146. #define SLC_TX_FULL (BIT(0))
  147. #define SLC_TX_FIFO_POP (REG_SLC_BASE + 0x20)
  148. #define SLC_TXFIFO_POP (BIT(16))
  149. #define SLC_TXFIFO_RDATA 0x000007FF
  150. #define SLC_TXFIFO_RDATA_S 0
  151. #define SLC_RX_LINK (REG_SLC_BASE + 0x24)
  152. #define SLC_RXLINK_PARK (BIT(31))
  153. #define SLC_RXLINK_RESTART (BIT(30))
  154. #define SLC_RXLINK_START (BIT(29))
  155. #define SLC_RXLINK_STOP (BIT(28))
  156. #define SLC_RXLINK_DESCADDR_MASK 0x000FFFFF
  157. #define SLC_RXLINK_ADDR_S 0
  158. #define SLC_TX_LINK (REG_SLC_BASE + 0x28)
  159. #define SLC_TXLINK_PARK (BIT(31))
  160. #define SLC_TXLINK_RESTART (BIT(30))
  161. #define SLC_TXLINK_START (BIT(29))
  162. #define SLC_TXLINK_STOP (BIT(28))
  163. #define SLC_TXLINK_DESCADDR_MASK 0x000FFFFF
  164. #define SLC_TXLINK_ADDR_S 0
  165. #define SLC_INTVEC_TOHOST (REG_SLC_BASE + 0x2C)
  166. #define SLC_TOHOST_INTVEC 0x000000FF
  167. #define SLC_TOHOST_INTVEC_S 0
  168. #define SLC_TOKEN0 (REG_SLC_BASE + 0x30)
  169. #define SLC_TOKEN0_MASK 0x00000FFF
  170. #define SLC_TOKEN0_S 16
  171. #define SLC_TOKEN0_LOCAL_INC_MORE (BIT(14))
  172. #define SLC_TOKEN0_LOCAL_INC (BIT(13))
  173. #define SLC_TOKEN0_LOCAL_WR (BIT(12))
  174. #define SLC_TOKEN0_LOCAL_WDATA_MASK 0x00000FFF
  175. #define SLC_TOKEN0_LOCAL_WDATA_S 0
  176. #define SLC_TOKEN1 (REG_SLC_BASE + 0x34)
  177. #define SLC_TOKEN1_MASK 0x00000FFF
  178. #define SLC_TOKEN1_S 16
  179. #define SLC_TOKEN1_LOCAL_INC_MORE (BIT(14))
  180. #define SLC_TOKEN1_LOCAL_INC (BIT(13))
  181. #define SLC_TOKEN1_LOCAL_WR (BIT(12))
  182. #define SLC_TOKEN1_LOCAL_WDATA 0x00000FFF
  183. #define SLC_TOKEN1_LOCAL_WDATA_S 0
  184. #define SLC_CONF1 (REG_SLC_BASE + 0x38)
  185. #define SLC_STATE0 (REG_SLC_BASE + 0x3C)
  186. #define SLC_STATE1 (REG_SLC_BASE + 0x40)
  187. #define SLC_BRIDGE_CONF (REG_SLC_BASE + 0x44)
  188. #ifndef ESP_MAC_5
  189. #define SLC_TX_PUSH_IDLE_NUM 0x0000FFFF
  190. #define SLC_TX_PUSH_IDLE_NUM_S 16
  191. #define SLC_TX_DUMMY_MODE (BIT(12))
  192. #endif
  193. #define SLC_FIFO_MAP_ENA 0x0000000F
  194. #define SLC_FIFO_MAP_ENA_S 8
  195. #define SLC_TXEOF_ENA 0x0000003F
  196. #define SLC_TXEOF_ENA_S 0
  197. #define SLC_RX_EOF_DES_ADDR (REG_SLC_BASE + 0x48)
  198. #define SLC_TX_EOF_DES_ADDR (REG_SLC_BASE + 0x4C)
  199. #define SLC_FROM_HOST_LAST_DESC SLC_TX_EOF_DES_ADDR
  200. #define SLC_TO_HOST_LAST_DESC SLC_RX_EOF_DES_ADDR
  201. #define SLC_RX_EOF_BFR_DES_ADDR (REG_SLC_BASE + 0x50)
  202. #define SLC_AHB_TEST (REG_SLC_BASE + 0x54)
  203. #define SLC_AHB_TESTADDR 0x00000003
  204. #define SLC_AHB_TESTADDR_S 4
  205. #define SLC_AHB_TESTMODE 0x00000007
  206. #define SLC_AHB_TESTMODE_S 0
  207. #define SLC_SDIO_ST (REG_SLC_BASE + 0x58)
  208. #define SLC_BUS_ST 0x00000007
  209. #define SLC_BUS_ST_S 12
  210. #define SLC_SDIO_WAKEUP (BIT(8))
  211. #define SLC_FUNC_ST 0x0000000F
  212. #define SLC_FUNC_ST_S 4
  213. #define SLC_CMD_ST 0x00000007
  214. #define SLC_CMD_ST_S 0
  215. #define SLC_RX_DSCR_CONF (REG_SLC_BASE + 0x5C)
  216. #ifdef ESP_MAC_5
  217. #define SLC_INFOR_NO_REPLACE (BIT(9))
  218. #define SLC_TOKEN_NO_REPLACE (BIT(8))
  219. #define SLC_POP_IDLE_CNT 0x000000FF
  220. #else
  221. #define SLC_RX_FILL_EN (BIT(20))
  222. #define SLC_RX_EOF_MODE (BIT(19))
  223. #define SLC_RX_FILL_MODE (BIT(18))
  224. #define SLC_INFOR_NO_REPLACE (BIT(17))
  225. #define SLC_TOKEN_NO_REPLACE (BIT(16)) //
  226. #define SLC_POP_IDLE_CNT 0x0000FFFF
  227. #endif
  228. #define SLC_POP_IDLE_CNT_S 0
  229. #define SLC_TXLINK_DSCR (REG_SLC_BASE + 0x60)
  230. #define SLC_TXLINK_DSCR_BF0 (REG_SLC_BASE + 0x64)
  231. #define SLC_TXLINK_DSCR_BF1 (REG_SLC_BASE + 0x68)
  232. #define SLC_RXLINK_DSCR (REG_SLC_BASE + 0x6C)
  233. #define SLC_RXLINK_DSCR_BF0 (REG_SLC_BASE + 0x70)
  234. #define SLC_RXLINK_DSCR_BF1 (REG_SLC_BASE + 0x74)
  235. #define SLC_DATE (REG_SLC_BASE + 0x78)
  236. #define SLC_ID (REG_SLC_BASE + 0x7C)
  237. #define SLC_HOST_CONF_W0 (REG_SLC_BASE + 0x80 + 0x14)
  238. #define SLC_HOST_CONF_W1 (REG_SLC_BASE + 0x80 + 0x18)
  239. #define SLC_HOST_CONF_W2 (REG_SLC_BASE + 0x80 + 0x20)
  240. #define SLC_HOST_CONF_W3 (REG_SLC_BASE + 0x80 + 0x24)
  241. #define SLC_HOST_CONF_W4 (REG_SLC_BASE + 0x80 + 0x28)
  242. #define SLC_HOST_INTR_ST (REG_SLC_BASE + 0x80 + 0x1c)
  243. #define SLC_HOST_INTR_CLR (REG_SLC_BASE + 0x80 + 0x30)
  244. #define SLC_HOST_INTR_SOF_BIT (BIT(12))
  245. #define SLC_HOST_INTR_ENA (REG_SLC_BASE + 0x80 + 0x34)
  246. #define SLC_RX_NEW_PACKET_INT_ENA (BIT23)
  247. #define SLC_HOST_TOHOST_BIT0_INT_ENA (BIT0)
  248. #define SLC_HOST_CONF_W5 (REG_SLC_BASE + 0x80 + 0x3C)
  249. #define SLC_HOST_INTR_RAW (REG_SLC_BASE + 0x80 + 0x8)
  250. #define SLC_HOST_INTR_ENA_BIT (BIT(23))
  251. //[15:12]: 0x3ff9xxxx -- 0b01 from_host
  252. // 0x3ffaxxxx -- 0b10 general
  253. // 0x3ffbxxxx -- 0b11 to_host
  254. #define SLC_DATA_ADDR_CLEAR_MASK (~(0xf<<12))
  255. #define SLC_FROM_HOST_ADDR_MASK (0x1<<12)
  256. #define SLC_TO_HOST_ADDR_MASK (0x3<<12)
  257. #define SLC_SET_FROM_HOST_ADDR_MASK(v) do { \
  258. (v) &= SLC_DATA_ADDR_CLEAR_MASK; \
  259. (v) |= SLC_FROM_HOST_ADDR_MASK; \
  260. } while(0);
  261. #define SLC_SET_TO_HOST_ADDR_MASK(v) do { \
  262. (v) &= SLC_DATA_ADDR_CLEAR_MASK; \
  263. (v) |= SLC_TO_HOST_ADDR_MASK; \
  264. } while(0);
  265. #define SLC_TX_DESC_DEBUG_REG 0x3ff0002c //[15:0] set to 0xcccc
  266. #endif // SLC_REGISTER_H_INCLUDED