aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-ppc64/pci-bridge.h
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2005-11-15 00:05:33 -0500
committerPaul Mackerras <paulus@samba.org>2005-11-15 21:29:46 -0500
commitb5166cc252190be80465f3b4f050e4a0310f71af (patch)
tree565d11c2ea25d1553489d6c8a9b4d2c00e110288 /include/asm-ppc64/pci-bridge.h
parentf9e4ec57c66586d0c165ed9373efaf9e329d5766 (diff)
[PATCH] powerpc: pci_64 fixes & cleanups
I discovered that in some cases (PowerMac for example) we wouldn't properly map the PCI IO space on recent kernels. In addition, the code for initializing PCI host bridges was scattered all over the place with some duplication between platforms. This patch fixes the problem and does a small cleanup by creating a pcibios_alloc_controller() in pci_64.c that is similar to the one in pci_32.c (just takes an additional device node argument) that takes care of all the grunt allocation and initialisation work. It should work for both boot time and dynamically allocated PHBs. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-ppc64/pci-bridge.h')
-rw-r--r--include/asm-ppc64/pci-bridge.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/asm-ppc64/pci-bridge.h b/include/asm-ppc64/pci-bridge.h
index efbdaece0cf0..cf04327a597a 100644
--- a/include/asm-ppc64/pci-bridge.h
+++ b/include/asm-ppc64/pci-bridge.h
@@ -61,12 +61,14 @@ struct pci_dn {
61 int busno; /* for pci devices */ 61 int busno; /* for pci devices */
62 int bussubno; /* for pci devices */ 62 int bussubno; /* for pci devices */
63 int devfn; /* for pci devices */ 63 int devfn; /* for pci devices */
64
65#ifdef CONFIG_PPC_PSERIES
64 int eeh_mode; /* See eeh.h for possible EEH_MODEs */ 66 int eeh_mode; /* See eeh.h for possible EEH_MODEs */
65 int eeh_config_addr; 67 int eeh_config_addr;
66 int eeh_check_count; /* # times driver ignored error */ 68 int eeh_check_count; /* # times driver ignored error */
67 int eeh_freeze_count; /* # times this device froze up. */ 69 int eeh_freeze_count; /* # times this device froze up. */
68 int eeh_is_bridge; /* device is pci-to-pci bridge */ 70 int eeh_is_bridge; /* device is pci-to-pci bridge */
69 71#endif
70 int pci_ext_config_space; /* for pci devices */ 72 int pci_ext_config_space; /* for pci devices */
71 struct pci_controller *phb; /* for pci devices */ 73 struct pci_controller *phb; /* for pci devices */
72 struct iommu_table *iommu_table; /* for phb's or bridges */ 74 struct iommu_table *iommu_table; /* for phb's or bridges */
@@ -74,9 +76,9 @@ struct pci_dn {
74 struct device_node *node; /* back-pointer to the device_node */ 76 struct device_node *node; /* back-pointer to the device_node */
75#ifdef CONFIG_PPC_ISERIES 77#ifdef CONFIG_PPC_ISERIES
76 struct list_head Device_List; 78 struct list_head Device_List;
77 int Irq; /* Assigned IRQ */ 79 int Irq; /* Assigned IRQ */
78 int Flags; /* Possible flags(disable/bist)*/ 80 int Flags; /* Possible flags(disable/bist)*/
79 u8 LogicalSlot; /* Hv Slot Index for Tces */ 81 u8 LogicalSlot; /* Hv Slot Index for Tces */
80#endif 82#endif
81 u32 config_space[16]; /* saved PCI config space */ 83 u32 config_space[16]; /* saved PCI config space */
82}; 84};
@@ -136,6 +138,10 @@ static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
136 return PCI_DN(busdn)->phb; 138 return PCI_DN(busdn)->phb;
137} 139}
138 140
141extern struct pci_controller *
142pcibios_alloc_controller(struct device_node *dev);
143extern void pcibios_free_controller(struct pci_controller *phb);
144
139/* Return values for ppc_md.pci_probe_mode function */ 145/* Return values for ppc_md.pci_probe_mode function */
140#define PCI_PROBE_NONE -1 /* Don't look at this bus at all */ 146#define PCI_PROBE_NONE -1 /* Don't look at this bus at all */
141#define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */ 147#define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */