x86/speculation/mds: Fix documentation typo
[linux/fpc-iii.git] / drivers / pci / host / pcie-iproc.h
blob4ac6282f2bfd60ab4c26589c74376fa2a9e1dc8f
1 /*
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.
14 #ifndef _PCIE_IPROC_H
15 #define _PCIE_IPROC_H
17 /**
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
24 * endpoint devices.
26 enum iproc_pcie_type {
27 IPROC_PCIE_PAXB_BCMA = 0,
28 IPROC_PCIE_PAXB,
29 IPROC_PCIE_PAXB_V2,
30 IPROC_PCIE_PAXC,
31 IPROC_PCIE_PAXC_V2,
34 /**
35 * iProc PCIe outbound mapping
36 * @axi_offset: offset from the AXI address to the internal address used by
37 * the iProc PCIe core
38 * @nr_windows: total number of supported outbound mapping windows
40 struct iproc_pcie_ob {
41 resource_size_t axi_offset;
42 unsigned int nr_windows;
45 /**
46 * iProc PCIe inbound mapping
47 * @nr_regions: total number of supported inbound mapping regions
49 struct iproc_pcie_ib {
50 unsigned int nr_regions;
53 struct iproc_pcie_ob_map;
54 struct iproc_pcie_ib_map;
55 struct iproc_msi;
57 /**
58 * iProc PCIe device
60 * @dev: pointer to device data structure
61 * @type: iProc PCIe interface type
62 * @reg_offsets: register offsets
63 * @base: PCIe host controller I/O register base
64 * @base_addr: PCIe host controller register base physical address
65 * @sysdata: Per PCI controller data (ARM-specific)
66 * @root_bus: pointer to root bus
67 * @phy: optional PHY device that controls the Serdes
68 * @map_irq: function callback to map interrupts
69 * @ep_is_internal: indicates an internal emulated endpoint device is connected
70 * @has_apb_err_disable: indicates the controller can be configured to prevent
71 * unsupported request from being forwarded as an APB bus error
73 * @need_ob_cfg: indicates SW needs to configure the outbound mapping window
74 * @ob: outbound mapping related parameters
75 * @ob_map: outbound mapping related parameters specific to the controller
77 * @need_ib_cfg: indicates SW needs to configure the inbound mapping window
78 * @ib: inbound mapping related parameters
79 * @ib_map: outbound mapping region related parameters
81 * @need_msi_steer: indicates additional configuration of the iProc PCIe
82 * controller is required to steer MSI writes to external interrupt controller
83 * @msi: MSI data
85 struct iproc_pcie {
86 struct device *dev;
87 enum iproc_pcie_type type;
88 u16 *reg_offsets;
89 void __iomem *base;
90 phys_addr_t base_addr;
91 #ifdef CONFIG_ARM
92 struct pci_sys_data sysdata;
93 #endif
94 struct resource mem;
95 struct pci_bus *root_bus;
96 struct phy *phy;
97 int (*map_irq)(const struct pci_dev *, u8, u8);
98 bool ep_is_internal;
99 bool has_apb_err_disable;
101 bool need_ob_cfg;
102 struct iproc_pcie_ob ob;
103 const struct iproc_pcie_ob_map *ob_map;
105 bool need_ib_cfg;
106 struct iproc_pcie_ib ib;
107 const struct iproc_pcie_ib_map *ib_map;
109 bool need_msi_steer;
110 struct iproc_msi *msi;
113 int iproc_pcie_setup(struct iproc_pcie *pcie, struct list_head *res);
114 int iproc_pcie_remove(struct iproc_pcie *pcie);
115 int iproc_pcie_shutdown(struct iproc_pcie *pcie);
117 #ifdef CONFIG_PCIE_IPROC_MSI
118 int iproc_msi_init(struct iproc_pcie *pcie, struct device_node *node);
119 void iproc_msi_exit(struct iproc_pcie *pcie);
120 #else
121 static inline int iproc_msi_init(struct iproc_pcie *pcie,
122 struct device_node *node)
124 return -ENODEV;
126 static inline void iproc_msi_exit(struct iproc_pcie *pcie)
129 #endif
131 #endif /* _PCIE_IPROC_H */