aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2010-02-26 14:04:15 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-02-26 14:06:24 -0500
commita7790532f5b7358c33a6b1834dc2b318de209f31 (patch)
tree0ceb9e24b3f54cb5c8453fb5a218e2a94a0f1cce /arch/sh/kernel
parent2764fb4244cc1bc08df3667924ca4a972e90ac70 (diff)
parent60b341b778cc2929df16c0a504c91621b3c6a4ad (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
The SmartMedia FTL code depends on new kfifo bits from 2.6.33
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r--arch/sh/kernel/Makefile3
-rw-r--r--arch/sh/kernel/cpu/clock.c4
-rw-r--r--arch/sh/kernel/cpu/irq/ipr.c7
-rw-r--r--arch/sh/kernel/cpu/sh2/setup-sh7619.c71
-rw-r--r--arch/sh/kernel/cpu/sh2a/setup-mxg.c23
-rw-r--r--arch/sh/kernel/cpu/sh2a/setup-sh7201.c181
-rw-r--r--arch/sh/kernel/cpu/sh2a/setup-sh7203.c89
-rw-r--r--arch/sh/kernel/cpu/sh2a/setup-sh7206.c89
-rw-r--r--arch/sh/kernel/cpu/sh3/entry.S3
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh7705.c49
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh770x.c80
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh7710.c50
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh7720.c50
-rw-r--r--arch/sh/kernel/cpu/sh4/setup-sh4-202.c23
-rw-r--r--arch/sh/kernel/cpu/sh4/setup-sh7750.c47
-rw-r--r--arch/sh/kernel/cpu/sh4/setup-sh7760.c89
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7343.c112
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7366.c39
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7722.c91
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7723.c160
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7724.c164
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7757.c92
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7763.c81
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7770.c221
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7780.c60
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7785.c163
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7786.c132
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-shx3.c76
-rw-r--r--arch/sh/kernel/cpu/sh5/fpu.c4
-rw-r--r--arch/sh/kernel/cpu/sh5/setup-sh5.c22
-rw-r--r--arch/sh/kernel/dwarf.c28
-rw-r--r--arch/sh/kernel/early_printk.c157
-rw-r--r--arch/sh/kernel/entry-common.S8
-rw-r--r--arch/sh/kernel/ftrace.c76
-rw-r--r--arch/sh/kernel/idle.c2
-rw-r--r--arch/sh/kernel/process_64.c6
-rw-r--r--arch/sh/kernel/ptrace_64.c15
-rw-r--r--arch/sh/kernel/setup.c3
-rw-r--r--arch/sh/kernel/signal_64.c6
-rw-r--r--arch/sh/kernel/syscalls_64.S1
-rw-r--r--arch/sh/kernel/traps_32.c18
-rw-r--r--arch/sh/kernel/traps_64.c4
42 files changed, 1574 insertions, 1025 deletions
diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile
index 0471a3eb25ed..0d587da1ef12 100644
--- a/arch/sh/kernel/Makefile
+++ b/arch/sh/kernel/Makefile
@@ -22,11 +22,10 @@ obj-y := debugtraps.o dma-nommu.o dumpstack.o \
22obj-y += cpu/ 22obj-y += cpu/
23obj-$(CONFIG_VSYSCALL) += vsyscall/ 23obj-$(CONFIG_VSYSCALL) += vsyscall/
24obj-$(CONFIG_SMP) += smp.o 24obj-$(CONFIG_SMP) += smp.o
25obj-$(CONFIG_SH_STANDARD_BIOS) += sh_bios.o 25obj-$(CONFIG_SH_STANDARD_BIOS) += sh_bios.o early_printk.o
26obj-$(CONFIG_KGDB) += kgdb.o 26obj-$(CONFIG_KGDB) += kgdb.o
27obj-$(CONFIG_SH_CPU_FREQ) += cpufreq.o 27obj-$(CONFIG_SH_CPU_FREQ) += cpufreq.o
28obj-$(CONFIG_MODULES) += sh_ksyms_$(BITS).o module.o 28obj-$(CONFIG_MODULES) += sh_ksyms_$(BITS).o module.o
29obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
30obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o 29obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
31obj-$(CONFIG_CRASH_DUMP) += crash_dump.o 30obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
32obj-$(CONFIG_STACKTRACE) += stacktrace.o 31obj-$(CONFIG_STACKTRACE) += stacktrace.o
diff --git a/arch/sh/kernel/cpu/clock.c b/arch/sh/kernel/cpu/clock.c
index f3a46be2ae81..83da5debeedf 100644
--- a/arch/sh/kernel/cpu/clock.c
+++ b/arch/sh/kernel/cpu/clock.c
@@ -598,7 +598,7 @@ static struct dentry *clk_debugfs_root;
598static int clk_debugfs_register_one(struct clk *c) 598static int clk_debugfs_register_one(struct clk *c)
599{ 599{
600 int err; 600 int err;
601 struct dentry *d, *child; 601 struct dentry *d, *child, *child_tmp;
602 struct clk *pa = c->parent; 602 struct clk *pa = c->parent;
603 char s[255]; 603 char s[255];
604 char *p = s; 604 char *p = s;
@@ -630,7 +630,7 @@ static int clk_debugfs_register_one(struct clk *c)
630 630
631err_out: 631err_out:
632 d = c->dentry; 632 d = c->dentry;
633 list_for_each_entry(child, &d->d_subdirs, d_u.d_child) 633 list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
634 debugfs_remove(child); 634 debugfs_remove(child);
635 debugfs_remove(c->dentry); 635 debugfs_remove(c->dentry);
636 return err; 636 return err;
diff --git a/arch/sh/kernel/cpu/irq/ipr.c b/arch/sh/kernel/cpu/irq/ipr.c
index c1508a90fc6a..9282d965a1b6 100644
--- a/arch/sh/kernel/cpu/irq/ipr.c
+++ b/arch/sh/kernel/cpu/irq/ipr.c
@@ -17,16 +17,17 @@
17 * for more details. 17 * for more details.
18 */ 18 */
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/interrupt.h>
21#include <linux/io.h>
20#include <linux/irq.h> 22#include <linux/irq.h>
23#include <linux/kernel.h>
21#include <linux/module.h> 24#include <linux/module.h>
22#include <linux/io.h>
23#include <linux/interrupt.h>
24#include <linux/topology.h> 25#include <linux/topology.h>
25 26
26static inline struct ipr_desc *get_ipr_desc(unsigned int irq) 27static inline struct ipr_desc *get_ipr_desc(unsigned int irq)
27{ 28{
28 struct irq_chip *chip = get_irq_chip(irq); 29 struct irq_chip *chip = get_irq_chip(irq);
29 return (void *)((char *)chip - offsetof(struct ipr_desc, chip)); 30 return container_of(chip, struct ipr_desc, chip);
30} 31}
31 32
32static void disable_ipr_irq(unsigned int irq) 33static void disable_ipr_irq(unsigned int irq)
diff --git a/arch/sh/kernel/cpu/sh2/setup-sh7619.c b/arch/sh/kernel/cpu/sh2/setup-sh7619.c
index 8555c05e8667..114c7cee7184 100644
--- a/arch/sh/kernel/cpu/sh2/setup-sh7619.c
+++ b/arch/sh/kernel/cpu/sh2/setup-sh7619.c
@@ -59,32 +59,48 @@ static struct intc_prio_reg prio_registers[] __initdata = {
59static DECLARE_INTC_DESC(intc_desc, "sh7619", vectors, NULL, 59static DECLARE_INTC_DESC(intc_desc, "sh7619", vectors, NULL,
60 NULL, prio_registers, NULL); 60 NULL, prio_registers, NULL);
61 61
62static struct plat_sci_port sci_platform_data[] = { 62static struct plat_sci_port scif0_platform_data = {
63 { 63 .mapbase = 0xf8400000,
64 .mapbase = 0xf8400000, 64 .flags = UPF_BOOT_AUTOCONF,
65 .flags = UPF_BOOT_AUTOCONF, 65 .type = PORT_SCIF,
66 .type = PORT_SCIF, 66 .irqs = { 88, 88, 88, 88 },
67 .irqs = { 88, 88, 88, 88 }, 67};
68 }, { 68
69 .mapbase = 0xf8410000, 69static struct platform_device scif0_device = {
70 .flags = UPF_BOOT_AUTOCONF, 70 .name = "sh-sci",
71 .type = PORT_SCIF, 71 .id = 0,
72 .irqs = { 92, 92, 92, 92 }, 72 .dev = {
73 }, { 73 .platform_data = &scif0_platform_data,
74 .mapbase = 0xf8420000, 74 },
75 .flags = UPF_BOOT_AUTOCONF, 75};
76 .type = PORT_SCIF, 76
77 .irqs = { 96, 96, 96, 96 }, 77static struct plat_sci_port scif1_platform_data = {
78 }, { 78 .mapbase = 0xf8410000,
79 .flags = 0, 79 .flags = UPF_BOOT_AUTOCONF,
80 } 80 .type = PORT_SCIF,
81}; 81 .irqs = { 92, 92, 92, 92 },
82 82};
83static struct platform_device sci_device = { 83
84static struct platform_device scif1_device = {
85 .name = "sh-sci",
86 .id = 1,
87 .dev = {
88 .platform_data = &scif1_platform_data,
89 },
90};
91
92static struct plat_sci_port scif2_platform_data = {
93 .mapbase = 0xf8420000,
94 .flags = UPF_BOOT_AUTOCONF,
95 .type = PORT_SCIF,
96 .irqs = { 96, 96, 96, 96 },
97};
98
99static struct platform_device scif2_device = {
84 .name = "sh-sci", 100 .name = "sh-sci",
85 .id = -1, 101 .id = 2,
86 .dev = { 102 .dev = {
87 .platform_data = sci_platform_data, 103 .platform_data = &scif2_platform_data,
88 }, 104 },
89}; 105};
90 106
@@ -176,7 +192,9 @@ static struct platform_device cmt1_device = {
176}; 192};
177 193
178static struct platform_device *sh7619_devices[] __initdata = { 194static struct platform_device *sh7619_devices[] __initdata = {
179 &sci_device, 195 &scif0_device,
196 &scif1_device,
197 &scif2_device,
180 &eth_device, 198 &eth_device,
181 &cmt0_device, 199 &cmt0_device,
182 &cmt1_device, 200 &cmt1_device,
@@ -195,6 +213,9 @@ void __init plat_irq_setup(void)
195} 213}
196 214
197static struct platform_device *sh7619_early_devices[] __initdata = { 215static struct platform_device *sh7619_early_devices[] __initdata = {
216 &scif0_device,
217 &scif1_device,
218 &scif2_device,
198 &cmt0_device, 219 &cmt0_device,
199 &cmt1_device, 220 &cmt1_device,
200}; 221};
diff --git a/arch/sh/kernel/cpu/sh2a/setup-mxg.c b/arch/sh/kernel/cpu/sh2a/setup-mxg.c
index b67376445315..8f669dc9b0da 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-mxg.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-mxg.c
@@ -207,27 +207,23 @@ static struct platform_device mtu2_2_device = {
207 .num_resources = ARRAY_SIZE(mtu2_2_resources), 207 .num_resources = ARRAY_SIZE(mtu2_2_resources),
208}; 208};
209 209
210static struct plat_sci_port sci_platform_data[] = { 210static struct plat_sci_port scif0_platform_data = {
211 { 211 .mapbase = 0xff804000,
212 .mapbase = 0xff804000, 212 .flags = UPF_BOOT_AUTOCONF,
213 .flags = UPF_BOOT_AUTOCONF, 213 .type = PORT_SCIF,
214 .type = PORT_SCIF, 214 .irqs = { 220, 220, 220, 220 },
215 .irqs = { 220, 220, 220, 220 },
216 }, {
217 .flags = 0,
218 }
219}; 215};
220 216
221static struct platform_device sci_device = { 217static struct platform_device scif0_device = {
222 .name = "sh-sci", 218 .name = "sh-sci",
223 .id = -1, 219 .id = 0,
224 .dev = { 220 .dev = {
225 .platform_data = sci_platform_data, 221 .platform_data = &scif0_platform_data,
226 }, 222 },
227}; 223};
228 224
229static struct platform_device *mxg_devices[] __initdata = { 225static struct platform_device *mxg_devices[] __initdata = {
230 &sci_device, 226 &scif0_device,
231 &mtu2_0_device, 227 &mtu2_0_device,
232 &mtu2_1_device, 228 &mtu2_1_device,
233 &mtu2_2_device, 229 &mtu2_2_device,
@@ -246,6 +242,7 @@ void __init plat_irq_setup(void)
246} 242}
247 243
248static struct platform_device *mxg_early_devices[] __initdata = { 244static struct platform_device *mxg_early_devices[] __initdata = {
245 &scif0_device,
249 &mtu2_0_device, 246 &mtu2_0_device,
250 &mtu2_1_device, 247 &mtu2_1_device,
251 &mtu2_2_device, 248 &mtu2_2_device,
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7201.c b/arch/sh/kernel/cpu/sh2a/setup-sh7201.c
index fbde5b75deb9..4ccfeb59eb1a 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-sh7201.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-sh7201.c
@@ -177,57 +177,123 @@ static struct intc_mask_reg mask_registers[] __initdata = {
177static DECLARE_INTC_DESC(intc_desc, "sh7201", vectors, groups, 177static DECLARE_INTC_DESC(intc_desc, "sh7201", vectors, groups,
178 mask_registers, prio_registers, NULL); 178 mask_registers, prio_registers, NULL);
179 179
180static struct plat_sci_port sci_platform_data[] = { 180static struct plat_sci_port scif0_platform_data = {
181 { 181 .mapbase = 0xfffe8000,
182 .mapbase = 0xfffe8000, 182 .flags = UPF_BOOT_AUTOCONF,
183 .flags = UPF_BOOT_AUTOCONF, 183 .type = PORT_SCIF,
184 .type = PORT_SCIF, 184 .irqs = { 180, 180, 180, 180 }
185 .irqs = { 180, 180, 180, 180 } 185};
186 }, { 186
187 .mapbase = 0xfffe8800, 187static struct platform_device scif0_device = {
188 .flags = UPF_BOOT_AUTOCONF,
189 .type = PORT_SCIF,
190 .irqs = { 184, 184, 184, 184 }
191 }, {
192 .mapbase = 0xfffe9000,
193 .flags = UPF_BOOT_AUTOCONF,
194 .type = PORT_SCIF,
195 .irqs = { 188, 188, 188, 188 }
196 }, {
197 .mapbase = 0xfffe9800,
198 .flags = UPF_BOOT_AUTOCONF,
199 .type = PORT_SCIF,
200 .irqs = { 192, 192, 192, 192 }
201 }, {
202 .mapbase = 0xfffea000,
203 .flags = UPF_BOOT_AUTOCONF,
204 .type = PORT_SCIF,
205 .irqs = { 196, 196, 196, 196 }
206 }, {
207 .mapbase = 0xfffea800,
208 .flags = UPF_BOOT_AUTOCONF,
209 .type = PORT_SCIF,
210 .irqs = { 200, 200, 200, 200 }
211 }, {
212 .mapbase = 0xfffeb000,
213 .flags = UPF_BOOT_AUTOCONF,
214 .type = PORT_SCIF,
215 .irqs = { 204, 204, 204, 204 }
216 }, {
217 .mapbase = 0xfffeb800,
218 .flags = UPF_BOOT_AUTOCONF,
219 .type = PORT_SCIF,
220 .irqs = { 208, 208, 208, 208 }
221 }, {
222 .flags = 0,
223 }
224};
225
226static struct platform_device sci_device = {
227 .name = "sh-sci", 188 .name = "sh-sci",
228 .id = -1, 189 .id = 0,
190 .dev = {
191 .platform_data = &scif0_platform_data,
192 },
193};
194
195static struct plat_sci_port scif1_platform_data = {
196 .mapbase = 0xfffe8800,
197 .flags = UPF_BOOT_AUTOCONF,
198 .type = PORT_SCIF,
199 .irqs = { 184, 184, 184, 184 }
200};
201
202static struct platform_device scif1_device = {
203 .name = "sh-sci",
204 .id = 1,
205 .dev = {
206 .platform_data = &scif1_platform_data,
207 },
208};
209
210static struct plat_sci_port scif2_platform_data = {
211 .mapbase = 0xfffe9000,
212 .flags = UPF_BOOT_AUTOCONF,
213 .type = PORT_SCIF,
214 .irqs = { 188, 188, 188, 188 }
215};
216
217static struct platform_device scif2_device = {
218 .name = "sh-sci",
219 .id = 2,
220 .dev = {
221 .platform_data = &scif2_platform_data,
222 },
223};
224
225static struct plat_sci_port scif3_platform_data = {
226 .mapbase = 0xfffe9800,
227 .flags = UPF_BOOT_AUTOCONF,
228 .type = PORT_SCIF,
229 .irqs = { 192, 192, 192, 192 }
230};
231
232static struct platform_device scif3_device = {
233 .name = "sh-sci",
234 .id = 3,
235 .dev = {
236 .platform_data = &scif3_platform_data,
237 },
238};
239
240static struct plat_sci_port scif4_platform_data = {
241 .mapbase = 0xfffea000,
242 .flags = UPF_BOOT_AUTOCONF,
243 .type = PORT_SCIF,
244 .irqs = { 196, 196, 196, 196 }
245};
246
247static struct platform_device scif4_device = {
248 .name = "sh-sci",
249 .id = 4,
250 .dev = {
251 .platform_data = &scif4_platform_data,
252 },
253};
254
255static struct plat_sci_port scif5_platform_data = {
256 .mapbase = 0xfffea800,
257 .flags = UPF_BOOT_AUTOCONF,
258 .type = PORT_SCIF,
259 .irqs = { 200, 200, 200, 200 }
260};
261
262static struct platform_device scif5_device = {
263 .name = "sh-sci",
264 .id = 5,
265 .dev = {
266 .platform_data = &scif5_platform_data,
267 },
268};
269
270static struct plat_sci_port scif6_platform_data = {
271 .mapbase = 0xfffeb000,
272 .flags = UPF_BOOT_AUTOCONF,
273 .type = PORT_SCIF,
274 .irqs = { 204, 204, 204, 204 }
275};
276
277static struct platform_device scif6_device = {
278 .name = "sh-sci",
279 .id = 6,
280 .dev = {
281 .platform_data = &scif6_platform_data,
282 },
283};
284
285static struct plat_sci_port scif7_platform_data = {
286 .mapbase = 0xfffeb800,
287 .flags = UPF_BOOT_AUTOCONF,
288 .type = PORT_SCIF,
289 .irqs = { 208, 208, 208, 208 }
290};
291
292static struct platform_device scif7_device = {
293 .name = "sh-sci",
294 .id = 7,
229 .dev = { 295 .dev = {
230 .platform_data = sci_platform_data, 296 .platform_data = &scif7_platform_data,
231 }, 297 },
232}; 298};
233 299
@@ -345,7 +411,14 @@ static struct platform_device mtu2_2_device = {
345}; 411};
346 412
347static struct platform_device *sh7201_devices[] __initdata = { 413static struct platform_device *sh7201_devices[] __initdata = {
348 &sci_device, 414 &scif0_device,
415 &scif1_device,
416 &scif2_device,
417 &scif3_device,
418 &scif4_device,
419 &scif5_device,
420 &scif6_device,
421 &scif7_device,
349 &rtc_device, 422 &rtc_device,
350 &mtu2_0_device, 423 &mtu2_0_device,
351 &mtu2_1_device, 424 &mtu2_1_device,
@@ -365,6 +438,14 @@ void __init plat_irq_setup(void)
365} 438}
366 439
367static struct platform_device *sh7201_early_devices[] __initdata = { 440static struct platform_device *sh7201_early_devices[] __initdata = {
441 &scif0_device,
442 &scif1_device,
443 &scif2_device,
444 &scif3_device,
445 &scif4_device,
446 &scif5_device,
447 &scif6_device,
448 &scif7_device,
368 &mtu2_0_device, 449 &mtu2_0_device,
369 &mtu2_1_device, 450 &mtu2_1_device,
370 &mtu2_2_device, 451 &mtu2_2_device,
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7203.c b/arch/sh/kernel/cpu/sh2a/setup-sh7203.c
index d3fd536c9a84..3136966cc9b3 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-sh7203.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-sh7203.c
@@ -173,37 +173,63 @@ static struct intc_mask_reg mask_registers[] __initdata = {
173static DECLARE_INTC_DESC(intc_desc, "sh7203", vectors, groups, 173static DECLARE_INTC_DESC(intc_desc, "sh7203", vectors, groups,
174 mask_registers, prio_registers, NULL); 174 mask_registers, prio_registers, NULL);
175 175
176static struct plat_sci_port sci_platform_data[] = { 176static struct plat_sci_port scif0_platform_data = {
177 { 177 .mapbase = 0xfffe8000,
178 .mapbase = 0xfffe8000, 178 .flags = UPF_BOOT_AUTOCONF,
179 .flags = UPF_BOOT_AUTOCONF, 179 .type = PORT_SCIF,
180 .type = PORT_SCIF, 180 .irqs = { 192, 192, 192, 192 },
181 .irqs = { 192, 192, 192, 192 },
182 }, {
183 .mapbase = 0xfffe8800,
184 .flags = UPF_BOOT_AUTOCONF,
185 .type = PORT_SCIF,
186 .irqs = { 196, 196, 196, 196 },
187 }, {
188 .mapbase = 0xfffe9000,
189 .flags = UPF_BOOT_AUTOCONF,
190 .type = PORT_SCIF,
191 .irqs = { 200, 200, 200, 200 },
192 }, {
193 .mapbase = 0xfffe9800,
194 .flags = UPF_BOOT_AUTOCONF,
195 .type = PORT_SCIF,
196 .irqs = { 204, 204, 204, 204 },
197 }, {
198 .flags = 0,
199 }
200}; 181};
201 182
202static struct platform_device sci_device = { 183static struct platform_device scif0_device = {
203 .name = "sh-sci", 184 .name = "sh-sci",
204 .id = -1, 185 .id = 0,
186 .dev = {
187 .platform_data = &scif0_platform_data,
188 },
189};
190
191static struct plat_sci_port scif1_platform_data = {
192 .mapbase = 0xfffe8800,
193 .flags = UPF_BOOT_AUTOCONF,
194 .type = PORT_SCIF,
195 .irqs = { 196, 196, 196, 196 },
196};
197
198static struct platform_device scif1_device = {
199 .name = "sh-sci",
200 .id = 1,
201 .dev = {
202 .platform_data = &scif1_platform_data,
203 },
204};
205
206static struct plat_sci_port scif2_platform_data = {
207 .mapbase = 0xfffe9000,
208 .flags = UPF_BOOT_AUTOCONF,
209 .type = PORT_SCIF,
210 .irqs = { 200, 200, 200, 200 },
211};
212
213static struct platform_device scif2_device = {
214 .name = "sh-sci",
215 .id = 2,
216 .dev = {
217 .platform_data = &scif2_platform_data,
218 },
219};
220
221static struct plat_sci_port scif3_platform_data = {
222 .mapbase = 0xfffe9800,
223 .flags = UPF_BOOT_AUTOCONF,
224 .type = PORT_SCIF,
225 .irqs = { 204, 204, 204, 204 },
226};
227
228static struct platform_device scif3_device = {
229 .name = "sh-sci",
230 .id = 3,
205 .dev = { 231 .dev = {
206 .platform_data = sci_platform_data, 232 .platform_data = &scif3_platform_data,
207 }, 233 },
208}; 234};
209 235
@@ -354,7 +380,10 @@ static struct platform_device rtc_device = {
354}; 380};
355 381
356static struct platform_device *sh7203_devices[] __initdata = { 382static struct platform_device *sh7203_devices[] __initdata = {
357 &sci_device, 383 &scif0_device,
384 &scif1_device,
385 &scif2_device,
386 &scif3_device,
358 &cmt0_device, 387 &cmt0_device,
359 &cmt1_device, 388 &cmt1_device,
360 &mtu2_0_device, 389 &mtu2_0_device,
@@ -375,6 +404,10 @@ void __init plat_irq_setup(void)
375} 404}
376 405
377static struct platform_device *sh7203_early_devices[] __initdata = { 406static struct platform_device *sh7203_early_devices[] __initdata = {
407 &scif0_device,
408 &scif1_device,
409 &scif2_device,
410 &scif3_device,
378 &cmt0_device, 411 &cmt0_device,
379 &cmt1_device, 412 &cmt1_device,
380 &mtu2_0_device, 413 &mtu2_0_device,
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7206.c b/arch/sh/kernel/cpu/sh2a/setup-sh7206.c
index a9ccc5e8d9e9..064873585a8b 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-sh7206.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-sh7206.c
@@ -133,37 +133,63 @@ static struct intc_mask_reg mask_registers[] __initdata = {
133static DECLARE_INTC_DESC(intc_desc, "sh7206", vectors, groups, 133static DECLARE_INTC_DESC(intc_desc, "sh7206", vectors, groups,
134 mask_registers, prio_registers, NULL); 134 mask_registers, prio_registers, NULL);
135 135
136static struct plat_sci_port sci_platform_data[] = { 136static struct plat_sci_port scif0_platform_data = {
137 { 137 .mapbase = 0xfffe8000,
138 .mapbase = 0xfffe8000, 138 .flags = UPF_BOOT_AUTOCONF,
139 .flags = UPF_BOOT_AUTOCONF, 139 .type = PORT_SCIF,
140 .type = PORT_SCIF, 140 .irqs = { 240, 240, 240, 240 },
141 .irqs = { 240, 240, 240, 240 },
142 }, {
143 .mapbase = 0xfffe8800,
144 .flags = UPF_BOOT_AUTOCONF,
145 .type = PORT_SCIF,
146 .irqs = { 244, 244, 244, 244 },
147 }, {
148 .mapbase = 0xfffe9000,
149 .flags = UPF_BOOT_AUTOCONF,
150 .type = PORT_SCIF,
151 .irqs = { 248, 248, 248, 248 },
152 }, {
153 .mapbase = 0xfffe9800,
154 .flags = UPF_BOOT_AUTOCONF,
155 .type = PORT_SCIF,
156 .irqs = { 252, 252, 252, 252 },
157 }, {
158 .flags = 0,
159 }
160}; 141};
161 142
162static struct platform_device sci_device = { 143static struct platform_device scif0_device = {
163 .name = "sh-sci", 144 .name = "sh-sci",
164 .id = -1, 145 .id = 0,
146 .dev = {
147 .platform_data = &scif0_platform_data,
148 },
149};
150
151static struct plat_sci_port scif1_platform_data = {
152 .mapbase = 0xfffe8800,
153 .flags = UPF_BOOT_AUTOCONF,
154 .type = PORT_SCIF,
155 .irqs = { 244, 244, 244, 244 },
156};
157
158static struct platform_device scif1_device = {
159 .name = "sh-sci",
160 .id = 1,
161 .dev = {
162 .platform_data = &scif1_platform_data,
163 },
164};
165
166static struct plat_sci_port scif2_platform_data = {
167 .mapbase = 0xfffe9000,
168 .flags = UPF_BOOT_AUTOCONF,
169 .type = PORT_SCIF,
170 .irqs = { 248, 248, 248, 248 },
171};
172
173static struct platform_device scif2_device = {
174 .name = "sh-sci",
175 .id = 2,
176 .dev = {
177 .platform_data = &scif2_platform_data,
178 },
179};
180
181static struct plat_sci_port scif3_platform_data = {
182 .mapbase = 0xfffe9800,
183 .flags = UPF_BOOT_AUTOCONF,
184 .type = PORT_SCIF,
185 .irqs = { 252, 252, 252, 252 },
186};
187
188static struct platform_device scif3_device = {
189 .name = "sh-sci",
190 .id = 3,
165 .dev = { 191 .dev = {
166 .platform_data = sci_platform_data, 192 .platform_data = &scif3_platform_data,
167 }, 193 },
168}; 194};
169 195
@@ -325,7 +351,10 @@ static struct platform_device mtu2_2_device = {
325}; 351};
326 352
327static struct platform_device *sh7206_devices[] __initdata = { 353static struct platform_device *sh7206_devices[] __initdata = {
328 &sci_device, 354 &scif0_device,
355 &scif1_device,
356 &scif2_device,
357 &scif3_device,
329 &cmt0_device, 358 &cmt0_device,
330 &cmt1_device, 359 &cmt1_device,
331 &mtu2_0_device, 360 &mtu2_0_device,
@@ -346,6 +375,10 @@ void __init plat_irq_setup(void)
346} 375}
347 376
348static struct platform_device *sh7206_early_devices[] __initdata = { 377static struct platform_device *sh7206_early_devices[] __initdata = {
378 &scif0_device,
379 &scif1_device,
380 &scif2_device,
381 &scif3_device,
349 &cmt0_device, 382 &cmt0_device,
350 &cmt1_device, 383 &cmt1_device,
351 &mtu2_0_device, 384 &mtu2_0_device,
diff --git a/arch/sh/kernel/cpu/sh3/entry.S b/arch/sh/kernel/cpu/sh3/entry.S
index 3f7e2a22c7c2..f6a389c996cb 100644
--- a/arch/sh/kernel/cpu/sh3/entry.S
+++ b/arch/sh/kernel/cpu/sh3/entry.S
@@ -132,7 +132,6 @@ ENTRY(tlb_protection_violation_store)
132 mov #1, r5 132 mov #1, r5
133 133
134call_handle_tlbmiss: 134call_handle_tlbmiss:
135 setup_frame_reg
136 mov.l 1f, r0 135 mov.l 1f, r0
137 mov r5, r8 136 mov r5, r8
138 mov.l @r0, r6 137 mov.l @r0, r6
@@ -365,6 +364,8 @@ handle_exception:
365 mov.l @k2, k2 ! read out vector and keep in k2 364 mov.l @k2, k2 ! read out vector and keep in k2
366 365
367handle_exception_special: 366handle_exception_special:
367 setup_frame_reg
368
368 ! Setup return address and jump to exception handler 369 ! Setup return address and jump to exception handler
369 mov.l 7f, r9 ! fetch return address 370 mov.l 7f, r9 ! fetch return address
370 stc r2_bank, r0 ! k2 (vector) 371 stc r2_bank, r0 ! k2 (vector)
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7705.c b/arch/sh/kernel/cpu/sh3/setup-sh7705.c
index c23105983878..7b892d60e3a0 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh7705.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh7705.c
@@ -67,27 +67,33 @@ static struct intc_prio_reg prio_registers[] __initdata = {
67static DECLARE_INTC_DESC(intc_desc, "sh7705", vectors, NULL, 67static DECLARE_INTC_DESC(intc_desc, "sh7705", vectors, NULL,
68 NULL, prio_registers, NULL); 68 NULL, prio_registers, NULL);
69 69
70static struct plat_sci_port sci_platform_data[] = { 70static struct plat_sci_port scif0_platform_data = {
71 { 71 .mapbase = 0xa4410000,
72 .mapbase = 0xa4410000, 72 .flags = UPF_BOOT_AUTOCONF,
73 .flags = UPF_BOOT_AUTOCONF, 73 .type = PORT_SCIF,
74 .type = PORT_SCIF, 74 .irqs = { 56, 56, 56 },
75 .irqs = { 56, 56, 56 }, 75};
76 }, { 76
77 .mapbase = 0xa4400000, 77static struct platform_device scif0_device = {
78 .flags = UPF_BOOT_AUTOCONF,
79 .type = PORT_SCIF,
80 .irqs = { 52, 52, 52 },
81 }, {
82 .flags = 0,
83 }
84};
85
86static struct platform_device sci_device = {
87 .name = "sh-sci", 78 .name = "sh-sci",
88 .id = -1, 79 .id = 0,
80 .dev = {
81 .platform_data = &scif0_platform_data,
82 },
83};
84
85static struct plat_sci_port scif1_platform_data = {
86 .mapbase = 0xa4400000,
87 .flags = UPF_BOOT_AUTOCONF,
88 .type = PORT_SCIF,
89 .irqs = { 52, 52, 52 },
90};
91
92static struct platform_device scif1_device = {
93 .name = "sh-sci",
94 .id = 1,
89 .dev = { 95 .dev = {
90 .platform_data = sci_platform_data, 96 .platform_data = &scif1_platform_data,
91 }, 97 },
92}; 98};
93 99
@@ -210,10 +216,11 @@ static struct platform_device tmu2_device = {
210}; 216};
211 217
212static struct platform_device *sh7705_devices[] __initdata = { 218static struct platform_device *sh7705_devices[] __initdata = {
219 &scif0_device,
220 &scif1_device,
213 &tmu0_device, 221 &tmu0_device,
214 &tmu1_device, 222 &tmu1_device,
215 &tmu2_device, 223 &tmu2_device,
216 &sci_device,
217 &rtc_device, 224 &rtc_device,
218}; 225};
219 226
@@ -225,6 +232,8 @@ static int __init sh7705_devices_setup(void)
225arch_initcall(sh7705_devices_setup); 232arch_initcall(sh7705_devices_setup);
226 233
227static struct platform_device *sh7705_early_devices[] __initdata = { 234static struct platform_device *sh7705_early_devices[] __initdata = {
235 &scif0_device,
236 &scif1_device,
228 &tmu0_device, 237 &tmu0_device,
229 &tmu1_device, 238 &tmu1_device,
230 &tmu2_device, 239 &tmu2_device,
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh770x.c b/arch/sh/kernel/cpu/sh3/setup-sh770x.c
index 347ab35d0697..bc0c4f68c7c7 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh770x.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh770x.c
@@ -106,44 +106,55 @@ static struct platform_device rtc_device = {
106 .resource = rtc_resources, 106 .resource = rtc_resources,
107}; 107};
108 108
109static struct plat_sci_port sci_platform_data[] = { 109static struct plat_sci_port scif0_platform_data = {
110 { 110 .mapbase = 0xfffffe80,
111 .mapbase = 0xfffffe80, 111 .flags = UPF_BOOT_AUTOCONF,
112 .flags = UPF_BOOT_AUTOCONF, 112 .type = PORT_SCI,
113 .type = PORT_SCI, 113 .irqs = { 23, 23, 23, 0 },
114 .irqs = { 23, 23, 23, 0 }, 114};
115
116static struct platform_device scif0_device = {
117 .name = "sh-sci",
118 .id = 0,
119 .dev = {
120 .platform_data = &scif0_platform_data,
115 }, 121 },
122};
116#if defined(CONFIG_CPU_SUBTYPE_SH7706) || \ 123#if defined(CONFIG_CPU_SUBTYPE_SH7706) || \
117 defined(CONFIG_CPU_SUBTYPE_SH7707) || \ 124 defined(CONFIG_CPU_SUBTYPE_SH7707) || \
118 defined(CONFIG_CPU_SUBTYPE_SH7709) 125 defined(CONFIG_CPU_SUBTYPE_SH7709)
119 { 126static struct plat_sci_port scif1_platform_data = {
120 .mapbase = 0xa4000150, 127 .mapbase = 0xa4000150,
121 .flags = UPF_BOOT_AUTOCONF, 128 .flags = UPF_BOOT_AUTOCONF,
122 .type = PORT_SCIF, 129 .type = PORT_SCIF,
123 .irqs = { 56, 56, 56, 56 }, 130 .irqs = { 56, 56, 56, 56 },
131};
132
133static struct platform_device scif1_device = {
134 .name = "sh-sci",
135 .id = 1,
136 .dev = {
137 .platform_data = &scif1_platform_data,
124 }, 138 },
139};
125#endif 140#endif
126#if defined(CONFIG_CPU_SUBTYPE_SH7707) || \ 141#if defined(CONFIG_CPU_SUBTYPE_SH7707) || \
127 defined(CONFIG_CPU_SUBTYPE_SH7709) 142 defined(CONFIG_CPU_SUBTYPE_SH7709)
128 { 143static struct plat_sci_port scif2_platform_data = {
129 .mapbase = 0xa4000140, 144 .mapbase = 0xa4000140,
130 .flags = UPF_BOOT_AUTOCONF, 145 .flags = UPF_BOOT_AUTOCONF,
131 .type = PORT_IRDA, 146 .type = PORT_IRDA,
132 .irqs = { 52, 52, 52, 52 }, 147 .irqs = { 52, 52, 52, 52 },
133 },
134#endif
135 {
136 .flags = 0,
137 }
138}; 148};
139 149
140static struct platform_device sci_device = { 150static struct platform_device scif2_device = {
141 .name = "sh-sci", 151 .name = "sh-sci",
142 .id = -1, 152 .id = 2,
143 .dev = { 153 .dev = {
144 .platform_data = sci_platform_data, 154 .platform_data = &scif2_platform_data,
145 }, 155 },
146}; 156};
157#endif
147 158
148static struct sh_timer_config tmu0_platform_data = { 159static struct sh_timer_config tmu0_platform_data = {
149 .name = "TMU0", 160 .name = "TMU0",
@@ -238,10 +249,19 @@ static struct platform_device tmu2_device = {
238}; 249};
239 250
240static struct platform_device *sh770x_devices[] __initdata = { 251static struct platform_device *sh770x_devices[] __initdata = {
252 &scif0_device,
253#if defined(CONFIG_CPU_SUBTYPE_SH7706) || \
254 defined(CONFIG_CPU_SUBTYPE_SH7707) || \
255 defined(CONFIG_CPU_SUBTYPE_SH7709)
256 &scif1_device,
257#endif
258#if defined(CONFIG_CPU_SUBTYPE_SH7707) || \
259 defined(CONFIG_CPU_SUBTYPE_SH7709)
260 &scif2_device,
261#endif
241 &tmu0_device, 262 &tmu0_device,
242 &tmu1_device, 263 &tmu1_device,
243 &tmu2_device, 264 &tmu2_device,
244 &sci_device,
245 &rtc_device, 265 &rtc_device,
246}; 266};
247 267
@@ -253,6 +273,16 @@ static int __init sh770x_devices_setup(void)
253arch_initcall(sh770x_devices_setup); 273arch_initcall(sh770x_devices_setup);
254 274
255static struct platform_device *sh770x_early_devices[] __initdata = { 275static struct platform_device *sh770x_early_devices[] __initdata = {
276 &scif0_device,
277#if defined(CONFIG_CPU_SUBTYPE_SH7706) || \
278 defined(CONFIG_CPU_SUBTYPE_SH7707) || \
279 defined(CONFIG_CPU_SUBTYPE_SH7709)
280 &scif1_device,
281#endif
282#if defined(CONFIG_CPU_SUBTYPE_SH7707) || \
283 defined(CONFIG_CPU_SUBTYPE_SH7709)
284 &scif2_device,
285#endif
256 &tmu0_device, 286 &tmu0_device,
257 &tmu1_device, 287 &tmu1_device,
258 &tmu2_device, 288 &tmu2_device,
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7710.c b/arch/sh/kernel/cpu/sh3/setup-sh7710.c
index 717e90ae1097..0845a3ad006d 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh7710.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh7710.c
@@ -96,28 +96,33 @@ static struct platform_device rtc_device = {
96 }, 96 },
97}; 97};
98 98
99static struct plat_sci_port sci_platform_data[] = { 99static struct plat_sci_port scif0_platform_data = {
100 { 100 .mapbase = 0xa4400000,
101 .mapbase = 0xa4400000, 101 .flags = UPF_BOOT_AUTOCONF,
102 .flags = UPF_BOOT_AUTOCONF, 102 .type = PORT_SCIF,
103 .type = PORT_SCIF, 103 .irqs = { 52, 52, 52, 52 },
104 .irqs = { 52, 52, 52, 52 }, 104};
105 }, { 105
106 .mapbase = 0xa4410000, 106static struct platform_device scif0_device = {
107 .flags = UPF_BOOT_AUTOCONF,
108 .type = PORT_SCIF,
109 .irqs = { 56, 56, 56, 56 },
110 }, {
111
112 .flags = 0,
113 }
114};
115
116static struct platform_device sci_device = {
117 .name = "sh-sci", 107 .name = "sh-sci",
118 .id = -1, 108 .id = 0,
109 .dev = {
110 .platform_data = &scif0_platform_data,
111 },
112};
113
114static struct plat_sci_port scif1_platform_data = {
115 .mapbase = 0xa4410000,
116 .flags = UPF_BOOT_AUTOCONF,
117 .type = PORT_SCIF,
118 .irqs = { 56, 56, 56, 56 },
119};
120
121static struct platform_device scif1_device = {
122 .name = "sh-sci",
123 .id = 1,
119 .dev = { 124 .dev = {
120 .platform_data = sci_platform_data, 125 .platform_data = &scif1_platform_data,
121 }, 126 },
122}; 127};
123 128
@@ -214,10 +219,11 @@ static struct platform_device tmu2_device = {
214}; 219};
215 220
216static struct platform_device *sh7710_devices[] __initdata = { 221static struct platform_device *sh7710_devices[] __initdata = {
222 &scif0_device,
223 &scif1_device,
217 &tmu0_device, 224 &tmu0_device,
218 &tmu1_device, 225 &tmu1_device,
219 &tmu2_device, 226 &tmu2_device,
220 &sci_device,
221 &rtc_device, 227 &rtc_device,
222}; 228};
223 229
@@ -229,6 +235,8 @@ static int __init sh7710_devices_setup(void)
229arch_initcall(sh7710_devices_setup); 235arch_initcall(sh7710_devices_setup);
230 236
231static struct platform_device *sh7710_early_devices[] __initdata = { 237static struct platform_device *sh7710_early_devices[] __initdata = {
238 &scif0_device,
239 &scif1_device,
232 &tmu0_device, 240 &tmu0_device,
233 &tmu1_device, 241 &tmu1_device,
234 &tmu2_device, 242 &tmu2_device,
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7720.c b/arch/sh/kernel/cpu/sh3/setup-sh7720.c
index 74d8baaf8e96..a718a6231091 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh7720.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh7720.c
@@ -48,28 +48,33 @@ static struct platform_device rtc_device = {
48 }, 48 },
49}; 49};
50 50
51static struct plat_sci_port sci_platform_data[] = { 51static struct plat_sci_port scif0_platform_data = {
52 { 52 .mapbase = 0xa4430000,
53 .mapbase = 0xa4430000, 53 .flags = UPF_BOOT_AUTOCONF,
54 .flags = UPF_BOOT_AUTOCONF, 54 .type = PORT_SCIF,
55 .type = PORT_SCIF, 55 .irqs = { 80, 80, 80, 80 },
56 .irqs = { 80, 80, 80, 80 }, 56};
57 }, { 57
58 .mapbase = 0xa4438000, 58static struct platform_device scif0_device = {
59 .flags = UPF_BOOT_AUTOCONF,
60 .type = PORT_SCIF,
61 .irqs = { 81, 81, 81, 81 },
62 }, {
63
64 .flags = 0,
65 }
66};
67
68static struct platform_device sci_device = {
69 .name = "sh-sci", 59 .name = "sh-sci",
70 .id = -1, 60 .id = 0,
61 .dev = {
62 .platform_data = &scif0_platform_data,
63 },
64};
65
66static struct plat_sci_port scif1_platform_data = {
67 .mapbase = 0xa4438000,
68 .flags = UPF_BOOT_AUTOCONF,
69 .type = PORT_SCIF,
70 .irqs = { 81, 81, 81, 81 },
71};
72
73static struct platform_device scif1_device = {
74 .name = "sh-sci",
75 .id = 1,
71 .dev = { 76 .dev = {
72 .platform_data = sci_platform_data, 77 .platform_data = &scif1_platform_data,
73 }, 78 },
74}; 79};
75 80
@@ -369,6 +374,8 @@ static struct platform_device tmu2_device = {
369}; 374};
370 375
371static struct platform_device *sh7720_devices[] __initdata = { 376static struct platform_device *sh7720_devices[] __initdata = {
377 &scif0_device,
378 &scif1_device,
372 &cmt0_device, 379 &cmt0_device,
373 &cmt1_device, 380 &cmt1_device,
374 &cmt2_device, 381 &cmt2_device,
@@ -378,7 +385,6 @@ static struct platform_device *sh7720_devices[] __initdata = {
378 &tmu1_device, 385 &tmu1_device,
379 &tmu2_device, 386 &tmu2_device,
380 &rtc_device, 387 &rtc_device,
381 &sci_device,
382 &usb_ohci_device, 388 &usb_ohci_device,
383 &usbf_device, 389 &usbf_device,
384}; 390};
@@ -391,6 +397,8 @@ static int __init sh7720_devices_setup(void)
391arch_initcall(sh7720_devices_setup); 397arch_initcall(sh7720_devices_setup);
392 398
393static struct platform_device *sh7720_early_devices[] __initdata = { 399static struct platform_device *sh7720_early_devices[] __initdata = {
400 &scif0_device,
401 &scif1_device,
394 &cmt0_device, 402 &cmt0_device,
395 &cmt1_device, 403 &cmt1_device,
396 &cmt2_device, 404 &cmt2_device,
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh4-202.c b/arch/sh/kernel/cpu/sh4/setup-sh4-202.c
index de4827df19aa..4b733715cdb5 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh4-202.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh4-202.c
@@ -15,22 +15,18 @@
15#include <linux/sh_timer.h> 15#include <linux/sh_timer.h>
16#include <linux/io.h> 16#include <linux/io.h>
17 17
18static struct plat_sci_port sci_platform_data[] = { 18static struct plat_sci_port scif0_platform_data = {
19 { 19 .mapbase = 0xffe80000,
20 .mapbase = 0xffe80000, 20 .flags = UPF_BOOT_AUTOCONF,
21 .flags = UPF_BOOT_AUTOCONF, 21 .type = PORT_SCIF,
22 .type = PORT_SCIF, 22 .irqs = { 40, 41, 43, 42 },
23 .irqs = { 40, 41, 43, 42 },
24 }, {
25 .flags = 0,
26 }
27}; 23};
28 24
29static struct platform_device sci_device = { 25static struct platform_device scif0_device = {
30 .name = "sh-sci", 26 .name = "sh-sci",
31 .id = -1, 27 .id = 0,
32 .dev = { 28 .dev = {
33 .platform_data = sci_platform_data, 29 .platform_data = &scif0_platform_data,
34 }, 30 },
35}; 31};
36 32
@@ -127,7 +123,7 @@ static struct platform_device tmu2_device = {
127}; 123};
128 124
129static struct platform_device *sh4202_devices[] __initdata = { 125static struct platform_device *sh4202_devices[] __initdata = {
130 &sci_device, 126 &scif0_device,
131 &tmu0_device, 127 &tmu0_device,
132 &tmu1_device, 128 &tmu1_device,
133 &tmu2_device, 129 &tmu2_device,
@@ -141,6 +137,7 @@ static int __init sh4202_devices_setup(void)
141arch_initcall(sh4202_devices_setup); 137arch_initcall(sh4202_devices_setup);
142 138
143static struct platform_device *sh4202_early_devices[] __initdata = { 139static struct platform_device *sh4202_early_devices[] __initdata = {
140 &scif0_device,
144 &tmu0_device, 141 &tmu0_device,
145 &tmu1_device, 142 &tmu1_device,
146 &tmu2_device, 143 &tmu2_device,
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7750.c b/arch/sh/kernel/cpu/sh4/setup-sh7750.c
index 1b8b122e8f3d..b2a9df1af64c 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh7750.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh7750.c
@@ -35,29 +35,33 @@ static struct platform_device rtc_device = {
35 .resource = rtc_resources, 35 .resource = rtc_resources,
36}; 36};
37 37
38static struct plat_sci_port sci_platform_data[] = { 38static struct plat_sci_port scif0_platform_data = {
39 { 39 .mapbase = 0xffe00000,
40#ifndef CONFIG_SH_RTS7751R2D 40 .flags = UPF_BOOT_AUTOCONF,
41 .mapbase = 0xffe00000, 41 .type = PORT_SCI,
42 .flags = UPF_BOOT_AUTOCONF, 42 .irqs = { 23, 23, 23, 0 },
43 .type = PORT_SCI,
44 .irqs = { 23, 23, 23, 0 },
45 }, {
46#endif
47 .mapbase = 0xffe80000,
48 .flags = UPF_BOOT_AUTOCONF,
49 .type = PORT_SCIF,
50 .irqs = { 40, 40, 40, 40 },
51 }, {
52 .flags = 0,
53 }
54}; 43};
55 44
56static struct platform_device sci_device = { 45static struct platform_device scif0_device = {
57 .name = "sh-sci", 46 .name = "sh-sci",
58 .id = -1, 47 .id = 0,
48 .dev = {
49 .platform_data = &scif0_platform_data,
50 },
51};
52
53static struct plat_sci_port scif1_platform_data = {
54 .mapbase = 0xffe80000,
55 .flags = UPF_BOOT_AUTOCONF,
56 .type = PORT_SCIF,
57 .irqs = { 40, 40, 40, 40 },
58};
59
60static struct platform_device scif1_device = {
61 .name = "sh-sci",
62 .id = 1,
59 .dev = { 63 .dev = {
60 .platform_data = sci_platform_data, 64 .platform_data = &scif1_platform_data,
61 }, 65 },
62}; 66};
63 67
@@ -221,8 +225,9 @@ static struct platform_device tmu4_device = {
221#endif 225#endif
222 226
223static struct platform_device *sh7750_devices[] __initdata = { 227static struct platform_device *sh7750_devices[] __initdata = {
228 &scif0_device,
229 &scif1_device,
224 &rtc_device, 230 &rtc_device,
225 &sci_device,
226 &tmu0_device, 231 &tmu0_device,
227 &tmu1_device, 232 &tmu1_device,
228 &tmu2_device, 233 &tmu2_device,
@@ -242,6 +247,8 @@ static int __init sh7750_devices_setup(void)
242arch_initcall(sh7750_devices_setup); 247arch_initcall(sh7750_devices_setup);
243 248
244static struct platform_device *sh7750_early_devices[] __initdata = { 249static struct platform_device *sh7750_early_devices[] __initdata = {
250 &scif0_device,
251 &scif1_device,
245 &tmu0_device, 252 &tmu0_device,
246 &tmu1_device, 253 &tmu1_device,
247 &tmu2_device, 254 &tmu2_device,
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7760.c b/arch/sh/kernel/cpu/sh4/setup-sh7760.c
index 7fbb7be9284c..5b74cc0b43da 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh7760.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh7760.c
@@ -126,37 +126,63 @@ static struct intc_vect vectors_irq[] __initdata = {
126static DECLARE_INTC_DESC(intc_desc_irq, "sh7760-irq", vectors_irq, groups, 126static DECLARE_INTC_DESC(intc_desc_irq, "sh7760-irq", vectors_irq, groups,
127 mask_registers, prio_registers, NULL); 127 mask_registers, prio_registers, NULL);
128 128
129static struct plat_sci_port sci_platform_data[] = { 129static struct plat_sci_port scif0_platform_data = {
130 { 130 .mapbase = 0xfe600000,
131 .mapbase = 0xfe600000, 131 .flags = UPF_BOOT_AUTOCONF,
132 .flags = UPF_BOOT_AUTOCONF, 132 .type = PORT_SCIF,
133 .type = PORT_SCIF, 133 .irqs = { 52, 53, 55, 54 },
134 .irqs = { 52, 53, 55, 54 }, 134};
135 }, { 135
136 .mapbase = 0xfe610000, 136static struct platform_device scif0_device = {
137 .flags = UPF_BOOT_AUTOCONF, 137 .name = "sh-sci",
138 .type = PORT_SCIF, 138 .id = 0,
139 .irqs = { 72, 73, 75, 74 }, 139 .dev = {
140 }, { 140 .platform_data = &scif0_platform_data,
141 .mapbase = 0xfe620000, 141 },
142 .flags = UPF_BOOT_AUTOCONF, 142};
143 .type = PORT_SCIF, 143
144 .irqs = { 76, 77, 79, 78 }, 144static struct plat_sci_port scif1_platform_data = {
145 }, { 145 .mapbase = 0xfe610000,
146 .mapbase = 0xfe480000, 146 .flags = UPF_BOOT_AUTOCONF,
147 .flags = UPF_BOOT_AUTOCONF, 147 .type = PORT_SCIF,
148 .type = PORT_SCI, 148 .irqs = { 72, 73, 75, 74 },
149 .irqs = { 80, 81, 82, 0 }, 149};
150 }, { 150
151 .flags = 0, 151static struct platform_device scif1_device = {
152 } 152 .name = "sh-sci",
153 .id = 1,
154 .dev = {
155 .platform_data = &scif1_platform_data,
156 },
157};
158
159static struct plat_sci_port scif2_platform_data = {
160 .mapbase = 0xfe620000,
161 .flags = UPF_BOOT_AUTOCONF,
162 .type = PORT_SCIF,
163 .irqs = { 76, 77, 79, 78 },
164};
165
166static struct platform_device scif2_device = {
167 .name = "sh-sci",
168 .id = 2,
169 .dev = {
170 .platform_data = &scif2_platform_data,
171 },
172};
173
174static struct plat_sci_port scif3_platform_data = {
175 .mapbase = 0xfe480000,
176 .flags = UPF_BOOT_AUTOCONF,
177 .type = PORT_SCI,
178 .irqs = { 80, 81, 82, 0 },
153}; 179};
154 180
155static struct platform_device sci_device = { 181static struct platform_device scif3_device = {
156 .name = "sh-sci", 182 .name = "sh-sci",
157 .id = -1, 183 .id = 3,
158 .dev = { 184 .dev = {
159 .platform_data = sci_platform_data, 185 .platform_data = &scif3_platform_data,
160 }, 186 },
161}; 187};
162 188
@@ -254,7 +280,10 @@ static struct platform_device tmu2_device = {
254 280
255 281
256static struct platform_device *sh7760_devices[] __initdata = { 282static struct platform_device *sh7760_devices[] __initdata = {
257 &sci_device, 283 &scif0_device,
284 &scif1_device,
285 &scif2_device,
286 &scif3_device,
258 &tmu0_device, 287 &tmu0_device,
259 &tmu1_device, 288 &tmu1_device,
260 &tmu2_device, 289 &tmu2_device,
@@ -268,6 +297,10 @@ static int __init sh7760_devices_setup(void)
268arch_initcall(sh7760_devices_setup); 297arch_initcall(sh7760_devices_setup);
269 298
270static struct platform_device *sh7760_early_devices[] __initdata = { 299static struct platform_device *sh7760_early_devices[] __initdata = {
300 &scif0_device,
301 &scif1_device,
302 &scif2_device,
303 &scif3_device,
271 &tmu0_device, 304 &tmu0_device,
272 &tmu1_device, 305 &tmu1_device,
273 &tmu2_device, 306 &tmu2_device,
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7343.c b/arch/sh/kernel/cpu/sh4a/setup-sh7343.c
index ac4d5672ec1a..45eb1bfd42c9 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7343.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7343.c
@@ -15,6 +15,71 @@
15#include <linux/sh_timer.h> 15#include <linux/sh_timer.h>
16#include <asm/clock.h> 16#include <asm/clock.h>
17 17
18/* Serial */
19static struct plat_sci_port scif0_platform_data = {
20 .mapbase = 0xffe00000,
21 .flags = UPF_BOOT_AUTOCONF,
22 .type = PORT_SCIF,
23 .irqs = { 80, 80, 80, 80 },
24 .clk = "scif0",
25};
26
27static struct platform_device scif0_device = {
28 .name = "sh-sci",
29 .id = 0,
30 .dev = {
31 .platform_data = &scif0_platform_data,
32 },
33};
34
35static struct plat_sci_port scif1_platform_data = {
36 .mapbase = 0xffe10000,
37 .flags = UPF_BOOT_AUTOCONF,
38 .type = PORT_SCIF,
39 .irqs = { 81, 81, 81, 81 },
40 .clk = "scif1",
41};
42
43static struct platform_device scif1_device = {
44 .name = "sh-sci",
45 .id = 1,
46 .dev = {
47 .platform_data = &scif1_platform_data,
48 },
49};
50
51static struct plat_sci_port scif2_platform_data = {
52 .mapbase = 0xffe20000,
53 .flags = UPF_BOOT_AUTOCONF,
54 .type = PORT_SCIF,
55 .irqs = { 82, 82, 82, 82 },
56 .clk = "scif2",
57};
58
59static struct platform_device scif2_device = {
60 .name = "sh-sci",
61 .id = 2,
62 .dev = {
63 .platform_data = &scif2_platform_data,
64 },
65};
66
67static struct plat_sci_port scif3_platform_data = {
68 .mapbase = 0xffe30000,
69 .flags = UPF_BOOT_AUTOCONF,
70 .type = PORT_SCIF,
71 .irqs = { 83, 83, 83, 83 },
72 .clk = "scif3",
73};
74
75static struct platform_device scif3_device = {
76 .name = "sh-sci",
77 .id = 3,
78 .dev = {
79 .platform_data = &scif3_platform_data,
80 },
81};
82
18static struct resource iic0_resources[] = { 83static struct resource iic0_resources[] = {
19 [0] = { 84 [0] = {
20 .name = "IIC0", 85 .name = "IIC0",
@@ -265,52 +330,17 @@ static struct platform_device tmu2_device = {
265 .num_resources = ARRAY_SIZE(tmu2_resources), 330 .num_resources = ARRAY_SIZE(tmu2_resources),
266}; 331};
267 332
268static struct plat_sci_port sci_platform_data[] = {
269 {
270 .mapbase = 0xffe00000,
271 .flags = UPF_BOOT_AUTOCONF,
272 .type = PORT_SCIF,
273 .irqs = { 80, 80, 80, 80 },
274 .clk = "scif0",
275 }, {
276 .mapbase = 0xffe10000,
277 .flags = UPF_BOOT_AUTOCONF,
278 .type = PORT_SCIF,
279 .irqs = { 81, 81, 81, 81 },
280 .clk = "scif1",
281 }, {
282 .mapbase = 0xffe20000,
283 .flags = UPF_BOOT_AUTOCONF,
284 .type = PORT_SCIF,
285 .irqs = { 82, 82, 82, 82 },
286 .clk = "scif2",
287 }, {
288 .mapbase = 0xffe30000,
289 .flags = UPF_BOOT_AUTOCONF,
290 .type = PORT_SCIF,
291 .irqs = { 83, 83, 83, 83 },
292 .clk = "scif3",
293 }, {
294 .flags = 0,
295 }
296};
297
298static struct platform_device sci_device = {
299 .name = "sh-sci",
300 .id = -1,
301 .dev = {
302 .platform_data = sci_platform_data,
303 },
304};
305
306static struct platform_device *sh7343_devices[] __initdata = { 333static struct platform_device *sh7343_devices[] __initdata = {
334 &scif0_device,
335 &scif1_device,
336 &scif2_device,
337 &scif3_device,
307 &cmt_device, 338 &cmt_device,
308 &tmu0_device, 339 &tmu0_device,
309 &tmu1_device, 340 &tmu1_device,
310 &tmu2_device, 341 &tmu2_device,
311 &iic0_device, 342 &iic0_device,
312 &iic1_device, 343 &iic1_device,
313 &sci_device,
314 &vpu_device, 344 &vpu_device,
315 &veu_device, 345 &veu_device,
316 &jpu_device, 346 &jpu_device,
@@ -328,6 +358,10 @@ static int __init sh7343_devices_setup(void)
328arch_initcall(sh7343_devices_setup); 358arch_initcall(sh7343_devices_setup);
329 359
330static struct platform_device *sh7343_early_devices[] __initdata = { 360static struct platform_device *sh7343_early_devices[] __initdata = {
361 &scif0_device,
362 &scif1_device,
363 &scif2_device,
364 &scif3_device,
331 &cmt_device, 365 &cmt_device,
332 &tmu0_device, 366 &tmu0_device,
333 &tmu1_device, 367 &tmu1_device,
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c
index 4a9010bf4fd3..c494c193e3b6 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c
@@ -18,6 +18,22 @@
18#include <linux/usb/r8a66597.h> 18#include <linux/usb/r8a66597.h>
19#include <asm/clock.h> 19#include <asm/clock.h>
20 20
21static struct plat_sci_port scif0_platform_data = {
22 .mapbase = 0xffe00000,
23 .flags = UPF_BOOT_AUTOCONF,
24 .type = PORT_SCIF,
25 .irqs = { 80, 80, 80, 80 },
26 .clk = "scif0",
27};
28
29static struct platform_device scif0_device = {
30 .name = "sh-sci",
31 .id = 0,
32 .dev = {
33 .platform_data = &scif0_platform_data,
34 },
35};
36
21static struct resource iic_resources[] = { 37static struct resource iic_resources[] = {
22 [0] = { 38 [0] = {
23 .name = "IIC", 39 .name = "IIC",
@@ -276,33 +292,13 @@ static struct platform_device tmu2_device = {
276 .num_resources = ARRAY_SIZE(tmu2_resources), 292 .num_resources = ARRAY_SIZE(tmu2_resources),
277}; 293};
278 294
279static struct plat_sci_port sci_platform_data[] = {
280 {
281 .mapbase = 0xffe00000,
282 .flags = UPF_BOOT_AUTOCONF,
283 .type = PORT_SCIF,
284 .irqs = { 80, 80, 80, 80 },
285 .clk = "scif0",
286 }, {
287 .flags = 0,
288 }
289};
290
291static struct platform_device sci_device = {
292 .name = "sh-sci",
293 .id = -1,
294 .dev = {
295 .platform_data = sci_platform_data,
296 },
297};
298
299static struct platform_device *sh7366_devices[] __initdata = { 295static struct platform_device *sh7366_devices[] __initdata = {
296 &scif0_device,
300 &cmt_device, 297 &cmt_device,
301 &tmu0_device, 298 &tmu0_device,
302 &tmu1_device, 299 &tmu1_device,
303 &tmu2_device, 300 &tmu2_device,
304 &iic_device, 301 &iic_device,
305 &sci_device,
306 &usb_host_device, 302 &usb_host_device,
307 &vpu_device, 303 &vpu_device,
308 &veu0_device, 304 &veu0_device,
@@ -321,6 +317,7 @@ static int __init sh7366_devices_setup(void)
321arch_initcall(sh7366_devices_setup); 317arch_initcall(sh7366_devices_setup);
322 318
323static struct platform_device *sh7366_early_devices[] __initdata = { 319static struct platform_device *sh7366_early_devices[] __initdata = {
320 &scif0_device,
324 &cmt_device, 321 &cmt_device,
325 &tmu0_device, 322 &tmu0_device,
326 &tmu1_device, 323 &tmu1_device,
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
index 5491b094cf05..b5335b5e309c 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
@@ -20,6 +20,55 @@
20#include <asm/dma-sh.h> 20#include <asm/dma-sh.h>
21#include <cpu/sh7722.h> 21#include <cpu/sh7722.h>
22 22
23/* Serial */
24static struct plat_sci_port scif0_platform_data = {
25 .mapbase = 0xffe00000,
26 .flags = UPF_BOOT_AUTOCONF,
27 .type = PORT_SCIF,
28 .irqs = { 80, 80, 80, 80 },
29 .clk = "scif0",
30};
31
32static struct platform_device scif0_device = {
33 .name = "sh-sci",
34 .id = 0,
35 .dev = {
36 .platform_data = &scif0_platform_data,
37 },
38};
39
40static struct plat_sci_port scif1_platform_data = {
41 .mapbase = 0xffe10000,
42 .flags = UPF_BOOT_AUTOCONF,
43 .type = PORT_SCIF,
44 .irqs = { 81, 81, 81, 81 },
45 .clk = "scif1",
46};
47
48static struct platform_device scif1_device = {
49 .name = "sh-sci",
50 .id = 1,
51 .dev = {
52 .platform_data = &scif1_platform_data,
53 },
54};
55
56static struct plat_sci_port scif2_platform_data = {
57 .mapbase = 0xffe20000,
58 .flags = UPF_BOOT_AUTOCONF,
59 .type = PORT_SCIF,
60 .irqs = { 82, 82, 82, 82 },
61 .clk = "scif2",
62};
63
64static struct platform_device scif2_device = {
65 .name = "sh-sci",
66 .id = 2,
67 .dev = {
68 .platform_data = &scif2_platform_data,
69 },
70};
71
23static struct resource rtc_resources[] = { 72static struct resource rtc_resources[] = {
24 [0] = { 73 [0] = {
25 .start = 0xa465fec0, 74 .start = 0xa465fec0,
@@ -339,41 +388,6 @@ static struct platform_device tmu2_device = {
339 }, 388 },
340}; 389};
341 390
342static struct plat_sci_port sci_platform_data[] = {
343 {
344 .mapbase = 0xffe00000,
345 .flags = UPF_BOOT_AUTOCONF,
346 .type = PORT_SCIF,
347 .irqs = { 80, 80, 80, 80 },
348 .clk = "scif0",
349 },
350 {
351 .mapbase = 0xffe10000,
352 .flags = UPF_BOOT_AUTOCONF,
353 .type = PORT_SCIF,
354 .irqs = { 81, 81, 81, 81 },
355 .clk = "scif1",
356 },
357 {
358 .mapbase = 0xffe20000,
359 .flags = UPF_BOOT_AUTOCONF,
360 .type = PORT_SCIF,
361 .irqs = { 82, 82, 82, 82 },
362 .clk = "scif2",
363 },
364 {
365 .flags = 0,
366 }
367};
368
369static struct platform_device sci_device = {
370 .name = "sh-sci",
371 .id = -1,
372 .dev = {
373 .platform_data = sci_platform_data,
374 },
375};
376
377static struct sh_dmae_pdata dma_platform_data = { 391static struct sh_dmae_pdata dma_platform_data = {
378 .mode = 0, 392 .mode = 0,
379}; 393};
@@ -387,6 +401,9 @@ static struct platform_device dma_device = {
387}; 401};
388 402
389static struct platform_device *sh7722_devices[] __initdata = { 403static struct platform_device *sh7722_devices[] __initdata = {
404 &scif0_device,
405 &scif1_device,
406 &scif2_device,
390 &cmt_device, 407 &cmt_device,
391 &tmu0_device, 408 &tmu0_device,
392 &tmu1_device, 409 &tmu1_device,
@@ -394,7 +411,6 @@ static struct platform_device *sh7722_devices[] __initdata = {
394 &rtc_device, 411 &rtc_device,
395 &usbf_device, 412 &usbf_device,
396 &iic_device, 413 &iic_device,
397 &sci_device,
398 &vpu_device, 414 &vpu_device,
399 &veu_device, 415 &veu_device,
400 &jpu_device, 416 &jpu_device,
@@ -413,6 +429,9 @@ static int __init sh7722_devices_setup(void)
413arch_initcall(sh7722_devices_setup); 429arch_initcall(sh7722_devices_setup);
414 430
415static struct platform_device *sh7722_early_devices[] __initdata = { 431static struct platform_device *sh7722_early_devices[] __initdata = {
432 &scif0_device,
433 &scif1_device,
434 &scif2_device,
416 &cmt_device, 435 &cmt_device,
417 &tmu0_device, 436 &tmu0_device,
418 &tmu1_device, 437 &tmu1_device,
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
index 4caa5a7ca86e..772b9265d0e4 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
@@ -20,6 +20,103 @@
20#include <asm/mmzone.h> 20#include <asm/mmzone.h>
21#include <cpu/sh7723.h> 21#include <cpu/sh7723.h>
22 22
23/* Serial */
24static struct plat_sci_port scif0_platform_data = {
25 .mapbase = 0xffe00000,
26 .flags = UPF_BOOT_AUTOCONF,
27 .type = PORT_SCIF,
28 .irqs = { 80, 80, 80, 80 },
29 .clk = "scif0",
30};
31
32static struct platform_device scif0_device = {
33 .name = "sh-sci",
34 .id = 0,
35 .dev = {
36 .platform_data = &scif0_platform_data,
37 },
38};
39
40static struct plat_sci_port scif1_platform_data = {
41 .mapbase = 0xffe10000,
42 .flags = UPF_BOOT_AUTOCONF,
43 .type = PORT_SCIF,
44 .irqs = { 81, 81, 81, 81 },
45 .clk = "scif1",
46};
47
48static struct platform_device scif1_device = {
49 .name = "sh-sci",
50 .id = 1,
51 .dev = {
52 .platform_data = &scif1_platform_data,
53 },
54};
55
56static struct plat_sci_port scif2_platform_data = {
57 .mapbase = 0xffe20000,
58 .flags = UPF_BOOT_AUTOCONF,
59 .type = PORT_SCIF,
60 .irqs = { 82, 82, 82, 82 },
61 .clk = "scif2",
62};
63
64static struct platform_device scif2_device = {
65 .name = "sh-sci",
66 .id = 2,
67 .dev = {
68 .platform_data = &scif2_platform_data,
69 },
70};
71
72static struct plat_sci_port scif3_platform_data = {
73 .mapbase = 0xa4e30000,
74 .flags = UPF_BOOT_AUTOCONF,
75 .type = PORT_SCIFA,
76 .irqs = { 56, 56, 56, 56 },
77 .clk = "scif3",
78};
79
80static struct platform_device scif3_device = {
81 .name = "sh-sci",
82 .id = 3,
83 .dev = {
84 .platform_data = &scif3_platform_data,
85 },
86};
87
88static struct plat_sci_port scif4_platform_data = {
89 .mapbase = 0xa4e40000,
90 .flags = UPF_BOOT_AUTOCONF,
91 .type = PORT_SCIFA,
92 .irqs = { 88, 88, 88, 88 },
93 .clk = "scif4",
94};
95
96static struct platform_device scif4_device = {
97 .name = "sh-sci",
98 .id = 4,
99 .dev = {
100 .platform_data = &scif4_platform_data,
101 },
102};
103
104static struct plat_sci_port scif5_platform_data = {
105 .mapbase = 0xa4e50000,
106 .flags = UPF_BOOT_AUTOCONF,
107 .type = PORT_SCIFA,
108 .irqs = { 109, 109, 109, 109 },
109 .clk = "scif5",
110};
111
112static struct platform_device scif5_device = {
113 .name = "sh-sci",
114 .id = 5,
115 .dev = {
116 .platform_data = &scif5_platform_data,
117 },
118};
119
23static struct uio_info vpu_platform_data = { 120static struct uio_info vpu_platform_data = {
24 .name = "VPU5", 121 .name = "VPU5",
25 .version = "0", 122 .version = "0",
@@ -348,56 +445,6 @@ static struct platform_device tmu5_device = {
348 }, 445 },
349}; 446};
350 447
351static struct plat_sci_port sci_platform_data[] = {
352 {
353 .mapbase = 0xffe00000,
354 .flags = UPF_BOOT_AUTOCONF,
355 .type = PORT_SCIF,
356 .irqs = { 80, 80, 80, 80 },
357 .clk = "scif0",
358 },{
359 .mapbase = 0xffe10000,
360 .flags = UPF_BOOT_AUTOCONF,
361 .type = PORT_SCIF,
362 .irqs = { 81, 81, 81, 81 },
363 .clk = "scif1",
364 },{
365 .mapbase = 0xffe20000,
366 .flags = UPF_BOOT_AUTOCONF,
367 .type = PORT_SCIF,
368 .irqs = { 82, 82, 82, 82 },
369 .clk = "scif2",
370 },{
371 .mapbase = 0xa4e30000,
372 .flags = UPF_BOOT_AUTOCONF,
373 .type = PORT_SCIFA,
374 .irqs = { 56, 56, 56, 56 },
375 .clk = "scif3",
376 },{
377 .mapbase = 0xa4e40000,
378 .flags = UPF_BOOT_AUTOCONF,
379 .type = PORT_SCIFA,
380 .irqs = { 88, 88, 88, 88 },
381 .clk = "scif4",
382 },{
383 .mapbase = 0xa4e50000,
384 .flags = UPF_BOOT_AUTOCONF,
385 .type = PORT_SCIFA,
386 .irqs = { 109, 109, 109, 109 },
387 .clk = "scif5",
388 }, {
389 .flags = 0,
390 }
391};
392
393static struct platform_device sci_device = {
394 .name = "sh-sci",
395 .id = -1,
396 .dev = {
397 .platform_data = sci_platform_data,
398 },
399};
400
401static struct resource rtc_resources[] = { 448static struct resource rtc_resources[] = {
402 [0] = { 449 [0] = {
403 .start = 0xa465fec0, 450 .start = 0xa465fec0,
@@ -488,6 +535,12 @@ static struct platform_device iic_device = {
488}; 535};
489 536
490static struct platform_device *sh7723_devices[] __initdata = { 537static struct platform_device *sh7723_devices[] __initdata = {
538 &scif0_device,
539 &scif1_device,
540 &scif2_device,
541 &scif3_device,
542 &scif4_device,
543 &scif5_device,
491 &cmt_device, 544 &cmt_device,
492 &tmu0_device, 545 &tmu0_device,
493 &tmu1_device, 546 &tmu1_device,
@@ -495,7 +548,6 @@ static struct platform_device *sh7723_devices[] __initdata = {
495 &tmu3_device, 548 &tmu3_device,
496 &tmu4_device, 549 &tmu4_device,
497 &tmu5_device, 550 &tmu5_device,
498 &sci_device,
499 &rtc_device, 551 &rtc_device,
500 &iic_device, 552 &iic_device,
501 &sh7723_usb_host_device, 553 &sh7723_usb_host_device,
@@ -516,6 +568,12 @@ static int __init sh7723_devices_setup(void)
516arch_initcall(sh7723_devices_setup); 568arch_initcall(sh7723_devices_setup);
517 569
518static struct platform_device *sh7723_early_devices[] __initdata = { 570static struct platform_device *sh7723_early_devices[] __initdata = {
571 &scif0_device,
572 &scif1_device,
573 &scif2_device,
574 &scif3_device,
575 &scif4_device,
576 &scif5_device,
519 &cmt_device, 577 &cmt_device,
520 &tmu0_device, 578 &tmu0_device,
521 &tmu1_device, 579 &tmu1_device,
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
index 845e89c936e7..d32f96c1cc15 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
@@ -23,57 +23,117 @@
23#include <linux/notifier.h> 23#include <linux/notifier.h>
24#include <asm/suspend.h> 24#include <asm/suspend.h>
25#include <asm/clock.h> 25#include <asm/clock.h>
26#include <asm/dma-sh.h>
26#include <asm/mmzone.h> 27#include <asm/mmzone.h>
27#include <cpu/sh7724.h> 28#include <cpu/sh7724.h>
28 29
30/* DMA */
31static struct sh_dmae_pdata dma_platform_data = {
32 .mode = SHDMA_DMAOR1,
33};
34
35static struct platform_device dma_device = {
36 .name = "sh-dma-engine",
37 .id = -1,
38 .dev = {
39 .platform_data = &dma_platform_data,
40 },
41};
42
29/* Serial */ 43/* Serial */
30static struct plat_sci_port sci_platform_data[] = { 44static struct plat_sci_port scif0_platform_data = {
31 { 45 .mapbase = 0xffe00000,
32 .mapbase = 0xffe00000, 46 .flags = UPF_BOOT_AUTOCONF,
33 .flags = UPF_BOOT_AUTOCONF, 47 .type = PORT_SCIF,
34 .type = PORT_SCIF, 48 .irqs = { 80, 80, 80, 80 },
35 .irqs = { 80, 80, 80, 80 }, 49 .clk = "scif0",
36 .clk = "scif0", 50};
37 }, { 51
38 .mapbase = 0xffe10000, 52static struct platform_device scif0_device = {
39 .flags = UPF_BOOT_AUTOCONF,
40 .type = PORT_SCIF,
41 .irqs = { 81, 81, 81, 81 },
42 .clk = "scif1",
43 }, {
44 .mapbase = 0xffe20000,
45 .flags = UPF_BOOT_AUTOCONF,
46 .type = PORT_SCIF,
47 .irqs = { 82, 82, 82, 82 },
48 .clk = "scif2",
49 }, {
50 .mapbase = 0xa4e30000,
51 .flags = UPF_BOOT_AUTOCONF,
52 .type = PORT_SCIFA,
53 .irqs = { 56, 56, 56, 56 },
54 .clk = "scif3",
55 }, {
56 .mapbase = 0xa4e40000,
57 .flags = UPF_BOOT_AUTOCONF,
58 .type = PORT_SCIFA,
59 .irqs = { 88, 88, 88, 88 },
60 .clk = "scif4",
61 }, {
62 .mapbase = 0xa4e50000,
63 .flags = UPF_BOOT_AUTOCONF,
64 .type = PORT_SCIFA,
65 .irqs = { 109, 109, 109, 109 },
66 .clk = "scif5",
67 }, {
68 .flags = 0,
69 }
70};
71
72static struct platform_device sci_device = {
73 .name = "sh-sci", 53 .name = "sh-sci",
74 .id = -1, 54 .id = 0,
55 .dev = {
56 .platform_data = &scif0_platform_data,
57 },
58};
59
60static struct plat_sci_port scif1_platform_data = {
61 .mapbase = 0xffe10000,
62 .flags = UPF_BOOT_AUTOCONF,
63 .type = PORT_SCIF,
64 .irqs = { 81, 81, 81, 81 },
65 .clk = "scif1",
66};
67
68static struct platform_device scif1_device = {
69 .name = "sh-sci",
70 .id = 1,
71 .dev = {
72 .platform_data = &scif1_platform_data,
73 },
74};
75
76static struct plat_sci_port scif2_platform_data = {
77 .mapbase = 0xffe20000,
78 .flags = UPF_BOOT_AUTOCONF,
79 .type = PORT_SCIF,
80 .irqs = { 82, 82, 82, 82 },
81 .clk = "scif2",
82};
83
84static struct platform_device scif2_device = {
85 .name = "sh-sci",
86 .id = 2,
87 .dev = {
88 .platform_data = &scif2_platform_data,
89 },
90};
91
92static struct plat_sci_port scif3_platform_data = {
93 .mapbase = 0xa4e30000,
94 .flags = UPF_BOOT_AUTOCONF,
95 .type = PORT_SCIFA,
96 .irqs = { 56, 56, 56, 56 },
97 .clk = "scif3",
98};
99
100static struct platform_device scif3_device = {
101 .name = "sh-sci",
102 .id = 3,
103 .dev = {
104 .platform_data = &scif3_platform_data,
105 },
106};
107
108static struct plat_sci_port scif4_platform_data = {
109 .mapbase = 0xa4e40000,
110 .flags = UPF_BOOT_AUTOCONF,
111 .type = PORT_SCIFA,
112 .irqs = { 88, 88, 88, 88 },
113 .clk = "scif4",
114};
115
116static struct platform_device scif4_device = {
117 .name = "sh-sci",
118 .id = 4,
119 .dev = {
120 .platform_data = &scif4_platform_data,
121 },
122};
123
124static struct plat_sci_port scif5_platform_data = {
125 .mapbase = 0xa4e50000,
126 .flags = UPF_BOOT_AUTOCONF,
127 .type = PORT_SCIFA,
128 .irqs = { 109, 109, 109, 109 },
129 .clk = "scif5",
130};
131
132static struct platform_device scif5_device = {
133 .name = "sh-sci",
134 .id = 5,
75 .dev = { 135 .dev = {
76 .platform_data = sci_platform_data, 136 .platform_data = &scif5_platform_data,
77 }, 137 },
78}; 138};
79 139
@@ -590,6 +650,12 @@ static struct platform_device spu1_device = {
590}; 650};
591 651
592static struct platform_device *sh7724_devices[] __initdata = { 652static struct platform_device *sh7724_devices[] __initdata = {
653 &scif0_device,
654 &scif1_device,
655 &scif2_device,
656 &scif3_device,
657 &scif4_device,
658 &scif5_device,
593 &cmt_device, 659 &cmt_device,
594 &tmu0_device, 660 &tmu0_device,
595 &tmu1_device, 661 &tmu1_device,
@@ -597,7 +663,7 @@ static struct platform_device *sh7724_devices[] __initdata = {
597 &tmu3_device, 663 &tmu3_device,
598 &tmu4_device, 664 &tmu4_device,
599 &tmu5_device, 665 &tmu5_device,
600 &sci_device, 666 &dma_device,
601 &rtc_device, 667 &rtc_device,
602 &iic0_device, 668 &iic0_device,
603 &iic1_device, 669 &iic1_device,
@@ -624,6 +690,12 @@ static int __init sh7724_devices_setup(void)
624arch_initcall(sh7724_devices_setup); 690arch_initcall(sh7724_devices_setup);
625 691
626static struct platform_device *sh7724_early_devices[] __initdata = { 692static struct platform_device *sh7724_early_devices[] __initdata = {
693 &scif0_device,
694 &scif1_device,
695 &scif2_device,
696 &scif3_device,
697 &scif4_device,
698 &scif5_device,
627 &cmt_device, 699 &cmt_device,
628 &tmu0_device, 700 &tmu0_device,
629 &tmu1_device, 701 &tmu1_device,
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
index c470e15f2e03..37e32efbbaa7 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
@@ -17,6 +17,51 @@
17#include <linux/mm.h> 17#include <linux/mm.h>
18#include <linux/sh_timer.h> 18#include <linux/sh_timer.h>
19 19
20static struct plat_sci_port scif2_platform_data = {
21 .mapbase = 0xfe4b0000, /* SCIF2 */
22 .flags = UPF_BOOT_AUTOCONF,
23 .type = PORT_SCIF,
24 .irqs = { 40, 40, 40, 40 },
25};
26
27static struct platform_device scif2_device = {
28 .name = "sh-sci",
29 .id = 2,
30 .dev = {
31 .platform_data = &scif2_platform_data,
32 },
33};
34
35static struct plat_sci_port scif3_platform_data = {
36 .mapbase = 0xfe4c0000, /* SCIF3 */
37 .flags = UPF_BOOT_AUTOCONF,
38 .type = PORT_SCIF,
39 .irqs = { 76, 76, 76, 76 },
40};
41
42static struct platform_device scif3_device = {
43 .name = "sh-sci",
44 .id = 3,
45 .dev = {
46 .platform_data = &scif3_platform_data,
47 },
48};
49
50static struct plat_sci_port scif4_platform_data = {
51 .mapbase = 0xfe4d0000, /* SCIF4 */
52 .flags = UPF_BOOT_AUTOCONF,
53 .type = PORT_SCIF,
54 .irqs = { 104, 104, 104, 104 },
55};
56
57static struct platform_device scif4_device = {
58 .name = "sh-sci",
59 .id = 4,
60 .dev = {
61 .platform_data = &scif4_platform_data,
62 },
63};
64
20static struct sh_timer_config tmu0_platform_data = { 65static struct sh_timer_config tmu0_platform_data = {
21 .name = "TMU0", 66 .name = "TMU0",
22 .channel_offset = 0x04, 67 .channel_offset = 0x04,
@@ -79,39 +124,12 @@ static struct platform_device tmu1_device = {
79 .num_resources = ARRAY_SIZE(tmu1_resources), 124 .num_resources = ARRAY_SIZE(tmu1_resources),
80}; 125};
81 126
82static struct plat_sci_port sci_platform_data[] = {
83 {
84 .mapbase = 0xfe4b0000, /* SCIF2 */
85 .flags = UPF_BOOT_AUTOCONF,
86 .type = PORT_SCIF,
87 .irqs = { 40, 40, 40, 40 },
88 }, {
89 .mapbase = 0xfe4c0000, /* SCIF3 */
90 .flags = UPF_BOOT_AUTOCONF,
91 .type = PORT_SCIF,
92 .irqs = { 76, 76, 76, 76 },
93 }, {
94 .mapbase = 0xfe4d0000, /* SCIF4 */
95 .flags = UPF_BOOT_AUTOCONF,
96 .type = PORT_SCIF,
97 .irqs = { 104, 104, 104, 104 },
98 }, {
99 .flags = 0,
100 }
101};
102
103static struct platform_device sci_device = {
104 .name = "sh-sci",
105 .id = -1,
106 .dev = {
107 .platform_data = sci_platform_data,
108 },
109};
110
111static struct platform_device *sh7757_devices[] __initdata = { 127static struct platform_device *sh7757_devices[] __initdata = {
128 &scif2_device,
129 &scif3_device,
130 &scif4_device,
112 &tmu0_device, 131 &tmu0_device,
113 &tmu1_device, 132 &tmu1_device,
114 &sci_device,
115}; 133};
116 134
117static int __init sh7757_devices_setup(void) 135static int __init sh7757_devices_setup(void)
@@ -121,6 +139,20 @@ static int __init sh7757_devices_setup(void)
121} 139}
122arch_initcall(sh7757_devices_setup); 140arch_initcall(sh7757_devices_setup);
123 141
142static struct platform_device *sh7757_early_devices[] __initdata = {
143 &scif2_device,
144 &scif3_device,
145 &scif4_device,
146 &tmu0_device,
147 &tmu1_device,
148};
149
150void __init plat_early_device_setup(void)
151{
152 early_platform_add_devices(sh7757_early_devices,
153 ARRAY_SIZE(sh7757_early_devices));
154}
155
124enum { 156enum {
125 UNUSED = 0, 157 UNUSED = 0,
126 158
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
index 4659fff6b842..6aba26fec416 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
@@ -16,6 +16,51 @@
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/serial_sci.h> 17#include <linux/serial_sci.h>
18 18
19static struct plat_sci_port scif0_platform_data = {
20 .mapbase = 0xffe00000,
21 .flags = UPF_BOOT_AUTOCONF,
22 .type = PORT_SCIF,
23 .irqs = { 40, 40, 40, 40 },
24};
25
26static struct platform_device scif0_device = {
27 .name = "sh-sci",
28 .id = 0,
29 .dev = {
30 .platform_data = &scif0_platform_data,
31 },
32};
33
34static struct plat_sci_port scif1_platform_data = {
35 .mapbase = 0xffe08000,
36 .flags = UPF_BOOT_AUTOCONF,
37 .type = PORT_SCIF,
38 .irqs = { 76, 76, 76, 76 },
39};
40
41static struct platform_device scif1_device = {
42 .name = "sh-sci",
43 .id = 1,
44 .dev = {
45 .platform_data = &scif1_platform_data,
46 },
47};
48
49static struct plat_sci_port scif2_platform_data = {
50 .mapbase = 0xffe10000,
51 .flags = UPF_BOOT_AUTOCONF,
52 .type = PORT_SCIF,
53 .irqs = { 104, 104, 104, 104 },
54};
55
56static struct platform_device scif2_device = {
57 .name = "sh-sci",
58 .id = 2,
59 .dev = {
60 .platform_data = &scif2_platform_data,
61 },
62};
63
19static struct resource rtc_resources[] = { 64static struct resource rtc_resources[] = {
20 [0] = { 65 [0] = {
21 .start = 0xffe80000, 66 .start = 0xffe80000,
@@ -36,35 +81,6 @@ static struct platform_device rtc_device = {
36 .resource = rtc_resources, 81 .resource = rtc_resources,
37}; 82};
38 83
39static struct plat_sci_port sci_platform_data[] = {
40 {
41 .mapbase = 0xffe00000,
42 .flags = UPF_BOOT_AUTOCONF,
43 .type = PORT_SCIF,
44 .irqs = { 40, 40, 40, 40 },
45 }, {
46 .mapbase = 0xffe08000,
47 .flags = UPF_BOOT_AUTOCONF,
48 .type = PORT_SCIF,
49 .irqs = { 76, 76, 76, 76 },
50 }, {
51 .mapbase = 0xffe10000,
52 .flags = UPF_BOOT_AUTOCONF,
53 .type = PORT_SCIF,
54 .irqs = { 104, 104, 104, 104 },
55 }, {
56 .flags = 0,
57 }
58};
59
60static struct platform_device sci_device = {
61 .name = "sh-sci",
62 .id = -1,
63 .dev = {
64 .platform_data = sci_platform_data,
65 },
66};
67
68static struct resource usb_ohci_resources[] = { 84static struct resource usb_ohci_resources[] = {
69 [0] = { 85 [0] = {
70 .start = 0xffec8000, 86 .start = 0xffec8000,
@@ -297,6 +313,9 @@ static struct platform_device tmu5_device = {
297}; 313};
298 314
299static struct platform_device *sh7763_devices[] __initdata = { 315static struct platform_device *sh7763_devices[] __initdata = {
316 &scif0_device,
317 &scif1_device,
318 &scif2_device,
300 &tmu0_device, 319 &tmu0_device,
301 &tmu1_device, 320 &tmu1_device,
302 &tmu2_device, 321 &tmu2_device,
@@ -304,7 +323,6 @@ static struct platform_device *sh7763_devices[] __initdata = {
304 &tmu4_device, 323 &tmu4_device,
305 &tmu5_device, 324 &tmu5_device,
306 &rtc_device, 325 &rtc_device,
307 &sci_device,
308 &usb_ohci_device, 326 &usb_ohci_device,
309 &usbf_device, 327 &usbf_device,
310}; 328};
@@ -317,6 +335,9 @@ static int __init sh7763_devices_setup(void)
317arch_initcall(sh7763_devices_setup); 335arch_initcall(sh7763_devices_setup);
318 336
319static struct platform_device *sh7763_early_devices[] __initdata = { 337static struct platform_device *sh7763_early_devices[] __initdata = {
338 &scif0_device,
339 &scif1_device,
340 &scif2_device,
320 &tmu0_device, 341 &tmu0_device,
321 &tmu1_device, 342 &tmu1_device,
322 &tmu2_device, 343 &tmu2_device,
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7770.c b/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
index eead08d89d32..c1643bc9590d 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
@@ -14,67 +14,153 @@
14#include <linux/sh_timer.h> 14#include <linux/sh_timer.h>
15#include <linux/io.h> 15#include <linux/io.h>
16 16
17static struct plat_sci_port sci_platform_data[] = { 17static struct plat_sci_port scif0_platform_data = {
18 { 18 .mapbase = 0xff923000,
19 .mapbase = 0xff923000, 19 .flags = UPF_BOOT_AUTOCONF,
20 .flags = UPF_BOOT_AUTOCONF, 20 .type = PORT_SCIF,
21 .type = PORT_SCIF, 21 .irqs = { 61, 61, 61, 61 },
22 .irqs = { 61, 61, 61, 61 }, 22};
23 }, { 23
24 .mapbase = 0xff924000, 24static struct platform_device scif0_device = {
25 .flags = UPF_BOOT_AUTOCONF, 25 .name = "sh-sci",
26 .type = PORT_SCIF, 26 .id = 0,
27 .irqs = { 62, 62, 62, 62 }, 27 .dev = {
28 }, { 28 .platform_data = &scif0_platform_data,
29 .mapbase = 0xff925000, 29 },
30 .flags = UPF_BOOT_AUTOCONF, 30};
31 .type = PORT_SCIF, 31
32 .irqs = { 63, 63, 63, 63 }, 32static struct plat_sci_port scif1_platform_data = {
33 }, { 33 .mapbase = 0xff924000,
34 .mapbase = 0xff926000, 34 .flags = UPF_BOOT_AUTOCONF,
35 .flags = UPF_BOOT_AUTOCONF, 35 .type = PORT_SCIF,
36 .type = PORT_SCIF, 36 .irqs = { 62, 62, 62, 62 },
37 .irqs = { 64, 64, 64, 64 }, 37};
38 }, { 38
39 .mapbase = 0xff927000, 39static struct platform_device scif1_device = {
40 .flags = UPF_BOOT_AUTOCONF, 40 .name = "sh-sci",
41 .type = PORT_SCIF, 41 .id = 1,
42 .irqs = { 65, 65, 65, 65 }, 42 .dev = {
43 }, { 43 .platform_data = &scif1_platform_data,
44 .mapbase = 0xff928000, 44 },
45 .flags = UPF_BOOT_AUTOCONF, 45};
46 .type = PORT_SCIF, 46
47 .irqs = { 66, 66, 66, 66 }, 47static struct plat_sci_port scif2_platform_data = {
48 }, { 48 .mapbase = 0xff925000,
49 .mapbase = 0xff929000, 49 .flags = UPF_BOOT_AUTOCONF,
50 .flags = UPF_BOOT_AUTOCONF, 50 .type = PORT_SCIF,
51 .type = PORT_SCIF, 51 .irqs = { 63, 63, 63, 63 },
52 .irqs = { 67, 67, 67, 67 }, 52};
53 }, { 53
54 .mapbase = 0xff92a000, 54static struct platform_device scif2_device = {
55 .flags = UPF_BOOT_AUTOCONF, 55 .name = "sh-sci",
56 .type = PORT_SCIF, 56 .id = 2,
57 .irqs = { 68, 68, 68, 68 }, 57 .dev = {
58 }, { 58 .platform_data = &scif2_platform_data,
59 .mapbase = 0xff92b000, 59 },
60 .flags = UPF_BOOT_AUTOCONF, 60};
61 .type = PORT_SCIF, 61
62 .irqs = { 69, 69, 69, 69 }, 62static struct plat_sci_port scif3_platform_data = {
63 }, { 63 .mapbase = 0xff926000,
64 .mapbase = 0xff92c000, 64 .flags = UPF_BOOT_AUTOCONF,
65 .flags = UPF_BOOT_AUTOCONF, 65 .type = PORT_SCIF,
66 .type = PORT_SCIF, 66 .irqs = { 64, 64, 64, 64 },
67 .irqs = { 70, 70, 70, 70 }, 67};
68 }, { 68
69 .flags = 0, 69static struct platform_device scif3_device = {
70 } 70 .name = "sh-sci",
71 .id = 3,
72 .dev = {
73 .platform_data = &scif3_platform_data,
74 },
75};
76
77static struct plat_sci_port scif4_platform_data = {
78 .mapbase = 0xff927000,
79 .flags = UPF_BOOT_AUTOCONF,
80 .type = PORT_SCIF,
81 .irqs = { 65, 65, 65, 65 },
82};
83
84static struct platform_device scif4_device = {
85 .name = "sh-sci",
86 .id = 4,
87 .dev = {
88 .platform_data = &scif4_platform_data,
89 },
90};
91
92static struct plat_sci_port scif5_platform_data = {
93 .mapbase = 0xff928000,
94 .flags = UPF_BOOT_AUTOCONF,
95 .type = PORT_SCIF,
96 .irqs = { 66, 66, 66, 66 },
97};
98
99static struct platform_device scif5_device = {
100 .name = "sh-sci",
101 .id = 5,
102 .dev = {
103 .platform_data = &scif5_platform_data,
104 },
105};
106
107static struct plat_sci_port scif6_platform_data = {
108 .mapbase = 0xff929000,
109 .flags = UPF_BOOT_AUTOCONF,
110 .type = PORT_SCIF,
111 .irqs = { 67, 67, 67, 67 },
112};
113
114static struct platform_device scif6_device = {
115 .name = "sh-sci",
116 .id = 6,
117 .dev = {
118 .platform_data = &scif6_platform_data,
119 },
120};
121
122static struct plat_sci_port scif7_platform_data = {
123 .mapbase = 0xff92a000,
124 .flags = UPF_BOOT_AUTOCONF,
125 .type = PORT_SCIF,
126 .irqs = { 68, 68, 68, 68 },
127};
128
129static struct platform_device scif7_device = {
130 .name = "sh-sci",
131 .id = 7,
132 .dev = {
133 .platform_data = &scif7_platform_data,
134 },
135};
136
137static struct plat_sci_port scif8_platform_data = {
138 .mapbase = 0xff92b000,
139 .flags = UPF_BOOT_AUTOCONF,
140 .type = PORT_SCIF,
141 .irqs = { 69, 69, 69, 69 },
142};
143
144static struct platform_device scif8_device = {
145 .name = "sh-sci",
146 .id = 8,
147 .dev = {
148 .platform_data = &scif8_platform_data,
149 },
150};
151
152static struct plat_sci_port scif9_platform_data = {
153 .mapbase = 0xff92c000,
154 .flags = UPF_BOOT_AUTOCONF,
155 .type = PORT_SCIF,
156 .irqs = { 70, 70, 70, 70 },
71}; 157};
72 158
73static struct platform_device sci_device = { 159static struct platform_device scif9_device = {
74 .name = "sh-sci", 160 .name = "sh-sci",
75 .id = -1, 161 .id = 9,
76 .dev = { 162 .dev = {
77 .platform_data = sci_platform_data, 163 .platform_data = &scif9_platform_data,
78 }, 164 },
79}; 165};
80 166
@@ -351,6 +437,16 @@ static struct platform_device tmu8_device = {
351}; 437};
352 438
353static struct platform_device *sh7770_devices[] __initdata = { 439static struct platform_device *sh7770_devices[] __initdata = {
440 &scif0_device,
441 &scif1_device,
442 &scif2_device,
443 &scif3_device,
444 &scif4_device,
445 &scif5_device,
446 &scif6_device,
447 &scif7_device,
448 &scif8_device,
449 &scif9_device,
354 &tmu0_device, 450 &tmu0_device,
355 &tmu1_device, 451 &tmu1_device,
356 &tmu2_device, 452 &tmu2_device,
@@ -360,7 +456,6 @@ static struct platform_device *sh7770_devices[] __initdata = {
360 &tmu6_device, 456 &tmu6_device,
361 &tmu7_device, 457 &tmu7_device,
362 &tmu8_device, 458 &tmu8_device,
363 &sci_device,
364}; 459};
365 460
366static int __init sh7770_devices_setup(void) 461static int __init sh7770_devices_setup(void)
@@ -371,6 +466,16 @@ static int __init sh7770_devices_setup(void)
371arch_initcall(sh7770_devices_setup); 466arch_initcall(sh7770_devices_setup);
372 467
373static struct platform_device *sh7770_early_devices[] __initdata = { 468static struct platform_device *sh7770_early_devices[] __initdata = {
469 &scif0_device,
470 &scif1_device,
471 &scif2_device,
472 &scif3_device,
473 &scif4_device,
474 &scif5_device,
475 &scif6_device,
476 &scif7_device,
477 &scif8_device,
478 &scif9_device,
374 &tmu0_device, 479 &tmu0_device,
375 &tmu1_device, 480 &tmu1_device,
376 &tmu2_device, 481 &tmu2_device,
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
index 12ff56f19c5c..c310558490d5 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
@@ -15,6 +15,36 @@
15#include <linux/sh_timer.h> 15#include <linux/sh_timer.h>
16#include <asm/dma-sh.h> 16#include <asm/dma-sh.h>
17 17
18static struct plat_sci_port scif0_platform_data = {
19 .mapbase = 0xffe00000,
20 .flags = UPF_BOOT_AUTOCONF,
21 .type = PORT_SCIF,
22 .irqs = { 40, 40, 40, 40 },
23};
24
25static struct platform_device scif0_device = {
26 .name = "sh-sci",
27 .id = 0,
28 .dev = {
29 .platform_data = &scif0_platform_data,
30 },
31};
32
33static struct plat_sci_port scif1_platform_data = {
34 .mapbase = 0xffe10000,
35 .flags = UPF_BOOT_AUTOCONF,
36 .type = PORT_SCIF,
37 .irqs = { 76, 76, 76, 76 },
38};
39
40static struct platform_device scif1_device = {
41 .name = "sh-sci",
42 .id = 1,
43 .dev = {
44 .platform_data = &scif1_platform_data,
45 },
46};
47
18static struct sh_timer_config tmu0_platform_data = { 48static struct sh_timer_config tmu0_platform_data = {
19 .name = "TMU0", 49 .name = "TMU0",
20 .channel_offset = 0x04, 50 .channel_offset = 0x04,
@@ -217,30 +247,6 @@ static struct platform_device rtc_device = {
217 .resource = rtc_resources, 247 .resource = rtc_resources,
218}; 248};
219 249
220static struct plat_sci_port sci_platform_data[] = {
221 {
222 .mapbase = 0xffe00000,
223 .flags = UPF_BOOT_AUTOCONF,
224 .type = PORT_SCIF,
225 .irqs = { 40, 40, 40, 40 },
226 }, {
227 .mapbase = 0xffe10000,
228 .flags = UPF_BOOT_AUTOCONF,
229 .type = PORT_SCIF,
230 .irqs = { 76, 76, 76, 76 },
231 }, {
232 .flags = 0,
233 }
234};
235
236static struct platform_device sci_device = {
237 .name = "sh-sci",
238 .id = -1,
239 .dev = {
240 .platform_data = sci_platform_data,
241 },
242};
243
244static struct sh_dmae_pdata dma_platform_data = { 250static struct sh_dmae_pdata dma_platform_data = {
245 .mode = (SHDMA_MIX_IRQ | SHDMA_DMAOR1), 251 .mode = (SHDMA_MIX_IRQ | SHDMA_DMAOR1),
246}; 252};
@@ -254,6 +260,8 @@ static struct platform_device dma_device = {
254}; 260};
255 261
256static struct platform_device *sh7780_devices[] __initdata = { 262static struct platform_device *sh7780_devices[] __initdata = {
263 &scif0_device,
264 &scif1_device,
257 &tmu0_device, 265 &tmu0_device,
258 &tmu1_device, 266 &tmu1_device,
259 &tmu2_device, 267 &tmu2_device,
@@ -261,7 +269,6 @@ static struct platform_device *sh7780_devices[] __initdata = {
261 &tmu4_device, 269 &tmu4_device,
262 &tmu5_device, 270 &tmu5_device,
263 &rtc_device, 271 &rtc_device,
264 &sci_device,
265 &dma_device, 272 &dma_device,
266}; 273};
267 274
@@ -271,8 +278,9 @@ static int __init sh7780_devices_setup(void)
271 ARRAY_SIZE(sh7780_devices)); 278 ARRAY_SIZE(sh7780_devices));
272} 279}
273arch_initcall(sh7780_devices_setup); 280arch_initcall(sh7780_devices_setup);
274
275static struct platform_device *sh7780_early_devices[] __initdata = { 281static struct platform_device *sh7780_early_devices[] __initdata = {
282 &scif0_device,
283 &scif1_device,
276 &tmu0_device, 284 &tmu0_device,
277 &tmu1_device, 285 &tmu1_device,
278 &tmu2_device, 286 &tmu2_device,
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
index 7f6c718b6c36..f685b9b21999 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
@@ -14,8 +14,105 @@
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/mm.h> 15#include <linux/mm.h>
16#include <linux/sh_timer.h> 16#include <linux/sh_timer.h>
17#include <asm/dma-sh.h>
17#include <asm/mmzone.h> 18#include <asm/mmzone.h>
18 19
20static struct plat_sci_port scif0_platform_data = {
21 .mapbase = 0xffea0000,
22 .flags = UPF_BOOT_AUTOCONF,
23 .type = PORT_SCIF,
24 .irqs = { 40, 40, 40, 40 },
25 .clk = "scif_fck",
26};
27
28static struct platform_device scif0_device = {
29 .name = "sh-sci",
30 .id = 0,
31 .dev = {
32 .platform_data = &scif0_platform_data,
33 },
34};
35
36static struct plat_sci_port scif1_platform_data = {
37 .mapbase = 0xffeb0000,
38 .flags = UPF_BOOT_AUTOCONF,
39 .type = PORT_SCIF,
40 .irqs = { 44, 44, 44, 44 },
41 .clk = "scif_fck",
42};
43
44static struct platform_device scif1_device = {
45 .name = "sh-sci",
46 .id = 1,
47 .dev = {
48 .platform_data = &scif1_platform_data,
49 },
50};
51
52static struct plat_sci_port scif2_platform_data = {
53 .mapbase = 0xffec0000,
54 .flags = UPF_BOOT_AUTOCONF,
55 .type = PORT_SCIF,
56 .irqs = { 60, 60, 60, 60 },
57 .clk = "scif_fck",
58};
59
60static struct platform_device scif2_device = {
61 .name = "sh-sci",
62 .id = 2,
63 .dev = {
64 .platform_data = &scif2_platform_data,
65 },
66};
67
68static struct plat_sci_port scif3_platform_data = {
69 .mapbase = 0xffed0000,
70 .flags = UPF_BOOT_AUTOCONF,
71 .type = PORT_SCIF,
72 .irqs = { 61, 61, 61, 61 },
73 .clk = "scif_fck",
74};
75
76static struct platform_device scif3_device = {
77 .name = "sh-sci",
78 .id = 3,
79 .dev = {
80 .platform_data = &scif3_platform_data,
81 },
82};
83
84static struct plat_sci_port scif4_platform_data = {
85 .mapbase = 0xffee0000,
86 .flags = UPF_BOOT_AUTOCONF,
87 .type = PORT_SCIF,
88 .irqs = { 62, 62, 62, 62 },
89 .clk = "scif_fck",
90};
91
92static struct platform_device scif4_device = {
93 .name = "sh-sci",
94 .id = 4,
95 .dev = {
96 .platform_data = &scif4_platform_data,
97 },
98};
99
100static struct plat_sci_port scif5_platform_data = {
101 .mapbase = 0xffef0000,
102 .flags = UPF_BOOT_AUTOCONF,
103 .type = PORT_SCIF,
104 .irqs = { 63, 63, 63, 63 },
105 .clk = "scif_fck",
106};
107
108static struct platform_device scif5_device = {
109 .name = "sh-sci",
110 .id = 5,
111 .dev = {
112 .platform_data = &scif5_platform_data,
113 },
114};
115
19static struct sh_timer_config tmu0_platform_data = { 116static struct sh_timer_config tmu0_platform_data = {
20 .name = "TMU0", 117 .name = "TMU0",
21 .channel_offset = 0x04, 118 .channel_offset = 0x04,
@@ -198,64 +295,32 @@ static struct platform_device tmu5_device = {
198 .num_resources = ARRAY_SIZE(tmu5_resources), 295 .num_resources = ARRAY_SIZE(tmu5_resources),
199}; 296};
200 297
201static struct plat_sci_port sci_platform_data[] = { 298static struct sh_dmae_pdata dma_platform_data = {
202 { 299 .mode = (SHDMA_MIX_IRQ | SHDMA_DMAOR1),
203 .mapbase = 0xffea0000,
204 .flags = UPF_BOOT_AUTOCONF,
205 .type = PORT_SCIF,
206 .irqs = { 40, 40, 40, 40 },
207 .clk = "scif_fck",
208 }, {
209 .mapbase = 0xffeb0000,
210 .flags = UPF_BOOT_AUTOCONF,
211 .type = PORT_SCIF,
212 .irqs = { 44, 44, 44, 44 },
213 .clk = "scif_fck",
214 }, {
215 .mapbase = 0xffec0000,
216 .flags = UPF_BOOT_AUTOCONF,
217 .type = PORT_SCIF,
218 .irqs = { 60, 60, 60, 60 },
219 .clk = "scif_fck",
220 }, {
221 .mapbase = 0xffed0000,
222 .flags = UPF_BOOT_AUTOCONF,
223 .type = PORT_SCIF,
224 .irqs = { 61, 61, 61, 61 },
225 .clk = "scif_fck",
226 }, {
227 .mapbase = 0xffee0000,
228 .flags = UPF_BOOT_AUTOCONF,
229 .type = PORT_SCIF,
230 .irqs = { 62, 62, 62, 62 },
231 .clk = "scif_fck",
232 }, {
233 .mapbase = 0xffef0000,
234 .flags = UPF_BOOT_AUTOCONF,
235 .type = PORT_SCIF,
236 .irqs = { 63, 63, 63, 63 },
237 .clk = "scif_fck",
238 }, {
239 .flags = 0,
240 }
241}; 300};
242 301
243static struct platform_device sci_device = { 302static struct platform_device dma_device = {
244 .name = "sh-sci", 303 .name = "sh-dma-engine",
245 .id = -1, 304 .id = -1,
246 .dev = { 305 .dev = {
247 .platform_data = sci_platform_data, 306 .platform_data = &dma_platform_data,
248 }, 307 },
249}; 308};
250 309
251static struct platform_device *sh7785_devices[] __initdata = { 310static struct platform_device *sh7785_devices[] __initdata = {
311 &scif0_device,
312 &scif1_device,
313 &scif2_device,
314 &scif3_device,
315 &scif4_device,
316 &scif5_device,
252 &tmu0_device, 317 &tmu0_device,
253 &tmu1_device, 318 &tmu1_device,
254 &tmu2_device, 319 &tmu2_device,
255 &tmu3_device, 320 &tmu3_device,
256 &tmu4_device, 321 &tmu4_device,
257 &tmu5_device, 322 &tmu5_device,
258 &sci_device, 323 &dma_device,
259}; 324};
260 325
261static int __init sh7785_devices_setup(void) 326static int __init sh7785_devices_setup(void)
@@ -266,6 +331,12 @@ static int __init sh7785_devices_setup(void)
266arch_initcall(sh7785_devices_setup); 331arch_initcall(sh7785_devices_setup);
267 332
268static struct platform_device *sh7785_early_devices[] __initdata = { 333static struct platform_device *sh7785_early_devices[] __initdata = {
334 &scif0_device,
335 &scif1_device,
336 &scif2_device,
337 &scif3_device,
338 &scif4_device,
339 &scif5_device,
269 &tmu0_device, 340 &tmu0_device,
270 &tmu1_device, 341 &tmu1_device,
271 &tmu2_device, 342 &tmu2_device,
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
index 0104a8ec5369..71673487ace0 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
@@ -23,51 +23,96 @@
23#include <linux/sh_timer.h> 23#include <linux/sh_timer.h>
24#include <asm/mmzone.h> 24#include <asm/mmzone.h>
25 25
26static struct plat_sci_port sci_platform_data[] = { 26static struct plat_sci_port scif0_platform_data = {
27 { 27 .mapbase = 0xffea0000,
28 .mapbase = 0xffea0000, 28 .flags = UPF_BOOT_AUTOCONF,
29 .flags = UPF_BOOT_AUTOCONF, 29 .type = PORT_SCIF,
30 .type = PORT_SCIF, 30 .irqs = { 40, 41, 43, 42 },
31 .irqs = { 40, 41, 43, 42 }, 31};
32
33static struct platform_device scif0_device = {
34 .name = "sh-sci",
35 .id = 0,
36 .dev = {
37 .platform_data = &scif0_platform_data,
32 }, 38 },
33 /*
34 * The rest of these all have multiplexed IRQs
35 */
36 {
37 .mapbase = 0xffeb0000,
38 .flags = UPF_BOOT_AUTOCONF,
39 .type = PORT_SCIF,
40 .irqs = { 44, 44, 44, 44 },
41 }, {
42 .mapbase = 0xffec0000,
43 .flags = UPF_BOOT_AUTOCONF,
44 .type = PORT_SCIF,
45 .irqs = { 50, 50, 50, 50 },
46 }, {
47 .mapbase = 0xffed0000,
48 .flags = UPF_BOOT_AUTOCONF,
49 .type = PORT_SCIF,
50 .irqs = { 51, 51, 51, 51 },
51 }, {
52 .mapbase = 0xffee0000,
53 .flags = UPF_BOOT_AUTOCONF,
54 .type = PORT_SCIF,
55 .irqs = { 52, 52, 52, 52 },
56 }, {
57 .mapbase = 0xffef0000,
58 .flags = UPF_BOOT_AUTOCONF,
59 .type = PORT_SCIF,
60 .irqs = { 53, 53, 53, 53 },
61 }, {
62 .flags = 0,
63 }
64}; 39};
65 40
66static struct platform_device sci_device = { 41/*
42 * The rest of these all have multiplexed IRQs
43 */
44static struct plat_sci_port scif1_platform_data = {
45 .mapbase = 0xffeb0000,
46 .flags = UPF_BOOT_AUTOCONF,
47 .type = PORT_SCIF,
48 .irqs = { 44, 44, 44, 44 },
49};
50
51static struct platform_device scif1_device = {
67 .name = "sh-sci", 52 .name = "sh-sci",
68 .id = -1, 53 .id = 1,
54 .dev = {
55 .platform_data = &scif1_platform_data,
56 },
57};
58
59static struct plat_sci_port scif2_platform_data = {
60 .mapbase = 0xffec0000,
61 .flags = UPF_BOOT_AUTOCONF,
62 .type = PORT_SCIF,
63 .irqs = { 50, 50, 50, 50 },
64};
65
66static struct platform_device scif2_device = {
67 .name = "sh-sci",
68 .id = 2,
69 .dev = {
70 .platform_data = &scif2_platform_data,
71 },
72};
73
74static struct plat_sci_port scif3_platform_data = {
75 .mapbase = 0xffed0000,
76 .flags = UPF_BOOT_AUTOCONF,
77 .type = PORT_SCIF,
78 .irqs = { 51, 51, 51, 51 },
79};
80
81static struct platform_device scif3_device = {
82 .name = "sh-sci",
83 .id = 3,
84 .dev = {
85 .platform_data = &scif3_platform_data,
86 },
87};
88
89static struct plat_sci_port scif4_platform_data = {
90 .mapbase = 0xffee0000,
91 .flags = UPF_BOOT_AUTOCONF,
92 .type = PORT_SCIF,
93 .irqs = { 52, 52, 52, 52 },
94};
95
96static struct platform_device scif4_device = {
97 .name = "sh-sci",
98 .id = 4,
99 .dev = {
100 .platform_data = &scif4_platform_data,
101 },
102};
103
104static struct plat_sci_port scif5_platform_data = {
105 .mapbase = 0xffef0000,
106 .flags = UPF_BOOT_AUTOCONF,
107 .type = PORT_SCIF,
108 .irqs = { 53, 53, 53, 53 },
109};
110
111static struct platform_device scif5_device = {
112 .name = "sh-sci",
113 .id = 5,
69 .dev = { 114 .dev = {
70 .platform_data = sci_platform_data, 115 .platform_data = &scif5_platform_data,
71 }, 116 },
72}; 117};
73 118
@@ -459,6 +504,12 @@ static struct platform_device usb_ohci_device = {
459}; 504};
460 505
461static struct platform_device *sh7786_early_devices[] __initdata = { 506static struct platform_device *sh7786_early_devices[] __initdata = {
507 &scif0_device,
508 &scif1_device,
509 &scif2_device,
510 &scif3_device,
511 &scif4_device,
512 &scif5_device,
462 &tmu0_device, 513 &tmu0_device,
463 &tmu1_device, 514 &tmu1_device,
464 &tmu2_device, 515 &tmu2_device,
@@ -474,7 +525,6 @@ static struct platform_device *sh7786_early_devices[] __initdata = {
474}; 525};
475 526
476static struct platform_device *sh7786_devices[] __initdata = { 527static struct platform_device *sh7786_devices[] __initdata = {
477 &sci_device,
478 &usb_ohci_device, 528 &usb_ohci_device,
479}; 529};
480 530
diff --git a/arch/sh/kernel/cpu/sh4a/setup-shx3.c b/arch/sh/kernel/cpu/sh4a/setup-shx3.c
index c7ba9166e18a..780ba17a5599 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-shx3.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-shx3.c
@@ -24,32 +24,48 @@
24 * silicon in the first place, we just refuse to deal with the port at 24 * silicon in the first place, we just refuse to deal with the port at
25 * all rather than adding infrastructure to hack around it. 25 * all rather than adding infrastructure to hack around it.
26 */ 26 */
27static struct plat_sci_port sci_platform_data[] = { 27static struct plat_sci_port scif0_platform_data = {
28 { 28 .mapbase = 0xffc30000,
29 .mapbase = 0xffc30000, 29 .flags = UPF_BOOT_AUTOCONF,
30 .flags = UPF_BOOT_AUTOCONF, 30 .type = PORT_SCIF,
31 .type = PORT_SCIF, 31 .irqs = { 40, 41, 43, 42 },
32 .irqs = { 40, 41, 43, 42 }, 32};
33 }, { 33
34 .mapbase = 0xffc40000, 34static struct platform_device scif0_device = {
35 .flags = UPF_BOOT_AUTOCONF, 35 .name = "sh-sci",
36 .type = PORT_SCIF, 36 .id = 0,
37 .irqs = { 44, 45, 47, 46 }, 37 .dev = {
38 }, { 38 .platform_data = &scif0_platform_data,
39 .mapbase = 0xffc60000, 39 },
40 .flags = UPF_BOOT_AUTOCONF, 40};
41 .type = PORT_SCIF, 41
42 .irqs = { 52, 53, 55, 54 }, 42static struct plat_sci_port scif1_platform_data = {
43 }, { 43 .mapbase = 0xffc40000,
44 .flags = 0, 44 .flags = UPF_BOOT_AUTOCONF,
45 } 45 .type = PORT_SCIF,
46 .irqs = { 44, 45, 47, 46 },
47};
48
49static struct platform_device scif1_device = {
50 .name = "sh-sci",
51 .id = 1,
52 .dev = {
53 .platform_data = &scif1_platform_data,
54 },
55};
56
57static struct plat_sci_port scif2_platform_data = {
58 .mapbase = 0xffc60000,
59 .flags = UPF_BOOT_AUTOCONF,
60 .type = PORT_SCIF,
61 .irqs = { 52, 53, 55, 54 },
46}; 62};
47 63
48static struct platform_device sci_device = { 64static struct platform_device scif2_device = {
49 .name = "sh-sci", 65 .name = "sh-sci",
50 .id = -1, 66 .id = 2,
51 .dev = { 67 .dev = {
52 .platform_data = sci_platform_data, 68 .platform_data = &scif2_platform_data,
53 }, 69 },
54}; 70};
55 71
@@ -236,6 +252,9 @@ static struct platform_device tmu5_device = {
236}; 252};
237 253
238static struct platform_device *shx3_early_devices[] __initdata = { 254static struct platform_device *shx3_early_devices[] __initdata = {
255 &scif0_device,
256 &scif1_device,
257 &scif2_device,
239 &tmu0_device, 258 &tmu0_device,
240 &tmu1_device, 259 &tmu1_device,
241 &tmu2_device, 260 &tmu2_device,
@@ -244,21 +263,10 @@ static struct platform_device *shx3_early_devices[] __initdata = {
244 &tmu5_device, 263 &tmu5_device,
245}; 264};
246 265
247static struct platform_device *shx3_devices[] __initdata = {
248 &sci_device,
249};
250
251static int __init shx3_devices_setup(void) 266static int __init shx3_devices_setup(void)
252{ 267{
253 int ret; 268 return platform_add_devices(shx3_early_devices,
254
255 ret = platform_add_devices(shx3_early_devices,
256 ARRAY_SIZE(shx3_early_devices)); 269 ARRAY_SIZE(shx3_early_devices));
257 if (unlikely(ret != 0))
258 return ret;
259
260 return platform_add_devices(shx3_devices,
261 ARRAY_SIZE(shx3_devices));
262} 270}
263arch_initcall(shx3_devices_setup); 271arch_initcall(shx3_devices_setup);
264 272
diff --git a/arch/sh/kernel/cpu/sh5/fpu.c b/arch/sh/kernel/cpu/sh5/fpu.c
index dd4f51ffb50e..4648ccee6c4d 100644
--- a/arch/sh/kernel/cpu/sh5/fpu.c
+++ b/arch/sh/kernel/cpu/sh5/fpu.c
@@ -34,7 +34,7 @@ static union sh_fpu_union init_fpuregs = {
34 } 34 }
35}; 35};
36 36
37void save_fpu(struct task_struct *tsk, struct pt_regs *regs) 37void save_fpu(struct task_struct *tsk)
38{ 38{
39 asm volatile("fst.p %0, (0*8), fp0\n\t" 39 asm volatile("fst.p %0, (0*8), fp0\n\t"
40 "fst.p %0, (1*8), fp2\n\t" 40 "fst.p %0, (1*8), fp2\n\t"
@@ -153,7 +153,7 @@ do_fpu_state_restore(unsigned long ex, struct pt_regs *regs)
153 enable_fpu(); 153 enable_fpu();
154 if (last_task_used_math != NULL) 154 if (last_task_used_math != NULL)
155 /* Other processes fpu state, save away */ 155 /* Other processes fpu state, save away */
156 save_fpu(last_task_used_math, regs); 156 save_fpu(last_task_used_math);
157 157
158 last_task_used_math = current; 158 last_task_used_math = current;
159 if (used_math()) { 159 if (used_math()) {
diff --git a/arch/sh/kernel/cpu/sh5/setup-sh5.c b/arch/sh/kernel/cpu/sh5/setup-sh5.c
index 6a0f82f70032..e7a3c1e4b604 100644
--- a/arch/sh/kernel/cpu/sh5/setup-sh5.c
+++ b/arch/sh/kernel/cpu/sh5/setup-sh5.c
@@ -16,22 +16,18 @@
16#include <linux/sh_timer.h> 16#include <linux/sh_timer.h>
17#include <asm/addrspace.h> 17#include <asm/addrspace.h>
18 18
19static struct plat_sci_port sci_platform_data[] = { 19static struct plat_sci_port scif0_platform_data = {
20 { 20 .mapbase = PHYS_PERIPHERAL_BLOCK + 0x01030000,
21 .mapbase = PHYS_PERIPHERAL_BLOCK + 0x01030000, 21 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
22 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, 22 .type = PORT_SCIF,
23 .type = PORT_SCIF, 23 .irqs = { 39, 40, 42, 0 },
24 .irqs = { 39, 40, 42, 0 },
25 }, {
26 .flags = 0,
27 }
28}; 24};
29 25
30static struct platform_device sci_device = { 26static struct platform_device scif0_device = {
31 .name = "sh-sci", 27 .name = "sh-sci",
32 .id = -1, 28 .id = 0,
33 .dev = { 29 .dev = {
34 .platform_data = sci_platform_data, 30 .platform_data = &scif0_platform_data,
35 }, 31 },
36}; 32};
37 33
@@ -164,13 +160,13 @@ static struct platform_device tmu2_device = {
164}; 160};
165 161
166static struct platform_device *sh5_early_devices[] __initdata = { 162static struct platform_device *sh5_early_devices[] __initdata = {
163 &scif0_device,
167 &tmu0_device, 164 &tmu0_device,
168 &tmu1_device, 165 &tmu1_device,
169 &tmu2_device, 166 &tmu2_device,
170}; 167};
171 168
172static struct platform_device *sh5_devices[] __initdata = { 169static struct platform_device *sh5_devices[] __initdata = {
173 &sci_device,
174 &rtc_device, 170 &rtc_device,
175}; 171};
176 172
diff --git a/arch/sh/kernel/dwarf.c b/arch/sh/kernel/dwarf.c
index 3576b709f052..e51168064e56 100644
--- a/arch/sh/kernel/dwarf.c
+++ b/arch/sh/kernel/dwarf.c
@@ -540,6 +540,8 @@ void dwarf_free_frame(struct dwarf_frame *frame)
540 mempool_free(frame, dwarf_frame_pool); 540 mempool_free(frame, dwarf_frame_pool);
541} 541}
542 542
543extern void ret_from_irq(void);
544
543/** 545/**
544 * dwarf_unwind_stack - unwind the stack 546 * dwarf_unwind_stack - unwind the stack
545 * 547 *
@@ -678,6 +680,24 @@ struct dwarf_frame * dwarf_unwind_stack(unsigned long pc,
678 addr = frame->cfa + reg->addr; 680 addr = frame->cfa + reg->addr;
679 frame->return_addr = __raw_readl(addr); 681 frame->return_addr = __raw_readl(addr);
680 682
683 /*
684 * Ah, the joys of unwinding through interrupts.
685 *
686 * Interrupts are tricky - the DWARF info needs to be _really_
687 * accurate and unfortunately I'm seeing a lot of bogus DWARF
688 * info. For example, I've seen interrupts occur in epilogues
689 * just after the frame pointer (r14) had been restored. The
690 * problem was that the DWARF info claimed that the CFA could be
691 * reached by using the value of the frame pointer before it was
692 * restored.
693 *
694 * So until the compiler can be trusted to produce reliable
695 * DWARF info when it really matters, let's stop unwinding once
696 * we've calculated the function that was interrupted.
697 */
698 if (prev && prev->pc == (unsigned long)ret_from_irq)
699 frame->return_addr = 0;
700
681 return frame; 701 return frame;
682 702
683bail: 703bail:
@@ -892,18 +912,18 @@ static struct unwinder dwarf_unwinder = {
892 912
893static void dwarf_unwinder_cleanup(void) 913static void dwarf_unwinder_cleanup(void)
894{ 914{
895 struct dwarf_cie *cie; 915 struct dwarf_cie *cie, *cie_tmp;
896 struct dwarf_fde *fde; 916 struct dwarf_fde *fde, *fde_tmp;
897 917
898 /* 918 /*
899 * Deallocate all the memory allocated for the DWARF unwinder. 919 * Deallocate all the memory allocated for the DWARF unwinder.
900 * Traverse all the FDE/CIE lists and remove and free all the 920 * Traverse all the FDE/CIE lists and remove and free all the
901 * memory associated with those data structures. 921 * memory associated with those data structures.
902 */ 922 */
903 list_for_each_entry(cie, &dwarf_cie_list, link) 923 list_for_each_entry_safe(cie, cie_tmp, &dwarf_cie_list, link)
904 kfree(cie); 924 kfree(cie);
905 925
906 list_for_each_entry(fde, &dwarf_fde_list, link) 926 list_for_each_entry_safe(fde, fde_tmp, &dwarf_fde_list, link)
907 kfree(fde); 927 kfree(fde);
908 928
909 kmem_cache_destroy(dwarf_reg_cachep); 929 kmem_cache_destroy(dwarf_reg_cachep);
diff --git a/arch/sh/kernel/early_printk.c b/arch/sh/kernel/early_printk.c
index 81a46145ffa5..f8bb50c6e050 100644
--- a/arch/sh/kernel/early_printk.c
+++ b/arch/sh/kernel/early_printk.c
@@ -15,7 +15,6 @@
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/delay.h> 16#include <linux/delay.h>
17 17
18#ifdef CONFIG_SH_STANDARD_BIOS
19#include <asm/sh_bios.h> 18#include <asm/sh_bios.h>
20 19
21/* 20/*
@@ -57,149 +56,8 @@ static struct console bios_console = {
57 .flags = CON_PRINTBUFFER, 56 .flags = CON_PRINTBUFFER,
58 .index = -1, 57 .index = -1,
59}; 58};
60#endif
61 59
62#ifdef CONFIG_EARLY_SCIF_CONSOLE 60static struct console *early_console;
63#include <linux/serial_core.h>
64#include "../../../drivers/serial/sh-sci.h"
65
66#if defined(CONFIG_CPU_SUBTYPE_SH7720) || \
67 defined(CONFIG_CPU_SUBTYPE_SH7721)
68#define EPK_SCSMR_VALUE 0x000
69#define EPK_SCBRR_VALUE 0x00C
70#define EPK_FIFO_SIZE 64
71#define EPK_FIFO_BITS (0x7f00 >> 8)
72#else
73#define EPK_FIFO_SIZE 16
74#define EPK_FIFO_BITS (0x1f00 >> 8)
75#endif
76
77static struct uart_port scif_port = {
78 .type = PORT_SCIF,
79 .mapbase = CONFIG_EARLY_SCIF_CONSOLE_PORT,
80 .membase = (char __iomem *)CONFIG_EARLY_SCIF_CONSOLE_PORT,
81};
82
83static void scif_sercon_putc(int c)
84{
85 while (((sci_in(&scif_port, SCFDR) & EPK_FIFO_BITS) >= EPK_FIFO_SIZE))
86 ;
87
88 sci_in(&scif_port, SCxSR);
89 sci_out(&scif_port, SCxSR, 0xf3 & ~(0x20 | 0x40));
90 sci_out(&scif_port, SCxTDR, c);
91
92 while ((sci_in(&scif_port, SCxSR) & 0x40) == 0)
93 ;
94
95 if (c == '\n')
96 scif_sercon_putc('\r');
97}
98
99static void scif_sercon_write(struct console *con, const char *s,
100 unsigned count)
101{
102 while (count-- > 0)
103 scif_sercon_putc(*s++);
104}
105
106static int __init scif_sercon_setup(struct console *con, char *options)
107{
108 con->cflag = CREAD | HUPCL | CLOCAL | B115200 | CS8;
109
110 return 0;
111}
112
113static struct console scif_console = {
114 .name = "sercon",
115 .write = scif_sercon_write,
116 .setup = scif_sercon_setup,
117 .flags = CON_PRINTBUFFER,
118 .index = -1,
119};
120
121#if !defined(CONFIG_SH_STANDARD_BIOS)
122#if defined(CONFIG_CPU_SUBTYPE_SH7720) || \
123 defined(CONFIG_CPU_SUBTYPE_SH7721)
124static void scif_sercon_init(char *s)
125{
126 sci_out(&scif_port, SCSCR, 0x0000); /* clear TE and RE */
127 sci_out(&scif_port, SCFCR, 0x4006); /* reset */
128 sci_out(&scif_port, SCSCR, 0x0000); /* select internal clock */
129 sci_out(&scif_port, SCSMR, EPK_SCSMR_VALUE);
130 sci_out(&scif_port, SCBRR, EPK_SCBRR_VALUE);
131
132 mdelay(1); /* wait 1-bit time */
133
134 sci_out(&scif_port, SCFCR, 0x0030); /* TTRG=b'11 */
135 sci_out(&scif_port, SCSCR, 0x0030); /* TE, RE */
136}
137#elif defined(CONFIG_CPU_SH4) || defined(CONFIG_CPU_SH3)
138#define DEFAULT_BAUD 115200
139/*
140 * Simple SCIF init, primarily aimed at SH7750 and other similar SH-4
141 * devices that aren't using sh-ipl+g.
142 */
143static void scif_sercon_init(char *s)
144{
145 struct uart_port *port = &scif_port;
146 unsigned baud = DEFAULT_BAUD;
147 unsigned int status;
148 char *e;
149
150 if (*s == ',')
151 ++s;
152
153 if (*s) {
154 /* ignore ioport/device name */
155 s += strcspn(s, ",");
156 if (*s == ',')
157 s++;
158 }
159
160 if (*s) {
161 baud = simple_strtoul(s, &e, 0);
162 if (baud == 0 || s == e)
163 baud = DEFAULT_BAUD;
164 }
165
166 do {
167 status = sci_in(port, SCxSR);
168 } while (!(status & SCxSR_TEND(port)));
169
170 sci_out(port, SCSCR, 0); /* TE=0, RE=0 */
171 sci_out(port, SCFCR, SCFCR_RFRST | SCFCR_TFRST);
172 sci_out(port, SCSMR, 0);
173
174 /* Set baud rate */
175 sci_out(port, SCBRR, (CONFIG_SH_PCLK_FREQ + 16 * baud) /
176 (32 * baud) - 1);
177 udelay((1000000+(baud-1)) / baud); /* Wait one bit interval */
178
179 sci_out(port, SCSPTR, 0);
180 sci_out(port, SCxSR, 0x60);
181 sci_out(port, SCLSR, 0);
182
183 sci_out(port, SCFCR, 0);
184 sci_out(port, SCSCR, 0x30); /* TE=1, RE=1 */
185}
186#endif /* defined(CONFIG_CPU_SUBTYPE_SH7720) */
187#endif /* !defined(CONFIG_SH_STANDARD_BIOS) */
188#endif /* CONFIG_EARLY_SCIF_CONSOLE */
189
190/*
191 * Setup a default console, if more than one is compiled in, rely on the
192 * earlyprintk= parsing to give priority.
193 */
194static struct console *early_console =
195#ifdef CONFIG_SH_STANDARD_BIOS
196 &bios_console
197#elif defined(CONFIG_EARLY_SCIF_CONSOLE)
198 &scif_console
199#else
200 NULL
201#endif
202 ;
203 61
204static int __init setup_early_printk(char *buf) 62static int __init setup_early_printk(char *buf)
205{ 63{
@@ -211,21 +69,8 @@ static int __init setup_early_printk(char *buf)
211 if (strstr(buf, "keep")) 69 if (strstr(buf, "keep"))
212 keep_early = 1; 70 keep_early = 1;
213 71
214#ifdef CONFIG_SH_STANDARD_BIOS
215 if (!strncmp(buf, "bios", 4)) 72 if (!strncmp(buf, "bios", 4))
216 early_console = &bios_console; 73 early_console = &bios_console;
217#endif
218#if defined(CONFIG_EARLY_SCIF_CONSOLE)
219 if (!strncmp(buf, "serial", 6)) {
220 early_console = &scif_console;
221
222#if !defined(CONFIG_SH_STANDARD_BIOS)
223#if defined(CONFIG_CPU_SH4) || defined(CONFIG_CPU_SH3)
224 scif_sercon_init(buf + 6);
225#endif
226#endif
227 }
228#endif
229 74
230 if (likely(early_console)) { 75 if (likely(early_console)) {
231 if (keep_early) 76 if (keep_early)
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S
index f0abd58c3a69..2b15ae60c3a0 100644
--- a/arch/sh/kernel/entry-common.S
+++ b/arch/sh/kernel/entry-common.S
@@ -70,8 +70,14 @@ ret_from_exception:
70 CFI_STARTPROC simple 70 CFI_STARTPROC simple
71 CFI_DEF_CFA r14, 0 71 CFI_DEF_CFA r14, 0
72 CFI_REL_OFFSET 17, 64 72 CFI_REL_OFFSET 17, 64
73 CFI_REL_OFFSET 15, 0 73 CFI_REL_OFFSET 15, 60
74 CFI_REL_OFFSET 14, 56 74 CFI_REL_OFFSET 14, 56
75 CFI_REL_OFFSET 13, 52
76 CFI_REL_OFFSET 12, 48
77 CFI_REL_OFFSET 11, 44
78 CFI_REL_OFFSET 10, 40
79 CFI_REL_OFFSET 9, 36
80 CFI_REL_OFFSET 8, 32
75 preempt_stop() 81 preempt_stop()
76ENTRY(ret_from_irq) 82ENTRY(ret_from_irq)
77 ! 83 !
diff --git a/arch/sh/kernel/ftrace.c b/arch/sh/kernel/ftrace.c
index b6f41c109beb..a48cdedc73b5 100644
--- a/arch/sh/kernel/ftrace.c
+++ b/arch/sh/kernel/ftrace.c
@@ -401,82 +401,10 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
401#endif /* CONFIG_FUNCTION_GRAPH_TRACER */ 401#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
402 402
403#ifdef CONFIG_FTRACE_SYSCALLS 403#ifdef CONFIG_FTRACE_SYSCALLS
404
405extern unsigned long __start_syscalls_metadata[];
406extern unsigned long __stop_syscalls_metadata[];
407extern unsigned long *sys_call_table; 404extern unsigned long *sys_call_table;
408 405
409static struct syscall_metadata **syscalls_metadata; 406unsigned long __init arch_syscall_addr(int nr)
410
411static struct syscall_metadata *find_syscall_meta(unsigned long *syscall)
412{
413 struct syscall_metadata *start;
414 struct syscall_metadata *stop;
415 char str[KSYM_SYMBOL_LEN];
416
417
418 start = (struct syscall_metadata *)__start_syscalls_metadata;
419 stop = (struct syscall_metadata *)__stop_syscalls_metadata;
420 kallsyms_lookup((unsigned long) syscall, NULL, NULL, NULL, str);
421
422 for ( ; start < stop; start++) {
423 if (start->name && !strcmp(start->name, str))
424 return start;
425 }
426
427 return NULL;
428}
429
430struct syscall_metadata *syscall_nr_to_meta(int nr)
431{
432 if (!syscalls_metadata || nr >= FTRACE_SYSCALL_MAX || nr < 0)
433 return NULL;
434
435 return syscalls_metadata[nr];
436}
437
438int syscall_name_to_nr(char *name)
439{
440 int i;
441
442 if (!syscalls_metadata)
443 return -1;
444 for (i = 0; i < NR_syscalls; i++)
445 if (syscalls_metadata[i])
446 if (!strcmp(syscalls_metadata[i]->name, name))
447 return i;
448 return -1;
449}
450
451void set_syscall_enter_id(int num, int id)
452{
453 syscalls_metadata[num]->enter_id = id;
454}
455
456void set_syscall_exit_id(int num, int id)
457{
458 syscalls_metadata[num]->exit_id = id;
459}
460
461static int __init arch_init_ftrace_syscalls(void)
462{ 407{
463 int i; 408 return (unsigned long)sys_call_table[nr];
464 struct syscall_metadata *meta;
465 unsigned long **psys_syscall_table = &sys_call_table;
466
467 syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) *
468 FTRACE_SYSCALL_MAX, GFP_KERNEL);
469 if (!syscalls_metadata) {
470 WARN_ON(1);
471 return -ENOMEM;
472 }
473
474 for (i = 0; i < FTRACE_SYSCALL_MAX; i++) {
475 meta = find_syscall_meta(psys_syscall_table[i]);
476 syscalls_metadata[i] = meta;
477 }
478
479 return 0;
480} 409}
481arch_initcall(arch_init_ftrace_syscalls);
482#endif /* CONFIG_FTRACE_SYSCALLS */ 410#endif /* CONFIG_FTRACE_SYSCALLS */
diff --git a/arch/sh/kernel/idle.c b/arch/sh/kernel/idle.c
index aaff0037fcd7..6b3d706deac1 100644
--- a/arch/sh/kernel/idle.c
+++ b/arch/sh/kernel/idle.c
@@ -62,6 +62,7 @@ void default_idle(void)
62 clear_thread_flag(TIF_POLLING_NRFLAG); 62 clear_thread_flag(TIF_POLLING_NRFLAG);
63 smp_mb__after_clear_bit(); 63 smp_mb__after_clear_bit();
64 64
65 set_bl_bit();
65 if (!need_resched()) { 66 if (!need_resched()) {
66 local_irq_enable(); 67 local_irq_enable();
67 cpu_sleep(); 68 cpu_sleep();
@@ -69,6 +70,7 @@ void default_idle(void)
69 local_irq_enable(); 70 local_irq_enable();
70 71
71 set_thread_flag(TIF_POLLING_NRFLAG); 72 set_thread_flag(TIF_POLLING_NRFLAG);
73 clear_bl_bit();
72 } else 74 } else
73 poll_idle(); 75 poll_idle();
74} 76}
diff --git a/arch/sh/kernel/process_64.c b/arch/sh/kernel/process_64.c
index 359b8a2f4d2e..ec79faf6f021 100644
--- a/arch/sh/kernel/process_64.c
+++ b/arch/sh/kernel/process_64.c
@@ -368,7 +368,7 @@ void exit_thread(void)
368void flush_thread(void) 368void flush_thread(void)
369{ 369{
370 370
371 /* Called by fs/exec.c (flush_old_exec) to remove traces of a 371 /* Called by fs/exec.c (setup_new_exec) to remove traces of a
372 * previously running executable. */ 372 * previously running executable. */
373#ifdef CONFIG_SH_FPU 373#ifdef CONFIG_SH_FPU
374 if (last_task_used_math == current) { 374 if (last_task_used_math == current) {
@@ -404,7 +404,7 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
404 if (fpvalid) { 404 if (fpvalid) {
405 if (current == last_task_used_math) { 405 if (current == last_task_used_math) {
406 enable_fpu(); 406 enable_fpu();
407 save_fpu(tsk, regs); 407 save_fpu(tsk);
408 disable_fpu(); 408 disable_fpu();
409 last_task_used_math = 0; 409 last_task_used_math = 0;
410 regs->sr |= SR_FD; 410 regs->sr |= SR_FD;
@@ -431,7 +431,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
431#ifdef CONFIG_SH_FPU 431#ifdef CONFIG_SH_FPU
432 if(last_task_used_math == current) { 432 if(last_task_used_math == current) {
433 enable_fpu(); 433 enable_fpu();
434 save_fpu(current, regs); 434 save_fpu(current);
435 disable_fpu(); 435 disable_fpu();
436 last_task_used_math = NULL; 436 last_task_used_math = NULL;
437 regs->sr |= SR_FD; 437 regs->sr |= SR_FD;
diff --git a/arch/sh/kernel/ptrace_64.c b/arch/sh/kernel/ptrace_64.c
index 952da83903da..b063eb8b18e3 100644
--- a/arch/sh/kernel/ptrace_64.c
+++ b/arch/sh/kernel/ptrace_64.c
@@ -82,7 +82,7 @@ get_fpu_long(struct task_struct *task, unsigned long addr)
82 82
83 if (last_task_used_math == task) { 83 if (last_task_used_math == task) {
84 enable_fpu(); 84 enable_fpu();
85 save_fpu(task, regs); 85 save_fpu(task);
86 disable_fpu(); 86 disable_fpu();
87 last_task_used_math = 0; 87 last_task_used_math = 0;
88 regs->sr |= SR_FD; 88 regs->sr |= SR_FD;
@@ -118,7 +118,7 @@ put_fpu_long(struct task_struct *task, unsigned long addr, unsigned long data)
118 set_stopped_child_used_math(task); 118 set_stopped_child_used_math(task);
119 } else if (last_task_used_math == task) { 119 } else if (last_task_used_math == task) {
120 enable_fpu(); 120 enable_fpu();
121 save_fpu(task, regs); 121 save_fpu(task);
122 disable_fpu(); 122 disable_fpu();
123 last_task_used_math = 0; 123 last_task_used_math = 0;
124 regs->sr |= SR_FD; 124 regs->sr |= SR_FD;
@@ -133,6 +133,8 @@ void user_enable_single_step(struct task_struct *child)
133 struct pt_regs *regs = child->thread.uregs; 133 struct pt_regs *regs = child->thread.uregs;
134 134
135 regs->sr |= SR_SSTEP; /* auto-resetting upon exception */ 135 regs->sr |= SR_SSTEP; /* auto-resetting upon exception */
136
137 set_tsk_thread_flag(child, TIF_SINGLESTEP);
136} 138}
137 139
138void user_disable_single_step(struct task_struct *child) 140void user_disable_single_step(struct task_struct *child)
@@ -140,6 +142,8 @@ void user_disable_single_step(struct task_struct *child)
140 struct pt_regs *regs = child->thread.uregs; 142 struct pt_regs *regs = child->thread.uregs;
141 143
142 regs->sr &= ~SR_SSTEP; 144 regs->sr &= ~SR_SSTEP;
145
146 clear_tsk_thread_flag(child, TIF_SINGLESTEP);
143} 147}
144 148
145static int genregs_get(struct task_struct *target, 149static int genregs_get(struct task_struct *target,
@@ -454,6 +458,8 @@ asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs)
454 458
455asmlinkage void do_syscall_trace_leave(struct pt_regs *regs) 459asmlinkage void do_syscall_trace_leave(struct pt_regs *regs)
456{ 460{
461 int step;
462
457 if (unlikely(current->audit_context)) 463 if (unlikely(current->audit_context))
458 audit_syscall_exit(AUDITSC_RESULT(regs->regs[9]), 464 audit_syscall_exit(AUDITSC_RESULT(regs->regs[9]),
459 regs->regs[9]); 465 regs->regs[9]);
@@ -461,8 +467,9 @@ asmlinkage void do_syscall_trace_leave(struct pt_regs *regs)
461 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) 467 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
462 trace_sys_exit(regs, regs->regs[9]); 468 trace_sys_exit(regs, regs->regs[9]);
463 469
464 if (test_thread_flag(TIF_SYSCALL_TRACE)) 470 step = test_thread_flag(TIF_SINGLESTEP);
465 tracehook_report_syscall_exit(regs, 0); 471 if (step || test_thread_flag(TIF_SYSCALL_TRACE))
472 tracehook_report_syscall_exit(regs, step);
466} 473}
467 474
468/* Called with interrupts disabled */ 475/* Called with interrupts disabled */
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index 5a947a2567e4..8b0e69792cf4 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -423,6 +423,9 @@ void __init setup_arch(char **cmdline_p)
423 423
424 plat_early_device_setup(); 424 plat_early_device_setup();
425 425
426 /* Let earlyprintk output early console messages */
427 early_platform_driver_probe("earlyprintk", 1, 1);
428
426 sh_mv_setup(); 429 sh_mv_setup();
427 430
428 /* 431 /*
diff --git a/arch/sh/kernel/signal_64.c b/arch/sh/kernel/signal_64.c
index feb3dddd3192..580e97d46ca5 100644
--- a/arch/sh/kernel/signal_64.c
+++ b/arch/sh/kernel/signal_64.c
@@ -118,7 +118,9 @@ static int do_signal(struct pt_regs *regs, sigset_t *oldset)
118 * clear the TS_RESTORE_SIGMASK flag. 118 * clear the TS_RESTORE_SIGMASK flag.
119 */ 119 */
120 current_thread_info()->status &= ~TS_RESTORE_SIGMASK; 120 current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
121 tracehook_signal_handler(signr, &info, &ka, regs, 0); 121
122 tracehook_signal_handler(signr, &info, &ka, regs,
123 test_thread_flag(TIF_SINGLESTEP));
122 return 1; 124 return 1;
123 } 125 }
124 } 126 }
@@ -314,7 +316,7 @@ setup_sigcontext_fpu(struct pt_regs *regs, struct sigcontext __user *sc)
314 316
315 if (current == last_task_used_math) { 317 if (current == last_task_used_math) {
316 enable_fpu(); 318 enable_fpu();
317 save_fpu(current, regs); 319 save_fpu(current);
318 disable_fpu(); 320 disable_fpu();
319 last_task_used_math = NULL; 321 last_task_used_math = NULL;
320 regs->sr |= SR_FD; 322 regs->sr |= SR_FD;
diff --git a/arch/sh/kernel/syscalls_64.S b/arch/sh/kernel/syscalls_64.S
index 07d2aaea9ae8..2048a20d7c80 100644
--- a/arch/sh/kernel/syscalls_64.S
+++ b/arch/sh/kernel/syscalls_64.S
@@ -392,3 +392,4 @@ sys_call_table:
392 .long sys_rt_tgsigqueueinfo 392 .long sys_rt_tgsigqueueinfo
393 .long sys_perf_event_open 393 .long sys_perf_event_open
394 .long sys_recvmmsg /* 365 */ 394 .long sys_recvmmsg /* 365 */
395 .long sys_accept4
diff --git a/arch/sh/kernel/traps_32.c b/arch/sh/kernel/traps_32.c
index 3da5a125d884..86639beac3a2 100644
--- a/arch/sh/kernel/traps_32.c
+++ b/arch/sh/kernel/traps_32.c
@@ -452,12 +452,18 @@ int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs,
452 rm = regs->regs[index]; 452 rm = regs->regs[index];
453 453
454 /* shout about fixups */ 454 /* shout about fixups */
455 if (!expected && printk_ratelimit()) 455 if (!expected) {
456 printk(KERN_NOTICE "Fixing up unaligned %s access " 456 if (user_mode(regs) && (se_usermode & 1) && printk_ratelimit())
457 "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n", 457 pr_notice("Fixing up unaligned userspace access "
458 user_mode(regs) ? "userspace" : "kernel", 458 "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
459 current->comm, task_pid_nr(current), 459 current->comm, task_pid_nr(current),
460 (void *)regs->pc, instruction); 460 (void *)regs->pc, instruction);
461 else if (se_kernmode_warn && printk_ratelimit())
462 pr_notice("Fixing up unaligned kernel access "
463 "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
464 current->comm, task_pid_nr(current),
465 (void *)regs->pc, instruction);
466 }
461 467
462 ret = -EFAULT; 468 ret = -EFAULT;
463 switch (instruction&0xF000) { 469 switch (instruction&0xF000) {
diff --git a/arch/sh/kernel/traps_64.c b/arch/sh/kernel/traps_64.c
index 75c0cbe2eda0..d86f5315a0c1 100644
--- a/arch/sh/kernel/traps_64.c
+++ b/arch/sh/kernel/traps_64.c
@@ -600,7 +600,7 @@ static int misaligned_fpu_load(struct pt_regs *regs,
600 indexed by register number. */ 600 indexed by register number. */
601 if (last_task_used_math == current) { 601 if (last_task_used_math == current) {
602 enable_fpu(); 602 enable_fpu();
603 save_fpu(current, regs); 603 save_fpu(current);
604 disable_fpu(); 604 disable_fpu();
605 last_task_used_math = NULL; 605 last_task_used_math = NULL;
606 regs->sr |= SR_FD; 606 regs->sr |= SR_FD;
@@ -673,7 +673,7 @@ static int misaligned_fpu_store(struct pt_regs *regs,
673 indexed by register number. */ 673 indexed by register number. */
674 if (last_task_used_math == current) { 674 if (last_task_used_math == current) {
675 enable_fpu(); 675 enable_fpu();
676 save_fpu(current, regs); 676 save_fpu(current);
677 disable_fpu(); 677 disable_fpu();
678 last_task_used_math = NULL; 678 last_task_used_math = NULL;
679 regs->sr |= SR_FD; 679 regs->sr |= SR_FD;