diff options
Diffstat (limited to 'include/asm-powerpc/pci-bridge.h')
-rw-r--r-- | include/asm-powerpc/pci-bridge.h | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h index 223ec7bd81da..38de92d41a14 100644 --- a/include/asm-powerpc/pci-bridge.h +++ b/include/asm-powerpc/pci-bridge.h | |||
@@ -1,5 +1,6 @@ | |||
1 | #ifndef _ASM_POWERPC_PCI_BRIDGE_H | 1 | #ifndef _ASM_POWERPC_PCI_BRIDGE_H |
2 | #define _ASM_POWERPC_PCI_BRIDGE_H | 2 | #define _ASM_POWERPC_PCI_BRIDGE_H |
3 | #ifdef __KERNEL__ | ||
3 | 4 | ||
4 | #ifndef CONFIG_PPC64 | 5 | #ifndef CONFIG_PPC64 |
5 | #include <asm-ppc/pci-bridge.h> | 6 | #include <asm-ppc/pci-bridge.h> |
@@ -60,16 +61,17 @@ struct pci_controller; | |||
60 | struct iommu_table; | 61 | struct iommu_table; |
61 | 62 | ||
62 | struct pci_dn { | 63 | struct pci_dn { |
63 | int busno; /* for pci devices */ | 64 | int busno; /* pci bus number */ |
64 | int bussubno; /* for pci devices */ | 65 | int bussubno; /* pci subordinate bus number */ |
65 | int devfn; /* for pci devices */ | 66 | int devfn; /* pci device and function number */ |
67 | int class_code; /* pci device class */ | ||
66 | 68 | ||
67 | #ifdef CONFIG_PPC_PSERIES | 69 | #ifdef CONFIG_PPC_PSERIES |
68 | int eeh_mode; /* See eeh.h for possible EEH_MODEs */ | 70 | int eeh_mode; /* See eeh.h for possible EEH_MODEs */ |
69 | int eeh_config_addr; | 71 | int eeh_config_addr; |
72 | int eeh_pe_config_addr; /* new-style partition endpoint address */ | ||
70 | int eeh_check_count; /* # times driver ignored error */ | 73 | int eeh_check_count; /* # times driver ignored error */ |
71 | int eeh_freeze_count; /* # times this device froze up. */ | 74 | int eeh_freeze_count; /* # times this device froze up. */ |
72 | int eeh_is_bridge; /* device is pci-to-pci bridge */ | ||
73 | #endif | 75 | #endif |
74 | int pci_ext_config_space; /* for pci devices */ | 76 | int pci_ext_config_space; /* for pci devices */ |
75 | struct pci_controller *phb; /* for pci devices */ | 77 | struct pci_controller *phb; /* for pci devices */ |
@@ -125,12 +127,20 @@ static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) | |||
125 | return bus->sysdata; /* Must be root bus (PHB) */ | 127 | return bus->sysdata; /* Must be root bus (PHB) */ |
126 | } | 128 | } |
127 | 129 | ||
130 | /** Find the bus corresponding to the indicated device node */ | ||
131 | struct pci_bus * pcibios_find_pci_bus(struct device_node *dn); | ||
132 | |||
128 | extern void pci_process_bridge_OF_ranges(struct pci_controller *hose, | 133 | extern void pci_process_bridge_OF_ranges(struct pci_controller *hose, |
129 | struct device_node *dev, int primary); | 134 | struct device_node *dev, int primary); |
130 | 135 | ||
131 | extern int pcibios_remove_root_bus(struct pci_controller *phb); | 136 | /** Remove all of the PCI devices under this bus */ |
137 | void pcibios_remove_pci_devices(struct pci_bus *bus); | ||
132 | 138 | ||
133 | extern void phbs_remap_io(void); | 139 | /** Discover new pci devices under this bus, and add them */ |
140 | void pcibios_add_pci_devices(struct pci_bus * bus); | ||
141 | void pcibios_fixup_new_pci_devices(struct pci_bus *bus, int fix_bus); | ||
142 | |||
143 | extern int pcibios_remove_root_bus(struct pci_controller *phb); | ||
134 | 144 | ||
135 | static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus) | 145 | static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus) |
136 | { | 146 | { |
@@ -140,14 +150,27 @@ static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus) | |||
140 | return PCI_DN(busdn)->phb; | 150 | return PCI_DN(busdn)->phb; |
141 | } | 151 | } |
142 | 152 | ||
153 | extern struct pci_controller* | ||
154 | pci_find_hose_for_OF_device(struct device_node* node); | ||
155 | |||
143 | extern struct pci_controller * | 156 | extern struct pci_controller * |
144 | pcibios_alloc_controller(struct device_node *dev); | 157 | pcibios_alloc_controller(struct device_node *dev); |
145 | extern void pcibios_free_controller(struct pci_controller *phb); | 158 | extern void pcibios_free_controller(struct pci_controller *phb); |
146 | 159 | ||
160 | #ifdef CONFIG_PCI | ||
161 | extern unsigned long pci_address_to_pio(phys_addr_t address); | ||
162 | #else | ||
163 | static inline unsigned long pci_address_to_pio(phys_addr_t address) | ||
164 | { | ||
165 | return (unsigned long)-1; | ||
166 | } | ||
167 | #endif | ||
168 | |||
147 | /* Return values for ppc_md.pci_probe_mode function */ | 169 | /* Return values for ppc_md.pci_probe_mode function */ |
148 | #define PCI_PROBE_NONE -1 /* Don't look at this bus at all */ | 170 | #define PCI_PROBE_NONE -1 /* Don't look at this bus at all */ |
149 | #define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */ | 171 | #define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */ |
150 | #define PCI_PROBE_DEVTREE 1 /* Instantiate from device tree */ | 172 | #define PCI_PROBE_DEVTREE 1 /* Instantiate from device tree */ |
151 | 173 | ||
152 | #endif /* CONFIG_PPC64 */ | 174 | #endif /* CONFIG_PPC64 */ |
175 | #endif /* __KERNEL__ */ | ||
153 | #endif | 176 | #endif |