aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/85xx/mpc85xx_ds.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/85xx/mpc85xx_ds.c')
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ds.c50
1 files changed, 10 insertions, 40 deletions
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
index 1b9a8cf1873a..eefbb91e1d61 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
@@ -35,6 +35,9 @@
35 35
36#include <sysdev/fsl_soc.h> 36#include <sysdev/fsl_soc.h>
37#include <sysdev/fsl_pci.h> 37#include <sysdev/fsl_pci.h>
38#include "smp.h"
39
40#include "mpc85xx.h"
38 41
39#undef DEBUG 42#undef DEBUG
40 43
@@ -60,43 +63,27 @@ static void mpc85xx_8259_cascade(unsigned int irq, struct irq_desc *desc)
60void __init mpc85xx_ds_pic_init(void) 63void __init mpc85xx_ds_pic_init(void)
61{ 64{
62 struct mpic *mpic; 65 struct mpic *mpic;
63 struct resource r;
64 struct device_node *np;
65#ifdef CONFIG_PPC_I8259 66#ifdef CONFIG_PPC_I8259
67 struct device_node *np;
66 struct device_node *cascade_node = NULL; 68 struct device_node *cascade_node = NULL;
67 int cascade_irq; 69 int cascade_irq;
68#endif 70#endif
69 unsigned long root = of_get_flat_dt_root(); 71 unsigned long root = of_get_flat_dt_root();
70 72
71 np = of_find_node_by_type(NULL, "open-pic");
72 if (np == NULL) {
73 printk(KERN_ERR "Could not find open-pic node\n");
74 return;
75 }
76
77 if (of_address_to_resource(np, 0, &r)) {
78 printk(KERN_ERR "Failed to map mpic register space\n");
79 of_node_put(np);
80 return;
81 }
82
83 if (of_flat_dt_is_compatible(root, "fsl,MPC8572DS-CAMP")) { 73 if (of_flat_dt_is_compatible(root, "fsl,MPC8572DS-CAMP")) {
84 mpic = mpic_alloc(np, r.start, 74 mpic = mpic_alloc(NULL, 0,
85 MPIC_PRIMARY |
86 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | 75 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
87 MPIC_SINGLE_DEST_CPU, 76 MPIC_SINGLE_DEST_CPU,
88 0, 256, " OpenPIC "); 77 0, 256, " OpenPIC ");
89 } else { 78 } else {
90 mpic = mpic_alloc(np, r.start, 79 mpic = mpic_alloc(NULL, 0,
91 MPIC_PRIMARY | MPIC_WANTS_RESET | 80 MPIC_WANTS_RESET |
92 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | 81 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
93 MPIC_SINGLE_DEST_CPU, 82 MPIC_SINGLE_DEST_CPU,
94 0, 256, " OpenPIC "); 83 0, 256, " OpenPIC ");
95 } 84 }
96 85
97 BUG_ON(mpic == NULL); 86 BUG_ON(mpic == NULL);
98 of_node_put(np);
99
100 mpic_init(mpic); 87 mpic_init(mpic);
101 88
102#ifdef CONFIG_PPC_I8259 89#ifdef CONFIG_PPC_I8259
@@ -152,9 +139,6 @@ static int mpc85xx_exclude_device(struct pci_controller *hose,
152/* 139/*
153 * Setup the architecture 140 * Setup the architecture
154 */ 141 */
155#ifdef CONFIG_SMP
156extern void __init mpc85xx_smp_init(void);
157#endif
158static void __init mpc85xx_ds_setup_arch(void) 142static void __init mpc85xx_ds_setup_arch(void)
159{ 143{
160#ifdef CONFIG_PCI 144#ifdef CONFIG_PCI
@@ -187,9 +171,7 @@ static void __init mpc85xx_ds_setup_arch(void)
187 ppc_md.pci_exclude_device = mpc85xx_exclude_device; 171 ppc_md.pci_exclude_device = mpc85xx_exclude_device;
188#endif 172#endif
189 173
190#ifdef CONFIG_SMP
191 mpc85xx_smp_init(); 174 mpc85xx_smp_init();
192#endif
193 175
194#ifdef CONFIG_SWIOTLB 176#ifdef CONFIG_SWIOTLB
195 if (memblock_end_of_DRAM() > max) { 177 if (memblock_end_of_DRAM() > max) {
@@ -219,21 +201,9 @@ static int __init mpc8544_ds_probe(void)
219 return 0; 201 return 0;
220} 202}
221 203
222static struct of_device_id __initdata mpc85xxds_ids[] = { 204machine_device_initcall(mpc8544_ds, mpc85xx_common_publish_devices);
223 { .type = "soc", }, 205machine_device_initcall(mpc8572_ds, mpc85xx_common_publish_devices);
224 { .compatible = "soc", }, 206machine_device_initcall(p2020_ds, mpc85xx_common_publish_devices);
225 { .compatible = "simple-bus", },
226 { .compatible = "gianfar", },
227 {},
228};
229
230static int __init mpc85xxds_publish_devices(void)
231{
232 return of_platform_bus_probe(NULL, mpc85xxds_ids, NULL);
233}
234machine_device_initcall(mpc8544_ds, mpc85xxds_publish_devices);
235machine_device_initcall(mpc8572_ds, mpc85xxds_publish_devices);
236machine_device_initcall(p2020_ds, mpc85xxds_publish_devices);
237 207
238machine_arch_initcall(mpc8544_ds, swiotlb_setup_bus_notifier); 208machine_arch_initcall(mpc8544_ds, swiotlb_setup_bus_notifier);
239machine_arch_initcall(mpc8572_ds, swiotlb_setup_bus_notifier); 209machine_arch_initcall(mpc8572_ds, swiotlb_setup_bus_notifier);