summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/maple/pci.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2005-11-15 16:05:33 +1100
committerPaul Mackerras <paulus@samba.org>2005-11-16 13:29:46 +1100
commitb5166cc252190be80465f3b4f050e4a0310f71af (patch)
tree565d11c2ea25d1553489d6c8a9b4d2c00e110288 /arch/powerpc/platforms/maple/pci.c
parentf9e4ec57c66586d0c165ed9373efaf9e329d5766 (diff)
downloadblackbird-op-linux-b5166cc252190be80465f3b4f050e4a0310f71af.tar.gz
blackbird-op-linux-b5166cc252190be80465f3b4f050e4a0310f71af.zip
[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 'arch/powerpc/platforms/maple/pci.c')
-rw-r--r--arch/powerpc/platforms/maple/pci.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c
index 895aeb3f75d0..f40451da037c 100644
--- a/arch/powerpc/platforms/maple/pci.c
+++ b/arch/powerpc/platforms/maple/pci.c
@@ -326,26 +326,12 @@ static int __init add_bridge(struct device_node *dev)
dev->full_name);
}
- hose = alloc_bootmem(sizeof(struct pci_controller));
+ hose = pcibios_alloc_controller(dev);
if (hose == NULL)
return -ENOMEM;
- pci_setup_pci_controller(hose);
-
- hose->arch_data = dev;
hose->first_busno = bus_range ? bus_range[0] : 0;
hose->last_busno = bus_range ? bus_range[1] : 0xff;
- of_prop = alloc_bootmem(sizeof(struct property) +
- sizeof(hose->global_number));
- if (of_prop) {
- memset(of_prop, 0, sizeof(struct property));
- of_prop->name = "linux,pci-domain";
- of_prop->length = sizeof(hose->global_number);
- of_prop->value = (unsigned char *)&of_prop[1];
- memcpy(of_prop->value, &hose->global_number, sizeof(hose->global_number));
- prom_add_property(dev, of_prop);
- }
-
disp_name = NULL;
if (device_is_compatible(dev, "u3-agp")) {
setup_u3_agp(hose);
OpenPOWER on IntegriCloud