Commit 0f5646a6 authored by Anton Blanchard's avatar Anton Blanchard

ppc64: rework pci PHB probe code

parent af92a648
This diff is collapsed.
...@@ -363,16 +363,33 @@ pcibios_assign_resources(void) ...@@ -363,16 +363,33 @@ pcibios_assign_resources(void)
* Allocate pci_controller(phb) initialized common variables. * Allocate pci_controller(phb) initialized common variables.
*/ */
struct pci_controller * __init struct pci_controller * __init
pci_alloc_pci_controller(char *model, enum phb_types controller_type) pci_alloc_pci_controller(enum phb_types controller_type)
{ {
struct pci_controller *hose; struct pci_controller *hose;
PPCDBG(PPCDBG_PHBINIT, "PCI: Allocate pci_controller for %s\n",model); char *model;
hose = (struct pci_controller *)alloc_bootmem(sizeof(struct pci_controller)); hose = (struct pci_controller *)alloc_bootmem(sizeof(struct pci_controller));
if(hose == NULL) { if(hose == NULL) {
printk(KERN_ERR "PCI: Allocate pci_controller failed.\n"); printk(KERN_ERR "PCI: Allocate pci_controller failed.\n");
return NULL; return NULL;
} }
memset(hose, 0, sizeof(struct pci_controller)); memset(hose, 0, sizeof(struct pci_controller));
switch(controller_type) {
case phb_type_python:
model = "PHB PY";
break;
case phb_type_speedwagon:
model = "PHB SW";
break;
case phb_type_winnipeg:
model = "PHB WP";
break;
default:
model = "PHB UK";
break;
}
if(strlen(model) < 8) if(strlen(model) < 8)
strcpy(hose->what,model); strcpy(hose->what,model);
else else
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
extern unsigned long isa_io_base; extern unsigned long isa_io_base;
extern struct pci_controller* pci_alloc_pci_controller(char *model, enum phb_types controller_type); extern struct pci_controller* pci_alloc_pci_controller(enum phb_types controller_type);
extern struct pci_controller* pci_find_hose_for_OF_device(struct device_node* node); extern struct pci_controller* pci_find_hose_for_OF_device(struct device_node* node);
extern struct pci_controller* hose_head; extern struct pci_controller* hose_head;
......
...@@ -20,7 +20,8 @@ enum phb_types { ...@@ -20,7 +20,8 @@ enum phb_types {
phb_type_unknown = 0x0, phb_type_unknown = 0x0,
phb_type_hypervisor = 0x1, phb_type_hypervisor = 0x1,
phb_type_python = 0x10, phb_type_python = 0x10,
phb_type_speedwagon = 0x11 phb_type_speedwagon = 0x11,
phb_type_winnipeg = 0x12
}; };
/* /*
......
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