aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile/include/asm/pci.h
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/tile/include/asm/pci.h
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'arch/tile/include/asm/pci.h')
-rw-r--r--arch/tile/include/asm/pci.h110
1 files changed, 43 insertions, 67 deletions
diff --git a/arch/tile/include/asm/pci.h b/arch/tile/include/asm/pci.h
index b0c15da2d5d5..7f03cefed1b9 100644
--- a/arch/tile/include/asm/pci.h
+++ b/arch/tile/include/asm/pci.h
@@ -15,7 +15,29 @@
15#ifndef _ASM_TILE_PCI_H 15#ifndef _ASM_TILE_PCI_H
16#define _ASM_TILE_PCI_H 16#define _ASM_TILE_PCI_H
17 17
18#include <asm/pci-bridge.h> 18#include <linux/pci.h>
19
20/*
21 * Structure of a PCI controller (host bridge)
22 */
23struct pci_controller {
24 int index; /* PCI domain number */
25 struct pci_bus *root_bus;
26
27 int first_busno;
28 int last_busno;
29
30 int hv_cfg_fd[2]; /* config{0,1} fds for this PCIe controller */
31 int hv_mem_fd; /* fd to Hypervisor for MMIO operations */
32
33 struct pci_ops *ops;
34
35 int irq_base; /* Base IRQ from the Hypervisor */
36 int plx_gen1; /* flag for PLX Gen 1 configuration */
37
38 /* Address ranges that are routed to this controller/bridge. */
39 struct resource mem_resources[3];
40};
19 41
20/* 42/*
21 * The hypervisor maps the entirety of CPA-space as bus addresses, so 43 * The hypervisor maps the entirety of CPA-space as bus addresses, so
@@ -24,56 +46,13 @@
24 */ 46 */
25#define PCI_DMA_BUS_IS_PHYS 1 47#define PCI_DMA_BUS_IS_PHYS 1
26 48
27struct pci_controller *pci_bus_to_hose(int bus); 49int __devinit tile_pci_init(void);
28unsigned char __init common_swizzle(struct pci_dev *dev, unsigned char *pinp); 50int __devinit pcibios_init(void);
29int __init tile_pci_init(void);
30void pci_iounmap(struct pci_dev *dev, void __iomem *addr);
31void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
32void __devinit pcibios_fixup_bus(struct pci_bus *bus);
33 51
34int __devinit _tile_cfg_read(struct pci_controller *hose, 52void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
35 int bus, 53static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) {}
36 int slot,
37 int function,
38 int offset,
39 int size,
40 u32 *val);
41int __devinit _tile_cfg_write(struct pci_controller *hose,
42 int bus,
43 int slot,
44 int function,
45 int offset,
46 int size,
47 u32 val);
48 54
49/* 55void __devinit pcibios_fixup_bus(struct pci_bus *bus);
50 * These are used to to config reads and writes in the early stages of
51 * setup before the driver infrastructure has been set up enough to be
52 * able to do config reads and writes.
53 */
54#define early_cfg_read(where, size, value) \
55 _tile_cfg_read(controller, \
56 current_bus, \
57 pci_slot, \
58 pci_fn, \
59 where, \
60 size, \
61 value)
62
63#define early_cfg_write(where, size, value) \
64 _tile_cfg_write(controller, \
65 current_bus, \
66 pci_slot, \
67 pci_fn, \
68 where, \
69 size, \
70 value)
71
72
73
74#define PCICFG_BYTE 1
75#define PCICFG_WORD 2
76#define PCICFG_DWORD 4
77 56
78#define TILE_NUM_PCIE 2 57#define TILE_NUM_PCIE 2
79 58
@@ -88,33 +67,33 @@ static inline int pci_proc_domain(struct pci_bus *bus)
88} 67}
89 68
90/* 69/*
91 * I/O space is currently not supported. 70 * pcibios_assign_all_busses() tells whether or not the bus numbers
71 * should be reassigned, in case the BIOS didn't do it correctly, or
72 * in case we don't have a BIOS and we want to let Linux do it.
92 */ 73 */
74static inline int pcibios_assign_all_busses(void)
75{
76 return 1;
77}
93 78
94#define TILE_PCIE_LOWER_IO 0x0 79/*
95#define TILE_PCIE_UPPER_IO 0x10000 80 * No special bus mastering setup handling.
96#define TILE_PCIE_PCIE_IO_SIZE 0x0000FFFF 81 */
97
98#define _PAGE_NO_CACHE 0
99#define _PAGE_GUARDED 0
100
101
102#define pcibios_assign_all_busses() pci_assign_all_buses
103extern int pci_assign_all_buses;
104
105static inline void pcibios_set_master(struct pci_dev *dev) 82static inline void pcibios_set_master(struct pci_dev *dev)
106{ 83{
107 /* No special bus mastering setup handling */
108} 84}
109 85
110#define PCIBIOS_MIN_MEM 0 86#define PCIBIOS_MIN_MEM 0
111#define PCIBIOS_MIN_IO TILE_PCIE_LOWER_IO 87#define PCIBIOS_MIN_IO 0
112 88
113/* 89/*
114 * This flag tells if the platform is TILEmpower that needs 90 * This flag tells if the platform is TILEmpower that needs
115 * special configuration for the PLX switch chip. 91 * special configuration for the PLX switch chip.
116 */ 92 */
117extern int blade_pci; 93extern int tile_plx_gen1;
94
95/* Use any cpu for PCI. */
96#define cpumask_of_pcibus(bus) cpu_online_mask
118 97
119/* implement the pci_ DMA API in terms of the generic device dma_ one */ 98/* implement the pci_ DMA API in terms of the generic device dma_ one */
120#include <asm-generic/pci-dma-compat.h> 99#include <asm-generic/pci-dma-compat.h>
@@ -122,7 +101,4 @@ extern int blade_pci;
122/* generic pci stuff */ 101/* generic pci stuff */
123#include <asm-generic/pci.h> 102#include <asm-generic/pci.h>
124 103
125/* Use any cpu for PCI. */
126#define cpumask_of_pcibus(bus) cpu_online_mask
127
128#endif /* _ASM_TILE_PCI_H */ 104#endif /* _ASM_TILE_PCI_H */