aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/85xx/ksi8560.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/85xx/ksi8560.c')
-rw-r--r--arch/powerpc/platforms/85xx/ksi8560.c69
1 files changed, 5 insertions, 64 deletions
diff --git a/arch/powerpc/platforms/85xx/ksi8560.c b/arch/powerpc/platforms/85xx/ksi8560.c
index c46f9359be15..20f75d7819c6 100644
--- a/arch/powerpc/platforms/85xx/ksi8560.c
+++ b/arch/powerpc/platforms/85xx/ksi8560.c
@@ -35,6 +35,7 @@
35#include <asm/cpm2.h> 35#include <asm/cpm2.h>
36#include <sysdev/cpm2_pic.h> 36#include <sysdev/cpm2_pic.h>
37 37
38#include "mpc85xx.h"
38 39
39#define KSI8560_CPLD_HVR 0x04 /* Hardware Version Register */ 40#define KSI8560_CPLD_HVR 0x04 /* Hardware Version Register */
40#define KSI8560_CPLD_PVR 0x08 /* PLD Version Register */ 41#define KSI8560_CPLD_PVR 0x08 /* PLD Version Register */
@@ -54,60 +55,15 @@ static void machine_restart(char *cmd)
54 for (;;); 55 for (;;);
55} 56}
56 57
57static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
58{
59 struct irq_chip *chip = irq_desc_get_chip(desc);
60 int cascade_irq;
61
62 while ((cascade_irq = cpm2_get_irq()) >= 0)
63 generic_handle_irq(cascade_irq);
64
65 chip->irq_eoi(&desc->irq_data);
66}
67
68static void __init ksi8560_pic_init(void) 58static void __init ksi8560_pic_init(void)
69{ 59{
70 struct mpic *mpic; 60 struct mpic *mpic = mpic_alloc(NULL, 0,
71 struct resource r; 61 MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
72 struct device_node *np;
73#ifdef CONFIG_CPM2
74 int irq;
75#endif
76
77 np = of_find_node_by_type(NULL, "open-pic");
78
79 if (np == NULL) {
80 printk(KERN_ERR "Could not find open-pic node\n");
81 return;
82 }
83
84 if (of_address_to_resource(np, 0, &r)) {
85 printk(KERN_ERR "Could not map mpic register space\n");
86 of_node_put(np);
87 return;
88 }
89
90 mpic = mpic_alloc(np, r.start,
91 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
92 0, 256, " OpenPIC "); 62 0, 256, " OpenPIC ");
93 BUG_ON(mpic == NULL); 63 BUG_ON(mpic == NULL);
94 of_node_put(np);
95
96 mpic_init(mpic); 64 mpic_init(mpic);
97 65
98#ifdef CONFIG_CPM2 66 mpc85xx_cpm2_pic_init();
99 /* Setup CPM2 PIC */
100 np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
101 if (np == NULL) {
102 printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
103 return;
104 }
105 irq = irq_of_parse_and_map(np, 0);
106
107 cpm2_pic_init(np);
108 of_node_put(np);
109 irq_set_chained_handler(irq, cpm2_cascade);
110#endif
111} 67}
112 68
113#ifdef CONFIG_CPM2 69#ifdef CONFIG_CPM2
@@ -215,22 +171,7 @@ static void ksi8560_show_cpuinfo(struct seq_file *m)
215 seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f)); 171 seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
216} 172}
217 173
218static struct of_device_id __initdata of_bus_ids[] = { 174machine_device_initcall(ksi8560, mpc85xx_common_publish_devices);
219 { .type = "soc", },
220 { .type = "simple-bus", },
221 { .name = "cpm", },
222 { .name = "localbus", },
223 { .compatible = "gianfar", },
224 {},
225};
226
227static int __init declare_of_platform_devices(void)
228{
229 of_platform_bus_probe(NULL, of_bus_ids, NULL);
230
231 return 0;
232}
233machine_device_initcall(ksi8560, declare_of_platform_devices);
234 175
235/* 176/*
236 * Called very early, device-tree isn't unflattened 177 * Called very early, device-tree isn't unflattened