Commit ead83717 authored by John Rose's avatar John Rose Committed by Paul Mackerras

[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: default avatarJohn Rose <johnrose@austin.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent f912696a
...@@ -295,8 +295,8 @@ static void pci_parse_of_addrs(struct device_node *node, struct pci_dev *dev) ...@@ -295,8 +295,8 @@ static void pci_parse_of_addrs(struct device_node *node, struct pci_dev *dev)
} }
} }
static struct pci_dev *of_create_pci_dev(struct device_node *node, struct pci_dev *of_create_pci_dev(struct device_node *node,
struct pci_bus *bus, int devfn) struct pci_bus *bus, int devfn)
{ {
struct pci_dev *dev; struct pci_dev *dev;
const char *type; const char *type;
...@@ -354,10 +354,9 @@ static struct pci_dev *of_create_pci_dev(struct device_node *node, ...@@ -354,10 +354,9 @@ static struct pci_dev *of_create_pci_dev(struct device_node *node,
return dev; return dev;
} }
EXPORT_SYMBOL(of_create_pci_dev);
static void of_scan_pci_bridge(struct device_node *node, struct pci_dev *dev); void __devinit of_scan_bus(struct device_node *node,
static void __devinit of_scan_bus(struct device_node *node,
struct pci_bus *bus) struct pci_bus *bus)
{ {
struct device_node *child = NULL; struct device_node *child = NULL;
...@@ -381,9 +380,10 @@ static void __devinit of_scan_bus(struct device_node *node, ...@@ -381,9 +380,10 @@ static void __devinit of_scan_bus(struct device_node *node,
do_bus_setup(bus); do_bus_setup(bus);
} }
EXPORT_SYMBOL(of_scan_bus);
static void __devinit of_scan_pci_bridge(struct device_node *node, void __devinit of_scan_pci_bridge(struct device_node *node,
struct pci_dev *dev) struct pci_dev *dev)
{ {
struct pci_bus *bus; struct pci_bus *bus;
u32 *busrange, *ranges; u32 *busrange, *ranges;
...@@ -464,9 +464,10 @@ static void __devinit of_scan_pci_bridge(struct device_node *node, ...@@ -464,9 +464,10 @@ static void __devinit of_scan_pci_bridge(struct device_node *node,
else if (mode == PCI_PROBE_NORMAL) else if (mode == PCI_PROBE_NORMAL)
pci_scan_child_bus(bus); pci_scan_child_bus(bus);
} }
EXPORT_SYMBOL(of_scan_pci_bridge);
#endif /* CONFIG_PPC_MULTIPLATFORM */ #endif /* CONFIG_PPC_MULTIPLATFORM */
static void __devinit scan_phb(struct pci_controller *hose) void __devinit scan_phb(struct pci_controller *hose)
{ {
struct pci_bus *bus; struct pci_bus *bus;
struct device_node *node = hose->arch_data; struct device_node *node = hose->arch_data;
......
...@@ -440,7 +440,6 @@ struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn) ...@@ -440,7 +440,6 @@ struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn)
struct device_node *root = of_find_node_by_path("/"); struct device_node *root = of_find_node_by_path("/");
unsigned int root_size_cells = 0; unsigned int root_size_cells = 0;
struct pci_controller *phb; struct pci_controller *phb;
struct pci_bus *bus;
int primary; int primary;
root_size_cells = prom_n_size_cells(root); root_size_cells = prom_n_size_cells(root);
...@@ -456,10 +455,7 @@ struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn) ...@@ -456,10 +455,7 @@ struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn)
of_node_put(root); of_node_put(root);
pci_devs_phb_init_dynamic(phb); pci_devs_phb_init_dynamic(phb);
phb->last_busno = 0xff; scan_phb(phb);
bus = pci_scan_bus(phb->first_busno, phb->ops, phb->arch_data);
phb->bus = bus;
phb->last_busno = bus->subordinate;
return phb; return phb;
} }
......
...@@ -34,6 +34,7 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre, ...@@ -34,6 +34,7 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre,
void pci_devs_phb_init(void); void pci_devs_phb_init(void);
void pci_devs_phb_init_dynamic(struct pci_controller *phb); void pci_devs_phb_init_dynamic(struct pci_controller *phb);
void __devinit scan_phb(struct pci_controller *hose);
/* PCI address cache management routines */ /* PCI address cache management routines */
void pci_addr_cache_insert_device(struct pci_dev *dev); void pci_addr_cache_insert_device(struct pci_dev *dev);
......
...@@ -162,6 +162,14 @@ pcibios_fixup_device_resources(struct pci_dev *dev, struct pci_bus *bus); ...@@ -162,6 +162,14 @@ pcibios_fixup_device_resources(struct pci_dev *dev, struct pci_bus *bus);
extern struct pci_controller *init_phb_dynamic(struct device_node *dn); extern struct pci_controller *init_phb_dynamic(struct device_node *dn);
extern struct pci_dev *of_create_pci_dev(struct device_node *node,
struct pci_bus *bus, int devfn);
extern void of_scan_pci_bridge(struct device_node *node,
struct pci_dev *dev);
extern void of_scan_bus(struct device_node *node, struct pci_bus *bus);
extern int pci_read_irq_line(struct pci_dev *dev); extern int pci_read_irq_line(struct pci_dev *dev);
extern void pcibios_add_platform_entries(struct pci_dev *dev); extern void pcibios_add_platform_entries(struct pci_dev *dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment