mtu3_hw_regs.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * mtu3_hw_regs.h - MediaTek USB3 DRD register and field definitions
  4. *
  5. * Copyright (C) 2016 MediaTek Inc.
  6. *
  7. * Author: Chunfeng Yun <chunfeng.yun@mediatek.com>
  8. */
  9. #ifndef _SSUSB_HW_REGS_H_
  10. #define _SSUSB_HW_REGS_H_
  11. /* segment offset of MAC register */
  12. #define SSUSB_DEV_BASE 0x0000
  13. #define SSUSB_EPCTL_CSR_BASE 0x0800
  14. #define SSUSB_USB3_MAC_CSR_BASE 0x1400
  15. #define SSUSB_USB3_SYS_CSR_BASE 0x1400
  16. #define SSUSB_USB2_CSR_BASE 0x2400
  17. /* IPPC register in Infra */
  18. #define SSUSB_SIFSLV_IPPC_BASE 0x0000
  19. /* --------------- SSUSB_DEV REGISTER DEFINITION --------------- */
  20. #define U3D_LV1ISR (SSUSB_DEV_BASE + 0x0000)
  21. #define U3D_LV1IER (SSUSB_DEV_BASE + 0x0004)
  22. #define U3D_LV1IESR (SSUSB_DEV_BASE + 0x0008)
  23. #define U3D_LV1IECR (SSUSB_DEV_BASE + 0x000C)
  24. #define U3D_EPISR (SSUSB_DEV_BASE + 0x0080)
  25. #define U3D_EPIER (SSUSB_DEV_BASE + 0x0084)
  26. #define U3D_EPIESR (SSUSB_DEV_BASE + 0x0088)
  27. #define U3D_EPIECR (SSUSB_DEV_BASE + 0x008C)
  28. #define U3D_EP0CSR (SSUSB_DEV_BASE + 0x0100)
  29. #define U3D_RXCOUNT0 (SSUSB_DEV_BASE + 0x0108)
  30. #define U3D_RESERVED (SSUSB_DEV_BASE + 0x010C)
  31. #define U3D_TX1CSR0 (SSUSB_DEV_BASE + 0x0110)
  32. #define U3D_TX1CSR1 (SSUSB_DEV_BASE + 0x0114)
  33. #define U3D_TX1CSR2 (SSUSB_DEV_BASE + 0x0118)
  34. #define U3D_RX1CSR0 (SSUSB_DEV_BASE + 0x0210)
  35. #define U3D_RX1CSR1 (SSUSB_DEV_BASE + 0x0214)
  36. #define U3D_RX1CSR2 (SSUSB_DEV_BASE + 0x0218)
  37. #define U3D_FIFO0 (SSUSB_DEV_BASE + 0x0300)
  38. #define U3D_QCR0 (SSUSB_DEV_BASE + 0x0400)
  39. #define U3D_QCR1 (SSUSB_DEV_BASE + 0x0404)
  40. #define U3D_QCR2 (SSUSB_DEV_BASE + 0x0408)
  41. #define U3D_QCR3 (SSUSB_DEV_BASE + 0x040C)
  42. #define U3D_TXQHIAR1 (SSUSB_DEV_BASE + 0x0484)
  43. #define U3D_RXQHIAR1 (SSUSB_DEV_BASE + 0x04C4)
  44. #define U3D_TXQCSR1 (SSUSB_DEV_BASE + 0x0510)
  45. #define U3D_TXQSAR1 (SSUSB_DEV_BASE + 0x0514)
  46. #define U3D_TXQCPR1 (SSUSB_DEV_BASE + 0x0518)
  47. #define U3D_RXQCSR1 (SSUSB_DEV_BASE + 0x0610)
  48. #define U3D_RXQSAR1 (SSUSB_DEV_BASE + 0x0614)
  49. #define U3D_RXQCPR1 (SSUSB_DEV_BASE + 0x0618)
  50. #define U3D_RXQLDPR1 (SSUSB_DEV_BASE + 0x061C)
  51. #define U3D_QISAR0 (SSUSB_DEV_BASE + 0x0700)
  52. #define U3D_QIER0 (SSUSB_DEV_BASE + 0x0704)
  53. #define U3D_QIESR0 (SSUSB_DEV_BASE + 0x0708)
  54. #define U3D_QIECR0 (SSUSB_DEV_BASE + 0x070C)
  55. #define U3D_QISAR1 (SSUSB_DEV_BASE + 0x0710)
  56. #define U3D_QIER1 (SSUSB_DEV_BASE + 0x0714)
  57. #define U3D_QIESR1 (SSUSB_DEV_BASE + 0x0718)
  58. #define U3D_QIECR1 (SSUSB_DEV_BASE + 0x071C)
  59. #define U3D_TQERRIR0 (SSUSB_DEV_BASE + 0x0780)
  60. #define U3D_TQERRIER0 (SSUSB_DEV_BASE + 0x0784)
  61. #define U3D_TQERRIESR0 (SSUSB_DEV_BASE + 0x0788)
  62. #define U3D_TQERRIECR0 (SSUSB_DEV_BASE + 0x078C)
  63. #define U3D_RQERRIR0 (SSUSB_DEV_BASE + 0x07C0)
  64. #define U3D_RQERRIER0 (SSUSB_DEV_BASE + 0x07C4)
  65. #define U3D_RQERRIESR0 (SSUSB_DEV_BASE + 0x07C8)
  66. #define U3D_RQERRIECR0 (SSUSB_DEV_BASE + 0x07CC)
  67. #define U3D_RQERRIR1 (SSUSB_DEV_BASE + 0x07D0)
  68. #define U3D_RQERRIER1 (SSUSB_DEV_BASE + 0x07D4)
  69. #define U3D_RQERRIESR1 (SSUSB_DEV_BASE + 0x07D8)
  70. #define U3D_RQERRIECR1 (SSUSB_DEV_BASE + 0x07DC)
  71. #define U3D_CAP_EP0FFSZ (SSUSB_DEV_BASE + 0x0C04)
  72. #define U3D_CAP_EPNTXFFSZ (SSUSB_DEV_BASE + 0x0C08)
  73. #define U3D_CAP_EPNRXFFSZ (SSUSB_DEV_BASE + 0x0C0C)
  74. #define U3D_CAP_EPINFO (SSUSB_DEV_BASE + 0x0C10)
  75. #define U3D_MISC_CTRL (SSUSB_DEV_BASE + 0x0C84)
  76. /*---------------- SSUSB_DEV FIELD DEFINITION ---------------*/
  77. /* U3D_LV1ISR */
  78. #define EP_CTRL_INTR BIT(5)
  79. #define MAC2_INTR BIT(4)
  80. #define DMA_INTR BIT(3)
  81. #define MAC3_INTR BIT(2)
  82. #define QMU_INTR BIT(1)
  83. #define BMU_INTR BIT(0)
  84. /* U3D_LV1IECR */
  85. #define LV1IECR_MSK GENMASK(31, 0)
  86. /* U3D_EPISR */
  87. #define EPRISR(x) (BIT(16) << (x))
  88. #define EPTISR(x) (BIT(0) << (x))
  89. #define EP0ISR BIT(0)
  90. /* U3D_EP0CSR */
  91. #define EP0_SENDSTALL BIT(25)
  92. #define EP0_FIFOFULL BIT(23)
  93. #define EP0_SENTSTALL BIT(22)
  94. #define EP0_DPHTX BIT(20)
  95. #define EP0_DATAEND BIT(19)
  96. #define EP0_TXPKTRDY BIT(18)
  97. #define EP0_SETUPPKTRDY BIT(17)
  98. #define EP0_RXPKTRDY BIT(16)
  99. #define EP0_MAXPKTSZ_MSK GENMASK(9, 0)
  100. #define EP0_MAXPKTSZ(x) ((x) & EP0_MAXPKTSZ_MSK)
  101. #define EP0_W1C_BITS (~(EP0_RXPKTRDY | EP0_SETUPPKTRDY | EP0_SENTSTALL))
  102. /* U3D_TX1CSR0 */
  103. #define TX_DMAREQEN BIT(29)
  104. #define TX_FIFOFULL BIT(25)
  105. #define TX_FIFOEMPTY BIT(24)
  106. #define TX_SENTSTALL BIT(22)
  107. #define TX_SENDSTALL BIT(21)
  108. #define TX_TXPKTRDY BIT(16)
  109. #define TX_TXMAXPKTSZ_MSK GENMASK(10, 0)
  110. #define TX_TXMAXPKTSZ(x) ((x) & TX_TXMAXPKTSZ_MSK)
  111. #define TX_W1C_BITS (~(TX_SENTSTALL))
  112. /* U3D_TX1CSR1 */
  113. #define TX_MULT(x) (((x) & 0x3) << 22)
  114. #define TX_MAX_PKT(x) (((x) & 0x3f) << 16)
  115. #define TX_SLOT(x) (((x) & 0x3f) << 8)
  116. #define TX_TYPE(x) (((x) & 0x3) << 4)
  117. #define TX_SS_BURST(x) (((x) & 0xf) << 0)
  118. /* for TX_TYPE & RX_TYPE */
  119. #define TYPE_BULK (0x0)
  120. #define TYPE_INT (0x1)
  121. #define TYPE_ISO (0x2)
  122. #define TYPE_MASK (0x3)
  123. /* U3D_TX1CSR2 */
  124. #define TX_BINTERVAL(x) (((x) & 0xff) << 24)
  125. #define TX_FIFOSEGSIZE(x) (((x) & 0xf) << 16)
  126. #define TX_FIFOADDR(x) (((x) & 0x1fff) << 0)
  127. /* U3D_RX1CSR0 */
  128. #define RX_DMAREQEN BIT(29)
  129. #define RX_SENTSTALL BIT(22)
  130. #define RX_SENDSTALL BIT(21)
  131. #define RX_RXPKTRDY BIT(16)
  132. #define RX_RXMAXPKTSZ_MSK GENMASK(10, 0)
  133. #define RX_RXMAXPKTSZ(x) ((x) & RX_RXMAXPKTSZ_MSK)
  134. #define RX_W1C_BITS (~(RX_SENTSTALL | RX_RXPKTRDY))
  135. /* U3D_RX1CSR1 */
  136. #define RX_MULT(x) (((x) & 0x3) << 22)
  137. #define RX_MAX_PKT(x) (((x) & 0x3f) << 16)
  138. #define RX_SLOT(x) (((x) & 0x3f) << 8)
  139. #define RX_TYPE(x) (((x) & 0x3) << 4)
  140. #define RX_SS_BURST(x) (((x) & 0xf) << 0)
  141. /* U3D_RX1CSR2 */
  142. #define RX_BINTERVAL(x) (((x) & 0xff) << 24)
  143. #define RX_FIFOSEGSIZE(x) (((x) & 0xf) << 16)
  144. #define RX_FIFOADDR(x) (((x) & 0x1fff) << 0)
  145. /* U3D_QCR0 */
  146. #define QMU_RX_CS_EN(x) (BIT(16) << (x))
  147. #define QMU_TX_CS_EN(x) (BIT(0) << (x))
  148. #define QMU_CS16B_EN BIT(0)
  149. /* U3D_QCR1 */
  150. #define QMU_TX_ZLP(x) (BIT(0) << (x))
  151. /* U3D_QCR3 */
  152. #define QMU_RX_COZ(x) (BIT(16) << (x))
  153. #define QMU_RX_ZLP(x) (BIT(0) << (x))
  154. /* U3D_TXQHIAR1 */
  155. /* U3D_RXQHIAR1 */
  156. #define QMU_LAST_DONE_PTR_HI(x) (((x) >> 16) & 0xf)
  157. #define QMU_CUR_GPD_ADDR_HI(x) (((x) >> 8) & 0xf)
  158. #define QMU_START_ADDR_HI_MSK GENMASK(3, 0)
  159. #define QMU_START_ADDR_HI(x) (((x) & 0xf) << 0)
  160. /* U3D_TXQCSR1 */
  161. /* U3D_RXQCSR1 */
  162. #define QMU_Q_ACTIVE BIT(15)
  163. #define QMU_Q_STOP BIT(2)
  164. #define QMU_Q_RESUME BIT(1)
  165. #define QMU_Q_START BIT(0)
  166. /* U3D_QISAR0, U3D_QIER0, U3D_QIESR0, U3D_QIECR0 */
  167. #define QMU_RX_DONE_INT(x) (BIT(16) << (x))
  168. #define QMU_TX_DONE_INT(x) (BIT(0) << (x))
  169. /* U3D_QISAR1, U3D_QIER1, U3D_QIESR1, U3D_QIECR1 */
  170. #define RXQ_ZLPERR_INT BIT(20)
  171. #define RXQ_LENERR_INT BIT(18)
  172. #define RXQ_CSERR_INT BIT(17)
  173. #define RXQ_EMPTY_INT BIT(16)
  174. #define TXQ_LENERR_INT BIT(2)
  175. #define TXQ_CSERR_INT BIT(1)
  176. #define TXQ_EMPTY_INT BIT(0)
  177. /* U3D_TQERRIR0, U3D_TQERRIER0, U3D_TQERRIESR0, U3D_TQERRIECR0 */
  178. #define QMU_TX_LEN_ERR(x) (BIT(16) << (x))
  179. #define QMU_TX_CS_ERR(x) (BIT(0) << (x))
  180. /* U3D_RQERRIR0, U3D_RQERRIER0, U3D_RQERRIESR0, U3D_RQERRIECR0 */
  181. #define QMU_RX_LEN_ERR(x) (BIT(16) << (x))
  182. #define QMU_RX_CS_ERR(x) (BIT(0) << (x))
  183. /* U3D_RQERRIR1, U3D_RQERRIER1, U3D_RQERRIESR1, U3D_RQERRIECR1 */
  184. #define QMU_RX_ZLP_ERR(n) (BIT(16) << (n))
  185. /* U3D_CAP_EPINFO */
  186. #define CAP_RX_EP_NUM(x) (((x) >> 8) & 0x1f)
  187. #define CAP_TX_EP_NUM(x) ((x) & 0x1f)
  188. /* U3D_MISC_CTRL */
  189. #define DMA_ADDR_36BIT BIT(31)
  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_SSP_SPEED BIT(9)
  376. #define SSUSB_U3_PORT_DUAL_MODE BIT(7)
  377. #define SSUSB_U3_PORT_HOST_SEL BIT(2)
  378. #define SSUSB_U3_PORT_PDN BIT(1)
  379. #define SSUSB_U3_PORT_DIS BIT(0)
  380. /* U3D_SSUSB_U2_CTRL_0P */
  381. #define SSUSB_U2_PORT_RG_IDDIG BIT(12)
  382. #define SSUSB_U2_PORT_FORCE_IDDIG BIT(11)
  383. #define SSUSB_U2_PORT_VBUSVALID BIT(9)
  384. #define SSUSB_U2_PORT_OTG_SEL BIT(7)
  385. #define SSUSB_U2_PORT_HOST BIT(2)
  386. #define SSUSB_U2_PORT_PDN BIT(1)
  387. #define SSUSB_U2_PORT_DIS BIT(0)
  388. #define SSUSB_U2_PORT_HOST_SEL (SSUSB_U2_PORT_VBUSVALID | SSUSB_U2_PORT_HOST)
  389. /* U3D_SSUSB_DEV_RST_CTRL */
  390. #define SSUSB_DEV_SW_RST BIT(0)
  391. #endif /* _SSUSB_HW_REGS_H_ */