Merge tag 'perf-urgent-for-mingo-20160809' of git://git.kernel.org/pub/scm/linux...
[deliverable/linux.git] / drivers / pci / host / pcie-iproc.h
CommitLineData
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
943ebae7
RJ
17/**
18 * iProc PCIe interface type
19 *
20 * PAXB is the wrapper used in root complex that can be connected to an
21 * external endpoint device.
22 *
23 * PAXC is the wrapper used in root complex dedicated for internal emulated
24 * endpoint devices.
25 */
26enum iproc_pcie_type {
27 IPROC_PCIE_PAXB = 0,
28 IPROC_PCIE_PAXC,
29};
30
e99a187b
RJ
31/**
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
35 * the iProc PCIe core
36 * @window_size: outbound window size
37 */
38struct iproc_pcie_ob {
39 bool set_oarr_size;
40 resource_size_t axi_offset;
41 resource_size_t window_size;
42};
43
3bc2b234
RJ
44struct iproc_msi;
45
1fb37a81
RJ
46/**
47 * iProc PCIe device
943ebae7 48 *
1fb37a81 49 * @dev: pointer to device data structure
943ebae7
RJ
50 * @type: iProc PCIe interface type
51 * @reg_offsets: register offsets
1fb37a81 52 * @base: PCIe host controller I/O register base
3bc2b234 53 * @base_addr: PCIe host controller register base physical address
8d9bfe37 54 * @sysdata: Per PCI controller data (ARM-specific)
1fb37a81
RJ
55 * @root_bus: pointer to root bus
56 * @phy: optional PHY device that controls the Serdes
5d92f41c 57 * @map_irq: function callback to map interrupts
3bc2b234 58 * @need_ob_cfg: indicates SW needs to configure the outbound mapping window
e99a187b 59 * @ob: outbound mapping parameters
3bc2b234 60 * @msi: MSI data
1fb37a81
RJ
61 */
62struct iproc_pcie {
63 struct device *dev;
943ebae7
RJ
64 enum iproc_pcie_type type;
65 const u16 *reg_offsets;
1fb37a81 66 void __iomem *base;
3bc2b234 67 phys_addr_t base_addr;
8d9bfe37 68#ifdef CONFIG_ARM
1fb37a81 69 struct pci_sys_data sysdata;
8d9bfe37 70#endif
1fb37a81
RJ
71 struct pci_bus *root_bus;
72 struct phy *phy;
c1e02cea 73 int (*map_irq)(const struct pci_dev *, u8, u8);
e99a187b
RJ
74 bool need_ob_cfg;
75 struct iproc_pcie_ob ob;
3bc2b234 76 struct iproc_msi *msi;
1fb37a81
RJ
77};
78
18c4342a 79int iproc_pcie_setup(struct iproc_pcie *pcie, struct list_head *res);
1fb37a81
RJ
80int iproc_pcie_remove(struct iproc_pcie *pcie);
81
3bc2b234
RJ
82#ifdef CONFIG_PCIE_IPROC_MSI
83int iproc_msi_init(struct iproc_pcie *pcie, struct device_node *node);
84void iproc_msi_exit(struct iproc_pcie *pcie);
85#else
86static inline int iproc_msi_init(struct iproc_pcie *pcie,
87 struct device_node *node)
88{
89 return -ENODEV;
90}
91static inline void iproc_msi_exit(struct iproc_pcie *pcie)
92{
93}
94#endif
95
1fb37a81 96#endif /* _PCIE_IPROC_H */
This page took 0.081044 seconds and 5 git commands to generate.