Commit | Line | Data |
---|---|---|
1fb37a81 RJ |
1 | /* |
2 | * Copyright (C) 2014-2015 Broadcom Corporation | |
3 | * | |
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. | |
7 | * | |
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. | |
12 | */ | |
13 | ||
14 | #ifndef _PCIE_IPROC_H | |
15 | #define _PCIE_IPROC_H | |
16 | ||
e99a187b RJ |
17 | /** |
18 | * iProc PCIe outbound mapping | |
19 | * @set_oarr_size: indicates the OARR size bit needs to be set | |
20 | * @axi_offset: offset from the AXI address to the internal address used by | |
21 | * the iProc PCIe core | |
22 | * @window_size: outbound window size | |
23 | */ | |
24 | struct iproc_pcie_ob { | |
25 | bool set_oarr_size; | |
26 | resource_size_t axi_offset; | |
27 | resource_size_t window_size; | |
28 | }; | |
29 | ||
1fb37a81 RJ |
30 | /** |
31 | * iProc PCIe device | |
32 | * @dev: pointer to device data structure | |
33 | * @base: PCIe host controller I/O register base | |
8d9bfe37 | 34 | * @sysdata: Per PCI controller data (ARM-specific) |
1fb37a81 RJ |
35 | * @root_bus: pointer to root bus |
36 | * @phy: optional PHY device that controls the Serdes | |
37 | * @irqs: interrupt IDs | |
5d92f41c | 38 | * @map_irq: function callback to map interrupts |
e99a187b RJ |
39 | * @need_ob_cfg: indidates SW needs to configure the outbound mapping window |
40 | * @ob: outbound mapping parameters | |
1fb37a81 RJ |
41 | */ |
42 | struct iproc_pcie { | |
43 | struct device *dev; | |
44 | void __iomem *base; | |
8d9bfe37 | 45 | #ifdef CONFIG_ARM |
1fb37a81 | 46 | struct pci_sys_data sysdata; |
8d9bfe37 | 47 | #endif |
1fb37a81 RJ |
48 | struct pci_bus *root_bus; |
49 | struct phy *phy; | |
c1e02cea | 50 | int (*map_irq)(const struct pci_dev *, u8, u8); |
e99a187b RJ |
51 | bool need_ob_cfg; |
52 | struct iproc_pcie_ob ob; | |
1fb37a81 RJ |
53 | }; |
54 | ||
18c4342a | 55 | int iproc_pcie_setup(struct iproc_pcie *pcie, struct list_head *res); |
1fb37a81 RJ |
56 | int iproc_pcie_remove(struct iproc_pcie *pcie); |
57 | ||
58 | #endif /* _PCIE_IPROC_H */ |