diff options
author | John Rose <johnrose@austin.ibm.com> | 2005-11-04 16:30:56 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-11-06 20:09:02 -0500 |
commit | ead837174d265b24334f0721a84cbdda8ccd89a7 (patch) | |
tree | a780bd6e7d47858d656d45165030b20a5a1dacfd | |
parent | f912696ab330bf539231d1f8032320f2a08b850f (diff) |
[PATCH] dlpar enable for OF pci probe
This patch contains the arch/ppc64 bits for enabling DLPAR and PCI
Hotplug for the new OF-based PCI probe mechanism. This code path is
currently broken.
Signed-off-by: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/ppc64/kernel/pci.c | 17 | ||||
-rw-r--r-- | arch/ppc64/kernel/rtas_pci.c | 6 | ||||
-rw-r--r-- | include/asm-powerpc/ppc-pci.h | 1 | ||||
-rw-r--r-- | include/asm-ppc64/pci.h | 8 |
4 files changed, 19 insertions, 13 deletions
diff --git a/arch/ppc64/kernel/pci.c b/arch/ppc64/kernel/pci.c index 3d2106b022a1..30247ff74972 100644 --- a/arch/ppc64/kernel/pci.c +++ b/arch/ppc64/kernel/pci.c | |||
@@ -295,8 +295,8 @@ static void pci_parse_of_addrs(struct device_node *node, struct pci_dev *dev) | |||
295 | } | 295 | } |
296 | } | 296 | } |
297 | 297 | ||
298 | static struct pci_dev *of_create_pci_dev(struct device_node *node, | 298 | struct pci_dev *of_create_pci_dev(struct device_node *node, |
299 | struct pci_bus *bus, int devfn) | 299 | struct pci_bus *bus, int devfn) |
300 | { | 300 | { |
301 | struct pci_dev *dev; | 301 | struct pci_dev *dev; |
302 | const char *type; | 302 | const char *type; |
@@ -354,10 +354,9 @@ static struct pci_dev *of_create_pci_dev(struct device_node *node, | |||
354 | 354 | ||
355 | return dev; | 355 | return dev; |
356 | } | 356 | } |
357 | EXPORT_SYMBOL(of_create_pci_dev); | ||
357 | 358 | ||
358 | static void of_scan_pci_bridge(struct device_node *node, struct pci_dev *dev); | 359 | void __devinit of_scan_bus(struct device_node *node, |
359 | |||
360 | static void __devinit of_scan_bus(struct device_node *node, | ||
361 | struct pci_bus *bus) | 360 | struct pci_bus *bus) |
362 | { | 361 | { |
363 | struct device_node *child = NULL; | 362 | struct device_node *child = NULL; |
@@ -381,9 +380,10 @@ static void __devinit of_scan_bus(struct device_node *node, | |||
381 | 380 | ||
382 | do_bus_setup(bus); | 381 | do_bus_setup(bus); |
383 | } | 382 | } |
383 | EXPORT_SYMBOL(of_scan_bus); | ||
384 | 384 | ||
385 | static void __devinit of_scan_pci_bridge(struct device_node *node, | 385 | void __devinit of_scan_pci_bridge(struct device_node *node, |
386 | struct pci_dev *dev) | 386 | struct pci_dev *dev) |
387 | { | 387 | { |
388 | struct pci_bus *bus; | 388 | struct pci_bus *bus; |
389 | u32 *busrange, *ranges; | 389 | u32 *busrange, *ranges; |
@@ -464,9 +464,10 @@ static void __devinit of_scan_pci_bridge(struct device_node *node, | |||
464 | else if (mode == PCI_PROBE_NORMAL) | 464 | else if (mode == PCI_PROBE_NORMAL) |
465 | pci_scan_child_bus(bus); | 465 | pci_scan_child_bus(bus); |
466 | } | 466 | } |
467 | EXPORT_SYMBOL(of_scan_pci_bridge); | ||
467 | #endif /* CONFIG_PPC_MULTIPLATFORM */ | 468 | #endif /* CONFIG_PPC_MULTIPLATFORM */ |
468 | 469 | ||
469 | static void __devinit scan_phb(struct pci_controller *hose) | 470 | void __devinit scan_phb(struct pci_controller *hose) |
470 | { | 471 | { |
471 | struct pci_bus *bus; | 472 | struct pci_bus *bus; |
472 | struct device_node *node = hose->arch_data; | 473 | struct device_node *node = hose->arch_data; |
diff --git a/arch/ppc64/kernel/rtas_pci.c b/arch/ppc64/kernel/rtas_pci.c index 3ad15c90fbbd..3c3f19192fcc 100644 --- a/arch/ppc64/kernel/rtas_pci.c +++ b/arch/ppc64/kernel/rtas_pci.c | |||
@@ -440,7 +440,6 @@ struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn) | |||
440 | struct device_node *root = of_find_node_by_path("/"); | 440 | struct device_node *root = of_find_node_by_path("/"); |
441 | unsigned int root_size_cells = 0; | 441 | unsigned int root_size_cells = 0; |
442 | struct pci_controller *phb; | 442 | struct pci_controller *phb; |
443 | struct pci_bus *bus; | ||
444 | int primary; | 443 | int primary; |
445 | 444 | ||
446 | root_size_cells = prom_n_size_cells(root); | 445 | root_size_cells = prom_n_size_cells(root); |
@@ -456,10 +455,7 @@ struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn) | |||
456 | of_node_put(root); | 455 | of_node_put(root); |
457 | 456 | ||
458 | pci_devs_phb_init_dynamic(phb); | 457 | pci_devs_phb_init_dynamic(phb); |
459 | phb->last_busno = 0xff; | 458 | scan_phb(phb); |
460 | bus = pci_scan_bus(phb->first_busno, phb->ops, phb->arch_data); | ||
461 | phb->bus = bus; | ||
462 | phb->last_busno = bus->subordinate; | ||
463 | 459 | ||
464 | return phb; | 460 | return phb; |
465 | } | 461 | } |
diff --git a/include/asm-powerpc/ppc-pci.h b/include/asm-powerpc/ppc-pci.h index a88728fba8f6..13aacff755f3 100644 --- a/include/asm-powerpc/ppc-pci.h +++ b/include/asm-powerpc/ppc-pci.h | |||
@@ -34,6 +34,7 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre, | |||
34 | 34 | ||
35 | void pci_devs_phb_init(void); | 35 | void pci_devs_phb_init(void); |
36 | void pci_devs_phb_init_dynamic(struct pci_controller *phb); | 36 | void pci_devs_phb_init_dynamic(struct pci_controller *phb); |
37 | void __devinit scan_phb(struct pci_controller *hose); | ||
37 | 38 | ||
38 | /* PCI address cache management routines */ | 39 | /* PCI address cache management routines */ |
39 | void pci_addr_cache_insert_device(struct pci_dev *dev); | 40 | void pci_addr_cache_insert_device(struct pci_dev *dev); |
diff --git a/include/asm-ppc64/pci.h b/include/asm-ppc64/pci.h index 342e2d755550..fafdf885a3cc 100644 --- a/include/asm-ppc64/pci.h +++ b/include/asm-ppc64/pci.h | |||
@@ -162,6 +162,14 @@ pcibios_fixup_device_resources(struct pci_dev *dev, struct pci_bus *bus); | |||
162 | 162 | ||
163 | extern struct pci_controller *init_phb_dynamic(struct device_node *dn); | 163 | extern struct pci_controller *init_phb_dynamic(struct device_node *dn); |
164 | 164 | ||
165 | extern struct pci_dev *of_create_pci_dev(struct device_node *node, | ||
166 | struct pci_bus *bus, int devfn); | ||
167 | |||
168 | extern void of_scan_pci_bridge(struct device_node *node, | ||
169 | struct pci_dev *dev); | ||
170 | |||
171 | extern void of_scan_bus(struct device_node *node, struct pci_bus *bus); | ||
172 | |||
165 | extern int pci_read_irq_line(struct pci_dev *dev); | 173 | extern int pci_read_irq_line(struct pci_dev *dev); |
166 | 174 | ||
167 | extern void pcibios_add_platform_entries(struct pci_dev *dev); | 175 | extern void pcibios_add_platform_entries(struct pci_dev *dev); |