diff options
Diffstat (limited to 'arch/powerpc/platforms/85xx')
22 files changed, 199 insertions, 785 deletions
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile index bc5acb95917a..9cb2d4320dcc 100644 --- a/arch/powerpc/platforms/85xx/Makefile +++ b/arch/powerpc/platforms/85xx/Makefile | |||
@@ -3,6 +3,8 @@ | |||
3 | # | 3 | # |
4 | obj-$(CONFIG_SMP) += smp.o | 4 | obj-$(CONFIG_SMP) += smp.o |
5 | 5 | ||
6 | obj-y += common.o | ||
7 | |||
6 | obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o | 8 | obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o |
7 | obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o | 9 | obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o |
8 | obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o | 10 | obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o |
diff --git a/arch/powerpc/platforms/85xx/common.c b/arch/powerpc/platforms/85xx/common.c new file mode 100644 index 000000000000..9fef5302adc1 --- /dev/null +++ b/arch/powerpc/platforms/85xx/common.c | |||
@@ -0,0 +1,66 @@ | |||
1 | /* | ||
2 | * Routines common to most mpc85xx-based boards. | ||
3 | * | ||
4 | * This is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | #include <linux/of_platform.h> | ||
9 | |||
10 | #include <sysdev/cpm2_pic.h> | ||
11 | |||
12 | #include "mpc85xx.h" | ||
13 | |||
14 | static struct of_device_id __initdata mpc85xx_common_ids[] = { | ||
15 | { .type = "soc", }, | ||
16 | { .compatible = "soc", }, | ||
17 | { .compatible = "simple-bus", }, | ||
18 | { .name = "cpm", }, | ||
19 | { .name = "localbus", }, | ||
20 | { .compatible = "gianfar", }, | ||
21 | { .compatible = "fsl,qe", }, | ||
22 | { .compatible = "fsl,cpm2", }, | ||
23 | { .compatible = "fsl,srio", }, | ||
24 | {}, | ||
25 | }; | ||
26 | |||
27 | int __init mpc85xx_common_publish_devices(void) | ||
28 | { | ||
29 | return of_platform_bus_probe(NULL, mpc85xx_common_ids, NULL); | ||
30 | } | ||
31 | #ifdef CONFIG_CPM2 | ||
32 | static void cpm2_cascade(unsigned int irq, struct irq_desc *desc) | ||
33 | { | ||
34 | struct irq_chip *chip = irq_desc_get_chip(desc); | ||
35 | int cascade_irq; | ||
36 | |||
37 | while ((cascade_irq = cpm2_get_irq()) >= 0) | ||
38 | generic_handle_irq(cascade_irq); | ||
39 | |||
40 | chip->irq_eoi(&desc->irq_data); | ||
41 | } | ||
42 | |||
43 | |||
44 | void __init mpc85xx_cpm2_pic_init(void) | ||
45 | { | ||
46 | struct device_node *np; | ||
47 | int irq; | ||
48 | |||
49 | /* Setup CPM2 PIC */ | ||
50 | np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic"); | ||
51 | if (np == NULL) { | ||
52 | printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n"); | ||
53 | return; | ||
54 | } | ||
55 | irq = irq_of_parse_and_map(np, 0); | ||
56 | if (irq == NO_IRQ) { | ||
57 | of_node_put(np); | ||
58 | printk(KERN_ERR "PIC init: got no IRQ for cpm cascade\n"); | ||
59 | return; | ||
60 | } | ||
61 | |||
62 | cpm2_pic_init(np); | ||
63 | of_node_put(np); | ||
64 | irq_set_chained_handler(irq, cpm2_cascade); | ||
65 | } | ||
66 | #endif | ||
diff --git a/arch/powerpc/platforms/85xx/corenet_ds.c b/arch/powerpc/platforms/85xx/corenet_ds.c index 802ad110b757..07e3e6c47371 100644 --- a/arch/powerpc/platforms/85xx/corenet_ds.c +++ b/arch/powerpc/platforms/85xx/corenet_ds.c | |||
@@ -31,32 +31,18 @@ | |||
31 | #include <linux/of_platform.h> | 31 | #include <linux/of_platform.h> |
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 | #include "smp.h" | ||
34 | 35 | ||
35 | void __init corenet_ds_pic_init(void) | 36 | void __init corenet_ds_pic_init(void) |
36 | { | 37 | { |
37 | struct mpic *mpic; | 38 | struct mpic *mpic; |
38 | struct resource r; | 39 | unsigned int flags = MPIC_BIG_ENDIAN | |
39 | struct device_node *np = NULL; | ||
40 | unsigned int flags = MPIC_PRIMARY | MPIC_BIG_ENDIAN | | ||
41 | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU; | 40 | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU; |
42 | 41 | ||
43 | np = of_find_node_by_type(np, "open-pic"); | ||
44 | |||
45 | if (np == NULL) { | ||
46 | printk(KERN_ERR "Could not find open-pic node\n"); | ||
47 | return; | ||
48 | } | ||
49 | |||
50 | if (of_address_to_resource(np, 0, &r)) { | ||
51 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
52 | of_node_put(np); | ||
53 | return; | ||
54 | } | ||
55 | |||
56 | if (ppc_md.get_irq == mpic_get_coreint_irq) | 42 | if (ppc_md.get_irq == mpic_get_coreint_irq) |
57 | flags |= MPIC_ENABLE_COREINT; | 43 | flags |= MPIC_ENABLE_COREINT; |
58 | 44 | ||
59 | mpic = mpic_alloc(np, r.start, flags, 0, 256, " OpenPIC "); | 45 | mpic = mpic_alloc(NULL, 0, flags, 0, 256, " OpenPIC "); |
60 | BUG_ON(mpic == NULL); | 46 | BUG_ON(mpic == NULL); |
61 | 47 | ||
62 | mpic_init(mpic); | 48 | mpic_init(mpic); |
@@ -65,10 +51,6 @@ void __init corenet_ds_pic_init(void) | |||
65 | /* | 51 | /* |
66 | * Setup the architecture | 52 | * Setup the architecture |
67 | */ | 53 | */ |
68 | #ifdef CONFIG_SMP | ||
69 | void __init mpc85xx_smp_init(void); | ||
70 | #endif | ||
71 | |||
72 | void __init corenet_ds_setup_arch(void) | 54 | void __init corenet_ds_setup_arch(void) |
73 | { | 55 | { |
74 | #ifdef CONFIG_PCI | 56 | #ifdef CONFIG_PCI |
@@ -77,9 +59,7 @@ void __init corenet_ds_setup_arch(void) | |||
77 | #endif | 59 | #endif |
78 | dma_addr_t max = 0xffffffff; | 60 | dma_addr_t max = 0xffffffff; |
79 | 61 | ||
80 | #ifdef CONFIG_SMP | ||
81 | mpc85xx_smp_init(); | 62 | mpc85xx_smp_init(); |
82 | #endif | ||
83 | 63 | ||
84 | #ifdef CONFIG_PCI | 64 | #ifdef CONFIG_PCI |
85 | for_each_node_by_type(np, "pci") { | 65 | for_each_node_by_type(np, "pci") { |
@@ -112,7 +92,7 @@ static const struct of_device_id of_device_ids[] __devinitconst = { | |||
112 | .compatible = "simple-bus" | 92 | .compatible = "simple-bus" |
113 | }, | 93 | }, |
114 | { | 94 | { |
115 | .compatible = "fsl,rapidio-delta", | 95 | .compatible = "fsl,srio", |
116 | }, | 96 | }, |
117 | { | 97 | { |
118 | .compatible = "fsl,p4080-pcie", | 98 | .compatible = "fsl,p4080-pcie", |
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 | ||
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 | |||
68 | static void __init ksi8560_pic_init(void) | 58 | static 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 | ||
218 | static struct of_device_id __initdata of_bus_ids[] = { | 174 | machine_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 | |||
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); | ||
234 | 175 | ||
235 | /* | 176 | /* |
236 | * Called very early, device-tree isn't unflattened | 177 | * Called very early, device-tree isn't unflattened |
diff --git a/arch/powerpc/platforms/85xx/mpc8536_ds.c b/arch/powerpc/platforms/85xx/mpc8536_ds.c index f79f2f102141..cf266826682e 100644 --- a/arch/powerpc/platforms/85xx/mpc8536_ds.c +++ b/arch/powerpc/platforms/85xx/mpc8536_ds.c | |||
@@ -32,31 +32,15 @@ | |||
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 | void __init mpc8536_ds_pic_init(void) | 37 | void __init mpc8536_ds_pic_init(void) |
36 | { | 38 | { |
37 | struct mpic *mpic; | 39 | struct mpic *mpic = mpic_alloc(NULL, 0, |
38 | struct resource r; | 40 | MPIC_WANTS_RESET | |
39 | struct device_node *np; | ||
40 | |||
41 | np = of_find_node_by_type(NULL, "open-pic"); | ||
42 | if (np == NULL) { | ||
43 | printk(KERN_ERR "Could not find open-pic node\n"); | ||
44 | return; | ||
45 | } | ||
46 | |||
47 | if (of_address_to_resource(np, 0, &r)) { | ||
48 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
49 | of_node_put(np); | ||
50 | return; | ||
51 | } | ||
52 | |||
53 | mpic = mpic_alloc(np, r.start, | ||
54 | MPIC_PRIMARY | MPIC_WANTS_RESET | | ||
55 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS, | 41 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS, |
56 | 0, 256, " OpenPIC "); | 42 | 0, 256, " OpenPIC "); |
57 | BUG_ON(mpic == NULL); | 43 | BUG_ON(mpic == NULL); |
58 | of_node_put(np); | ||
59 | |||
60 | mpic_init(mpic); | 44 | mpic_init(mpic); |
61 | } | 45 | } |
62 | 46 | ||
@@ -104,19 +88,7 @@ static void __init mpc8536_ds_setup_arch(void) | |||
104 | printk("MPC8536 DS board from Freescale Semiconductor\n"); | 88 | printk("MPC8536 DS board from Freescale Semiconductor\n"); |
105 | } | 89 | } |
106 | 90 | ||
107 | static struct of_device_id __initdata mpc8536_ds_ids[] = { | 91 | machine_device_initcall(mpc8536_ds, mpc85xx_common_publish_devices); |
108 | { .type = "soc", }, | ||
109 | { .compatible = "soc", }, | ||
110 | { .compatible = "simple-bus", }, | ||
111 | { .compatible = "gianfar", }, | ||
112 | {}, | ||
113 | }; | ||
114 | |||
115 | static int __init mpc8536_ds_publish_devices(void) | ||
116 | { | ||
117 | return of_platform_bus_probe(NULL, mpc8536_ds_ids, NULL); | ||
118 | } | ||
119 | machine_device_initcall(mpc8536_ds, mpc8536_ds_publish_devices); | ||
120 | 92 | ||
121 | machine_arch_initcall(mpc8536_ds, swiotlb_setup_bus_notifier); | 93 | machine_arch_initcall(mpc8536_ds, swiotlb_setup_bus_notifier); |
122 | 94 | ||
diff --git a/arch/powerpc/platforms/85xx/mpc85xx.h b/arch/powerpc/platforms/85xx/mpc85xx.h new file mode 100644 index 000000000000..2aa7c5dc2c7f --- /dev/null +++ b/arch/powerpc/platforms/85xx/mpc85xx.h | |||
@@ -0,0 +1,11 @@ | |||
1 | #ifndef MPC85xx_H | ||
2 | #define MPC85xx_H | ||
3 | extern int mpc85xx_common_publish_devices(void); | ||
4 | |||
5 | #ifdef CONFIG_CPM2 | ||
6 | extern void mpc85xx_cpm2_pic_init(void); | ||
7 | #else | ||
8 | static inline void __init mpc85xx_cpm2_pic_init(void) {} | ||
9 | #endif /* CONFIG_CPM2 */ | ||
10 | |||
11 | #endif | ||
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c index 3b2c9bb66199..3bebb5173bfc 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c | |||
@@ -35,6 +35,8 @@ | |||
35 | #include <sysdev/cpm2_pic.h> | 35 | #include <sysdev/cpm2_pic.h> |
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | #include "mpc85xx.h" | ||
39 | |||
38 | #ifdef CONFIG_PCI | 40 | #ifdef CONFIG_PCI |
39 | static int mpc85xx_exclude_device(struct pci_controller *hose, | 41 | static int mpc85xx_exclude_device(struct pci_controller *hose, |
40 | u_char bus, u_char devfn) | 42 | u_char bus, u_char devfn) |
@@ -46,63 +48,15 @@ static int mpc85xx_exclude_device(struct pci_controller *hose, | |||
46 | } | 48 | } |
47 | #endif /* CONFIG_PCI */ | 49 | #endif /* CONFIG_PCI */ |
48 | 50 | ||
49 | #ifdef CONFIG_CPM2 | ||
50 | |||
51 | static void cpm2_cascade(unsigned int irq, struct irq_desc *desc) | ||
52 | { | ||
53 | struct irq_chip *chip = irq_desc_get_chip(desc); | ||
54 | int cascade_irq; | ||
55 | |||
56 | while ((cascade_irq = cpm2_get_irq()) >= 0) | ||
57 | generic_handle_irq(cascade_irq); | ||
58 | |||
59 | chip->irq_eoi(&desc->irq_data); | ||
60 | } | ||
61 | |||
62 | #endif /* CONFIG_CPM2 */ | ||
63 | |||
64 | static void __init mpc85xx_ads_pic_init(void) | 51 | static void __init mpc85xx_ads_pic_init(void) |
65 | { | 52 | { |
66 | struct mpic *mpic; | 53 | struct mpic *mpic = mpic_alloc(NULL, 0, |
67 | struct resource r; | 54 | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, |
68 | struct device_node *np = NULL; | ||
69 | #ifdef CONFIG_CPM2 | ||
70 | int irq; | ||
71 | #endif | ||
72 | |||
73 | np = of_find_node_by_type(np, "open-pic"); | ||
74 | if (!np) { | ||
75 | printk(KERN_ERR "Could not find open-pic node\n"); | ||
76 | return; | ||
77 | } | ||
78 | |||
79 | if (of_address_to_resource(np, 0, &r)) { | ||
80 | printk(KERN_ERR "Could not map mpic register space\n"); | ||
81 | of_node_put(np); | ||
82 | return; | ||
83 | } | ||
84 | |||
85 | mpic = mpic_alloc(np, r.start, | ||
86 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | ||
87 | 0, 256, " OpenPIC "); | 55 | 0, 256, " OpenPIC "); |
88 | BUG_ON(mpic == NULL); | 56 | BUG_ON(mpic == NULL); |
89 | of_node_put(np); | ||
90 | |||
91 | mpic_init(mpic); | 57 | mpic_init(mpic); |
92 | 58 | ||
93 | #ifdef CONFIG_CPM2 | 59 | mpc85xx_cpm2_pic_init(); |
94 | /* Setup CPM2 PIC */ | ||
95 | np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic"); | ||
96 | if (np == NULL) { | ||
97 | printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n"); | ||
98 | return; | ||
99 | } | ||
100 | irq = irq_of_parse_and_map(np, 0); | ||
101 | |||
102 | cpm2_pic_init(np); | ||
103 | of_node_put(np); | ||
104 | irq_set_chained_handler(irq, cpm2_cascade); | ||
105 | #endif | ||
106 | } | 60 | } |
107 | 61 | ||
108 | /* | 62 | /* |
@@ -221,23 +175,7 @@ static void mpc85xx_ads_show_cpuinfo(struct seq_file *m) | |||
221 | seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f)); | 175 | seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f)); |
222 | } | 176 | } |
223 | 177 | ||
224 | static struct of_device_id __initdata of_bus_ids[] = { | 178 | machine_device_initcall(mpc85xx_ads, mpc85xx_common_publish_devices); |
225 | { .name = "soc", }, | ||
226 | { .type = "soc", }, | ||
227 | { .name = "cpm", }, | ||
228 | { .name = "localbus", }, | ||
229 | { .compatible = "simple-bus", }, | ||
230 | { .compatible = "gianfar", }, | ||
231 | {}, | ||
232 | }; | ||
233 | |||
234 | static int __init declare_of_platform_devices(void) | ||
235 | { | ||
236 | of_platform_bus_probe(NULL, of_bus_ids, NULL); | ||
237 | |||
238 | return 0; | ||
239 | } | ||
240 | machine_device_initcall(mpc85xx_ads, declare_of_platform_devices); | ||
241 | 179 | ||
242 | /* | 180 | /* |
243 | * Called very early, device-tree isn't unflattened | 181 | * Called very early, device-tree isn't unflattened |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c index 66cb8d64079f..40f03da616a9 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c | |||
@@ -46,6 +46,8 @@ | |||
46 | #include <sysdev/fsl_soc.h> | 46 | #include <sysdev/fsl_soc.h> |
47 | #include <sysdev/fsl_pci.h> | 47 | #include <sysdev/fsl_pci.h> |
48 | 48 | ||
49 | #include "mpc85xx.h" | ||
50 | |||
49 | /* CADMUS info */ | 51 | /* CADMUS info */ |
50 | /* xxx - galak, move into device tree */ | 52 | /* xxx - galak, move into device tree */ |
51 | #define CADMUS_BASE (0xf8004000) | 53 | #define CADMUS_BASE (0xf8004000) |
@@ -177,7 +179,7 @@ static irqreturn_t mpc85xx_8259_cascade_action(int irq, void *dev_id) | |||
177 | 179 | ||
178 | static struct irqaction mpc85xxcds_8259_irqaction = { | 180 | static struct irqaction mpc85xxcds_8259_irqaction = { |
179 | .handler = mpc85xx_8259_cascade_action, | 181 | .handler = mpc85xx_8259_cascade_action, |
180 | .flags = IRQF_SHARED, | 182 | .flags = IRQF_SHARED | IRQF_NO_THREAD, |
181 | .name = "8259 cascade", | 183 | .name = "8259 cascade", |
182 | }; | 184 | }; |
183 | #endif /* PPC_I8259 */ | 185 | #endif /* PPC_I8259 */ |
@@ -186,30 +188,10 @@ static struct irqaction mpc85xxcds_8259_irqaction = { | |||
186 | static void __init mpc85xx_cds_pic_init(void) | 188 | static void __init mpc85xx_cds_pic_init(void) |
187 | { | 189 | { |
188 | struct mpic *mpic; | 190 | struct mpic *mpic; |
189 | struct resource r; | 191 | mpic = mpic_alloc(NULL, 0, |
190 | struct device_node *np = NULL; | 192 | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, |
191 | |||
192 | np = of_find_node_by_type(np, "open-pic"); | ||
193 | |||
194 | if (np == NULL) { | ||
195 | printk(KERN_ERR "Could not find open-pic node\n"); | ||
196 | return; | ||
197 | } | ||
198 | |||
199 | if (of_address_to_resource(np, 0, &r)) { | ||
200 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
201 | of_node_put(np); | ||
202 | return; | ||
203 | } | ||
204 | |||
205 | mpic = mpic_alloc(np, r.start, | ||
206 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | ||
207 | 0, 256, " OpenPIC "); | 193 | 0, 256, " OpenPIC "); |
208 | BUG_ON(mpic == NULL); | 194 | BUG_ON(mpic == NULL); |
209 | |||
210 | /* Return the mpic node */ | ||
211 | of_node_put(np); | ||
212 | |||
213 | mpic_init(mpic); | 195 | mpic_init(mpic); |
214 | } | 196 | } |
215 | 197 | ||
@@ -330,19 +312,7 @@ static int __init mpc85xx_cds_probe(void) | |||
330 | return of_flat_dt_is_compatible(root, "MPC85xxCDS"); | 312 | return of_flat_dt_is_compatible(root, "MPC85xxCDS"); |
331 | } | 313 | } |
332 | 314 | ||
333 | static struct of_device_id __initdata of_bus_ids[] = { | 315 | machine_device_initcall(mpc85xx_cds, mpc85xx_common_publish_devices); |
334 | { .type = "soc", }, | ||
335 | { .compatible = "soc", }, | ||
336 | { .compatible = "simple-bus", }, | ||
337 | { .compatible = "gianfar", }, | ||
338 | {}, | ||
339 | }; | ||
340 | |||
341 | static int __init declare_of_platform_devices(void) | ||
342 | { | ||
343 | return of_platform_bus_probe(NULL, of_bus_ids, NULL); | ||
344 | } | ||
345 | machine_device_initcall(mpc85xx_cds, declare_of_platform_devices); | ||
346 | 316 | ||
347 | define_machine(mpc85xx_cds) { | 317 | define_machine(mpc85xx_cds) { |
348 | .name = "MPC85xx CDS", | 318 | .name = "MPC85xx CDS", |
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) | |||
60 | void __init mpc85xx_ds_pic_init(void) | 63 | void __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 | ||
156 | extern void __init mpc85xx_smp_init(void); | ||
157 | #endif | ||
158 | static void __init mpc85xx_ds_setup_arch(void) | 142 | static 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 | ||
222 | static struct of_device_id __initdata mpc85xxds_ids[] = { | 204 | machine_device_initcall(mpc8544_ds, mpc85xx_common_publish_devices); |
223 | { .type = "soc", }, | 205 | machine_device_initcall(mpc8572_ds, mpc85xx_common_publish_devices); |
224 | { .compatible = "soc", }, | 206 | machine_device_initcall(p2020_ds, mpc85xx_common_publish_devices); |
225 | { .compatible = "simple-bus", }, | ||
226 | { .compatible = "gianfar", }, | ||
227 | {}, | ||
228 | }; | ||
229 | |||
230 | static int __init mpc85xxds_publish_devices(void) | ||
231 | { | ||
232 | return of_platform_bus_probe(NULL, mpc85xxds_ids, NULL); | ||
233 | } | ||
234 | machine_device_initcall(mpc8544_ds, mpc85xxds_publish_devices); | ||
235 | machine_device_initcall(mpc8572_ds, mpc85xxds_publish_devices); | ||
236 | machine_device_initcall(p2020_ds, mpc85xxds_publish_devices); | ||
237 | 207 | ||
238 | machine_arch_initcall(mpc8544_ds, swiotlb_setup_bus_notifier); | 208 | machine_arch_initcall(mpc8544_ds, swiotlb_setup_bus_notifier); |
239 | machine_arch_initcall(mpc8572_ds, swiotlb_setup_bus_notifier); | 209 | machine_arch_initcall(mpc8572_ds, swiotlb_setup_bus_notifier); |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c index a23a3ff634c5..1d15a0cd2c82 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c | |||
@@ -51,6 +51,9 @@ | |||
51 | #include <asm/qe_ic.h> | 51 | #include <asm/qe_ic.h> |
52 | #include <asm/mpic.h> | 52 | #include <asm/mpic.h> |
53 | #include <asm/swiotlb.h> | 53 | #include <asm/swiotlb.h> |
54 | #include "smp.h" | ||
55 | |||
56 | #include "mpc85xx.h" | ||
54 | 57 | ||
55 | #undef DEBUG | 58 | #undef DEBUG |
56 | #ifdef DEBUG | 59 | #ifdef DEBUG |
@@ -153,30 +156,7 @@ static int mpc8568_mds_phy_fixups(struct phy_device *phydev) | |||
153 | * Setup the architecture | 156 | * Setup the architecture |
154 | * | 157 | * |
155 | */ | 158 | */ |
156 | #ifdef CONFIG_SMP | ||
157 | extern void __init mpc85xx_smp_init(void); | ||
158 | #endif | ||
159 | |||
160 | #ifdef CONFIG_QUICC_ENGINE | 159 | #ifdef CONFIG_QUICC_ENGINE |
161 | static struct of_device_id mpc85xx_qe_ids[] __initdata = { | ||
162 | { .type = "qe", }, | ||
163 | { .compatible = "fsl,qe", }, | ||
164 | { }, | ||
165 | }; | ||
166 | |||
167 | static void __init mpc85xx_publish_qe_devices(void) | ||
168 | { | ||
169 | struct device_node *np; | ||
170 | |||
171 | np = of_find_compatible_node(NULL, NULL, "fsl,qe"); | ||
172 | if (!of_device_is_available(np)) { | ||
173 | of_node_put(np); | ||
174 | return; | ||
175 | } | ||
176 | |||
177 | of_platform_bus_probe(NULL, mpc85xx_qe_ids, NULL); | ||
178 | } | ||
179 | |||
180 | static void __init mpc85xx_mds_reset_ucc_phys(void) | 160 | static void __init mpc85xx_mds_reset_ucc_phys(void) |
181 | { | 161 | { |
182 | struct device_node *np; | 162 | struct device_node *np; |
@@ -347,7 +327,6 @@ static void __init mpc85xx_mds_qeic_init(void) | |||
347 | of_node_put(np); | 327 | of_node_put(np); |
348 | } | 328 | } |
349 | #else | 329 | #else |
350 | static void __init mpc85xx_publish_qe_devices(void) { } | ||
351 | static void __init mpc85xx_mds_qe_init(void) { } | 330 | static void __init mpc85xx_mds_qe_init(void) { } |
352 | static void __init mpc85xx_mds_qeic_init(void) { } | 331 | static void __init mpc85xx_mds_qeic_init(void) { } |
353 | #endif /* CONFIG_QUICC_ENGINE */ | 332 | #endif /* CONFIG_QUICC_ENGINE */ |
@@ -381,9 +360,7 @@ static void __init mpc85xx_mds_setup_arch(void) | |||
381 | } | 360 | } |
382 | #endif | 361 | #endif |
383 | 362 | ||
384 | #ifdef CONFIG_SMP | ||
385 | mpc85xx_smp_init(); | 363 | mpc85xx_smp_init(); |
386 | #endif | ||
387 | 364 | ||
388 | mpc85xx_mds_qe_init(); | 365 | mpc85xx_mds_qe_init(); |
389 | 366 | ||
@@ -429,24 +406,11 @@ machine_arch_initcall(mpc8568_mds, board_fixups); | |||
429 | machine_arch_initcall(mpc8569_mds, board_fixups); | 406 | machine_arch_initcall(mpc8569_mds, board_fixups); |
430 | 407 | ||
431 | static struct of_device_id mpc85xx_ids[] = { | 408 | static struct of_device_id mpc85xx_ids[] = { |
432 | { .type = "soc", }, | ||
433 | { .compatible = "soc", }, | ||
434 | { .compatible = "simple-bus", }, | ||
435 | { .compatible = "gianfar", }, | ||
436 | { .compatible = "fsl,rapidio-delta", }, | ||
437 | { .compatible = "fsl,mpc8548-guts", }, | 409 | { .compatible = "fsl,mpc8548-guts", }, |
438 | { .compatible = "gpio-leds", }, | 410 | { .compatible = "gpio-leds", }, |
439 | {}, | 411 | {}, |
440 | }; | 412 | }; |
441 | 413 | ||
442 | static struct of_device_id p1021_ids[] = { | ||
443 | { .type = "soc", }, | ||
444 | { .compatible = "soc", }, | ||
445 | { .compatible = "simple-bus", }, | ||
446 | { .compatible = "gianfar", }, | ||
447 | {}, | ||
448 | }; | ||
449 | |||
450 | static int __init mpc85xx_publish_devices(void) | 414 | static int __init mpc85xx_publish_devices(void) |
451 | { | 415 | { |
452 | if (machine_is(mpc8568_mds)) | 416 | if (machine_is(mpc8568_mds)) |
@@ -454,23 +418,15 @@ static int __init mpc85xx_publish_devices(void) | |||
454 | if (machine_is(mpc8569_mds)) | 418 | if (machine_is(mpc8569_mds)) |
455 | simple_gpiochip_init("fsl,mpc8569mds-bcsr-gpio"); | 419 | simple_gpiochip_init("fsl,mpc8569mds-bcsr-gpio"); |
456 | 420 | ||
421 | mpc85xx_common_publish_devices(); | ||
457 | of_platform_bus_probe(NULL, mpc85xx_ids, NULL); | 422 | of_platform_bus_probe(NULL, mpc85xx_ids, NULL); |
458 | mpc85xx_publish_qe_devices(); | ||
459 | |||
460 | return 0; | ||
461 | } | ||
462 | |||
463 | static int __init p1021_publish_devices(void) | ||
464 | { | ||
465 | of_platform_bus_probe(NULL, p1021_ids, NULL); | ||
466 | mpc85xx_publish_qe_devices(); | ||
467 | 423 | ||
468 | return 0; | 424 | return 0; |
469 | } | 425 | } |
470 | 426 | ||
471 | machine_device_initcall(mpc8568_mds, mpc85xx_publish_devices); | 427 | machine_device_initcall(mpc8568_mds, mpc85xx_publish_devices); |
472 | machine_device_initcall(mpc8569_mds, mpc85xx_publish_devices); | 428 | machine_device_initcall(mpc8569_mds, mpc85xx_publish_devices); |
473 | machine_device_initcall(p1021_mds, p1021_publish_devices); | 429 | machine_device_initcall(p1021_mds, mpc85xx_common_publish_devices); |
474 | 430 | ||
475 | machine_arch_initcall(mpc8568_mds, swiotlb_setup_bus_notifier); | 431 | machine_arch_initcall(mpc8568_mds, swiotlb_setup_bus_notifier); |
476 | machine_arch_initcall(mpc8569_mds, swiotlb_setup_bus_notifier); | 432 | machine_arch_initcall(mpc8569_mds, swiotlb_setup_bus_notifier); |
@@ -478,26 +434,11 @@ machine_arch_initcall(p1021_mds, swiotlb_setup_bus_notifier); | |||
478 | 434 | ||
479 | static void __init mpc85xx_mds_pic_init(void) | 435 | static void __init mpc85xx_mds_pic_init(void) |
480 | { | 436 | { |
481 | struct mpic *mpic; | 437 | struct mpic *mpic = mpic_alloc(NULL, 0, |
482 | struct resource r; | 438 | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN | |
483 | struct device_node *np = NULL; | ||
484 | |||
485 | np = of_find_node_by_type(NULL, "open-pic"); | ||
486 | if (!np) | ||
487 | return; | ||
488 | |||
489 | if (of_address_to_resource(np, 0, &r)) { | ||
490 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
491 | of_node_put(np); | ||
492 | return; | ||
493 | } | ||
494 | |||
495 | mpic = mpic_alloc(np, r.start, | ||
496 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN | | ||
497 | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, | 439 | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, |
498 | 0, 256, " OpenPIC "); | 440 | 0, 256, " OpenPIC "); |
499 | BUG_ON(mpic == NULL); | 441 | BUG_ON(mpic == NULL); |
500 | of_node_put(np); | ||
501 | 442 | ||
502 | mpic_init(mpic); | 443 | mpic_init(mpic); |
503 | mpc85xx_mds_qeic_init(); | 444 | mpc85xx_mds_qeic_init(); |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c index f5ff9110c97e..ccf520e890be 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c | |||
@@ -29,6 +29,9 @@ | |||
29 | 29 | ||
30 | #include <sysdev/fsl_soc.h> | 30 | #include <sysdev/fsl_soc.h> |
31 | #include <sysdev/fsl_pci.h> | 31 | #include <sysdev/fsl_pci.h> |
32 | #include "smp.h" | ||
33 | |||
34 | #include "mpc85xx.h" | ||
32 | 35 | ||
33 | #undef DEBUG | 36 | #undef DEBUG |
34 | 37 | ||
@@ -42,49 +45,28 @@ | |||
42 | void __init mpc85xx_rdb_pic_init(void) | 45 | void __init mpc85xx_rdb_pic_init(void) |
43 | { | 46 | { |
44 | struct mpic *mpic; | 47 | struct mpic *mpic; |
45 | struct resource r; | ||
46 | struct device_node *np; | ||
47 | unsigned long root = of_get_flat_dt_root(); | 48 | unsigned long root = of_get_flat_dt_root(); |
48 | 49 | ||
49 | np = of_find_node_by_type(NULL, "open-pic"); | ||
50 | if (np == NULL) { | ||
51 | printk(KERN_ERR "Could not find open-pic node\n"); | ||
52 | return; | ||
53 | } | ||
54 | |||
55 | if (of_address_to_resource(np, 0, &r)) { | ||
56 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
57 | of_node_put(np); | ||
58 | return; | ||
59 | } | ||
60 | |||
61 | if (of_flat_dt_is_compatible(root, "fsl,MPC85XXRDB-CAMP")) { | 50 | if (of_flat_dt_is_compatible(root, "fsl,MPC85XXRDB-CAMP")) { |
62 | mpic = mpic_alloc(np, r.start, | 51 | mpic = mpic_alloc(NULL, 0, |
63 | MPIC_PRIMARY | | ||
64 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | | 52 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | |
65 | MPIC_SINGLE_DEST_CPU, | 53 | MPIC_SINGLE_DEST_CPU, |
66 | 0, 256, " OpenPIC "); | 54 | 0, 256, " OpenPIC "); |
67 | } else { | 55 | } else { |
68 | mpic = mpic_alloc(np, r.start, | 56 | mpic = mpic_alloc(NULL, 0, |
69 | MPIC_PRIMARY | MPIC_WANTS_RESET | | 57 | MPIC_WANTS_RESET | |
70 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | | 58 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | |
71 | MPIC_SINGLE_DEST_CPU, | 59 | MPIC_SINGLE_DEST_CPU, |
72 | 0, 256, " OpenPIC "); | 60 | 0, 256, " OpenPIC "); |
73 | } | 61 | } |
74 | 62 | ||
75 | BUG_ON(mpic == NULL); | 63 | BUG_ON(mpic == NULL); |
76 | of_node_put(np); | ||
77 | |||
78 | mpic_init(mpic); | 64 | mpic_init(mpic); |
79 | |||
80 | } | 65 | } |
81 | 66 | ||
82 | /* | 67 | /* |
83 | * Setup the architecture | 68 | * Setup the architecture |
84 | */ | 69 | */ |
85 | #ifdef CONFIG_SMP | ||
86 | extern void __init mpc85xx_smp_init(void); | ||
87 | #endif | ||
88 | static void __init mpc85xx_rdb_setup_arch(void) | 70 | static void __init mpc85xx_rdb_setup_arch(void) |
89 | { | 71 | { |
90 | #ifdef CONFIG_PCI | 72 | #ifdef CONFIG_PCI |
@@ -102,27 +84,12 @@ static void __init mpc85xx_rdb_setup_arch(void) | |||
102 | 84 | ||
103 | #endif | 85 | #endif |
104 | 86 | ||
105 | #ifdef CONFIG_SMP | ||
106 | mpc85xx_smp_init(); | 87 | mpc85xx_smp_init(); |
107 | #endif | ||
108 | |||
109 | printk(KERN_INFO "MPC85xx RDB board from Freescale Semiconductor\n"); | 88 | printk(KERN_INFO "MPC85xx RDB board from Freescale Semiconductor\n"); |
110 | } | 89 | } |
111 | 90 | ||
112 | static struct of_device_id __initdata mpc85xxrdb_ids[] = { | 91 | machine_device_initcall(p2020_rdb, mpc85xx_common_publish_devices); |
113 | { .type = "soc", }, | 92 | machine_device_initcall(p1020_rdb, mpc85xx_common_publish_devices); |
114 | { .compatible = "soc", }, | ||
115 | { .compatible = "simple-bus", }, | ||
116 | { .compatible = "gianfar", }, | ||
117 | {}, | ||
118 | }; | ||
119 | |||
120 | static int __init mpc85xxrdb_publish_devices(void) | ||
121 | { | ||
122 | return of_platform_bus_probe(NULL, mpc85xxrdb_ids, NULL); | ||
123 | } | ||
124 | machine_device_initcall(p2020_rdb, mpc85xxrdb_publish_devices); | ||
125 | machine_device_initcall(p1020_rdb, mpc85xxrdb_publish_devices); | ||
126 | 93 | ||
127 | /* | 94 | /* |
128 | * Called very early, device-tree isn't unflattened | 95 | * Called very early, device-tree isn't unflattened |
diff --git a/arch/powerpc/platforms/85xx/p1010rdb.c b/arch/powerpc/platforms/85xx/p1010rdb.c index d7387fa7f534..538bc3f57e9d 100644 --- a/arch/powerpc/platforms/85xx/p1010rdb.c +++ b/arch/powerpc/platforms/85xx/p1010rdb.c | |||
@@ -28,33 +28,18 @@ | |||
28 | #include <sysdev/fsl_soc.h> | 28 | #include <sysdev/fsl_soc.h> |
29 | #include <sysdev/fsl_pci.h> | 29 | #include <sysdev/fsl_pci.h> |
30 | 30 | ||
31 | #include "mpc85xx.h" | ||
32 | |||
31 | void __init p1010_rdb_pic_init(void) | 33 | void __init p1010_rdb_pic_init(void) |
32 | { | 34 | { |
33 | struct mpic *mpic; | 35 | struct mpic *mpic = mpic_alloc(NULL, 0, |
34 | struct resource r; | 36 | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN | |
35 | struct device_node *np; | 37 | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, |
36 | |||
37 | np = of_find_node_by_type(NULL, "open-pic"); | ||
38 | if (np == NULL) { | ||
39 | printk(KERN_ERR "Could not find open-pic node\n"); | ||
40 | return; | ||
41 | } | ||
42 | |||
43 | if (of_address_to_resource(np, 0, &r)) { | ||
44 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
45 | of_node_put(np); | ||
46 | return; | ||
47 | } | ||
48 | |||
49 | mpic = mpic_alloc(np, r.start, MPIC_PRIMARY | MPIC_WANTS_RESET | | ||
50 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, | ||
51 | 0, 256, " OpenPIC "); | 38 | 0, 256, " OpenPIC "); |
52 | 39 | ||
53 | BUG_ON(mpic == NULL); | 40 | BUG_ON(mpic == NULL); |
54 | of_node_put(np); | ||
55 | 41 | ||
56 | mpic_init(mpic); | 42 | mpic_init(mpic); |
57 | |||
58 | } | 43 | } |
59 | 44 | ||
60 | 45 | ||
@@ -81,18 +66,7 @@ static void __init p1010_rdb_setup_arch(void) | |||
81 | printk(KERN_INFO "P1010 RDB board from Freescale Semiconductor\n"); | 66 | printk(KERN_INFO "P1010 RDB board from Freescale Semiconductor\n"); |
82 | } | 67 | } |
83 | 68 | ||
84 | static struct of_device_id __initdata p1010rdb_ids[] = { | 69 | machine_device_initcall(p1010_rdb, mpc85xx_common_publish_devices); |
85 | { .type = "soc", }, | ||
86 | { .compatible = "soc", }, | ||
87 | { .compatible = "simple-bus", }, | ||
88 | {}, | ||
89 | }; | ||
90 | |||
91 | static int __init p1010rdb_publish_devices(void) | ||
92 | { | ||
93 | return of_platform_bus_probe(NULL, p1010rdb_ids, NULL); | ||
94 | } | ||
95 | machine_device_initcall(p1010_rdb, p1010rdb_publish_devices); | ||
96 | machine_arch_initcall(p1010_rdb, swiotlb_setup_bus_notifier); | 70 | machine_arch_initcall(p1010_rdb, swiotlb_setup_bus_notifier); |
97 | 71 | ||
98 | /* | 72 | /* |
diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c b/arch/powerpc/platforms/85xx/p1022_ds.c index fda15716fada..bb3d84f4046f 100644 --- a/arch/powerpc/platforms/85xx/p1022_ds.c +++ b/arch/powerpc/platforms/85xx/p1022_ds.c | |||
@@ -26,6 +26,9 @@ | |||
26 | #include <sysdev/fsl_soc.h> | 26 | #include <sysdev/fsl_soc.h> |
27 | #include <sysdev/fsl_pci.h> | 27 | #include <sysdev/fsl_pci.h> |
28 | #include <asm/fsl_guts.h> | 28 | #include <asm/fsl_guts.h> |
29 | #include "smp.h" | ||
30 | |||
31 | #include "mpc85xx.h" | ||
29 | 32 | ||
30 | #if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) | 33 | #if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) |
31 | 34 | ||
@@ -238,38 +241,15 @@ p1022ds_valid_monitor_port(enum fsl_diu_monitor_port port) | |||
238 | 241 | ||
239 | void __init p1022_ds_pic_init(void) | 242 | void __init p1022_ds_pic_init(void) |
240 | { | 243 | { |
241 | struct mpic *mpic; | 244 | struct mpic *mpic = mpic_alloc(NULL, 0, |
242 | struct resource r; | 245 | MPIC_WANTS_RESET | |
243 | struct device_node *np; | ||
244 | |||
245 | np = of_find_node_by_type(NULL, "open-pic"); | ||
246 | if (!np) { | ||
247 | pr_err("Could not find open-pic node\n"); | ||
248 | return; | ||
249 | } | ||
250 | |||
251 | if (of_address_to_resource(np, 0, &r)) { | ||
252 | pr_err("Failed to map mpic register space\n"); | ||
253 | of_node_put(np); | ||
254 | return; | ||
255 | } | ||
256 | |||
257 | mpic = mpic_alloc(np, r.start, | ||
258 | MPIC_PRIMARY | MPIC_WANTS_RESET | | ||
259 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | | 246 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | |
260 | MPIC_SINGLE_DEST_CPU, | 247 | MPIC_SINGLE_DEST_CPU, |
261 | 0, 256, " OpenPIC "); | 248 | 0, 256, " OpenPIC "); |
262 | |||
263 | BUG_ON(mpic == NULL); | 249 | BUG_ON(mpic == NULL); |
264 | of_node_put(np); | ||
265 | |||
266 | mpic_init(mpic); | 250 | mpic_init(mpic); |
267 | } | 251 | } |
268 | 252 | ||
269 | #ifdef CONFIG_SMP | ||
270 | void __init mpc85xx_smp_init(void); | ||
271 | #endif | ||
272 | |||
273 | /* | 253 | /* |
274 | * Setup the architecture | 254 | * Setup the architecture |
275 | */ | 255 | */ |
@@ -309,9 +289,7 @@ static void __init p1022_ds_setup_arch(void) | |||
309 | diu_ops.valid_monitor_port = p1022ds_valid_monitor_port; | 289 | diu_ops.valid_monitor_port = p1022ds_valid_monitor_port; |
310 | #endif | 290 | #endif |
311 | 291 | ||
312 | #ifdef CONFIG_SMP | ||
313 | mpc85xx_smp_init(); | 292 | mpc85xx_smp_init(); |
314 | #endif | ||
315 | 293 | ||
316 | #ifdef CONFIG_SWIOTLB | 294 | #ifdef CONFIG_SWIOTLB |
317 | if (memblock_end_of_DRAM() > max) { | 295 | if (memblock_end_of_DRAM() > max) { |
@@ -325,10 +303,6 @@ static void __init p1022_ds_setup_arch(void) | |||
325 | } | 303 | } |
326 | 304 | ||
327 | static struct of_device_id __initdata p1022_ds_ids[] = { | 305 | static struct of_device_id __initdata p1022_ds_ids[] = { |
328 | { .type = "soc", }, | ||
329 | { .compatible = "soc", }, | ||
330 | { .compatible = "simple-bus", }, | ||
331 | { .compatible = "gianfar", }, | ||
332 | /* So that the DMA channel nodes can be probed individually: */ | 306 | /* So that the DMA channel nodes can be probed individually: */ |
333 | { .compatible = "fsl,eloplus-dma", }, | 307 | { .compatible = "fsl,eloplus-dma", }, |
334 | {}, | 308 | {}, |
@@ -336,6 +310,7 @@ static struct of_device_id __initdata p1022_ds_ids[] = { | |||
336 | 310 | ||
337 | static int __init p1022_ds_publish_devices(void) | 311 | static int __init p1022_ds_publish_devices(void) |
338 | { | 312 | { |
313 | mpc85xx_common_publish_devices(); | ||
339 | return of_platform_bus_probe(NULL, p1022_ds_ids, NULL); | 314 | return of_platform_bus_probe(NULL, p1022_ds_ids, NULL); |
340 | } | 315 | } |
341 | machine_device_initcall(p1022_ds, p1022_ds_publish_devices); | 316 | machine_device_initcall(p1022_ds, p1022_ds_publish_devices); |
diff --git a/arch/powerpc/platforms/85xx/p1023_rds.c b/arch/powerpc/platforms/85xx/p1023_rds.c index 835e0b335bfa..d951e7027bb6 100644 --- a/arch/powerpc/platforms/85xx/p1023_rds.c +++ b/arch/powerpc/platforms/85xx/p1023_rds.c | |||
@@ -30,19 +30,18 @@ | |||
30 | #include <asm/prom.h> | 30 | #include <asm/prom.h> |
31 | #include <asm/udbg.h> | 31 | #include <asm/udbg.h> |
32 | #include <asm/mpic.h> | 32 | #include <asm/mpic.h> |
33 | #include "smp.h" | ||
33 | 34 | ||
34 | #include <sysdev/fsl_soc.h> | 35 | #include <sysdev/fsl_soc.h> |
35 | #include <sysdev/fsl_pci.h> | 36 | #include <sysdev/fsl_pci.h> |
36 | 37 | ||
38 | #include "mpc85xx.h" | ||
39 | |||
37 | /* ************************************************************************ | 40 | /* ************************************************************************ |
38 | * | 41 | * |
39 | * Setup the architecture | 42 | * Setup the architecture |
40 | * | 43 | * |
41 | */ | 44 | */ |
42 | #ifdef CONFIG_SMP | ||
43 | void __init mpc85xx_smp_init(void); | ||
44 | #endif | ||
45 | |||
46 | static void __init mpc85xx_rds_setup_arch(void) | 45 | static void __init mpc85xx_rds_setup_arch(void) |
47 | { | 46 | { |
48 | struct device_node *np; | 47 | struct device_node *np; |
@@ -87,53 +86,19 @@ static void __init mpc85xx_rds_setup_arch(void) | |||
87 | fsl_add_bridge(np, 0); | 86 | fsl_add_bridge(np, 0); |
88 | #endif | 87 | #endif |
89 | 88 | ||
90 | #ifdef CONFIG_SMP | ||
91 | mpc85xx_smp_init(); | 89 | mpc85xx_smp_init(); |
92 | #endif | ||
93 | } | ||
94 | |||
95 | static struct of_device_id p1023_ids[] = { | ||
96 | { .type = "soc", }, | ||
97 | { .compatible = "soc", }, | ||
98 | { .compatible = "simple-bus", }, | ||
99 | {}, | ||
100 | }; | ||
101 | |||
102 | |||
103 | static int __init p1023_publish_devices(void) | ||
104 | { | ||
105 | of_platform_bus_probe(NULL, p1023_ids, NULL); | ||
106 | |||
107 | return 0; | ||
108 | } | 90 | } |
109 | 91 | ||
110 | machine_device_initcall(p1023_rds, p1023_publish_devices); | 92 | machine_device_initcall(p1023_rds, mpc85xx_common_publish_devices); |
111 | 93 | ||
112 | static void __init mpc85xx_rds_pic_init(void) | 94 | static void __init mpc85xx_rds_pic_init(void) |
113 | { | 95 | { |
114 | struct mpic *mpic; | 96 | struct mpic *mpic = mpic_alloc(NULL, 0, |
115 | struct resource r; | 97 | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN | |
116 | struct device_node *np = NULL; | ||
117 | |||
118 | np = of_find_node_by_type(NULL, "open-pic"); | ||
119 | if (!np) { | ||
120 | printk(KERN_ERR "Could not find open-pic node\n"); | ||
121 | return; | ||
122 | } | ||
123 | |||
124 | if (of_address_to_resource(np, 0, &r)) { | ||
125 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
126 | of_node_put(np); | ||
127 | return; | ||
128 | } | ||
129 | |||
130 | mpic = mpic_alloc(np, r.start, | ||
131 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN | | ||
132 | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, | 98 | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, |
133 | 0, 256, " OpenPIC "); | 99 | 0, 256, " OpenPIC "); |
134 | 100 | ||
135 | BUG_ON(mpic == NULL); | 101 | BUG_ON(mpic == NULL); |
136 | of_node_put(np); | ||
137 | 102 | ||
138 | mpic_init(mpic); | 103 | mpic_init(mpic); |
139 | } | 104 | } |
diff --git a/arch/powerpc/platforms/85xx/sbc8548.c b/arch/powerpc/platforms/85xx/sbc8548.c index 14632a971225..184a50784617 100644 --- a/arch/powerpc/platforms/85xx/sbc8548.c +++ b/arch/powerpc/platforms/85xx/sbc8548.c | |||
@@ -48,35 +48,16 @@ | |||
48 | #include <sysdev/fsl_soc.h> | 48 | #include <sysdev/fsl_soc.h> |
49 | #include <sysdev/fsl_pci.h> | 49 | #include <sysdev/fsl_pci.h> |
50 | 50 | ||
51 | #include "mpc85xx.h" | ||
52 | |||
51 | static int sbc_rev; | 53 | static int sbc_rev; |
52 | 54 | ||
53 | static void __init sbc8548_pic_init(void) | 55 | static void __init sbc8548_pic_init(void) |
54 | { | 56 | { |
55 | struct mpic *mpic; | 57 | struct mpic *mpic = mpic_alloc(NULL, 0, |
56 | struct resource r; | 58 | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, |
57 | struct device_node *np = NULL; | ||
58 | |||
59 | np = of_find_node_by_type(np, "open-pic"); | ||
60 | |||
61 | if (np == NULL) { | ||
62 | printk(KERN_ERR "Could not find open-pic node\n"); | ||
63 | return; | ||
64 | } | ||
65 | |||
66 | if (of_address_to_resource(np, 0, &r)) { | ||
67 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
68 | of_node_put(np); | ||
69 | return; | ||
70 | } | ||
71 | |||
72 | mpic = mpic_alloc(np, r.start, | ||
73 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | ||
74 | 0, 256, " OpenPIC "); | 59 | 0, 256, " OpenPIC "); |
75 | BUG_ON(mpic == NULL); | 60 | BUG_ON(mpic == NULL); |
76 | |||
77 | /* Return the mpic node */ | ||
78 | of_node_put(np); | ||
79 | |||
80 | mpic_init(mpic); | 61 | mpic_init(mpic); |
81 | } | 62 | } |
82 | 63 | ||
@@ -149,21 +130,7 @@ static void sbc8548_show_cpuinfo(struct seq_file *m) | |||
149 | seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f)); | 130 | seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f)); |
150 | } | 131 | } |
151 | 132 | ||
152 | static struct of_device_id __initdata of_bus_ids[] = { | 133 | machine_device_initcall(sbc8548, mpc85xx_common_publish_devices); |
153 | { .name = "soc", }, | ||
154 | { .type = "soc", }, | ||
155 | { .compatible = "simple-bus", }, | ||
156 | { .compatible = "gianfar", }, | ||
157 | {}, | ||
158 | }; | ||
159 | |||
160 | static int __init declare_of_platform_devices(void) | ||
161 | { | ||
162 | of_platform_bus_probe(NULL, of_bus_ids, NULL); | ||
163 | |||
164 | return 0; | ||
165 | } | ||
166 | machine_device_initcall(sbc8548, declare_of_platform_devices); | ||
167 | 134 | ||
168 | /* | 135 | /* |
169 | * Called very early, device-tree isn't unflattened | 136 | * Called very early, device-tree isn't unflattened |
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 | |||
42 | static 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 | |||
55 | static void __init sbc8560_pic_init(void) | 42 | static 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 | ||
211 | static struct of_device_id __initdata of_bus_ids[] = { | 165 | machine_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 | |||
221 | static int __init declare_of_platform_devices(void) | ||
222 | { | ||
223 | of_platform_bus_probe(NULL, of_bus_ids, NULL); | ||
224 | |||
225 | return 0; | ||
226 | } | ||
227 | machine_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 |
diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c index 2df4785ffd4e..ff4249044a3c 100644 --- a/arch/powerpc/platforms/85xx/smp.c +++ b/arch/powerpc/platforms/85xx/smp.c | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | #include <sysdev/fsl_soc.h> | 28 | #include <sysdev/fsl_soc.h> |
29 | #include <sysdev/mpic.h> | 29 | #include <sysdev/mpic.h> |
30 | #include "smp.h" | ||
30 | 31 | ||
31 | extern void __early_start(void); | 32 | extern void __early_start(void); |
32 | 33 | ||
diff --git a/arch/powerpc/platforms/85xx/smp.h b/arch/powerpc/platforms/85xx/smp.h new file mode 100644 index 000000000000..e2b44933ff19 --- /dev/null +++ b/arch/powerpc/platforms/85xx/smp.h | |||
@@ -0,0 +1,15 @@ | |||
1 | #ifndef POWERPC_85XX_SMP_H_ | ||
2 | #define POWERPC_85XX_SMP_H_ 1 | ||
3 | |||
4 | #include <linux/init.h> | ||
5 | |||
6 | #ifdef CONFIG_SMP | ||
7 | void __init mpc85xx_smp_init(void); | ||
8 | #else | ||
9 | static inline void mpc85xx_smp_init(void) | ||
10 | { | ||
11 | /* Nothing to do */ | ||
12 | } | ||
13 | #endif | ||
14 | |||
15 | #endif /* not POWERPC_85XX_SMP_H_ */ | ||
diff --git a/arch/powerpc/platforms/85xx/socrates.c b/arch/powerpc/platforms/85xx/socrates.c index 747d8fb3ab82..18f635906b27 100644 --- a/arch/powerpc/platforms/85xx/socrates.c +++ b/arch/powerpc/platforms/85xx/socrates.c | |||
@@ -41,32 +41,17 @@ | |||
41 | #include <sysdev/fsl_soc.h> | 41 | #include <sysdev/fsl_soc.h> |
42 | #include <sysdev/fsl_pci.h> | 42 | #include <sysdev/fsl_pci.h> |
43 | 43 | ||
44 | #include "mpc85xx.h" | ||
44 | #include "socrates_fpga_pic.h" | 45 | #include "socrates_fpga_pic.h" |
45 | 46 | ||
46 | static void __init socrates_pic_init(void) | 47 | static void __init socrates_pic_init(void) |
47 | { | 48 | { |
48 | struct mpic *mpic; | ||
49 | struct resource r; | ||
50 | struct device_node *np; | 49 | struct device_node *np; |
51 | 50 | ||
52 | np = of_find_node_by_type(NULL, "open-pic"); | 51 | struct mpic *mpic = mpic_alloc(NULL, 0, |
53 | if (!np) { | 52 | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, |
54 | printk(KERN_ERR "Could not find open-pic node\n"); | ||
55 | return; | ||
56 | } | ||
57 | |||
58 | if (of_address_to_resource(np, 0, &r)) { | ||
59 | printk(KERN_ERR "Could not map mpic register space\n"); | ||
60 | of_node_put(np); | ||
61 | return; | ||
62 | } | ||
63 | |||
64 | mpic = mpic_alloc(np, r.start, | ||
65 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | ||
66 | 0, 256, " OpenPIC "); | 53 | 0, 256, " OpenPIC "); |
67 | BUG_ON(mpic == NULL); | 54 | BUG_ON(mpic == NULL); |
68 | of_node_put(np); | ||
69 | |||
70 | mpic_init(mpic); | 55 | mpic_init(mpic); |
71 | 56 | ||
72 | np = of_find_compatible_node(NULL, NULL, "abb,socrates-fpga-pic"); | 57 | np = of_find_compatible_node(NULL, NULL, "abb,socrates-fpga-pic"); |
@@ -96,17 +81,7 @@ static void __init socrates_setup_arch(void) | |||
96 | #endif | 81 | #endif |
97 | } | 82 | } |
98 | 83 | ||
99 | static struct of_device_id __initdata socrates_of_bus_ids[] = { | 84 | machine_device_initcall(socrates, mpc85xx_common_publish_devices); |
100 | { .compatible = "simple-bus", }, | ||
101 | { .compatible = "gianfar", }, | ||
102 | {}, | ||
103 | }; | ||
104 | |||
105 | static int __init socrates_publish_devices(void) | ||
106 | { | ||
107 | return of_platform_bus_probe(NULL, socrates_of_bus_ids, NULL); | ||
108 | } | ||
109 | machine_device_initcall(socrates, socrates_publish_devices); | ||
110 | 85 | ||
111 | /* | 86 | /* |
112 | * Called very early, device-tree isn't unflattened | 87 | * Called very early, device-tree isn't unflattened |
diff --git a/arch/powerpc/platforms/85xx/stx_gp3.c b/arch/powerpc/platforms/85xx/stx_gp3.c index 5387e9f06bdb..e9e5234b4e76 100644 --- a/arch/powerpc/platforms/85xx/stx_gp3.c +++ b/arch/powerpc/platforms/85xx/stx_gp3.c | |||
@@ -40,70 +40,21 @@ | |||
40 | #include <sysdev/fsl_soc.h> | 40 | #include <sysdev/fsl_soc.h> |
41 | #include <sysdev/fsl_pci.h> | 41 | #include <sysdev/fsl_pci.h> |
42 | 42 | ||
43 | #include "mpc85xx.h" | ||
44 | |||
43 | #ifdef CONFIG_CPM2 | 45 | #ifdef CONFIG_CPM2 |
44 | #include <asm/cpm2.h> | 46 | #include <asm/cpm2.h> |
45 | #include <sysdev/cpm2_pic.h> | ||
46 | |||
47 | static void cpm2_cascade(unsigned int irq, struct irq_desc *desc) | ||
48 | { | ||
49 | struct irq_chip *chip = irq_desc_get_chip(desc); | ||
50 | int cascade_irq; | ||
51 | |||
52 | while ((cascade_irq = cpm2_get_irq()) >= 0) | ||
53 | generic_handle_irq(cascade_irq); | ||
54 | |||
55 | chip->irq_eoi(&desc->irq_data); | ||
56 | } | ||
57 | #endif /* CONFIG_CPM2 */ | 47 | #endif /* CONFIG_CPM2 */ |
58 | 48 | ||
59 | static void __init stx_gp3_pic_init(void) | 49 | static void __init stx_gp3_pic_init(void) |
60 | { | 50 | { |
61 | struct mpic *mpic; | 51 | struct mpic *mpic = mpic_alloc(NULL, 0, |
62 | struct resource r; | 52 | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, |
63 | struct device_node *np; | ||
64 | #ifdef CONFIG_CPM2 | ||
65 | int irq; | ||
66 | #endif | ||
67 | |||
68 | np = of_find_node_by_type(NULL, "open-pic"); | ||
69 | if (!np) { | ||
70 | printk(KERN_ERR "Could not find open-pic node\n"); | ||
71 | return; | ||
72 | } | ||
73 | |||
74 | if (of_address_to_resource(np, 0, &r)) { | ||
75 | printk(KERN_ERR "Could not map mpic register space\n"); | ||
76 | of_node_put(np); | ||
77 | return; | ||
78 | } | ||
79 | |||
80 | mpic = mpic_alloc(np, r.start, | ||
81 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | ||
82 | 0, 256, " OpenPIC "); | 53 | 0, 256, " OpenPIC "); |
83 | BUG_ON(mpic == NULL); | 54 | BUG_ON(mpic == NULL); |
84 | of_node_put(np); | ||
85 | |||
86 | mpic_init(mpic); | 55 | mpic_init(mpic); |
87 | 56 | ||
88 | #ifdef CONFIG_CPM2 | 57 | mpc85xx_cpm2_pic_init(); |
89 | /* Setup CPM2 PIC */ | ||
90 | np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic"); | ||
91 | if (np == NULL) { | ||
92 | printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n"); | ||
93 | return; | ||
94 | } | ||
95 | irq = irq_of_parse_and_map(np, 0); | ||
96 | |||
97 | if (irq == NO_IRQ) { | ||
98 | of_node_put(np); | ||
99 | printk(KERN_ERR "PIC init: got no IRQ for cpm cascade\n"); | ||
100 | return; | ||
101 | } | ||
102 | |||
103 | cpm2_pic_init(np); | ||
104 | of_node_put(np); | ||
105 | irq_set_chained_handler(irq, cpm2_cascade); | ||
106 | #endif | ||
107 | } | 58 | } |
108 | 59 | ||
109 | /* | 60 | /* |
@@ -144,19 +95,7 @@ static void stx_gp3_show_cpuinfo(struct seq_file *m) | |||
144 | seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f)); | 95 | seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f)); |
145 | } | 96 | } |
146 | 97 | ||
147 | static struct of_device_id __initdata of_bus_ids[] = { | 98 | machine_device_initcall(stx_gp3, mpc85xx_common_publish_devices); |
148 | { .compatible = "simple-bus", }, | ||
149 | { .compatible = "gianfar", }, | ||
150 | {}, | ||
151 | }; | ||
152 | |||
153 | static int __init declare_of_platform_devices(void) | ||
154 | { | ||
155 | of_platform_bus_probe(NULL, of_bus_ids, NULL); | ||
156 | |||
157 | return 0; | ||
158 | } | ||
159 | machine_device_initcall(stx_gp3, declare_of_platform_devices); | ||
160 | 99 | ||
161 | /* | 100 | /* |
162 | * Called very early, device-tree isn't unflattened | 101 | * Called very early, device-tree isn't unflattened |
diff --git a/arch/powerpc/platforms/85xx/tqm85xx.c b/arch/powerpc/platforms/85xx/tqm85xx.c index 325de772725a..bf7c89fb75bb 100644 --- a/arch/powerpc/platforms/85xx/tqm85xx.c +++ b/arch/powerpc/platforms/85xx/tqm85xx.c | |||
@@ -38,70 +38,21 @@ | |||
38 | #include <sysdev/fsl_soc.h> | 38 | #include <sysdev/fsl_soc.h> |
39 | #include <sysdev/fsl_pci.h> | 39 | #include <sysdev/fsl_pci.h> |
40 | 40 | ||
41 | #include "mpc85xx.h" | ||
42 | |||
41 | #ifdef CONFIG_CPM2 | 43 | #ifdef CONFIG_CPM2 |
42 | #include <asm/cpm2.h> | 44 | #include <asm/cpm2.h> |
43 | #include <sysdev/cpm2_pic.h> | ||
44 | |||
45 | static void cpm2_cascade(unsigned int irq, struct irq_desc *desc) | ||
46 | { | ||
47 | struct irq_chip *chip = irq_desc_get_chip(desc); | ||
48 | int cascade_irq; | ||
49 | |||
50 | while ((cascade_irq = cpm2_get_irq()) >= 0) | ||
51 | generic_handle_irq(cascade_irq); | ||
52 | |||
53 | chip->irq_eoi(&desc->irq_data); | ||
54 | } | ||
55 | #endif /* CONFIG_CPM2 */ | 45 | #endif /* CONFIG_CPM2 */ |
56 | 46 | ||
57 | static void __init tqm85xx_pic_init(void) | 47 | static void __init tqm85xx_pic_init(void) |
58 | { | 48 | { |
59 | struct mpic *mpic; | 49 | struct mpic *mpic = mpic_alloc(NULL, 0, |
60 | struct resource r; | 50 | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, |
61 | struct device_node *np; | ||
62 | #ifdef CONFIG_CPM2 | ||
63 | int irq; | ||
64 | #endif | ||
65 | |||
66 | np = of_find_node_by_type(NULL, "open-pic"); | ||
67 | if (!np) { | ||
68 | printk(KERN_ERR "Could not find open-pic node\n"); | ||
69 | return; | ||
70 | } | ||
71 | |||
72 | if (of_address_to_resource(np, 0, &r)) { | ||
73 | printk(KERN_ERR "Could not map mpic register space\n"); | ||
74 | of_node_put(np); | ||
75 | return; | ||
76 | } | ||
77 | |||
78 | mpic = mpic_alloc(np, r.start, | ||
79 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | ||
80 | 0, 256, " OpenPIC "); | 51 | 0, 256, " OpenPIC "); |
81 | BUG_ON(mpic == NULL); | 52 | BUG_ON(mpic == NULL); |
82 | of_node_put(np); | ||
83 | |||
84 | mpic_init(mpic); | 53 | mpic_init(mpic); |
85 | 54 | ||
86 | #ifdef CONFIG_CPM2 | 55 | mpc85xx_cpm2_pic_init(); |
87 | /* Setup CPM2 PIC */ | ||
88 | np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic"); | ||
89 | if (np == NULL) { | ||
90 | printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n"); | ||
91 | return; | ||
92 | } | ||
93 | irq = irq_of_parse_and_map(np, 0); | ||
94 | |||
95 | if (irq == NO_IRQ) { | ||
96 | of_node_put(np); | ||
97 | printk(KERN_ERR "PIC init: got no IRQ for cpm cascade\n"); | ||
98 | return; | ||
99 | } | ||
100 | |||
101 | cpm2_pic_init(np); | ||
102 | of_node_put(np); | ||
103 | irq_set_chained_handler(irq, cpm2_cascade); | ||
104 | #endif | ||
105 | } | 56 | } |
106 | 57 | ||
107 | /* | 58 | /* |
@@ -173,19 +124,7 @@ static void __init tqm85xx_ti1520_fixup(struct pci_dev *pdev) | |||
173 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1520, | 124 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1520, |
174 | tqm85xx_ti1520_fixup); | 125 | tqm85xx_ti1520_fixup); |
175 | 126 | ||
176 | static struct of_device_id __initdata of_bus_ids[] = { | 127 | machine_device_initcall(tqm85xx, mpc85xx_common_publish_devices); |
177 | { .compatible = "simple-bus", }, | ||
178 | { .compatible = "gianfar", }, | ||
179 | {}, | ||
180 | }; | ||
181 | |||
182 | static int __init declare_of_platform_devices(void) | ||
183 | { | ||
184 | of_platform_bus_probe(NULL, of_bus_ids, NULL); | ||
185 | |||
186 | return 0; | ||
187 | } | ||
188 | machine_device_initcall(tqm85xx, declare_of_platform_devices); | ||
189 | 128 | ||
190 | static const char *board[] __initdata = { | 129 | static const char *board[] __initdata = { |
191 | "tqc,tqm8540", | 130 | "tqc,tqm8540", |
diff --git a/arch/powerpc/platforms/85xx/xes_mpc85xx.c b/arch/powerpc/platforms/85xx/xes_mpc85xx.c index a9dc5e795123..3a69f8b77de6 100644 --- a/arch/powerpc/platforms/85xx/xes_mpc85xx.c +++ b/arch/powerpc/platforms/85xx/xes_mpc85xx.c | |||
@@ -32,6 +32,9 @@ | |||
32 | 32 | ||
33 | #include <sysdev/fsl_soc.h> | 33 | #include <sysdev/fsl_soc.h> |
34 | #include <sysdev/fsl_pci.h> | 34 | #include <sysdev/fsl_pci.h> |
35 | #include "smp.h" | ||
36 | |||
37 | #include "mpc85xx.h" | ||
35 | 38 | ||
36 | /* A few bit definitions needed for fixups on some boards */ | 39 | /* A few bit definitions needed for fixups on some boards */ |
37 | #define MPC85xx_L2CTL_L2E 0x80000000 /* L2 enable */ | 40 | #define MPC85xx_L2CTL_L2E 0x80000000 /* L2 enable */ |
@@ -40,29 +43,11 @@ | |||
40 | 43 | ||
41 | void __init xes_mpc85xx_pic_init(void) | 44 | void __init xes_mpc85xx_pic_init(void) |
42 | { | 45 | { |
43 | struct mpic *mpic; | 46 | struct mpic *mpic = mpic_alloc(NULL, 0, |
44 | struct resource r; | 47 | MPIC_WANTS_RESET | |
45 | struct device_node *np; | ||
46 | |||
47 | np = of_find_node_by_type(NULL, "open-pic"); | ||
48 | if (np == NULL) { | ||
49 | printk(KERN_ERR "Could not find open-pic node\n"); | ||
50 | return; | ||
51 | } | ||
52 | |||
53 | if (of_address_to_resource(np, 0, &r)) { | ||
54 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
55 | of_node_put(np); | ||
56 | return; | ||
57 | } | ||
58 | |||
59 | mpic = mpic_alloc(np, r.start, | ||
60 | MPIC_PRIMARY | MPIC_WANTS_RESET | | ||
61 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS, | 48 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS, |
62 | 0, 256, " OpenPIC "); | 49 | 0, 256, " OpenPIC "); |
63 | BUG_ON(mpic == NULL); | 50 | BUG_ON(mpic == NULL); |
64 | of_node_put(np); | ||
65 | |||
66 | mpic_init(mpic); | 51 | mpic_init(mpic); |
67 | } | 52 | } |
68 | 53 | ||
@@ -136,9 +121,6 @@ static int primary_phb_addr; | |||
136 | /* | 121 | /* |
137 | * Setup the architecture | 122 | * Setup the architecture |
138 | */ | 123 | */ |
139 | #ifdef CONFIG_SMP | ||
140 | extern void __init mpc85xx_smp_init(void); | ||
141 | #endif | ||
142 | static void __init xes_mpc85xx_setup_arch(void) | 124 | static void __init xes_mpc85xx_setup_arch(void) |
143 | { | 125 | { |
144 | #ifdef CONFIG_PCI | 126 | #ifdef CONFIG_PCI |
@@ -172,26 +154,12 @@ static void __init xes_mpc85xx_setup_arch(void) | |||
172 | } | 154 | } |
173 | #endif | 155 | #endif |
174 | 156 | ||
175 | #ifdef CONFIG_SMP | ||
176 | mpc85xx_smp_init(); | 157 | mpc85xx_smp_init(); |
177 | #endif | ||
178 | } | 158 | } |
179 | 159 | ||
180 | static struct of_device_id __initdata xes_mpc85xx_ids[] = { | 160 | machine_device_initcall(xes_mpc8572, mpc85xx_common_publish_devices); |
181 | { .type = "soc", }, | 161 | machine_device_initcall(xes_mpc8548, mpc85xx_common_publish_devices); |
182 | { .compatible = "soc", }, | 162 | machine_device_initcall(xes_mpc8540, mpc85xx_common_publish_devices); |
183 | { .compatible = "simple-bus", }, | ||
184 | { .compatible = "gianfar", }, | ||
185 | {}, | ||
186 | }; | ||
187 | |||
188 | static int __init xes_mpc85xx_publish_devices(void) | ||
189 | { | ||
190 | return of_platform_bus_probe(NULL, xes_mpc85xx_ids, NULL); | ||
191 | } | ||
192 | machine_device_initcall(xes_mpc8572, xes_mpc85xx_publish_devices); | ||
193 | machine_device_initcall(xes_mpc8548, xes_mpc85xx_publish_devices); | ||
194 | machine_device_initcall(xes_mpc8540, xes_mpc85xx_publish_devices); | ||
195 | 163 | ||
196 | /* | 164 | /* |
197 | * Called very early, device-tree isn't unflattened | 165 | * Called very early, device-tree isn't unflattened |