mtu3_hw_regs.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  1. /*
  2. * mtu3_hw_regs.h - MediaTek USB3 DRD register and field definitions
  3. *
  4. * Copyright (C) 2016 MediaTek Inc.
  5. *
  6. * Author: Chunfeng Yun <chunfeng.yun@mediatek.com>
  7. *
  8. * This software is licensed under the terms of the GNU General Public
  9. * License version 2, as published by the Free Software Foundation, and
  10. * may be copied, distributed, and modified under those terms.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. */
  18. #ifndef _SSUSB_HW_REGS_H_
  19. #define _SSUSB_HW_REGS_H_
  20. /* segment offset of MAC register */
  21. #define SSUSB_DEV_BASE 0x0000
  22. #define SSUSB_EPCTL_CSR_BASE 0x0800
  23. #define SSUSB_USB3_MAC_CSR_BASE 0x1400
  24. #define SSUSB_USB3_SYS_CSR_BASE 0x1400
  25. #define SSUSB_USB2_CSR_BASE 0x2400
  26. /* IPPC register in Infra */
  27. #define SSUSB_SIFSLV_IPPC_BASE 0x0000
  28. /* --------------- SSUSB_DEV REGISTER DEFINITION --------------- */
  29. #define U3D_LV1ISR (SSUSB_DEV_BASE + 0x0000)
  30. #define U3D_LV1IER (SSUSB_DEV_BASE + 0x0004)
  31. #define U3D_LV1IESR (SSUSB_DEV_BASE + 0x0008)
  32. #define U3D_LV1IECR (SSUSB_DEV_BASE + 0x000C)
  33. #define U3D_EPISR (SSUSB_DEV_BASE + 0x0080)
  34. #define U3D_EPIER (SSUSB_DEV_BASE + 0x0084)
  35. #define U3D_EPIESR (SSUSB_DEV_BASE + 0x0088)
  36. #define U3D_EPIECR (SSUSB_DEV_BASE + 0x008C)
  37. #define U3D_EP0CSR (SSUSB_DEV_BASE + 0x0100)
  38. #define U3D_RXCOUNT0 (SSUSB_DEV_BASE + 0x0108)
  39. #define U3D_RESERVED (SSUSB_DEV_BASE + 0x010C)
  40. #define U3D_TX1CSR0 (SSUSB_DEV_BASE + 0x0110)
  41. #define U3D_TX1CSR1 (SSUSB_DEV_BASE + 0x0114)
  42. #define U3D_TX1CSR2 (SSUSB_DEV_BASE + 0x0118)
  43. #define U3D_RX1CSR0 (SSUSB_DEV_BASE + 0x0210)
  44. #define U3D_RX1CSR1 (SSUSB_DEV_BASE + 0x0214)
  45. #define U3D_RX1CSR2 (SSUSB_DEV_BASE + 0x0218)
  46. #define U3D_FIFO0 (SSUSB_DEV_BASE + 0x0300)
  47. #define U3D_QCR0 (SSUSB_DEV_BASE + 0x0400)
  48. #define U3D_QCR1 (SSUSB_DEV_BASE + 0x0404)
  49. #define U3D_QCR2 (SSUSB_DEV_BASE + 0x0408)
  50. #define U3D_QCR3 (SSUSB_DEV_BASE + 0x040C)
  51. #define U3D_TXQCSR1 (SSUSB_DEV_BASE + 0x0510)
  52. #define U3D_TXQSAR1 (SSUSB_DEV_BASE + 0x0514)
  53. #define U3D_TXQCPR1 (SSUSB_DEV_BASE + 0x0518)
  54. #define U3D_RXQCSR1 (SSUSB_DEV_BASE + 0x0610)
  55. #define U3D_RXQSAR1 (SSUSB_DEV_BASE + 0x0614)
  56. #define U3D_RXQCPR1 (SSUSB_DEV_BASE + 0x0618)
  57. #define U3D_RXQLDPR1 (SSUSB_DEV_BASE + 0x061C)
  58. #define U3D_QISAR0 (SSUSB_DEV_BASE + 0x0700)
  59. #define U3D_QIER0 (SSUSB_DEV_BASE + 0x0704)
  60. #define U3D_QIESR0 (SSUSB_DEV_BASE + 0x0708)
  61. #define U3D_QIECR0 (SSUSB_DEV_BASE + 0x070C)
  62. #define U3D_QISAR1 (SSUSB_DEV_BASE + 0x0710)
  63. #define U3D_QIER1 (SSUSB_DEV_BASE + 0x0714)
  64. #define U3D_QIESR1 (SSUSB_DEV_BASE + 0x0718)
  65. #define U3D_QIECR1 (SSUSB_DEV_BASE + 0x071C)
  66. #define U3D_TQERRIR0 (SSUSB_DEV_BASE + 0x0780)
  67. #define U3D_TQERRIER0 (SSUSB_DEV_BASE + 0x0784)
  68. #define U3D_TQERRIESR0 (SSUSB_DEV_BASE + 0x0788)
  69. #define U3D_TQERRIECR0 (SSUSB_DEV_BASE + 0x078C)
  70. #define U3D_RQERRIR0 (SSUSB_DEV_BASE + 0x07C0)
  71. #define U3D_RQERRIER0 (SSUSB_DEV_BASE + 0x07C4)
  72. #define U3D_RQERRIESR0 (SSUSB_DEV_BASE + 0x07C8)
  73. #define U3D_RQERRIECR0 (SSUSB_DEV_BASE + 0x07CC)
  74. #define U3D_RQERRIR1 (SSUSB_DEV_BASE + 0x07D0)
  75. #define U3D_RQERRIER1 (SSUSB_DEV_BASE + 0x07D4)
  76. #define U3D_RQERRIESR1 (SSUSB_DEV_BASE + 0x07D8)
  77. #define U3D_RQERRIECR1 (SSUSB_DEV_BASE + 0x07DC)
  78. #define U3D_CAP_EP0FFSZ (SSUSB_DEV_BASE + 0x0C04)
  79. #define U3D_CAP_EPNTXFFSZ (SSUSB_DEV_BASE + 0x0C08)
  80. #define U3D_CAP_EPNRXFFSZ (SSUSB_DEV_BASE + 0x0C0C)
  81. #define U3D_CAP_EPINFO (SSUSB_DEV_BASE + 0x0C10)
  82. #define U3D_MISC_CTRL (SSUSB_DEV_BASE + 0x0C84)
  83. /*---------------- SSUSB_DEV FIELD DEFINITION ---------------*/
  84. /* U3D_LV1ISR */
  85. #define EP_CTRL_INTR BIT(5)
  86. #define MAC2_INTR BIT(4)
  87. #define DMA_INTR BIT(3)
  88. #define MAC3_INTR BIT(2)
  89. #define QMU_INTR BIT(1)
  90. #define BMU_INTR BIT(0)
  91. /* U3D_LV1IECR */
  92. #define LV1IECR_MSK GENMASK(31, 0)
  93. /* U3D_EPISR */
  94. #define EPRISR(x) (BIT(16) << (x))
  95. #define EPTISR(x) (BIT(0) << (x))
  96. #define EP0ISR BIT(0)
  97. /* U3D_EP0CSR */
  98. #define EP0_SENDSTALL BIT(25)
  99. #define EP0_FIFOFULL BIT(23)
  100. #define EP0_SENTSTALL BIT(22)
  101. #define EP0_DPHTX BIT(20)
  102. #define EP0_DATAEND BIT(19)
  103. #define EP0_TXPKTRDY BIT(18)
  104. #define EP0_SETUPPKTRDY BIT(17)
  105. #define EP0_RXPKTRDY BIT(16)
  106. #define EP0_MAXPKTSZ_MSK GENMASK(9, 0)
  107. #define EP0_MAXPKTSZ(x) ((x) & EP0_MAXPKTSZ_MSK)
  108. #define EP0_W1C_BITS (~(EP0_RXPKTRDY | EP0_SETUPPKTRDY | EP0_SENTSTALL))
  109. /* U3D_TX1CSR0 */
  110. #define TX_DMAREQEN BIT(29)
  111. #define TX_FIFOFULL BIT(25)
  112. #define TX_FIFOEMPTY BIT(24)
  113. #define TX_SENTSTALL BIT(22)
  114. #define TX_SENDSTALL BIT(21)
  115. #define TX_TXPKTRDY BIT(16)
  116. #define TX_TXMAXPKTSZ_MSK GENMASK(10, 0)
  117. #define TX_TXMAXPKTSZ(x) ((x) & TX_TXMAXPKTSZ_MSK)
  118. #define TX_W1C_BITS (~(TX_SENTSTALL))
  119. /* U3D_TX1CSR1 */
  120. #define TX_MULT(x) (((x) & 0x3) << 22)
  121. #define TX_MAX_PKT(x) (((x) & 0x3f) << 16)
  122. #define TX_SLOT(x) (((x) & 0x3f) << 8)
  123. #define TX_TYPE(x) (((x) & 0x3) << 4)
  124. #define TX_SS_BURST(x) (((x) & 0xf) << 0)
  125. /* for TX_TYPE & RX_TYPE */
  126. #define TYPE_BULK (0x0)
  127. #define TYPE_INT (0x1)
  128. #define TYPE_ISO (0x2)
  129. #define TYPE_MASK (0x3)
  130. /* U3D_TX1CSR2 */
  131. #define TX_BINTERVAL(x) (((x) & 0xff) << 24)
  132. #define TX_FIFOSEGSIZE(x) (((x) & 0xf) << 16)
  133. #define TX_FIFOADDR(x) (((x) & 0x1fff) << 0)
  134. /* U3D_RX1CSR0 */
  135. #define RX_DMAREQEN BIT(29)
  136. #define RX_SENTSTALL BIT(22)
  137. #define RX_SENDSTALL BIT(21)
  138. #define RX_RXPKTRDY BIT(16)
  139. #define RX_RXMAXPKTSZ_MSK GENMASK(10, 0)
  140. #define RX_RXMAXPKTSZ(x) ((x) & RX_RXMAXPKTSZ_MSK)
  141. #define RX_W1C_BITS (~(RX_SENTSTALL | RX_RXPKTRDY))
  142. /* U3D_RX1CSR1 */
  143. #define RX_MULT(x) (((x) & 0x3) << 22)
  144. #define RX_MAX_PKT(x) (((x) & 0x3f) << 16)
  145. #define RX_SLOT(x) (((x) & 0x3f) << 8)
  146. #define RX_TYPE(x) (((x) & 0x3) << 4)
  147. #define RX_SS_BURST(x) (((x) & 0xf) << 0)
  148. /* U3D_RX1CSR2 */
  149. #define RX_BINTERVAL(x) (((x) & 0xff) << 24)
  150. #define RX_FIFOSEGSIZE(x) (((x) & 0xf) << 16)
  151. #define RX_FIFOADDR(x) (((x) & 0x1fff) << 0)
  152. /* U3D_QCR0 */
  153. #define QMU_RX_CS_EN(x) (BIT(16) << (x))
  154. #define QMU_TX_CS_EN(x) (BIT(0) << (x))
  155. #define QMU_CS16B_EN BIT(0)
  156. /* U3D_QCR1 */
  157. #define QMU_TX_ZLP(x) (BIT(0) << (x))
  158. /* U3D_QCR3 */
  159. #define QMU_RX_COZ(x) (BIT(16) << (x))
  160. #define QMU_RX_ZLP(x) (BIT(0) << (x))
  161. /* U3D_TXQCSR1 */
  162. /* U3D_RXQCSR1 */
  163. #define QMU_Q_ACTIVE BIT(15)
  164. #define QMU_Q_STOP BIT(2)
  165. #define QMU_Q_RESUME BIT(1)
  166. #define QMU_Q_START BIT(0)
  167. /* U3D_QISAR0, U3D_QIER0, U3D_QIESR0, U3D_QIECR0 */
  168. #define QMU_RX_DONE_INT(x) (BIT(16) << (x))
  169. #define QMU_TX_DONE_INT(x) (BIT(0) << (x))
  170. /* U3D_QISAR1, U3D_QIER1, U3D_QIESR1, U3D_QIECR1 */
  171. #define RXQ_ZLPERR_INT BIT(20)
  172. #define RXQ_LENERR_INT BIT(18)
  173. #define RXQ_CSERR_INT BIT(17)
  174. #define RXQ_EMPTY_INT BIT(16)
  175. #define TXQ_LENERR_INT BIT(2)
  176. #define TXQ_CSERR_INT BIT(1)
  177. #define TXQ_EMPTY_INT BIT(0)
  178. /* U3D_TQERRIR0, U3D_TQERRIER0, U3D_TQERRIESR0, U3D_TQERRIECR0 */
  179. #define QMU_TX_LEN_ERR(x) (BIT(16) << (x))
  180. #define QMU_TX_CS_ERR(x) (BIT(0) << (x))
  181. /* U3D_RQERRIR0, U3D_RQERRIER0, U3D_RQERRIESR0, U3D_RQERRIECR0 */
  182. #define QMU_RX_LEN_ERR(x) (BIT(16) << (x))
  183. #define QMU_RX_CS_ERR(x) (BIT(0) << (x))
  184. /* U3D_RQERRIR1, U3D_RQERRIER1, U3D_RQERRIESR1, U3D_RQERRIECR1 */
  185. #define QMU_RX_ZLP_ERR(n) (BIT(16) << (n))
  186. /* U3D_CAP_EPINFO */
  187. #define CAP_RX_EP_NUM(x) (((x) >> 8) & 0x1f)
  188. #define CAP_TX_EP_NUM(x) ((x) & 0x1f)
  189. /* U3D_MISC_CTRL */
  190. #define VBUS_ON BIT(1)
  191. #define VBUS_FRC_EN BIT(0)
  192. /*---------------- SSUSB_EPCTL_CSR REGISTER DEFINITION ----------------*/
  193. #define U3D_DEVICE_CONF (SSUSB_EPCTL_CSR_BASE + 0x0000)
  194. #define U3D_EP_RST (SSUSB_EPCTL_CSR_BASE + 0x0004)
  195. #define U3D_DEV_LINK_INTR_ENABLE (SSUSB_EPCTL_CSR_BASE + 0x0050)
  196. #define U3D_DEV_LINK_INTR (SSUSB_EPCTL_CSR_BASE + 0x0054)
  197. /*---------------- SSUSB_EPCTL_CSR FIELD DEFINITION ----------------*/
  198. /* U3D_DEVICE_CONF */
  199. #define DEV_ADDR_MSK GENMASK(30, 24)
  200. #define DEV_ADDR(x) ((0x7f & (x)) << 24)
  201. #define HW_USB2_3_SEL BIT(18)
  202. #define SW_USB2_3_SEL_EN BIT(17)
  203. #define SW_USB2_3_SEL BIT(16)
  204. #define SSUSB_DEV_SPEED(x) ((x) & 0x7)
  205. /* U3D_EP_RST */
  206. #define EP1_IN_RST BIT(17)
  207. #define EP1_OUT_RST BIT(1)
  208. #define EP_RST(is_in, epnum) (((is_in) ? BIT(16) : BIT(0)) << (epnum))
  209. #define EP0_RST BIT(0)
  210. /* U3D_DEV_LINK_INTR_ENABLE */
  211. /* U3D_DEV_LINK_INTR */
  212. #define SSUSB_DEV_SPEED_CHG_INTR BIT(0)
  213. /*---------------- SSUSB_USB3_MAC_CSR REGISTER DEFINITION ----------------*/
  214. #define U3D_LTSSM_CTRL (SSUSB_USB3_MAC_CSR_BASE + 0x0010)
  215. #define U3D_USB3_CONFIG (SSUSB_USB3_MAC_CSR_BASE + 0x001C)
  216. #define U3D_LTSSM_INTR_ENABLE (SSUSB_USB3_MAC_CSR_BASE + 0x013C)
  217. #define U3D_LTSSM_INTR (SSUSB_USB3_MAC_CSR_BASE + 0x0140)
  218. /*---------------- SSUSB_USB3_MAC_CSR FIELD DEFINITION ----------------*/
  219. /* U3D_LTSSM_CTRL */
  220. #define FORCE_POLLING_FAIL BIT(4)
  221. #define FORCE_RXDETECT_FAIL BIT(3)
  222. #define SOFT_U3_EXIT_EN BIT(2)
  223. #define COMPLIANCE_EN BIT(1)
  224. #define U1_GO_U2_EN BIT(0)
  225. /* U3D_USB3_CONFIG */
  226. #define USB3_EN BIT(0)
  227. /* U3D_LTSSM_INTR_ENABLE */
  228. /* U3D_LTSSM_INTR */
  229. #define U3_RESUME_INTR BIT(18)
  230. #define U3_LFPS_TMOUT_INTR BIT(17)
  231. #define VBUS_FALL_INTR BIT(16)
  232. #define VBUS_RISE_INTR BIT(15)
  233. #define RXDET_SUCCESS_INTR BIT(14)
  234. #define EXIT_U3_INTR BIT(13)
  235. #define EXIT_U2_INTR BIT(12)
  236. #define EXIT_U1_INTR BIT(11)
  237. #define ENTER_U3_INTR BIT(10)
  238. #define ENTER_U2_INTR BIT(9)
  239. #define ENTER_U1_INTR BIT(8)
  240. #define ENTER_U0_INTR BIT(7)
  241. #define RECOVERY_INTR BIT(6)
  242. #define WARM_RST_INTR BIT(5)
  243. #define HOT_RST_INTR BIT(4)
  244. #define LOOPBACK_INTR BIT(3)
  245. #define COMPLIANCE_INTR BIT(2)
  246. #define SS_DISABLE_INTR BIT(1)
  247. #define SS_INACTIVE_INTR BIT(0)
  248. /*---------------- SSUSB_USB3_SYS_CSR REGISTER DEFINITION ----------------*/
  249. #define U3D_LINK_UX_INACT_TIMER (SSUSB_USB3_SYS_CSR_BASE + 0x020C)
  250. #define U3D_LINK_POWER_CONTROL (SSUSB_USB3_SYS_CSR_BASE + 0x0210)
  251. #define U3D_LINK_ERR_COUNT (SSUSB_USB3_SYS_CSR_BASE + 0x0214)
  252. /*---------------- SSUSB_USB3_SYS_CSR FIELD DEFINITION ----------------*/
  253. /* U3D_LINK_UX_INACT_TIMER */
  254. #define DEV_U2_INACT_TIMEOUT_MSK GENMASK(23, 16)
  255. #define DEV_U2_INACT_TIMEOUT_VALUE(x) (((x) & 0xff) << 16)
  256. #define U2_INACT_TIMEOUT_MSK GENMASK(15, 8)
  257. #define U1_INACT_TIMEOUT_MSK GENMASK(7, 0)
  258. #define U1_INACT_TIMEOUT_VALUE(x) ((x) & 0xff)
  259. /* U3D_LINK_POWER_CONTROL */
  260. #define SW_U2_ACCEPT_ENABLE BIT(9)
  261. #define SW_U1_ACCEPT_ENABLE BIT(8)
  262. #define UX_EXIT BIT(5)
  263. #define LGO_U3 BIT(4)
  264. #define LGO_U2 BIT(3)
  265. #define LGO_U1 BIT(2)
  266. #define SW_U2_REQUEST_ENABLE BIT(1)
  267. #define SW_U1_REQUEST_ENABLE BIT(0)
  268. /* U3D_LINK_ERR_COUNT */
  269. #define CLR_LINK_ERR_CNT BIT(16)
  270. #define LINK_ERROR_COUNT GENMASK(15, 0)
  271. /*---------------- SSUSB_USB2_CSR REGISTER DEFINITION ----------------*/
  272. #define U3D_POWER_MANAGEMENT (SSUSB_USB2_CSR_BASE + 0x0004)
  273. #define U3D_DEVICE_CONTROL (SSUSB_USB2_CSR_BASE + 0x000C)
  274. #define U3D_USB2_TEST_MODE (SSUSB_USB2_CSR_BASE + 0x0014)
  275. #define U3D_COMMON_USB_INTR_ENABLE (SSUSB_USB2_CSR_BASE + 0x0018)
  276. #define U3D_COMMON_USB_INTR (SSUSB_USB2_CSR_BASE + 0x001C)
  277. #define U3D_LINK_RESET_INFO (SSUSB_USB2_CSR_BASE + 0x0024)
  278. #define U3D_USB20_FRAME_NUM (SSUSB_USB2_CSR_BASE + 0x003C)
  279. #define U3D_USB20_LPM_PARAMETER (SSUSB_USB2_CSR_BASE + 0x0044)
  280. #define U3D_USB20_MISC_CONTROL (SSUSB_USB2_CSR_BASE + 0x004C)
  281. /*---------------- SSUSB_USB2_CSR FIELD DEFINITION ----------------*/
  282. /* U3D_POWER_MANAGEMENT */
  283. #define LPM_BESL_STALL BIT(14)
  284. #define LPM_BESLD_STALL BIT(13)
  285. #define LPM_RWP BIT(11)
  286. #define LPM_HRWE BIT(10)
  287. #define LPM_MODE(x) (((x) & 0x3) << 8)
  288. #define ISO_UPDATE BIT(7)
  289. #define SOFT_CONN BIT(6)
  290. #define HS_ENABLE BIT(5)
  291. #define RESUME BIT(2)
  292. #define SUSPENDM_ENABLE BIT(0)
  293. /* U3D_DEVICE_CONTROL */
  294. #define DC_HOSTREQ BIT(1)
  295. #define DC_SESSION BIT(0)
  296. /* U3D_USB2_TEST_MODE */
  297. #define U2U3_AUTO_SWITCH BIT(10)
  298. #define LPM_FORCE_STALL BIT(8)
  299. #define FIFO_ACCESS BIT(6)
  300. #define FORCE_FS BIT(5)
  301. #define FORCE_HS BIT(4)
  302. #define TEST_PACKET_MODE BIT(3)
  303. #define TEST_K_MODE BIT(2)
  304. #define TEST_J_MODE BIT(1)
  305. #define TEST_SE0_NAK_MODE BIT(0)
  306. /* U3D_COMMON_USB_INTR_ENABLE */
  307. /* U3D_COMMON_USB_INTR */
  308. #define LPM_RESUME_INTR BIT(9)
  309. #define LPM_INTR BIT(8)
  310. #define DISCONN_INTR BIT(5)
  311. #define CONN_INTR BIT(4)
  312. #define SOF_INTR BIT(3)
  313. #define RESET_INTR BIT(2)
  314. #define RESUME_INTR BIT(1)
  315. #define SUSPEND_INTR BIT(0)
  316. /* U3D_LINK_RESET_INFO */
  317. #define WTCHRP_MSK GENMASK(19, 16)
  318. /* U3D_USB20_LPM_PARAMETER */
  319. #define LPM_BESLCK_U3(x) (((x) & 0xf) << 12)
  320. #define LPM_BESLCK(x) (((x) & 0xf) << 8)
  321. #define LPM_BESLDCK(x) (((x) & 0xf) << 4)
  322. #define LPM_BESL GENMASK(3, 0)
  323. /* U3D_USB20_MISC_CONTROL */
  324. #define LPM_U3_ACK_EN BIT(0)
  325. /*---------------- SSUSB_SIFSLV_IPPC REGISTER DEFINITION ----------------*/
  326. #define U3D_SSUSB_IP_PW_CTRL0 (SSUSB_SIFSLV_IPPC_BASE + 0x0000)
  327. #define U3D_SSUSB_IP_PW_CTRL1 (SSUSB_SIFSLV_IPPC_BASE + 0x0004)
  328. #define U3D_SSUSB_IP_PW_CTRL2 (SSUSB_SIFSLV_IPPC_BASE + 0x0008)
  329. #define U3D_SSUSB_IP_PW_CTRL3 (SSUSB_SIFSLV_IPPC_BASE + 0x000C)
  330. #define U3D_SSUSB_IP_PW_STS1 (SSUSB_SIFSLV_IPPC_BASE + 0x0010)
  331. #define U3D_SSUSB_IP_PW_STS2 (SSUSB_SIFSLV_IPPC_BASE + 0x0014)
  332. #define U3D_SSUSB_OTG_STS (SSUSB_SIFSLV_IPPC_BASE + 0x0018)
  333. #define U3D_SSUSB_OTG_STS_CLR (SSUSB_SIFSLV_IPPC_BASE + 0x001C)
  334. #define U3D_SSUSB_IP_XHCI_CAP (SSUSB_SIFSLV_IPPC_BASE + 0x0024)
  335. #define U3D_SSUSB_IP_DEV_CAP (SSUSB_SIFSLV_IPPC_BASE + 0x0028)
  336. #define U3D_SSUSB_OTG_INT_EN (SSUSB_SIFSLV_IPPC_BASE + 0x002C)
  337. #define U3D_SSUSB_U3_CTRL_0P (SSUSB_SIFSLV_IPPC_BASE + 0x0030)
  338. #define U3D_SSUSB_U2_CTRL_0P (SSUSB_SIFSLV_IPPC_BASE + 0x0050)
  339. #define U3D_SSUSB_REF_CK_CTRL (SSUSB_SIFSLV_IPPC_BASE + 0x008C)
  340. #define U3D_SSUSB_DEV_RST_CTRL (SSUSB_SIFSLV_IPPC_BASE + 0x0098)
  341. #define U3D_SSUSB_HW_ID (SSUSB_SIFSLV_IPPC_BASE + 0x00A0)
  342. #define U3D_SSUSB_HW_SUB_ID (SSUSB_SIFSLV_IPPC_BASE + 0x00A4)
  343. #define U3D_SSUSB_IP_SPARE0 (SSUSB_SIFSLV_IPPC_BASE + 0x00C8)
  344. /*---------------- SSUSB_SIFSLV_IPPC FIELD DEFINITION ----------------*/
  345. /* U3D_SSUSB_IP_PW_CTRL0 */
  346. #define SSUSB_IP_SW_RST BIT(0)
  347. /* U3D_SSUSB_IP_PW_CTRL1 */
  348. #define SSUSB_IP_HOST_PDN BIT(0)
  349. /* U3D_SSUSB_IP_PW_CTRL2 */
  350. #define SSUSB_IP_DEV_PDN BIT(0)
  351. /* U3D_SSUSB_IP_PW_CTRL3 */
  352. #define SSUSB_IP_PCIE_PDN BIT(0)
  353. /* U3D_SSUSB_IP_PW_STS1 */
  354. #define SSUSB_IP_SLEEP_STS BIT(30)
  355. #define SSUSB_U3_MAC_RST_B_STS BIT(16)
  356. #define SSUSB_XHCI_RST_B_STS BIT(11)
  357. #define SSUSB_SYS125_RST_B_STS BIT(10)
  358. #define SSUSB_REF_RST_B_STS BIT(8)
  359. #define SSUSB_SYSPLL_STABLE BIT(0)
  360. /* U3D_SSUSB_IP_PW_STS2 */
  361. #define SSUSB_U2_MAC_SYS_RST_B_STS BIT(0)
  362. /* U3D_SSUSB_OTG_STS */
  363. #define SSUSB_VBUS_VALID BIT(9)
  364. /* U3D_SSUSB_OTG_STS_CLR */
  365. #define SSUSB_VBUS_INTR_CLR BIT(6)
  366. /* U3D_SSUSB_IP_XHCI_CAP */
  367. #define SSUSB_IP_XHCI_U2_PORT_NUM(x) (((x) >> 8) & 0xff)
  368. #define SSUSB_IP_XHCI_U3_PORT_NUM(x) ((x) & 0xff)
  369. /* U3D_SSUSB_IP_DEV_CAP */
  370. #define SSUSB_IP_DEV_U3_PORT_NUM(x) ((x) & 0xff)
  371. /* U3D_SSUSB_OTG_INT_EN */
  372. #define SSUSB_VBUS_CHG_INT_A_EN BIT(7)
  373. #define SSUSB_VBUS_CHG_INT_B_EN BIT(6)
  374. /* U3D_SSUSB_U3_CTRL_0P */
  375. #define SSUSB_U3_PORT_HOST_SEL BIT(2)
  376. #define SSUSB_U3_PORT_PDN BIT(1)
  377. #define SSUSB_U3_PORT_DIS BIT(0)
  378. /* U3D_SSUSB_U2_CTRL_0P */
  379. #define SSUSB_U2_PORT_OTG_SEL BIT(7)
  380. #define SSUSB_U2_PORT_HOST_SEL BIT(2)
  381. #define SSUSB_U2_PORT_PDN BIT(1)
  382. #define SSUSB_U2_PORT_DIS BIT(0)
  383. /* U3D_SSUSB_DEV_RST_CTRL */
  384. #define SSUSB_DEV_SW_RST BIT(0)
  385. #endif /* _SSUSB_HW_REGS_H_ */