aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/kernel/pci_32.c3
-rw-r--r--arch/powerpc/platforms/52xx/efika.c3
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_pci.c4
-rw-r--r--arch/powerpc/platforms/82xx/mpc82xx_ads.c4
-rw-r--r--arch/powerpc/platforms/83xx/pci.c3
-rw-r--r--arch/powerpc/platforms/85xx/pci.c3
-rw-r--r--arch/powerpc/platforms/86xx/pci.c4
-rw-r--r--arch/powerpc/platforms/chrp/pci.c3
-rw-r--r--arch/powerpc/platforms/embedded6xx/linkstation.c3
-rw-r--r--arch/powerpc/platforms/powermac/pci.c6
-rw-r--r--arch/powerpc/sysdev/mv64x60_pci.c4
-rw-r--r--arch/powerpc/sysdev/tsi108_pci.c3
-rw-r--r--include/asm-powerpc/pci-bridge.h8
13 files changed, 16 insertions, 35 deletions
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 56deb316efd3..df3251ccca0f 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -610,7 +610,7 @@ pcibios_enable_resources(struct pci_dev *dev, int mask)
610static int next_controller_index; 610static int next_controller_index;
611 611
612struct pci_controller * __init 612struct pci_controller * __init
613pcibios_alloc_controller(void) 613pcibios_alloc_controller(struct device_node *dev)
614{ 614{
615 struct pci_controller *hose; 615 struct pci_controller *hose;
616 616
@@ -621,6 +621,7 @@ pcibios_alloc_controller(void)
621 hose_tail = &hose->next; 621 hose_tail = &hose->next;
622 622
623 hose->global_number = next_controller_index++; 623 hose->global_number = next_controller_index++;
624 hose->arch_data = dev;
624 625
625 return hose; 626 return hose;
626} 627}
diff --git a/arch/powerpc/platforms/52xx/efika.c b/arch/powerpc/platforms/52xx/efika.c
index 010be5c082d5..0256423c99d6 100644
--- a/arch/powerpc/platforms/52xx/efika.c
+++ b/arch/powerpc/platforms/52xx/efika.c
@@ -128,7 +128,7 @@ void __init efika_pcisetup(void)
128 printk(" controlled by %s\n", pcictrl->full_name); 128 printk(" controlled by %s\n", pcictrl->full_name);
129 printk("\n"); 129 printk("\n");
130 130
131 hose = pcibios_alloc_controller(); 131 hose = pcibios_alloc_controller(of_node_get(pcictrl));
132 if (!hose) { 132 if (!hose) {
133 printk(KERN_WARNING EFIKA_PLATFORM_NAME 133 printk(KERN_WARNING EFIKA_PLATFORM_NAME
134 ": Can't allocate PCI controller structure for %s\n", 134 ": Can't allocate PCI controller structure for %s\n",
@@ -136,7 +136,6 @@ void __init efika_pcisetup(void)
136 return; 136 return;
137 } 137 }
138 138
139 hose->arch_data = of_node_get(pcictrl);
140 hose->first_busno = bus_range[0]; 139 hose->first_busno = bus_range[0];
141 hose->last_busno = bus_range[1]; 140 hose->last_busno = bus_range[1];
142 hose->ops = &rtas_pci_ops; 141 hose->ops = &rtas_pci_ops;
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pci.c b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
index 69a04217c79d..4c6c82a684b1 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pci.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
@@ -385,12 +385,10 @@ mpc52xx_add_bridge(struct device_node *node)
385 * tree are needed to configure the 52xx PCI controller. Rather 385 * tree are needed to configure the 52xx PCI controller. Rather
386 * than parse the tree here, let pci_process_bridge_OF_ranges() 386 * than parse the tree here, let pci_process_bridge_OF_ranges()
387 * do it for us and extract the values after the fact */ 387 * do it for us and extract the values after the fact */
388 hose = pcibios_alloc_controller(); 388 hose = pcibios_alloc_controller(node);
389 if (!hose) 389 if (!hose)
390 return -ENOMEM; 390 return -ENOMEM;
391 391
392 hose->arch_data = node;
393
394 hose->first_busno = bus_range ? bus_range[0] : 0; 392 hose->first_busno = bus_range ? bus_range[0] : 0;
395 hose->last_busno = bus_range ? bus_range[1] : 0xff; 393 hose->last_busno = bus_range ? bus_range[1] : 0xff;
396 394
diff --git a/arch/powerpc/platforms/82xx/mpc82xx_ads.c b/arch/powerpc/platforms/82xx/mpc82xx_ads.c
index d1e0919a3dee..da20832b27f1 100644
--- a/arch/powerpc/platforms/82xx/mpc82xx_ads.c
+++ b/arch/powerpc/platforms/82xx/mpc82xx_ads.c
@@ -543,13 +543,11 @@ static void __init mpc82xx_add_bridge(struct device_node *np)
543 543
544 pci_assign_all_buses = 1; 544 pci_assign_all_buses = 1;
545 545
546 hose = pcibios_alloc_controller(); 546 hose = pcibios_alloc_controller(np);
547 547
548 if (!hose) 548 if (!hose)
549 return; 549 return;
550 550
551 hose->arch_data = np;
552
553 hose->first_busno = bus_range ? bus_range[0] : 0; 551 hose->first_busno = bus_range ? bus_range[0] : 0;
554 hose->last_busno = bus_range ? bus_range[1] : 0xff; 552 hose->last_busno = bus_range ? bus_range[1] : 0xff;
555 553
diff --git a/arch/powerpc/platforms/83xx/pci.c b/arch/powerpc/platforms/83xx/pci.c
index f49ed277e843..c0e2b89154e5 100644
--- a/arch/powerpc/platforms/83xx/pci.c
+++ b/arch/powerpc/platforms/83xx/pci.c
@@ -62,10 +62,9 @@ int __init mpc83xx_add_bridge(struct device_node *dev)
62 } 62 }
63 63
64 pci_assign_all_buses = 1; 64 pci_assign_all_buses = 1;
65 hose = pcibios_alloc_controller(); 65 hose = pcibios_alloc_controller(dev);
66 if (!hose) 66 if (!hose)
67 return -ENOMEM; 67 return -ENOMEM;
68 hose->arch_data = dev;
69 68
70 hose->first_busno = bus_range ? bus_range[0] : 0; 69 hose->first_busno = bus_range ? bus_range[0] : 0;
71 hose->last_busno = bus_range ? bus_range[1] : 0xff; 70 hose->last_busno = bus_range ? bus_range[1] : 0xff;
diff --git a/arch/powerpc/platforms/85xx/pci.c b/arch/powerpc/platforms/85xx/pci.c
index a25b3e77a7d2..8118417b7364 100644
--- a/arch/powerpc/platforms/85xx/pci.c
+++ b/arch/powerpc/platforms/85xx/pci.c
@@ -56,10 +56,9 @@ int __init mpc85xx_add_bridge(struct device_node *dev)
56 } 56 }
57 57
58 pci_assign_all_buses = 1; 58 pci_assign_all_buses = 1;
59 hose = pcibios_alloc_controller(); 59 hose = pcibios_alloc_controller(dev);
60 if (!hose) 60 if (!hose)
61 return -ENOMEM; 61 return -ENOMEM;
62 hose->arch_data = dev;
63 62
64 hose->first_busno = bus_range ? bus_range[0] : 0; 63 hose->first_busno = bus_range ? bus_range[0] : 0;
65 hose->last_busno = bus_range ? bus_range[1] : 0xff; 64 hose->last_busno = bus_range ? bus_range[1] : 0xff;
diff --git a/arch/powerpc/platforms/86xx/pci.c b/arch/powerpc/platforms/86xx/pci.c
index 2d7254c91ad9..5cb2188ee406 100644
--- a/arch/powerpc/platforms/86xx/pci.c
+++ b/arch/powerpc/platforms/86xx/pci.c
@@ -196,10 +196,10 @@ int __init mpc86xx_add_bridge(struct device_node *dev)
196 " bus 0\n", dev->full_name); 196 " bus 0\n", dev->full_name);
197 197
198 pci_assign_all_buses = 1; 198 pci_assign_all_buses = 1;
199 hose = pcibios_alloc_controller(); 199 hose = pcibios_alloc_controller(dev);
200 if (!hose) 200 if (!hose)
201 return -ENOMEM; 201 return -ENOMEM;
202 hose->arch_data = dev; 202
203 hose->indirect_type = PPC_INDIRECT_TYPE_EXT_REG | 203 hose->indirect_type = PPC_INDIRECT_TYPE_EXT_REG |
204 PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS; 204 PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS;
205 205
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c
index d8408632b1a9..3690624e49d4 100644
--- a/arch/powerpc/platforms/chrp/pci.c
+++ b/arch/powerpc/platforms/chrp/pci.c
@@ -254,13 +254,12 @@ chrp_find_bridges(void)
254 printk(" at %llx", (unsigned long long)r.start); 254 printk(" at %llx", (unsigned long long)r.start);
255 printk("\n"); 255 printk("\n");
256 256
257 hose = pcibios_alloc_controller(); 257 hose = pcibios_alloc_controller(dev);
258 if (!hose) { 258 if (!hose) {
259 printk("Can't allocate PCI controller structure for %s\n", 259 printk("Can't allocate PCI controller structure for %s\n",
260 dev->full_name); 260 dev->full_name);
261 continue; 261 continue;
262 } 262 }
263 hose->arch_data = dev;
264 hose->first_busno = bus_range[0]; 263 hose->first_busno = bus_range[0];
265 hose->last_busno = bus_range[1]; 264 hose->last_busno = bus_range[1];
266 265
diff --git a/arch/powerpc/platforms/embedded6xx/linkstation.c b/arch/powerpc/platforms/embedded6xx/linkstation.c
index 885c789a8c2d..f4d0a7a603f5 100644
--- a/arch/powerpc/platforms/embedded6xx/linkstation.c
+++ b/arch/powerpc/platforms/embedded6xx/linkstation.c
@@ -68,12 +68,11 @@ static int __init linkstation_add_bridge(struct device_node *dev)
68 printk(KERN_WARNING "Can't get bus-range for %s, assume" 68 printk(KERN_WARNING "Can't get bus-range for %s, assume"
69 " bus 0\n", dev->full_name); 69 " bus 0\n", dev->full_name);
70 70
71 hose = pcibios_alloc_controller(); 71 hose = pcibios_alloc_controller(dev);
72 if (hose == NULL) 72 if (hose == NULL)
73 return -ENOMEM; 73 return -ENOMEM;
74 hose->first_busno = bus_range ? bus_range[0] : 0; 74 hose->first_busno = bus_range ? bus_range[0] : 0;
75 hose->last_busno = bus_range ? bus_range[1] : 0xff; 75 hose->last_busno = bus_range ? bus_range[1] : 0xff;
76 hose->arch_data = dev;
77 setup_indirect_pci(hose, 0xfec00000, 0xfee00000); 76 setup_indirect_pci(hose, 0xfec00000, 0xfee00000);
78 77
79 /* Interpret the "ranges" property */ 78 /* Interpret the "ranges" property */
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index fb853c0affcc..92586db19754 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -916,15 +916,9 @@ static int __init pmac_add_bridge(struct device_node *dev)
916 " bus 0\n", dev->full_name); 916 " bus 0\n", dev->full_name);
917 } 917 }
918 918
919 /* XXX Different prototypes, to be merged */
920#ifdef CONFIG_PPC64
921 hose = pcibios_alloc_controller(dev); 919 hose = pcibios_alloc_controller(dev);
922#else
923 hose = pcibios_alloc_controller();
924#endif
925 if (!hose) 920 if (!hose)
926 return -ENOMEM; 921 return -ENOMEM;
927 hose->arch_data = dev;
928 hose->first_busno = bus_range ? bus_range[0] : 0; 922 hose->first_busno = bus_range ? bus_range[0] : 0;
929 hose->last_busno = bus_range ? bus_range[1] : 0xff; 923 hose->last_busno = bus_range ? bus_range[1] : 0xff;
930 924
diff --git a/arch/powerpc/sysdev/mv64x60_pci.c b/arch/powerpc/sysdev/mv64x60_pci.c
index 2e7738455ae5..45db86c2363c 100644
--- a/arch/powerpc/sysdev/mv64x60_pci.c
+++ b/arch/powerpc/sysdev/mv64x60_pci.c
@@ -137,12 +137,10 @@ static int __init mv64x60_add_bridge(struct device_node *dev)
137 printk(KERN_WARNING "Can't get bus-range for %s, assume" 137 printk(KERN_WARNING "Can't get bus-range for %s, assume"
138 " bus 0\n", dev->full_name); 138 " bus 0\n", dev->full_name);
139 139
140 hose = pcibios_alloc_controller(); 140 hose = pcibios_alloc_controller(dev);
141 if (!hose) 141 if (!hose)
142 return -ENOMEM; 142 return -ENOMEM;
143 143
144 hose->arch_data = dev;
145
146 hose->first_busno = bus_range ? bus_range[0] : 0; 144 hose->first_busno = bus_range ? bus_range[0] : 0;
147 hose->last_busno = bus_range ? bus_range[1] : 0xff; 145 hose->last_busno = bus_range ? bus_range[1] : 0xff;
148 146
diff --git a/arch/powerpc/sysdev/tsi108_pci.c b/arch/powerpc/sysdev/tsi108_pci.c
index 298e2dd34e89..90db8a720fed 100644
--- a/arch/powerpc/sysdev/tsi108_pci.c
+++ b/arch/powerpc/sysdev/tsi108_pci.c
@@ -221,13 +221,12 @@ int __init tsi108_setup_pci(struct device_node *dev, u32 cfg_phys, int primary)
221 " bus 0\n", dev->full_name); 221 " bus 0\n", dev->full_name);
222 } 222 }
223 223
224 hose = pcibios_alloc_controller(); 224 hose = pcibios_alloc_controller(dev);
225 225
226 if (!hose) { 226 if (!hose) {
227 printk("PCI Host bridge init failed\n"); 227 printk("PCI Host bridge init failed\n");
228 return -ENOMEM; 228 return -ENOMEM;
229 } 229 }
230 hose->arch_data = dev;
231 230
232 hose->first_busno = bus_range ? bus_range[0] : 0; 231 hose->first_busno = bus_range ? bus_range[0] : 0;
233 hose->last_busno = bus_range ? bus_range[1] : 0xff; 232 hose->last_busno = bus_range ? bus_range[1] : 0xff;
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
index 80cfb4a75053..d5a9c9f9ade3 100644
--- a/include/asm-powerpc/pci-bridge.h
+++ b/include/asm-powerpc/pci-bridge.h
@@ -9,9 +9,6 @@
9struct device_node; 9struct device_node;
10struct pci_controller; 10struct pci_controller;
11 11
12/* Allocate a new PCI host bridge structure */
13extern struct pci_controller* pcibios_alloc_controller(void);
14
15/* Get the PCI host controller for a bus */ 12/* Get the PCI host controller for a bus */
16extern struct pci_controller* pci_bus_to_hose(int bus); 13extern struct pci_controller* pci_bus_to_hose(int bus);
17 14
@@ -232,8 +229,6 @@ static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
232 return PCI_DN(busdn)->phb; 229 return PCI_DN(busdn)->phb;
233} 230}
234 231
235extern struct pci_controller *
236pcibios_alloc_controller(struct device_node *dev);
237extern void pcibios_free_controller(struct pci_controller *phb); 232extern void pcibios_free_controller(struct pci_controller *phb);
238 233
239extern void isa_bridge_find_early(struct pci_controller *hose); 234extern void isa_bridge_find_early(struct pci_controller *hose);
@@ -263,6 +258,9 @@ extern void
263pci_process_bridge_OF_ranges(struct pci_controller *hose, 258pci_process_bridge_OF_ranges(struct pci_controller *hose,
264 struct device_node *dev, int primary); 259 struct device_node *dev, int primary);
265 260
261/* Allocate a new PCI host bridge structure */
262extern struct pci_controller *
263pcibios_alloc_controller(struct device_node *dev);
266#ifdef CONFIG_PCI 264#ifdef CONFIG_PCI
267extern unsigned long pci_address_to_pio(phys_addr_t address); 265extern unsigned long pci_address_to_pio(phys_addr_t address);
268#else 266#else