diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-09-19 08:47:57 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-09-19 08:47:57 -0400 |
commit | 40d743b8c16a8cf6e30c1d941aa6147f9550ea75 (patch) | |
tree | 9fcdf9a06b18a275253048d1ea7c9803cec38845 /arch/powerpc/platforms/85xx | |
parent | 7da18afa423f167e7ef3c9728e584d8bf05bd55a (diff) | |
parent | 83e686ea0291ee93b87dcdc00b96443b80de56c9 (diff) |
Merge branch 'for-rmk' of git://linux-arm.org/linux-2.6
Diffstat (limited to 'arch/powerpc/platforms/85xx')
-rw-r--r-- | arch/powerpc/platforms/85xx/Kconfig | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/Makefile | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc8536_ds.c | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc85xx_ds.c | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc85xx_mds.c | 7 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 141 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/sbc8560.c | 39 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/smp.c | 23 |
8 files changed, 200 insertions, 28 deletions
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig index a9b416688975..d3a975e8fd3e 100644 --- a/arch/powerpc/platforms/85xx/Kconfig +++ b/arch/powerpc/platforms/85xx/Kconfig | |||
@@ -55,6 +55,15 @@ config MPC85xx_DS | |||
55 | help | 55 | help |
56 | This option enables support for the MPC85xx DS (MPC8544 DS) board | 56 | This option enables support for the MPC85xx DS (MPC8544 DS) board |
57 | 57 | ||
58 | config MPC85xx_RDB | ||
59 | bool "Freescale MPC85xx RDB" | ||
60 | select PPC_I8259 | ||
61 | select DEFAULT_UIMAGE | ||
62 | select FSL_ULI1575 | ||
63 | select SWIOTLB | ||
64 | help | ||
65 | This option enables support for the MPC85xx RDB (P2020 RDB) board | ||
66 | |||
58 | config SOCRATES | 67 | config SOCRATES |
59 | bool "Socrates" | 68 | bool "Socrates" |
60 | select DEFAULT_UIMAGE | 69 | select DEFAULT_UIMAGE |
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile index 835733f2b12c..9098aea0cf32 100644 --- a/arch/powerpc/platforms/85xx/Makefile +++ b/arch/powerpc/platforms/85xx/Makefile | |||
@@ -9,10 +9,11 @@ obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o | |||
9 | obj-$(CONFIG_MPC8536_DS) += mpc8536_ds.o | 9 | obj-$(CONFIG_MPC8536_DS) += mpc8536_ds.o |
10 | obj-$(CONFIG_MPC85xx_DS) += mpc85xx_ds.o | 10 | obj-$(CONFIG_MPC85xx_DS) += mpc85xx_ds.o |
11 | obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o | 11 | obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o |
12 | obj-$(CONFIG_MPC85xx_RDB) += mpc85xx_rdb.o | ||
12 | obj-$(CONFIG_STX_GP3) += stx_gp3.o | 13 | obj-$(CONFIG_STX_GP3) += stx_gp3.o |
13 | obj-$(CONFIG_TQM85xx) += tqm85xx.o | 14 | obj-$(CONFIG_TQM85xx) += tqm85xx.o |
14 | obj-$(CONFIG_SBC8560) += sbc8560.o | 15 | obj-$(CONFIG_SBC8560) += sbc8560.o |
15 | obj-$(CONFIG_SBC8548) += sbc8548.o | 16 | obj-$(CONFIG_SBC8548) += sbc8548.o |
16 | obj-$(CONFIG_SOCRATES) += socrates.o socrates_fpga_pic.o | 17 | obj-$(CONFIG_SOCRATES) += socrates.o socrates_fpga_pic.o |
17 | obj-$(CONFIG_KSI8560) += ksi8560.o | 18 | obj-$(CONFIG_KSI8560) += ksi8560.o |
18 | obj-$(CONFIG_XES_MPC85xx) += xes_mpc85xx.o \ No newline at end of file | 19 | obj-$(CONFIG_XES_MPC85xx) += xes_mpc85xx.o |
diff --git a/arch/powerpc/platforms/85xx/mpc8536_ds.c b/arch/powerpc/platforms/85xx/mpc8536_ds.c index 055ff417bae9..004b7d36cdb7 100644 --- a/arch/powerpc/platforms/85xx/mpc8536_ds.c +++ b/arch/powerpc/platforms/85xx/mpc8536_ds.c | |||
@@ -96,7 +96,8 @@ static void __init mpc8536_ds_setup_arch(void) | |||
96 | #ifdef CONFIG_SWIOTLB | 96 | #ifdef CONFIG_SWIOTLB |
97 | if (lmb_end_of_DRAM() > max) { | 97 | if (lmb_end_of_DRAM() > max) { |
98 | ppc_swiotlb_enable = 1; | 98 | ppc_swiotlb_enable = 1; |
99 | set_pci_dma_ops(&swiotlb_pci_dma_ops); | 99 | set_pci_dma_ops(&swiotlb_dma_ops); |
100 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; | ||
100 | } | 101 | } |
101 | #endif | 102 | #endif |
102 | 103 | ||
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c index 849c0ac0025f..544011a562fb 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c | |||
@@ -192,7 +192,8 @@ static void __init mpc85xx_ds_setup_arch(void) | |||
192 | #ifdef CONFIG_SWIOTLB | 192 | #ifdef CONFIG_SWIOTLB |
193 | if (lmb_end_of_DRAM() > max) { | 193 | if (lmb_end_of_DRAM() > max) { |
194 | ppc_swiotlb_enable = 1; | 194 | ppc_swiotlb_enable = 1; |
195 | set_pci_dma_ops(&swiotlb_pci_dma_ops); | 195 | set_pci_dma_ops(&swiotlb_dma_ops); |
196 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; | ||
196 | } | 197 | } |
197 | #endif | 198 | #endif |
198 | 199 | ||
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c index bfb32834ab0c..3909d57b86e3 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #include <asm/udbg.h> | 47 | #include <asm/udbg.h> |
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 | #include <sysdev/simple_gpio.h> | ||
50 | #include <asm/qe.h> | 51 | #include <asm/qe.h> |
51 | #include <asm/qe_ic.h> | 52 | #include <asm/qe_ic.h> |
52 | #include <asm/mpic.h> | 53 | #include <asm/mpic.h> |
@@ -254,7 +255,8 @@ static void __init mpc85xx_mds_setup_arch(void) | |||
254 | #ifdef CONFIG_SWIOTLB | 255 | #ifdef CONFIG_SWIOTLB |
255 | if (lmb_end_of_DRAM() > max) { | 256 | if (lmb_end_of_DRAM() > max) { |
256 | ppc_swiotlb_enable = 1; | 257 | ppc_swiotlb_enable = 1; |
257 | set_pci_dma_ops(&swiotlb_pci_dma_ops); | 258 | set_pci_dma_ops(&swiotlb_dma_ops); |
259 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; | ||
258 | } | 260 | } |
259 | #endif | 261 | #endif |
260 | } | 262 | } |
@@ -304,6 +306,9 @@ static struct of_device_id mpc85xx_ids[] = { | |||
304 | 306 | ||
305 | static int __init mpc85xx_publish_devices(void) | 307 | static int __init mpc85xx_publish_devices(void) |
306 | { | 308 | { |
309 | if (machine_is(mpc8569_mds)) | ||
310 | simple_gpiochip_init("fsl,mpc8569mds-bcsr-gpio"); | ||
311 | |||
307 | /* Publish the QE devices */ | 312 | /* Publish the QE devices */ |
308 | of_platform_bus_probe(NULL, mpc85xx_ids, NULL); | 313 | of_platform_bus_probe(NULL, mpc85xx_ids, NULL); |
309 | 314 | ||
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c new file mode 100644 index 000000000000..c8468de4acf6 --- /dev/null +++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c | |||
@@ -0,0 +1,141 @@ | |||
1 | /* | ||
2 | * MPC85xx RDB Board Setup | ||
3 | * | ||
4 | * Copyright 2009 Freescale Semiconductor Inc. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the | ||
8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | */ | ||
11 | |||
12 | #include <linux/stddef.h> | ||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/pci.h> | ||
15 | #include <linux/kdev_t.h> | ||
16 | #include <linux/delay.h> | ||
17 | #include <linux/seq_file.h> | ||
18 | #include <linux/interrupt.h> | ||
19 | #include <linux/of_platform.h> | ||
20 | |||
21 | #include <asm/system.h> | ||
22 | #include <asm/time.h> | ||
23 | #include <asm/machdep.h> | ||
24 | #include <asm/pci-bridge.h> | ||
25 | #include <mm/mmu_decl.h> | ||
26 | #include <asm/prom.h> | ||
27 | #include <asm/udbg.h> | ||
28 | #include <asm/mpic.h> | ||
29 | |||
30 | #include <sysdev/fsl_soc.h> | ||
31 | #include <sysdev/fsl_pci.h> | ||
32 | |||
33 | #undef DEBUG | ||
34 | |||
35 | #ifdef DEBUG | ||
36 | #define DBG(fmt, args...) printk(KERN_ERR "%s: " fmt, __func__, ## args) | ||
37 | #else | ||
38 | #define DBG(fmt, args...) | ||
39 | #endif | ||
40 | |||
41 | |||
42 | void __init mpc85xx_rdb_pic_init(void) | ||
43 | { | ||
44 | struct mpic *mpic; | ||
45 | struct resource r; | ||
46 | struct device_node *np; | ||
47 | |||
48 | np = of_find_node_by_type(NULL, "open-pic"); | ||
49 | if (np == NULL) { | ||
50 | printk(KERN_ERR "Could not find open-pic node\n"); | ||
51 | return; | ||
52 | } | ||
53 | |||
54 | if (of_address_to_resource(np, 0, &r)) { | ||
55 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
56 | of_node_put(np); | ||
57 | return; | ||
58 | } | ||
59 | |||
60 | mpic = mpic_alloc(np, r.start, | ||
61 | MPIC_PRIMARY | MPIC_WANTS_RESET | | ||
62 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | | ||
63 | MPIC_SINGLE_DEST_CPU, | ||
64 | 0, 256, " OpenPIC "); | ||
65 | |||
66 | BUG_ON(mpic == NULL); | ||
67 | of_node_put(np); | ||
68 | |||
69 | mpic_init(mpic); | ||
70 | |||
71 | } | ||
72 | |||
73 | /* | ||
74 | * Setup the architecture | ||
75 | */ | ||
76 | #ifdef CONFIG_SMP | ||
77 | extern void __init mpc85xx_smp_init(void); | ||
78 | #endif | ||
79 | static void __init mpc85xx_rdb_setup_arch(void) | ||
80 | { | ||
81 | #ifdef CONFIG_PCI | ||
82 | struct device_node *np; | ||
83 | #endif | ||
84 | |||
85 | if (ppc_md.progress) | ||
86 | ppc_md.progress("mpc85xx_rdb_setup_arch()", 0); | ||
87 | |||
88 | #ifdef CONFIG_PCI | ||
89 | for_each_node_by_type(np, "pci") { | ||
90 | if (of_device_is_compatible(np, "fsl,mpc8548-pcie")) | ||
91 | fsl_add_bridge(np, 0); | ||
92 | } | ||
93 | |||
94 | #endif | ||
95 | |||
96 | #ifdef CONFIG_SMP | ||
97 | mpc85xx_smp_init(); | ||
98 | #endif | ||
99 | |||
100 | printk(KERN_INFO "MPC85xx RDB board from Freescale Semiconductor\n"); | ||
101 | } | ||
102 | |||
103 | static struct of_device_id __initdata mpc85xxrdb_ids[] = { | ||
104 | { .type = "soc", }, | ||
105 | { .compatible = "soc", }, | ||
106 | { .compatible = "simple-bus", }, | ||
107 | { .compatible = "gianfar", }, | ||
108 | {}, | ||
109 | }; | ||
110 | |||
111 | static int __init mpc85xxrdb_publish_devices(void) | ||
112 | { | ||
113 | return of_platform_bus_probe(NULL, mpc85xxrdb_ids, NULL); | ||
114 | } | ||
115 | machine_device_initcall(p2020_rdb, mpc85xxrdb_publish_devices); | ||
116 | |||
117 | /* | ||
118 | * Called very early, device-tree isn't unflattened | ||
119 | */ | ||
120 | static int __init p2020_rdb_probe(void) | ||
121 | { | ||
122 | unsigned long root = of_get_flat_dt_root(); | ||
123 | |||
124 | if (of_flat_dt_is_compatible(root, "fsl,P2020RDB")) | ||
125 | return 1; | ||
126 | return 0; | ||
127 | } | ||
128 | |||
129 | define_machine(p2020_rdb) { | ||
130 | .name = "P2020 RDB", | ||
131 | .probe = p2020_rdb_probe, | ||
132 | .setup_arch = mpc85xx_rdb_setup_arch, | ||
133 | .init_IRQ = mpc85xx_rdb_pic_init, | ||
134 | #ifdef CONFIG_PCI | ||
135 | .pcibios_fixup_bus = fsl_pcibios_fixup_bus, | ||
136 | #endif | ||
137 | .get_irq = mpic_get_irq, | ||
138 | .restart = fsl_rstcr_restart, | ||
139 | .calibrate_decr = generic_calibrate_decr, | ||
140 | .progress = udbg_progress, | ||
141 | }; | ||
diff --git a/arch/powerpc/platforms/85xx/sbc8560.c b/arch/powerpc/platforms/85xx/sbc8560.c index cc27807a8b64..a5ad1c7794bf 100644 --- a/arch/powerpc/platforms/85xx/sbc8560.c +++ b/arch/powerpc/platforms/85xx/sbc8560.c | |||
@@ -267,6 +267,43 @@ arch_initcall(sbc8560_rtc_init); | |||
267 | 267 | ||
268 | #endif /* M48T59 */ | 268 | #endif /* M48T59 */ |
269 | 269 | ||
270 | static __u8 __iomem *brstcr; | ||
271 | |||
272 | static int __init sbc8560_bdrstcr_init(void) | ||
273 | { | ||
274 | struct device_node *np; | ||
275 | struct resource res; | ||
276 | |||
277 | np = of_find_compatible_node(NULL, NULL, "wrs,sbc8560-brstcr"); | ||
278 | if (np == NULL) { | ||
279 | printk(KERN_WARNING "sbc8560: No board specific RSTCR in DTB.\n"); | ||
280 | return -ENODEV; | ||
281 | } | ||
282 | |||
283 | of_address_to_resource(np, 0, &res); | ||
284 | |||
285 | printk(KERN_INFO "sbc8560: Found BRSTCR at i/o 0x%x\n", res.start); | ||
286 | |||
287 | brstcr = ioremap(res.start, res.end - res.start); | ||
288 | if(!brstcr) | ||
289 | printk(KERN_WARNING "sbc8560: ioremap of brstcr failed.\n"); | ||
290 | |||
291 | of_node_put(np); | ||
292 | |||
293 | return 0; | ||
294 | } | ||
295 | |||
296 | arch_initcall(sbc8560_bdrstcr_init); | ||
297 | |||
298 | void sbc8560_rstcr_restart(char * cmd) | ||
299 | { | ||
300 | local_irq_disable(); | ||
301 | if(brstcr) | ||
302 | clrbits8(brstcr, 0x80); | ||
303 | |||
304 | while(1); | ||
305 | } | ||
306 | |||
270 | define_machine(sbc8560) { | 307 | define_machine(sbc8560) { |
271 | .name = "SBC8560", | 308 | .name = "SBC8560", |
272 | .probe = sbc8560_probe, | 309 | .probe = sbc8560_probe, |
@@ -274,7 +311,7 @@ define_machine(sbc8560) { | |||
274 | .init_IRQ = sbc8560_pic_init, | 311 | .init_IRQ = sbc8560_pic_init, |
275 | .show_cpuinfo = sbc8560_show_cpuinfo, | 312 | .show_cpuinfo = sbc8560_show_cpuinfo, |
276 | .get_irq = mpic_get_irq, | 313 | .get_irq = mpic_get_irq, |
277 | .restart = fsl_rstcr_restart, | 314 | .restart = sbc8560_rstcr_restart, |
278 | .calibrate_decr = generic_calibrate_decr, | 315 | .calibrate_decr = generic_calibrate_decr, |
279 | .progress = udbg_progress, | 316 | .progress = udbg_progress, |
280 | }; | 317 | }; |
diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c index 62c592ede641..04160a4cc699 100644 --- a/arch/powerpc/platforms/85xx/smp.c +++ b/arch/powerpc/platforms/85xx/smp.c | |||
@@ -25,7 +25,6 @@ | |||
25 | 25 | ||
26 | #include <sysdev/fsl_soc.h> | 26 | #include <sysdev/fsl_soc.h> |
27 | 27 | ||
28 | extern volatile unsigned long __secondary_hold_acknowledge; | ||
29 | extern void __early_start(void); | 28 | extern void __early_start(void); |
30 | 29 | ||
31 | #define BOOT_ENTRY_ADDR_UPPER 0 | 30 | #define BOOT_ENTRY_ADDR_UPPER 0 |
@@ -80,46 +79,24 @@ smp_85xx_kick_cpu(int nr) | |||
80 | } | 79 | } |
81 | 80 | ||
82 | static void __init | 81 | static void __init |
83 | smp_85xx_basic_setup(int cpu_nr) | ||
84 | { | ||
85 | /* Clear any pending timer interrupts */ | ||
86 | mtspr(SPRN_TSR, TSR_ENW | TSR_WIS | TSR_DIS | TSR_FIS); | ||
87 | |||
88 | /* Enable decrementer interrupt */ | ||
89 | mtspr(SPRN_TCR, TCR_DIE); | ||
90 | } | ||
91 | |||
92 | static void __init | ||
93 | smp_85xx_setup_cpu(int cpu_nr) | 82 | smp_85xx_setup_cpu(int cpu_nr) |
94 | { | 83 | { |
95 | mpic_setup_this_cpu(); | 84 | mpic_setup_this_cpu(); |
96 | |||
97 | smp_85xx_basic_setup(cpu_nr); | ||
98 | } | 85 | } |
99 | 86 | ||
100 | struct smp_ops_t smp_85xx_ops = { | 87 | struct smp_ops_t smp_85xx_ops = { |
101 | .kick_cpu = smp_85xx_kick_cpu, | 88 | .kick_cpu = smp_85xx_kick_cpu, |
102 | }; | 89 | }; |
103 | 90 | ||
104 | static int __init smp_dummy_probe(void) | ||
105 | { | ||
106 | return NR_CPUS; | ||
107 | } | ||
108 | |||
109 | void __init mpc85xx_smp_init(void) | 91 | void __init mpc85xx_smp_init(void) |
110 | { | 92 | { |
111 | struct device_node *np; | 93 | struct device_node *np; |
112 | 94 | ||
113 | smp_85xx_ops.message_pass = NULL; | ||
114 | |||
115 | np = of_find_node_by_type(NULL, "open-pic"); | 95 | np = of_find_node_by_type(NULL, "open-pic"); |
116 | if (np) { | 96 | if (np) { |
117 | smp_85xx_ops.probe = smp_mpic_probe; | 97 | smp_85xx_ops.probe = smp_mpic_probe; |
118 | smp_85xx_ops.setup_cpu = smp_85xx_setup_cpu; | 98 | smp_85xx_ops.setup_cpu = smp_85xx_setup_cpu; |
119 | smp_85xx_ops.message_pass = smp_mpic_message_pass; | 99 | smp_85xx_ops.message_pass = smp_mpic_message_pass; |
120 | } else { | ||
121 | smp_85xx_ops.probe = smp_dummy_probe; | ||
122 | smp_85xx_ops.setup_cpu = smp_85xx_basic_setup; | ||
123 | } | 100 | } |
124 | 101 | ||
125 | if (cpu_has_feature(CPU_FTR_DBELL)) | 102 | if (cpu_has_feature(CPU_FTR_DBELL)) |