pcie-dw.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  1. /*
  2. * Copyright (c) 2006-2023, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2023-09-23 GuEe-GUI first version
  9. */
  10. #ifndef __PCIE_DESIGNWARE_H__
  11. #define __PCIE_DESIGNWARE_H__
  12. #include <rtthread.h>
  13. #include <rtdevice.h>
  14. /* Parameters for the waiting for link up routine */
  15. #define LINK_WAIT_MAX_RETRIES 10
  16. #define LINK_WAIT_USLEEP_MIN 90000
  17. #define LINK_WAIT_USLEEP_MAX 100000
  18. /* Parameters for the waiting for iATU enabled routine */
  19. #define LINK_WAIT_MAX_IATU_RETRIES 5
  20. #define LINK_WAIT_IATU 9
  21. /* Synopsys-specific PCIe configuration registers */
  22. #define PCIE_PORT_AFR 0x70c
  23. #define PORT_AFR_N_FTS_MASK RT_GENMASK(15, 8)
  24. #define PORT_AFR_N_FTS(n) RT_FIELD_PREP(PORT_AFR_N_FTS_MASK, n)
  25. #define PORT_AFR_CC_N_FTS_MASK RT_GENMASK(23, 16)
  26. #define PORT_AFR_CC_N_FTS(n) RT_FIELD_PREP(PORT_AFR_CC_N_FTS_MASK, n)
  27. #define PORT_AFR_ENTER_ASPM RT_BIT(30)
  28. #define PORT_AFR_L0S_ENTRANCE_LAT_SHIFT 24
  29. #define PORT_AFR_L0S_ENTRANCE_LAT_MASK RT_GENMASK(26, 24)
  30. #define PORT_AFR_L1_ENTRANCE_LAT_SHIFT 27
  31. #define PORT_AFR_L1_ENTRANCE_LAT_MASK RT_GENMASK(29, 27)
  32. #define PCIE_PORT_LINK_CONTROL 0x710
  33. #define PORT_LINK_LPBK_ENABLE RT_BIT(2)
  34. #define PORT_LINK_DLL_LINK_EN RT_BIT(5)
  35. #define PORT_LINK_FAST_LINK_MODE RT_BIT(7)
  36. #define PORT_LINK_MODE_MASK RT_GENMASK(21, 16)
  37. #define PORT_LINK_MODE(n) RT_FIELD_PREP(PORT_LINK_MODE_MASK, n)
  38. #define PORT_LINK_MODE_1_LANES PORT_LINK_MODE(0x1)
  39. #define PORT_LINK_MODE_2_LANES PORT_LINK_MODE(0x3)
  40. #define PORT_LINK_MODE_4_LANES PORT_LINK_MODE(0x7)
  41. #define PORT_LINK_MODE_8_LANES PORT_LINK_MODE(0xf)
  42. #define PCIE_PORT_DEBUG0 0x728
  43. #define PORT_LOGIC_LTSSM_STATE_MASK 0x1f
  44. #define PORT_LOGIC_LTSSM_STATE_L0 0x11
  45. #define PCIE_PORT_DEBUG1 0x72c
  46. #define PCIE_PORT_DEBUG1_LINK_UP RT_BIT(4)
  47. #define PCIE_PORT_DEBUG1_LINK_IN_TRAINING RT_BIT(29)
  48. #define PCIE_LINK_WIDTH_SPEED_CONTROL 0x80c
  49. #define PORT_LOGIC_N_FTS_MASK RT_GENMASK(7, 0)
  50. #define PORT_LOGIC_SPEED_CHANGE RT_BIT(17)
  51. #define PORT_LOGIC_LINK_WIDTH_MASK RT_GENMASK(12, 8)
  52. #define PORT_LOGIC_LINK_WIDTH(n) RT_FIELD_PREP(PORT_LOGIC_LINK_WIDTH_MASK, n)
  53. #define PORT_LOGIC_LINK_WIDTH_1_LANES PORT_LOGIC_LINK_WIDTH(0x1)
  54. #define PORT_LOGIC_LINK_WIDTH_2_LANES PORT_LOGIC_LINK_WIDTH(0x2)
  55. #define PORT_LOGIC_LINK_WIDTH_4_LANES PORT_LOGIC_LINK_WIDTH(0x4)
  56. #define PORT_LOGIC_LINK_WIDTH_8_LANES PORT_LOGIC_LINK_WIDTH(0x8)
  57. #define PCIE_MSI_ADDR_LO 0x820
  58. #define PCIE_MSI_ADDR_HI 0x824
  59. #define PCIE_MSI_INTR0_ENABLE 0x828
  60. #define PCIE_MSI_INTR0_MASK 0x82c
  61. #define PCIE_MSI_INTR0_STATUS 0x830
  62. #define PCIE_PORT_MULTI_LANE_CTRL 0x8c0
  63. #define PORT_MLTI_UPCFG_SUPPORT RT_BIT(7)
  64. #define PCIE_ATU_VIEWPORT 0x900
  65. #define PCIE_ATU_REGION_INBOUND RT_BIT(31)
  66. #define PCIE_ATU_REGION_OUTBOUND 0
  67. #define PCIE_ATU_CR1 0x904
  68. #define PCIE_ATU_TYPE_MEM 0x0
  69. #define PCIE_ATU_TYPE_IO 0x2
  70. #define PCIE_ATU_TYPE_CFG0 0x4
  71. #define PCIE_ATU_TYPE_CFG1 0x5
  72. #define PCIE_ATU_FUNC_NUM(pf) ((pf) << 20)
  73. #define PCIE_ATU_CR2 0x908
  74. #define PCIE_ATU_ENABLE RT_BIT(31)
  75. #define PCIE_ATU_BAR_MODE_ENABLE RT_BIT(30)
  76. #define PCIE_ATU_FUNC_NUM_MATCH_EN RT_BIT(19)
  77. #define PCIE_ATU_LOWER_BASE 0x90c
  78. #define PCIE_ATU_UPPER_BASE 0x910
  79. #define PCIE_ATU_LIMIT 0x914
  80. #define PCIE_ATU_LOWER_TARGET 0x918
  81. #define PCIE_ATU_BUS(x) RT_FIELD_PREP(RT_GENMASK(31, 24), x)
  82. #define PCIE_ATU_DEV(x) RT_FIELD_PREP(RT_GENMASK(23, 19), x)
  83. #define PCIE_ATU_FUNC(x) RT_FIELD_PREP(RT_GENMASK(18, 16), x)
  84. #define PCIE_ATU_UPPER_TARGET 0x91c
  85. #define PCIE_MISC_CONTROL_1_OFF 0x8bc
  86. #define PCIE_DBI_RO_WR_EN RT_BIT(0)
  87. #define PCIE_MSIX_DOORBELL 0x948
  88. #define PCIE_MSIX_DOORBELL_PF_SHIFT 24
  89. #define PCIE_PL_CHK_REG_CONTROL_STATUS 0xb20
  90. #define PCIE_PL_CHK_REG_CHK_REG_START RT_BIT(0)
  91. #define PCIE_PL_CHK_REG_CHK_REG_CONTINUOUS RT_BIT(1)
  92. #define PCIE_PL_CHK_REG_CHK_REG_COMPARISON_ERROR RT_BIT(16)
  93. #define PCIE_PL_CHK_REG_CHK_REG_LOGIC_ERROR RT_BIT(17)
  94. #define PCIE_PL_CHK_REG_CHK_REG_COMPLETE RT_BIT(18)
  95. #define PCIE_PL_CHK_REG_ERR_ADDR 0xb28
  96. /*
  97. * iATU Unroll-specific register definitions
  98. * From 4.80 core version the address translation will be made by unroll
  99. */
  100. #define PCIE_ATU_UNR_REGION_CTRL1 0x00
  101. #define PCIE_ATU_UNR_REGION_CTRL2 0x04
  102. #define PCIE_ATU_UNR_LOWER_BASE 0x08
  103. #define PCIE_ATU_UNR_UPPER_BASE 0x0C
  104. #define PCIE_ATU_UNR_LOWER_LIMIT 0x10
  105. #define PCIE_ATU_UNR_LOWER_TARGET 0x14
  106. #define PCIE_ATU_UNR_UPPER_TARGET 0x18
  107. #define PCIE_ATU_UNR_UPPER_LIMIT 0x20
  108. /*
  109. * The default address offset between dbi_base and atu_base. Root controller
  110. * drivers are not required to initialize atu_base if the offset matches this
  111. * default; the driver core automatically derives atu_base from dbi_base using
  112. * this offset, if atu_base not set.
  113. */
  114. #define DEFAULT_DBI_ATU_OFFSET (0x3 << 20)
  115. /* Register address builder */
  116. #define PCIE_GET_ATU_OUTB_UNR_REG_OFFSET(region) ((region) << 9)
  117. #define PCIE_GET_ATU_INB_UNR_REG_OFFSET(region) (((region) << 9) | RT_BIT(8))
  118. #define MAX_MSI_IRQS 256
  119. #define MAX_MSI_IRQS_PER_CTRL 32
  120. #define MAX_MSI_CTRLS (MAX_MSI_IRQS / MAX_MSI_IRQS_PER_CTRL)
  121. #define MSI_REG_CTRL_BLOCK_SIZE 12
  122. #define MSI_DEF_NUM_VECTORS 32
  123. /* Maximum number of inbound/outbound iATUs */
  124. #define MAX_IATU_IN 256
  125. #define MAX_IATU_OUT 256
  126. #define DWC_IATU_UNROLL_EN RT_BIT(0)
  127. #define DWC_IATU_IOCFG_SHARED RT_BIT(1)
  128. struct dw_pcie_host_ops;
  129. struct dw_pcie_ep_ops;
  130. struct dw_pcie_ops;
  131. enum dw_pcie_region_type
  132. {
  133. DW_PCIE_REGION_UNKNOWN,
  134. DW_PCIE_REGION_INBOUND,
  135. DW_PCIE_REGION_OUTBOUND,
  136. };
  137. enum dw_pcie_device_mode
  138. {
  139. DW_PCIE_UNKNOWN_TYPE,
  140. DW_PCIE_EP_TYPE,
  141. DW_PCIE_LEG_EP_TYPE,
  142. DW_PCIE_RC_TYPE,
  143. };
  144. enum dw_pcie_aspace_type
  145. {
  146. DW_PCIE_ASPACE_UNKNOWN,
  147. DW_PCIE_ASPACE_MEM,
  148. DW_PCIE_ASPACE_IO,
  149. };
  150. struct dw_pcie_port
  151. {
  152. void *cfg0_base;
  153. rt_uint64_t cfg0_addr;
  154. rt_uint64_t cfg0_size;
  155. rt_ubase_t io_addr;
  156. rt_ubase_t io_bus_addr;
  157. rt_size_t io_size;
  158. const struct dw_pcie_host_ops *ops;
  159. int sys_irq;
  160. int msi_irq;
  161. struct rt_pic *irq_pic;
  162. struct rt_pic *msi_pic;
  163. void *msi_data;
  164. rt_ubase_t msi_data_phy;
  165. rt_uint32_t irq_count;
  166. rt_uint32_t irq_mask[MAX_MSI_CTRLS];
  167. struct rt_pci_host_bridge *bridge;
  168. const struct rt_pci_ops *bridge_child_ops;
  169. struct rt_spinlock lock;
  170. RT_BITMAP_DECLARE(msi_map, MAX_MSI_IRQS);
  171. };
  172. struct dw_pcie_host_ops
  173. {
  174. rt_err_t (*host_init)(struct dw_pcie_port *port);
  175. rt_err_t (*msi_host_init)(struct dw_pcie_port *port);
  176. void (*set_irq_count)(struct dw_pcie_port *port);
  177. };
  178. struct dw_pcie_ep_func
  179. {
  180. rt_list_t list;
  181. rt_uint8_t func_no;
  182. rt_uint8_t msi_cap; /* MSI capability offset */
  183. rt_uint8_t msix_cap; /* MSI-X capability offset */
  184. };
  185. struct dw_pcie_ep
  186. {
  187. struct rt_pci_ep *epc;
  188. struct rt_pci_ep_bar *epc_bar[PCI_STD_NUM_BARS];
  189. rt_list_t func_nodes;
  190. const struct dw_pcie_ep_ops *ops;
  191. rt_uint64_t aspace;
  192. rt_uint64_t aspace_size;
  193. rt_size_t page_size;
  194. rt_uint8_t bar_to_atu[PCI_STD_NUM_BARS];
  195. rt_ubase_t *outbound_addr;
  196. rt_bitmap_t *ib_window_map;
  197. rt_bitmap_t *ob_window_map;
  198. rt_uint32_t num_ib_windows;
  199. rt_uint32_t num_ob_windows;
  200. void *msi_mem;
  201. rt_ubase_t msi_mem_phy;
  202. };
  203. struct dw_pcie_ep_ops
  204. {
  205. rt_err_t (*ep_init)(struct dw_pcie_ep *ep);
  206. rt_err_t (*raise_irq)(struct dw_pcie_ep *ep, rt_uint8_t func_no, enum rt_pci_ep_irq type, unsigned irq);
  207. rt_off_t (*func_select)(struct dw_pcie_ep *ep, rt_uint8_t func_no);
  208. };
  209. struct dw_pcie
  210. {
  211. struct rt_device *dev;
  212. void *dbi_base;
  213. void *dbi_base2;
  214. void *atu_base;
  215. rt_uint32_t version;
  216. rt_uint32_t num_viewport;
  217. rt_uint32_t num_lanes;
  218. rt_uint32_t link_gen;
  219. rt_uint32_t user_speed;
  220. rt_uint8_t iatu_unroll_enabled; /* Internal Address Translation Unit */
  221. rt_uint8_t fts_number[2]; /* Fast Training Sequences */
  222. struct dw_pcie_port port;
  223. struct dw_pcie_ep endpoint;
  224. const struct dw_pcie_ops *ops;
  225. void *priv;
  226. };
  227. struct dw_pcie_ops
  228. {
  229. rt_uint64_t (*cpu_addr_fixup)(struct dw_pcie *pcie, rt_uint64_t cpu_addr);
  230. rt_uint32_t (*read_dbi)(struct dw_pcie *pcie, void *base, rt_uint32_t reg, rt_size_t size);
  231. void (*write_dbi)(struct dw_pcie *pcie, void *base, rt_uint32_t reg, rt_size_t size, rt_uint32_t val);
  232. void (*write_dbi2)(struct dw_pcie *pcie, void *base, rt_uint32_t reg, rt_size_t size, rt_uint32_t val);
  233. rt_bool_t (*link_up)(struct dw_pcie *pcie);
  234. rt_err_t (*start_link)(struct dw_pcie *pcie);
  235. void (*stop_link)(struct dw_pcie *pcie);
  236. };
  237. #define to_dw_pcie_from_port(ptr) rt_container_of((ptr), struct dw_pcie, port)
  238. #define to_dw_pcie_from_endpoint(ptr) rt_container_of((ptr), struct dw_pcie, endpoint)
  239. #ifdef RT_PCI_DW_HOST
  240. #undef RT_PCI_DW_HOST
  241. #define RT_PCI_DW_HOST 1
  242. #define HOST_API
  243. #define HOST_RET(...) ;
  244. #else
  245. #define HOST_API rt_inline
  246. #define HOST_RET(...) { return __VA_ARGS__; }
  247. #endif
  248. #ifdef RT_PCI_DW_EP
  249. #undef RT_PCI_DW_EP
  250. #define RT_PCI_DW_EP 1
  251. #define EP_API
  252. #define EP_RET(...) ;
  253. #else
  254. #define EP_API rt_inline
  255. #define EP_RET(...) { return __VA_ARGS__; }
  256. #endif
  257. rt_uint8_t dw_pcie_find_capability(struct dw_pcie *pci, rt_uint8_t cap);
  258. rt_uint16_t dw_pcie_find_ext_capability(struct dw_pcie *pci, rt_uint8_t cap);
  259. rt_err_t dw_pcie_read(void *addr, rt_size_t size, rt_uint32_t *out_val);
  260. rt_err_t dw_pcie_write(void *addr, rt_size_t size, rt_uint32_t val);
  261. rt_uint32_t dw_pcie_read_dbi(struct dw_pcie *pci, rt_uint32_t reg, rt_size_t size);
  262. void dw_pcie_write_dbi(struct dw_pcie *pci, rt_uint32_t reg, rt_size_t size, rt_uint32_t val);
  263. void dw_pcie_write_dbi2(struct dw_pcie *pci, rt_uint32_t reg, rt_size_t size, rt_uint32_t val);
  264. rt_uint32_t dw_pcie_readl_atu(struct dw_pcie *pci, rt_uint32_t reg);
  265. void dw_pcie_writel_atu(struct dw_pcie *pci, rt_uint32_t reg, rt_uint32_t val);
  266. rt_bool_t dw_pcie_link_up(struct dw_pcie *pci);
  267. void dw_pcie_upconfig_setup(struct dw_pcie *pci);
  268. rt_err_t dw_pcie_wait_for_link(struct dw_pcie *pci);
  269. void dw_pcie_prog_outbound_atu(struct dw_pcie *pci, int index, int type, rt_uint64_t cpu_addr, rt_uint64_t pci_addr, rt_size_t size);
  270. void dw_pcie_prog_ep_outbound_atu(struct dw_pcie *pci, rt_uint8_t func_no, int index, int type, rt_uint64_t cpu_addr, rt_uint64_t pci_addr, rt_size_t size);
  271. rt_err_t dw_pcie_prog_inbound_atu(struct dw_pcie *pci, rt_uint8_t func_no, int index, int bar, rt_uint64_t cpu_addr, enum dw_pcie_aspace_type aspace_type);
  272. void dw_pcie_disable_atu(struct dw_pcie *pci, int index, enum dw_pcie_region_type type);
  273. void dw_pcie_setup(struct dw_pcie *pci);
  274. rt_inline void dw_pcie_writel_dbi(struct dw_pcie *pci, rt_uint32_t reg, rt_uint32_t val)
  275. {
  276. dw_pcie_write_dbi(pci, reg, 0x4, val);
  277. }
  278. rt_inline rt_uint32_t dw_pcie_readl_dbi(struct dw_pcie *pci, rt_uint32_t reg)
  279. {
  280. return dw_pcie_read_dbi(pci, reg, 0x4);
  281. }
  282. rt_inline void dw_pcie_writew_dbi(struct dw_pcie *pci, rt_uint32_t reg, rt_uint16_t val)
  283. {
  284. dw_pcie_write_dbi(pci, reg, 0x2, val);
  285. }
  286. rt_inline rt_uint16_t dw_pcie_readw_dbi(struct dw_pcie *pci, rt_uint32_t reg)
  287. {
  288. return dw_pcie_read_dbi(pci, reg, 0x2);
  289. }
  290. rt_inline void dw_pcie_writeb_dbi(struct dw_pcie *pci, rt_uint32_t reg, rt_uint8_t val)
  291. {
  292. dw_pcie_write_dbi(pci, reg, 0x1, val);
  293. }
  294. rt_inline rt_uint8_t dw_pcie_readb_dbi(struct dw_pcie *pci, rt_uint32_t reg)
  295. {
  296. return dw_pcie_read_dbi(pci, reg, 0x1);
  297. }
  298. rt_inline void dw_pcie_writel_dbi2(struct dw_pcie *pci, rt_uint32_t reg, rt_uint32_t val)
  299. {
  300. dw_pcie_write_dbi2(pci, reg, 0x4, val);
  301. }
  302. rt_inline void dw_pcie_dbi_ro_writable_enable(struct dw_pcie *pci, rt_bool_t enable)
  303. {
  304. const rt_uint32_t reg = PCIE_MISC_CONTROL_1_OFF;
  305. if (enable)
  306. {
  307. dw_pcie_writel_dbi(pci, reg, dw_pcie_readl_dbi(pci, reg) | PCIE_DBI_RO_WR_EN);
  308. }
  309. else
  310. {
  311. dw_pcie_writel_dbi(pci, reg, dw_pcie_readl_dbi(pci, reg) & ~PCIE_DBI_RO_WR_EN);
  312. }
  313. }
  314. rt_inline rt_uint8_t dw_pcie_iatu_unroll_enabled(struct dw_pcie *pci)
  315. {
  316. return dw_pcie_readl_dbi(pci, PCIE_ATU_VIEWPORT) == 0xffffffff ? 1 : 0;
  317. }
  318. rt_inline rt_uint32_t dw_pcie_readl_ob_unroll(struct dw_pcie *pci,
  319. rt_uint32_t index, rt_uint32_t reg)
  320. {
  321. return dw_pcie_readl_atu(pci, PCIE_GET_ATU_OUTB_UNR_REG_OFFSET(index) + reg);
  322. }
  323. rt_inline void dw_pcie_writel_ob_unroll(struct dw_pcie *pci,
  324. rt_uint32_t index, rt_uint32_t reg, rt_uint32_t val)
  325. {
  326. dw_pcie_writel_atu(pci, PCIE_GET_ATU_OUTB_UNR_REG_OFFSET(index) + reg, val);
  327. }
  328. rt_inline rt_uint32_t dw_pcie_readl_ib_unroll(struct dw_pcie *pci,
  329. rt_uint32_t index, rt_uint32_t reg)
  330. {
  331. return dw_pcie_readl_atu(pci, PCIE_GET_ATU_INB_UNR_REG_OFFSET(index) + reg);
  332. }
  333. rt_inline void dw_pcie_writel_ib_unroll(struct dw_pcie *pci,
  334. rt_uint32_t index, rt_uint32_t reg, rt_uint32_t val)
  335. {
  336. dw_pcie_writel_atu(pci, reg + PCIE_GET_ATU_INB_UNR_REG_OFFSET(index), val);
  337. }
  338. HOST_API rt_err_t dw_handle_msi_irq(struct dw_pcie_port *port) HOST_RET(-RT_ENOSYS)
  339. HOST_API void dw_pcie_msi_init(struct dw_pcie_port *port) HOST_RET()
  340. HOST_API void dw_pcie_free_msi(struct dw_pcie_port *port) HOST_RET()
  341. HOST_API void dw_pcie_setup_rc(struct dw_pcie_port *port) HOST_RET()
  342. HOST_API rt_err_t dw_pcie_host_init(struct dw_pcie_port *port) HOST_RET(-RT_ENOSYS)
  343. HOST_API void dw_pcie_host_deinit(struct dw_pcie_port *port) HOST_RET()
  344. HOST_API void dw_pcie_host_free(struct dw_pcie_port *port) HOST_RET()
  345. HOST_API void *dw_pcie_own_conf_map(struct rt_pci_bus *bus, rt_uint32_t devfn, int reg) HOST_RET(RT_NULL)
  346. EP_API rt_err_t dw_pcie_ep_init(struct dw_pcie_ep *ep) EP_RET(-RT_ENOSYS)
  347. EP_API rt_err_t dw_pcie_ep_init_complete(struct dw_pcie_ep *ep) EP_RET(-RT_ENOSYS)
  348. EP_API void dw_pcie_ep_exit(struct dw_pcie_ep *ep) EP_RET()
  349. EP_API rt_err_t dw_pcie_ep_raise_legacy_irq(struct dw_pcie_ep *ep, rt_uint8_t func_no) EP_RET(-RT_ENOSYS)
  350. EP_API rt_err_t dw_pcie_ep_raise_msi_irq(struct dw_pcie_ep *ep, rt_uint8_t func_no, unsigned irq) EP_RET(-RT_ENOSYS)
  351. EP_API rt_err_t dw_pcie_ep_raise_msix_irq(struct dw_pcie_ep *ep, rt_uint8_t func_no, unsigned irq) EP_RET(-RT_ENOSYS)
  352. EP_API rt_err_t dw_pcie_ep_raise_msix_irq_doorbell(struct dw_pcie_ep *ep, rt_uint8_t func_no, unsigned irq) EP_RET(-RT_ENOSYS)
  353. EP_API void dw_pcie_ep_reset_bar(struct dw_pcie *pci, int bar_idx) EP_RET()
  354. EP_API rt_err_t dw_pcie_ep_inbound_atu(struct dw_pcie_ep *ep, rt_uint8_t func_no,
  355. int bar_idx, rt_ubase_t cpu_addr, enum dw_pcie_aspace_type aspace_type) EP_RET(-RT_ENOSYS)
  356. EP_API rt_err_t dw_pcie_ep_outbound_atu(struct dw_pcie_ep *ep, rt_uint8_t func_no,
  357. rt_ubase_t phys_addr, rt_uint64_t pci_addr, rt_size_t size) EP_RET(-RT_ENOSYS)
  358. EP_API struct dw_pcie_ep_func *dw_pcie_ep_get_func_from_ep(struct dw_pcie_ep *ep, rt_uint8_t func_no) EP_RET(RT_NULL)
  359. #endif /* __PCIE_DESIGNWARE_H__ */