pcie_regs_pearl.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. /*
  2. * Copyright (c) 2015 Quantenna Communications, Inc.
  3. * All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation; either version 2
  8. * of the License, or (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. */
  16. #ifndef __PEARL_PCIE_H
  17. #define __PEARL_PCIE_H
  18. #define PCIE_GEN2_BASE (0xe9000000)
  19. #define PCIE_GEN3_BASE (0xe7000000)
  20. #define PEARL_CUR_PCIE_BASE (PCIE_GEN2_BASE)
  21. #define PCIE_HDP_OFFSET (0x2000)
  22. #define PCIE_HDP_CTRL(base) ((base) + 0x2c00)
  23. #define PCIE_HDP_AXI_CTRL(base) ((base) + 0x2c04)
  24. #define PCIE_HDP_HOST_WR_DESC0(base) ((base) + 0x2c10)
  25. #define PCIE_HDP_HOST_WR_DESC0_H(base) ((base) + 0x2c14)
  26. #define PCIE_HDP_HOST_WR_DESC1(base) ((base) + 0x2c18)
  27. #define PCIE_HDP_HOST_WR_DESC1_H(base) ((base) + 0x2c1c)
  28. #define PCIE_HDP_HOST_WR_DESC2(base) ((base) + 0x2c20)
  29. #define PCIE_HDP_HOST_WR_DESC2_H(base) ((base) + 0x2c24)
  30. #define PCIE_HDP_HOST_WR_DESC3(base) ((base) + 0x2c28)
  31. #define PCIE_HDP_HOST_WR_DESC4_H(base) ((base) + 0x2c2c)
  32. #define PCIE_HDP_RX_INT_CTRL(base) ((base) + 0x2c30)
  33. #define PCIE_HDP_TX_INT_CTRL(base) ((base) + 0x2c34)
  34. #define PCIE_HDP_INT_STATUS(base) ((base) + 0x2c38)
  35. #define PCIE_HDP_INT_EN(base) ((base) + 0x2c3c)
  36. #define PCIE_HDP_RX_DESC0_PTR(base) ((base) + 0x2c40)
  37. #define PCIE_HDP_RX_DESC0_NOE(base) ((base) + 0x2c44)
  38. #define PCIE_HDP_RX_DESC1_PTR(base) ((base) + 0x2c48)
  39. #define PCIE_HDP_RX_DESC1_NOE(base) ((base) + 0x2c4c)
  40. #define PCIE_HDP_RX_DESC2_PTR(base) ((base) + 0x2c50)
  41. #define PCIE_HDP_RX_DESC2_NOE(base) ((base) + 0x2c54)
  42. #define PCIE_HDP_RX_DESC3_PTR(base) ((base) + 0x2c58)
  43. #define PCIE_HDP_RX_DESC3_NOE(base) ((base) + 0x2c5c)
  44. #define PCIE_HDP_TX0_BASE_ADDR(base) ((base) + 0x2c60)
  45. #define PCIE_HDP_TX1_BASE_ADDR(base) ((base) + 0x2c64)
  46. #define PCIE_HDP_TX0_Q_CTRL(base) ((base) + 0x2c70)
  47. #define PCIE_HDP_TX1_Q_CTRL(base) ((base) + 0x2c74)
  48. #define PCIE_HDP_CFG0(base) ((base) + 0x2c80)
  49. #define PCIE_HDP_CFG1(base) ((base) + 0x2c84)
  50. #define PCIE_HDP_CFG2(base) ((base) + 0x2c88)
  51. #define PCIE_HDP_CFG3(base) ((base) + 0x2c8c)
  52. #define PCIE_HDP_CFG4(base) ((base) + 0x2c90)
  53. #define PCIE_HDP_CFG5(base) ((base) + 0x2c94)
  54. #define PCIE_HDP_CFG6(base) ((base) + 0x2c98)
  55. #define PCIE_HDP_CFG7(base) ((base) + 0x2c9c)
  56. #define PCIE_HDP_CFG8(base) ((base) + 0x2ca0)
  57. #define PCIE_HDP_CFG9(base) ((base) + 0x2ca4)
  58. #define PCIE_HDP_CFG10(base) ((base) + 0x2ca8)
  59. #define PCIE_HDP_CFG11(base) ((base) + 0x2cac)
  60. #define PCIE_INT(base) ((base) + 0x2cb0)
  61. #define PCIE_INT_MASK(base) ((base) + 0x2cb4)
  62. #define PCIE_MSI_MASK(base) ((base) + 0x2cb8)
  63. #define PCIE_MSI_PNDG(base) ((base) + 0x2cbc)
  64. #define PCIE_PRI_CFG(base) ((base) + 0x2cc0)
  65. #define PCIE_PHY_CR(base) ((base) + 0x2cc4)
  66. #define PCIE_HDP_CTAG_CTRL(base) ((base) + 0x2cf4)
  67. #define PCIE_HDP_HHBM_BUF_PTR(base) ((base) + 0x2d00)
  68. #define PCIE_HDP_HHBM_BUF_PTR_H(base) ((base) + 0x2d04)
  69. #define PCIE_HDP_HHBM_BUF_FIFO_NOE(base) ((base) + 0x2d04)
  70. #define PCIE_HDP_RX0DMA_CNT(base) ((base) + 0x2d10)
  71. #define PCIE_HDP_RX1DMA_CNT(base) ((base) + 0x2d14)
  72. #define PCIE_HDP_RX2DMA_CNT(base) ((base) + 0x2d18)
  73. #define PCIE_HDP_RX3DMA_CNT(base) ((base) + 0x2d1c)
  74. #define PCIE_HDP_TX0DMA_CNT(base) ((base) + 0x2d20)
  75. #define PCIE_HDP_TX1DMA_CNT(base) ((base) + 0x2d24)
  76. #define PCIE_HDP_RXDMA_CTRL(base) ((base) + 0x2d28)
  77. #define PCIE_HDP_TX_HOST_Q_SZ_CTRL(base) ((base) + 0x2d2c)
  78. #define PCIE_HDP_TX_HOST_Q_BASE_L(base) ((base) + 0x2d30)
  79. #define PCIE_HDP_TX_HOST_Q_BASE_H(base) ((base) + 0x2d34)
  80. #define PCIE_HDP_TX_HOST_Q_WR_PTR(base) ((base) + 0x2d38)
  81. #define PCIE_HDP_TX_HOST_Q_RD_PTR(base) ((base) + 0x2d3c)
  82. #define PCIE_HDP_TX_HOST_Q_STS(base) ((base) + 0x2d40)
  83. /* Host HBM pool registers */
  84. #define PCIE_HHBM_CSR_REG(base) ((base) + 0x2e00)
  85. #define PCIE_HHBM_Q_BASE_REG(base) ((base) + 0x2e04)
  86. #define PCIE_HHBM_Q_LIMIT_REG(base) ((base) + 0x2e08)
  87. #define PCIE_HHBM_Q_WR_REG(base) ((base) + 0x2e0c)
  88. #define PCIE_HHBM_Q_RD_REG(base) ((base) + 0x2e10)
  89. #define PCIE_HHBM_POOL_DATA_0_H(base) ((base) + 0x2e90)
  90. #define PCIE_HHBM_CONFIG(base) ((base) + 0x2f9c)
  91. #define PCIE_HHBM_POOL_REQ_0(base) ((base) + 0x2f10)
  92. #define PCIE_HHBM_POOL_DATA_0(base) ((base) + 0x2f40)
  93. #define PCIE_HHBM_WATERMARK_MASKED_INT(base) ((base) + 0x2f68)
  94. #define PCIE_HHBM_WATERMARK_INT(base) ((base) + 0x2f6c)
  95. #define PCIE_HHBM_POOL_WATERMARK(base) ((base) + 0x2f70)
  96. #define PCIE_HHBM_POOL_OVERFLOW_CNT(base) ((base) + 0x2f90)
  97. #define PCIE_HHBM_POOL_UNDERFLOW_CNT(base) ((base) + 0x2f94)
  98. #define HBM_INT_STATUS(base) ((base) + 0x2f9c)
  99. #define PCIE_HHBM_POOL_CNFIG(base) ((base) + 0x2f9c)
  100. /* host HBM bit field definition */
  101. #define HHBM_CONFIG_SOFT_RESET (BIT(8))
  102. #define HHBM_WR_REQ (BIT(0))
  103. #define HHBM_RD_REQ (BIT(1))
  104. #define HHBM_DONE (BIT(31))
  105. #define HHBM_64BIT (BIT(10))
  106. /* offsets for dual PCIE */
  107. #define PCIE_PORT_LINK_CTL(base) ((base) + 0x0710)
  108. #define PCIE_GEN2_CTL(base) ((base) + 0x080C)
  109. #define PCIE_GEN3_OFF(base) ((base) + 0x0890)
  110. #define PCIE_ATU_CTRL1(base) ((base) + 0x0904)
  111. #define PCIE_ATU_CTRL2(base) ((base) + 0x0908)
  112. #define PCIE_ATU_BASE_LOW(base) ((base) + 0x090C)
  113. #define PCIE_ATU_BASE_HIGH(base) ((base) + 0x0910)
  114. #define PCIE_ATU_BASE_LIMIT(base) ((base) + 0x0914)
  115. #define PCIE_ATU_TGT_LOW(base) ((base) + 0x0918)
  116. #define PCIE_ATU_TGT_HIGH(base) ((base) + 0x091C)
  117. #define PCIE_DMA_WR_ENABLE(base) ((base) + 0x097C)
  118. #define PCIE_DMA_WR_CHWTLOW(base) ((base) + 0x0988)
  119. #define PCIE_DMA_WR_CHWTHIG(base) ((base) + 0x098C)
  120. #define PCIE_DMA_WR_INTSTS(base) ((base) + 0x09BC)
  121. #define PCIE_DMA_WR_INTMASK(base) ((base) + 0x09C4)
  122. #define PCIE_DMA_WR_INTCLER(base) ((base) + 0x09C8)
  123. #define PCIE_DMA_WR_DONE_IMWR_ADDR_L(base) ((base) + 0x09D0)
  124. #define PCIE_DMA_WR_DONE_IMWR_ADDR_H(base) ((base) + 0x09D4)
  125. #define PCIE_DMA_WR_ABORT_IMWR_ADDR_L(base) ((base) + 0x09D8)
  126. #define PCIE_DMA_WR_ABORT_IMWR_ADDR_H(base) ((base) + 0x09DC)
  127. #define PCIE_DMA_WR_IMWR_DATA(base) ((base) + 0x09E0)
  128. #define PCIE_DMA_WR_LL_ERR_EN(base) ((base) + 0x0A00)
  129. #define PCIE_DMA_WR_DOORBELL(base) ((base) + 0x0980)
  130. #define PCIE_DMA_RD_ENABLE(base) ((base) + 0x099C)
  131. #define PCIE_DMA_RD_DOORBELL(base) ((base) + 0x09A0)
  132. #define PCIE_DMA_RD_CHWTLOW(base) ((base) + 0x09A8)
  133. #define PCIE_DMA_RD_CHWTHIG(base) ((base) + 0x09AC)
  134. #define PCIE_DMA_RD_INTSTS(base) ((base) + 0x0A10)
  135. #define PCIE_DMA_RD_INTMASK(base) ((base) + 0x0A18)
  136. #define PCIE_DMA_RD_INTCLER(base) ((base) + 0x0A1C)
  137. #define PCIE_DMA_RD_ERR_STS_L(base) ((base) + 0x0A24)
  138. #define PCIE_DMA_RD_ERR_STS_H(base) ((base) + 0x0A28)
  139. #define PCIE_DMA_RD_LL_ERR_EN(base) ((base) + 0x0A34)
  140. #define PCIE_DMA_RD_DONE_IMWR_ADDR_L(base) ((base) + 0x0A3C)
  141. #define PCIE_DMA_RD_DONE_IMWR_ADDR_H(base) ((base) + 0x0A40)
  142. #define PCIE_DMA_RD_ABORT_IMWR_ADDR_L(base) ((base) + 0x0A44)
  143. #define PCIE_DMA_RD_ABORT_IMWR_ADDR_H(base) ((base) + 0x0A48)
  144. #define PCIE_DMA_RD_IMWR_DATA(base) ((base) + 0x0A4C)
  145. #define PCIE_DMA_CHNL_CONTEXT(base) ((base) + 0x0A6C)
  146. #define PCIE_DMA_CHNL_CNTRL(base) ((base) + 0x0A70)
  147. #define PCIE_DMA_XFR_SIZE(base) ((base) + 0x0A78)
  148. #define PCIE_DMA_SAR_LOW(base) ((base) + 0x0A7C)
  149. #define PCIE_DMA_SAR_HIGH(base) ((base) + 0x0A80)
  150. #define PCIE_DMA_DAR_LOW(base) ((base) + 0x0A84)
  151. #define PCIE_DMA_DAR_HIGH(base) ((base) + 0x0A88)
  152. #define PCIE_DMA_LLPTR_LOW(base) ((base) + 0x0A8C)
  153. #define PCIE_DMA_LLPTR_HIGH(base) ((base) + 0x0A90)
  154. #define PCIE_DMA_WRLL_ERR_ENB(base) ((base) + 0x0A00)
  155. #define PCIE_DMA_RDLL_ERR_ENB(base) ((base) + 0x0A34)
  156. #define PCIE_DMABD_CHNL_CNTRL(base) ((base) + 0x8000)
  157. #define PCIE_DMABD_XFR_SIZE(base) ((base) + 0x8004)
  158. #define PCIE_DMABD_SAR_LOW(base) ((base) + 0x8008)
  159. #define PCIE_DMABD_SAR_HIGH(base) ((base) + 0x800c)
  160. #define PCIE_DMABD_DAR_LOW(base) ((base) + 0x8010)
  161. #define PCIE_DMABD_DAR_HIGH(base) ((base) + 0x8014)
  162. #define PCIE_DMABD_LLPTR_LOW(base) ((base) + 0x8018)
  163. #define PCIE_DMABD_LLPTR_HIGH(base) ((base) + 0x801c)
  164. #define PCIE_WRDMA0_CHNL_CNTRL(base) ((base) + 0x8000)
  165. #define PCIE_WRDMA0_XFR_SIZE(base) ((base) + 0x8004)
  166. #define PCIE_WRDMA0_SAR_LOW(base) ((base) + 0x8008)
  167. #define PCIE_WRDMA0_SAR_HIGH(base) ((base) + 0x800c)
  168. #define PCIE_WRDMA0_DAR_LOW(base) ((base) + 0x8010)
  169. #define PCIE_WRDMA0_DAR_HIGH(base) ((base) + 0x8014)
  170. #define PCIE_WRDMA0_LLPTR_LOW(base) ((base) + 0x8018)
  171. #define PCIE_WRDMA0_LLPTR_HIGH(base) ((base) + 0x801c)
  172. #define PCIE_WRDMA1_CHNL_CNTRL(base) ((base) + 0x8020)
  173. #define PCIE_WRDMA1_XFR_SIZE(base) ((base) + 0x8024)
  174. #define PCIE_WRDMA1_SAR_LOW(base) ((base) + 0x8028)
  175. #define PCIE_WRDMA1_SAR_HIGH(base) ((base) + 0x802c)
  176. #define PCIE_WRDMA1_DAR_LOW(base) ((base) + 0x8030)
  177. #define PCIE_WRDMA1_DAR_HIGH(base) ((base) + 0x8034)
  178. #define PCIE_WRDMA1_LLPTR_LOW(base) ((base) + 0x8038)
  179. #define PCIE_WRDMA1_LLPTR_HIGH(base) ((base) + 0x803c)
  180. #define PCIE_RDDMA0_CHNL_CNTRL(base) ((base) + 0x8040)
  181. #define PCIE_RDDMA0_XFR_SIZE(base) ((base) + 0x8044)
  182. #define PCIE_RDDMA0_SAR_LOW(base) ((base) + 0x8048)
  183. #define PCIE_RDDMA0_SAR_HIGH(base) ((base) + 0x804c)
  184. #define PCIE_RDDMA0_DAR_LOW(base) ((base) + 0x8050)
  185. #define PCIE_RDDMA0_DAR_HIGH(base) ((base) + 0x8054)
  186. #define PCIE_RDDMA0_LLPTR_LOW(base) ((base) + 0x8058)
  187. #define PCIE_RDDMA0_LLPTR_HIGH(base) ((base) + 0x805c)
  188. #define PCIE_RDDMA1_CHNL_CNTRL(base) ((base) + 0x8060)
  189. #define PCIE_RDDMA1_XFR_SIZE(base) ((base) + 0x8064)
  190. #define PCIE_RDDMA1_SAR_LOW(base) ((base) + 0x8068)
  191. #define PCIE_RDDMA1_SAR_HIGH(base) ((base) + 0x806c)
  192. #define PCIE_RDDMA1_DAR_LOW(base) ((base) + 0x8070)
  193. #define PCIE_RDDMA1_DAR_HIGH(base) ((base) + 0x8074)
  194. #define PCIE_RDDMA1_LLPTR_LOW(base) ((base) + 0x8078)
  195. #define PCIE_RDDMA1_LLPTR_HIGH(base) ((base) + 0x807c)
  196. #define PCIE_ID(base) ((base) + 0x0000)
  197. #define PCIE_CMD(base) ((base) + 0x0004)
  198. #define PCIE_BAR(base, n) ((base) + 0x0010 + ((n) << 2))
  199. #define PCIE_CAP_PTR(base) ((base) + 0x0034)
  200. #define PCIE_MSI_LBAR(base) ((base) + 0x0054)
  201. #define PCIE_MSI_CTRL(base) ((base) + 0x0050)
  202. #define PCIE_MSI_ADDR_L(base) ((base) + 0x0054)
  203. #define PCIE_MSI_ADDR_H(base) ((base) + 0x0058)
  204. #define PCIE_MSI_DATA(base) ((base) + 0x005C)
  205. #define PCIE_MSI_MASK_BIT(base) ((base) + 0x0060)
  206. #define PCIE_MSI_PEND_BIT(base) ((base) + 0x0064)
  207. #define PCIE_DEVCAP(base) ((base) + 0x0074)
  208. #define PCIE_DEVCTLSTS(base) ((base) + 0x0078)
  209. #define PCIE_CMDSTS(base) ((base) + 0x0004)
  210. #define PCIE_LINK_STAT(base) ((base) + 0x80)
  211. #define PCIE_LINK_CTL2(base) ((base) + 0xa0)
  212. #define PCIE_ASPM_L1_CTRL(base) ((base) + 0x70c)
  213. #define PCIE_ASPM_LINK_CTRL(base) (PCIE_LINK_STAT)
  214. #define PCIE_ASPM_L1_SUBSTATE_TIMING(base) ((base) + 0xB44)
  215. #define PCIE_L1SUB_CTRL1(base) ((base) + 0x150)
  216. #define PCIE_PMCSR(base) ((base) + 0x44)
  217. #define PCIE_CFG_SPACE_LIMIT(base) ((base) + 0x100)
  218. /* PCIe link defines */
  219. #define PEARL_PCIE_LINKUP (0x7)
  220. #define PEARL_PCIE_DATA_LINK (BIT(0))
  221. #define PEARL_PCIE_PHY_LINK (BIT(1))
  222. #define PEARL_PCIE_LINK_RST (BIT(3))
  223. #define PEARL_PCIE_FATAL_ERR (BIT(5))
  224. #define PEARL_PCIE_NONFATAL_ERR (BIT(6))
  225. /* PCIe Lane defines */
  226. #define PCIE_G2_LANE_X1 ((BIT(0)) << 16)
  227. #define PCIE_G2_LANE_X2 ((BIT(0) | BIT(1)) << 16)
  228. /* PCIe DLL link enable */
  229. #define PCIE_DLL_LINK_EN ((BIT(0)) << 5)
  230. #define PCIE_LINK_GEN1 (BIT(0))
  231. #define PCIE_LINK_GEN2 (BIT(1))
  232. #define PCIE_LINK_GEN3 (BIT(2))
  233. #define PCIE_LINK_MODE(x) (((x) >> 16) & 0x7)
  234. #define MSI_EN (BIT(0))
  235. #define MSI_64_EN (BIT(7))
  236. #define PCIE_MSI_ADDR_OFFSET(a) ((a) & 0xFFFF)
  237. #define PCIE_MSI_ADDR_ALIGN(a) ((a) & (~0xFFFF))
  238. #define PCIE_BAR_MASK(base, n) ((base) + 0x1010 + ((n) << 2))
  239. #define PCIE_MAX_BAR (6)
  240. #define PCIE_ATU_VIEW(base) ((base) + 0x0900)
  241. #define PCIE_ATU_CTL1(base) ((base) + 0x0904)
  242. #define PCIE_ATU_CTL2(base) ((base) + 0x0908)
  243. #define PCIE_ATU_LBAR(base) ((base) + 0x090c)
  244. #define PCIE_ATU_UBAR(base) ((base) + 0x0910)
  245. #define PCIE_ATU_LAR(base) ((base) + 0x0914)
  246. #define PCIE_ATU_LTAR(base) ((base) + 0x0918)
  247. #define PCIE_ATU_UTAR(base) ((base) + 0x091c)
  248. #define PCIE_MSI_ADDR_LOWER(base) ((base) + 0x0820)
  249. #define PCIE_MSI_ADDR_UPPER(base) ((base) + 0x0824)
  250. #define PCIE_MSI_ENABLE(base) ((base) + 0x0828)
  251. #define PCIE_MSI_MASK_RC(base) ((base) + 0x082c)
  252. #define PCIE_MSI_STATUS(base) ((base) + 0x0830)
  253. #define PEARL_PCIE_MSI_REGION (0xce000000)
  254. #define PEARL_PCIE_MSI_DATA (0)
  255. #define PCIE_MSI_GPIO(base) ((base) + 0x0888)
  256. #define PCIE_HDP_HOST_QUEUE_FULL (BIT(17))
  257. #define USE_BAR_MATCH_MODE
  258. #define PCIE_ATU_OB_REGION (BIT(0))
  259. #define PCIE_ATU_EN_REGION (BIT(31))
  260. #define PCIE_ATU_EN_MATCH (BIT(30))
  261. #define PCIE_BASE_REGION (0xb0000000)
  262. #define PCIE_MEM_MAP_SIZE (512 * 1024)
  263. #define PCIE_OB_REG_REGION (0xcf000000)
  264. #define PCIE_CONFIG_REGION (0xcf000000)
  265. #define PCIE_CONFIG_SIZE (4096)
  266. #define PCIE_CONFIG_CH (1)
  267. /* inbound mapping */
  268. #define PCIE_IB_BAR0 (0x00000000) /* ddr */
  269. #define PCIE_IB_BAR0_CH (0)
  270. #define PCIE_IB_BAR3 (0xe0000000) /* sys_reg */
  271. #define PCIE_IB_BAR3_CH (1)
  272. /* outbound mapping */
  273. #define PCIE_MEM_CH (0)
  274. #define PCIE_REG_CH (1)
  275. #define PCIE_MEM_REGION (0xc0000000)
  276. #define PCIE_MEM_SIZE (0x000fffff)
  277. #define PCIE_MEM_TAR (0x80000000)
  278. #define PCIE_MSI_REGION (0xce000000)
  279. #define PCIE_MSI_SIZE (KBYTE(4) - 1)
  280. #define PCIE_MSI_CH (1)
  281. /* size of config region */
  282. #define PCIE_CFG_SIZE (0x0000ffff)
  283. #define PCIE_ATU_DIR_IB (BIT(31))
  284. #define PCIE_ATU_DIR_OB (0)
  285. #define PCIE_ATU_DIR_CFG (2)
  286. #define PCIE_ATU_DIR_MATCH_IB (BIT(31) | BIT(30))
  287. #define PCIE_DMA_WR_0 (0)
  288. #define PCIE_DMA_WR_1 (1)
  289. #define PCIE_DMA_RD_0 (2)
  290. #define PCIE_DMA_RD_1 (3)
  291. #define PCIE_DMA_CHNL_CNTRL_CB (BIT(0))
  292. #define PCIE_DMA_CHNL_CNTRL_TCB (BIT(1))
  293. #define PCIE_DMA_CHNL_CNTRL_LLP (BIT(2))
  294. #define PCIE_DMA_CHNL_CNTRL_LIE (BIT(3))
  295. #define PCIE_DMA_CHNL_CNTRL_RIE (BIT(4))
  296. #define PCIE_DMA_CHNL_CNTRL_CSS (BIT(8))
  297. #define PCIE_DMA_CHNL_CNTRL_LLE (BIT(9))
  298. #define PCIE_DMA_CHNL_CNTRL_TLP (BIT(26))
  299. #define PCIE_DMA_CHNL_CONTEXT_RD (BIT(31))
  300. #define PCIE_DMA_CHNL_CONTEXT_WR (0)
  301. #define PCIE_MAX_BAR (6)
  302. /* PCIe HDP interrupt status definition */
  303. #define PCIE_HDP_INT_EP_RXDMA (BIT(0))
  304. #define PCIE_HDP_INT_HBM_UF (BIT(1))
  305. #define PCIE_HDP_INT_RX_LEN_ERR (BIT(2))
  306. #define PCIE_HDP_INT_RX_HDR_LEN_ERR (BIT(3))
  307. #define PCIE_HDP_INT_EP_TXDMA (BIT(12))
  308. #define PCIE_HDP_INT_HHBM_UF (BIT(13))
  309. #define PCIE_HDP_INT_EP_TXEMPTY (BIT(15))
  310. #define PCIE_HDP_INT_IPC (BIT(29))
  311. /* PCIe interrupt status definition */
  312. #define PCIE_INT_MSI (BIT(24))
  313. #define PCIE_INT_INTX (BIT(23))
  314. /* PCIe legacy INTx */
  315. #define PEARL_PCIE_CFG0_OFFSET (0x6C)
  316. #define PEARL_ASSERT_INTX (BIT(9))
  317. /* SYS CTL regs */
  318. #define QTN_PEARL_SYSCTL_LHOST_IRQ_OFFSET (0x001C)
  319. #define QTN_PEARL_IPC_IRQ_WORD(irq) (BIT(irq) | BIT(irq + 16))
  320. #define QTN_PEARL_LHOST_IPC_IRQ (6)
  321. #define QTN_PEARL_LHOST_EP_RESET (7)
  322. #endif /* __PEARL_PCIE_H */