2 * Copyright (C) 2014-2015 Broadcom Corporation
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation version 2.
8 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
9 * kind, whether express or implied; without even the implied warranty
10 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
18 * iProc PCIe interface type
20 * PAXB is the wrapper used in root complex that can be connected to an
21 * external endpoint device.
23 * PAXC is the wrapper used in root complex dedicated for internal emulated
26 enum iproc_pcie_type {
32 * iProc PCIe outbound mapping
33 * @set_oarr_size: indicates the OARR size bit needs to be set
34 * @axi_offset: offset from the AXI address to the internal address used by
36 * @window_size: outbound window size
38 struct iproc_pcie_ob {
40 resource_size_t axi_offset;
41 resource_size_t window_size;
49 * @dev: pointer to device data structure
50 * @type: iProc PCIe interface type
51 * @reg_offsets: register offsets
52 * @base: PCIe host controller I/O register base
53 * @base_addr: PCIe host controller register base physical address
54 * @sysdata: Per PCI controller data (ARM-specific)
55 * @root_bus: pointer to root bus
56 * @phy: optional PHY device that controls the Serdes
57 * @map_irq: function callback to map interrupts
58 * @need_ob_cfg: indicates SW needs to configure the outbound mapping window
59 * @ob: outbound mapping parameters
64 enum iproc_pcie_type type;
65 const u16 *reg_offsets;
67 phys_addr_t base_addr;
69 struct pci_sys_data sysdata;
72 struct pci_bus *root_bus;
74 int (*map_irq)(const struct pci_dev *, u8, u8);
76 struct iproc_pcie_ob ob;
77 struct iproc_msi *msi;
80 int iproc_pcie_setup(struct iproc_pcie *pcie, struct list_head *res);
81 int iproc_pcie_remove(struct iproc_pcie *pcie);
83 #ifdef CONFIG_PCIE_IPROC_MSI
84 int iproc_msi_init(struct iproc_pcie *pcie, struct device_node *node);
85 void iproc_msi_exit(struct iproc_pcie *pcie);
87 static inline int iproc_msi_init(struct iproc_pcie *pcie,
88 struct device_node *node)
92 static inline void iproc_msi_exit(struct iproc_pcie *pcie)
97 #endif /* _PCIE_IPROC_H */