aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/85xx/sbc8560.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/85xx/sbc8560.c')
-rw-r--r--arch/powerpc/platforms/85xx/sbc8560.c74
1 files changed, 6 insertions, 68 deletions
diff --git a/arch/powerpc/platforms/85xx/sbc8560.c b/arch/powerpc/platforms/85xx/sbc8560.c
index cebd786dc334..940752e93051 100644
--- a/arch/powerpc/platforms/85xx/sbc8560.c
+++ b/arch/powerpc/platforms/85xx/sbc8560.c
@@ -32,68 +32,22 @@
32#include <sysdev/fsl_soc.h> 32#include <sysdev/fsl_soc.h>
33#include <sysdev/fsl_pci.h> 33#include <sysdev/fsl_pci.h>
34 34
35#include "mpc85xx.h"
36
35#ifdef CONFIG_CPM2 37#ifdef CONFIG_CPM2
36#include <asm/cpm2.h> 38#include <asm/cpm2.h>
37#include <sysdev/cpm2_pic.h> 39#include <sysdev/cpm2_pic.h>
38#endif 40#endif
39 41
40#ifdef CONFIG_CPM2
41
42static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
43{
44 struct irq_chip *chip = irq_desc_get_chip(desc);
45 int cascade_irq;
46
47 while ((cascade_irq = cpm2_get_irq()) >= 0)
48 generic_handle_irq(cascade_irq);
49
50 chip->irq_eoi(&desc->irq_data);
51}
52
53#endif /* CONFIG_CPM2 */
54
55static void __init sbc8560_pic_init(void) 42static void __init sbc8560_pic_init(void)
56{ 43{
57 struct mpic *mpic; 44 struct mpic *mpic = mpic_alloc(NULL, 0,
58 struct resource r; 45 MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
59 struct device_node *np = NULL;
60#ifdef CONFIG_CPM2
61 int irq;
62#endif
63
64 np = of_find_node_by_type(np, "open-pic");
65 if (!np) {
66 printk(KERN_ERR "Could not find open-pic node\n");
67 return;
68 }
69
70 if (of_address_to_resource(np, 0, &r)) {
71 printk(KERN_ERR "Could not map mpic register space\n");
72 of_node_put(np);
73 return;
74 }
75
76 mpic = mpic_alloc(np, r.start,
77 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
78 0, 256, " OpenPIC "); 46 0, 256, " OpenPIC ");
79 BUG_ON(mpic == NULL); 47 BUG_ON(mpic == NULL);
80 of_node_put(np);
81
82 mpic_init(mpic); 48 mpic_init(mpic);
83 49
84#ifdef CONFIG_CPM2 50 mpc85xx_cpm2_pic_init();
85 /* Setup CPM2 PIC */
86 np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
87 if (np == NULL) {
88 printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
89 return;
90 }
91 irq = irq_of_parse_and_map(np, 0);
92
93 cpm2_pic_init(np);
94 of_node_put(np);
95 irq_set_chained_handler(irq, cpm2_cascade);
96#endif
97} 51}
98 52
99/* 53/*
@@ -208,23 +162,7 @@ static void sbc8560_show_cpuinfo(struct seq_file *m)
208 seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f)); 162 seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
209} 163}
210 164
211static struct of_device_id __initdata of_bus_ids[] = { 165machine_device_initcall(sbc8560, mpc85xx_common_publish_devices);
212 { .name = "soc", },
213 { .type = "soc", },
214 { .name = "cpm", },
215 { .name = "localbus", },
216 { .compatible = "simple-bus", },
217 { .compatible = "gianfar", },
218 {},
219};
220
221static int __init declare_of_platform_devices(void)
222{
223 of_platform_bus_probe(NULL, of_bus_ids, NULL);
224
225 return 0;
226}
227machine_device_initcall(sbc8560, declare_of_platform_devices);
228 166
229/* 167/*
230 * Called very early, device-tree isn't unflattened 168 * Called very early, device-tree isn't unflattened