diff options
Diffstat (limited to 'arch/powerpc/platforms/cell/setup.c')
-rw-r--r-- | arch/powerpc/platforms/cell/setup.c | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c index 5c531e8f9f6f..ab721b50fbba 100644 --- a/arch/powerpc/platforms/cell/setup.c +++ b/arch/powerpc/platforms/cell/setup.c | |||
@@ -57,6 +57,7 @@ | |||
57 | #include "interrupt.h" | 57 | #include "interrupt.h" |
58 | #include "pervasive.h" | 58 | #include "pervasive.h" |
59 | #include "ras.h" | 59 | #include "ras.h" |
60 | #include "io-workarounds.h" | ||
60 | 61 | ||
61 | #ifdef DEBUG | 62 | #ifdef DEBUG |
62 | #define DBG(fmt...) udbg_printf(fmt) | 63 | #define DBG(fmt...) udbg_printf(fmt) |
@@ -117,13 +118,50 @@ static void cell_fixup_pcie_rootcomplex(struct pci_dev *dev) | |||
117 | } | 118 | } |
118 | DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, cell_fixup_pcie_rootcomplex); | 119 | DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, cell_fixup_pcie_rootcomplex); |
119 | 120 | ||
121 | static int __devinit cell_setup_phb(struct pci_controller *phb) | ||
122 | { | ||
123 | const char *model; | ||
124 | struct device_node *np; | ||
125 | |||
126 | int rc = rtas_setup_phb(phb); | ||
127 | if (rc) | ||
128 | return rc; | ||
129 | |||
130 | np = phb->dn; | ||
131 | model = of_get_property(np, "model", NULL); | ||
132 | if (model == NULL || strcmp(np->name, "pci")) | ||
133 | return 0; | ||
134 | |||
135 | /* Setup workarounds for spider */ | ||
136 | if (strcmp(model, "Spider")) | ||
137 | return 0; | ||
138 | |||
139 | iowa_register_bus(phb, &spiderpci_ops, &spiderpci_iowa_init, | ||
140 | (void *)SPIDER_PCI_REG_BASE); | ||
141 | io_workaround_init(); | ||
142 | |||
143 | return 0; | ||
144 | } | ||
145 | |||
120 | static int __init cell_publish_devices(void) | 146 | static int __init cell_publish_devices(void) |
121 | { | 147 | { |
148 | struct device_node *root = of_find_node_by_path("/"); | ||
149 | struct device_node *np; | ||
122 | int node; | 150 | int node; |
123 | 151 | ||
124 | /* Publish OF platform devices for southbridge IOs */ | 152 | /* Publish OF platform devices for southbridge IOs */ |
125 | of_platform_bus_probe(NULL, NULL, NULL); | 153 | of_platform_bus_probe(NULL, NULL, NULL); |
126 | 154 | ||
155 | /* On spider based blades, we need to manually create the OF | ||
156 | * platform devices for the PCI host bridges | ||
157 | */ | ||
158 | for_each_child_of_node(root, np) { | ||
159 | if (np->type == NULL || (strcmp(np->type, "pci") != 0 && | ||
160 | strcmp(np->type, "pciex") != 0)) | ||
161 | continue; | ||
162 | of_platform_device_create(np, NULL, NULL); | ||
163 | } | ||
164 | |||
127 | /* There is no device for the MIC memory controller, thus we create | 165 | /* There is no device for the MIC memory controller, thus we create |
128 | * a platform device for it to attach the EDAC driver to. | 166 | * a platform device for it to attach the EDAC driver to. |
129 | */ | 167 | */ |
@@ -132,6 +170,7 @@ static int __init cell_publish_devices(void) | |||
132 | continue; | 170 | continue; |
133 | platform_device_register_simple("cbe-mic", node, NULL, 0); | 171 | platform_device_register_simple("cbe-mic", node, NULL, 0); |
134 | } | 172 | } |
173 | |||
135 | return 0; | 174 | return 0; |
136 | } | 175 | } |
137 | machine_subsys_initcall(cell, cell_publish_devices); | 176 | machine_subsys_initcall(cell, cell_publish_devices); |
@@ -213,7 +252,7 @@ static void __init cell_setup_arch(void) | |||
213 | 252 | ||
214 | /* Find and initialize PCI host bridges */ | 253 | /* Find and initialize PCI host bridges */ |
215 | init_pci_config_tokens(); | 254 | init_pci_config_tokens(); |
216 | find_and_init_phbs(); | 255 | |
217 | cbe_pervasive_init(); | 256 | cbe_pervasive_init(); |
218 | #ifdef CONFIG_DUMMY_CONSOLE | 257 | #ifdef CONFIG_DUMMY_CONSOLE |
219 | conswitchp = &dummy_con; | 258 | conswitchp = &dummy_con; |
@@ -249,7 +288,7 @@ define_machine(cell) { | |||
249 | .calibrate_decr = generic_calibrate_decr, | 288 | .calibrate_decr = generic_calibrate_decr, |
250 | .progress = cell_progress, | 289 | .progress = cell_progress, |
251 | .init_IRQ = cell_init_irq, | 290 | .init_IRQ = cell_init_irq, |
252 | .pci_setup_phb = rtas_setup_phb, | 291 | .pci_setup_phb = cell_setup_phb, |
253 | #ifdef CONFIG_KEXEC | 292 | #ifdef CONFIG_KEXEC |
254 | .machine_kexec = default_machine_kexec, | 293 | .machine_kexec = default_machine_kexec, |
255 | .machine_kexec_prepare = default_machine_kexec_prepare, | 294 | .machine_kexec_prepare = default_machine_kexec_prepare, |