diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /arch/powerpc/platforms/85xx/ksi8560.c | |
parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) |
Patched in Tegra support.
Diffstat (limited to 'arch/powerpc/platforms/85xx/ksi8560.c')
-rw-r--r-- | arch/powerpc/platforms/85xx/ksi8560.c | 69 |
1 files changed, 65 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/85xx/ksi8560.c b/arch/powerpc/platforms/85xx/ksi8560.c index 3dc1bda3ddc..c46f9359be1 100644 --- a/arch/powerpc/platforms/85xx/ksi8560.c +++ b/arch/powerpc/platforms/85xx/ksi8560.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/seq_file.h> | 20 | #include <linux/seq_file.h> |
21 | #include <linux/of_platform.h> | 21 | #include <linux/of_platform.h> |
22 | 22 | ||
23 | #include <asm/system.h> | ||
23 | #include <asm/time.h> | 24 | #include <asm/time.h> |
24 | #include <asm/machdep.h> | 25 | #include <asm/machdep.h> |
25 | #include <asm/pci-bridge.h> | 26 | #include <asm/pci-bridge.h> |
@@ -34,7 +35,6 @@ | |||
34 | #include <asm/cpm2.h> | 35 | #include <asm/cpm2.h> |
35 | #include <sysdev/cpm2_pic.h> | 36 | #include <sysdev/cpm2_pic.h> |
36 | 37 | ||
37 | #include "mpc85xx.h" | ||
38 | 38 | ||
39 | #define KSI8560_CPLD_HVR 0x04 /* Hardware Version Register */ | 39 | #define KSI8560_CPLD_HVR 0x04 /* Hardware Version Register */ |
40 | #define KSI8560_CPLD_PVR 0x08 /* PLD Version Register */ | 40 | #define KSI8560_CPLD_PVR 0x08 /* PLD Version Register */ |
@@ -54,14 +54,60 @@ static void machine_restart(char *cmd) | |||
54 | for (;;); | 54 | for (;;); |
55 | } | 55 | } |
56 | 56 | ||
57 | static 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 | |||
57 | static void __init ksi8560_pic_init(void) | 68 | static void __init ksi8560_pic_init(void) |
58 | { | 69 | { |
59 | struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN, | 70 | struct mpic *mpic; |
71 | struct resource r; | ||
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, | ||
60 | 0, 256, " OpenPIC "); | 92 | 0, 256, " OpenPIC "); |
61 | BUG_ON(mpic == NULL); | 93 | BUG_ON(mpic == NULL); |
94 | of_node_put(np); | ||
95 | |||
62 | mpic_init(mpic); | 96 | mpic_init(mpic); |
63 | 97 | ||
64 | mpc85xx_cpm2_pic_init(); | 98 | #ifdef CONFIG_CPM2 |
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 | ||
65 | } | 111 | } |
66 | 112 | ||
67 | #ifdef CONFIG_CPM2 | 113 | #ifdef CONFIG_CPM2 |
@@ -169,7 +215,22 @@ static void ksi8560_show_cpuinfo(struct seq_file *m) | |||
169 | seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f)); | 215 | seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f)); |
170 | } | 216 | } |
171 | 217 | ||
172 | machine_device_initcall(ksi8560, mpc85xx_common_publish_devices); | 218 | static struct of_device_id __initdata of_bus_ids[] = { |
219 | { .type = "soc", }, | ||
220 | { .type = "simple-bus", }, | ||
221 | { .name = "cpm", }, | ||
222 | { .name = "localbus", }, | ||
223 | { .compatible = "gianfar", }, | ||
224 | {}, | ||
225 | }; | ||
226 | |||
227 | static int __init declare_of_platform_devices(void) | ||
228 | { | ||
229 | of_platform_bus_probe(NULL, of_bus_ids, NULL); | ||
230 | |||
231 | return 0; | ||
232 | } | ||
233 | machine_device_initcall(ksi8560, declare_of_platform_devices); | ||
173 | 234 | ||
174 | /* | 235 | /* |
175 | * Called very early, device-tree isn't unflattened | 236 | * Called very early, device-tree isn't unflattened |