aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/parisc/kernel/pci.c')
-rw-r--r--arch/parisc/kernel/pci.c42
1 files changed, 5 insertions, 37 deletions
diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c
index 563df0072dee..507d0ac99f66 100644
--- a/arch/parisc/kernel/pci.c
+++ b/arch/parisc/kernel/pci.c
@@ -194,37 +194,13 @@ void __init pcibios_init_bus(struct pci_bus *bus)
194 pci_write_config_word(dev, PCI_BRIDGE_CONTROL, bridge_ctl); 194 pci_write_config_word(dev, PCI_BRIDGE_CONTROL, bridge_ctl);
195} 195}
196 196
197
198/* KLUGE: Link the child and parent resources - generic PCI didn't */
199static void
200pcibios_link_hba_resources( struct resource *hba_res, struct resource *r)
201{
202 if (!r->parent) {
203 printk(KERN_EMERG "PCI: resource not parented! [%p-%p]\n",
204 (void*) r->start, (void*) r->end);
205 r->parent = hba_res;
206
207 /* reverse link is harder *sigh* */
208 if (r->parent->child) {
209 if (r->parent->sibling) {
210 struct resource *next = r->parent->sibling;
211 while (next->sibling)
212 next = next->sibling;
213 next->sibling = r;
214 } else {
215 r->parent->sibling = r;
216 }
217 } else
218 r->parent->child = r;
219 }
220}
221
222/* called by drivers/pci/setup-bus.c:pci_setup_bridge(). */ 197/* called by drivers/pci/setup-bus.c:pci_setup_bridge(). */
223void __devinit pcibios_resource_to_bus(struct pci_dev *dev, 198void __devinit pcibios_resource_to_bus(struct pci_dev *dev,
224 struct pci_bus_region *region, struct resource *res) 199 struct pci_bus_region *region, struct resource *res)
225{ 200{
226 struct pci_bus *bus = dev->bus; 201#ifdef CONFIG_64BIT
227 struct pci_hba_data *hba = HBA_DATA(bus->bridge->platform_data); 202 struct pci_hba_data *hba = HBA_DATA(dev->bus->bridge->platform_data);
203#endif
228 204
229 if (res->flags & IORESOURCE_IO) { 205 if (res->flags & IORESOURCE_IO) {
230 /* 206 /*
@@ -243,23 +219,15 @@ void __devinit pcibios_resource_to_bus(struct pci_dev *dev,
243 } 219 }
244 220
245 DBG_RES("pcibios_resource_to_bus(%02x %s [%lx,%lx])\n", 221 DBG_RES("pcibios_resource_to_bus(%02x %s [%lx,%lx])\n",
246 bus->number, res->flags & IORESOURCE_IO ? "IO" : "MEM", 222 dev->bus->number, res->flags & IORESOURCE_IO ? "IO" : "MEM",
247 region->start, region->end); 223 region->start, region->end);
248
249 /* KLUGE ALERT
250 ** if this resource isn't linked to a "parent", then it seems
251 ** to be a child of the HBA - lets link it in.
252 */
253 pcibios_link_hba_resources(&hba->io_space, bus->resource[0]);
254 pcibios_link_hba_resources(&hba->lmmio_space, bus->resource[1]);
255} 224}
256 225
257void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, 226void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
258 struct pci_bus_region *region) 227 struct pci_bus_region *region)
259{ 228{
260#ifdef CONFIG_64BIT 229#ifdef CONFIG_64BIT
261 struct pci_bus *bus = dev->bus; 230 struct pci_hba_data *hba = HBA_DATA(dev->bus->bridge->platform_data);
262 struct pci_hba_data *hba = HBA_DATA(bus->bridge->platform_data);
263#endif 231#endif
264 232
265 if (res->flags & IORESOURCE_MEM) { 233 if (res->flags & IORESOURCE_MEM) {