1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (C) 2014-2015 Broadcom Corporation
10 * iProc PCIe interface type
12 * PAXB is the wrapper used in root complex that can be connected to an
13 * external endpoint device.
15 * PAXC is the wrapper used in root complex dedicated for internal emulated
18 enum iproc_pcie_type
{
19 IPROC_PCIE_PAXB_BCMA
= 0,
27 * iProc PCIe outbound mapping
28 * @axi_offset: offset from the AXI address to the internal address used by
30 * @nr_windows: total number of supported outbound mapping windows
32 struct iproc_pcie_ob
{
33 resource_size_t axi_offset
;
34 unsigned int nr_windows
;
38 * iProc PCIe inbound mapping
39 * @nr_regions: total number of supported inbound mapping regions
41 struct iproc_pcie_ib
{
42 unsigned int nr_regions
;
45 struct iproc_pcie_ob_map
;
46 struct iproc_pcie_ib_map
;
52 * @dev: pointer to device data structure
53 * @type: iProc PCIe interface type
54 * @reg_offsets: register offsets
55 * @base: PCIe host controller I/O register base
56 * @base_addr: PCIe host controller register base physical address
57 * @root_bus: pointer to root bus
58 * @phy: optional PHY device that controls the Serdes
59 * @map_irq: function callback to map interrupts
60 * @ep_is_internal: indicates an internal emulated endpoint device is connected
61 * @iproc_cfg_read: indicates the iProc config read function should be used
62 * @rej_unconfig_pf: indicates the root complex needs to detect and reject
63 * enumeration against unconfigured physical functions emulated in the ASIC
64 * @has_apb_err_disable: indicates the controller can be configured to prevent
65 * unsupported request from being forwarded as an APB bus error
66 * @fix_paxc_cap: indicates the controller has corrupted capability list in its
67 * config space registers and requires SW based fixup
69 * @need_ob_cfg: indicates SW needs to configure the outbound mapping window
70 * @ob: outbound mapping related parameters
71 * @ob_map: outbound mapping related parameters specific to the controller
73 * @need_ib_cfg: indicates SW needs to configure the inbound mapping window
74 * @ib: inbound mapping related parameters
75 * @ib_map: outbound mapping region related parameters
77 * @need_msi_steer: indicates additional configuration of the iProc PCIe
78 * controller is required to steer MSI writes to external interrupt controller
83 enum iproc_pcie_type type
;
86 phys_addr_t base_addr
;
88 struct pci_bus
*root_bus
;
90 int (*map_irq
)(const struct pci_dev
*, u8
, u8
);
94 bool has_apb_err_disable
;
98 struct iproc_pcie_ob ob
;
99 const struct iproc_pcie_ob_map
*ob_map
;
102 struct iproc_pcie_ib ib
;
103 const struct iproc_pcie_ib_map
*ib_map
;
106 struct iproc_msi
*msi
;
109 int iproc_pcie_setup(struct iproc_pcie
*pcie
, struct list_head
*res
);
110 int iproc_pcie_remove(struct iproc_pcie
*pcie
);
111 int iproc_pcie_shutdown(struct iproc_pcie
*pcie
);
113 #ifdef CONFIG_PCIE_IPROC_MSI
114 int iproc_msi_init(struct iproc_pcie
*pcie
, struct device_node
*node
);
115 void iproc_msi_exit(struct iproc_pcie
*pcie
);
117 static inline int iproc_msi_init(struct iproc_pcie
*pcie
,
118 struct device_node
*node
)
122 static inline void iproc_msi_exit(struct iproc_pcie
*pcie
)
127 #endif /* _PCIE_IPROC_H */