aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/sh4/setup-sh7750.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-06-24 04:53:33 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-06-24 04:53:33 -0400
commit00b9de9c249f51f09c19aa41cbbb3e3eb4eea807 (patch)
tree28715dbc2472e6da8b7d670e63439172a1de9a6b /arch/sh/kernel/cpu/sh4/setup-sh7750.c
parentbb38c222e07cbe252cfbd99cd6a9c834b0a2639a (diff)
serial: sh-sci: Move SCSCR_INIT in to platform data.
This moves all of the SCSCR_INIT definitions in to the platform data, for future consolidation. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/sh4/setup-sh7750.c')
-rw-r--r--arch/sh/kernel/cpu/sh4/setup-sh7750.c48
1 files changed, 30 insertions, 18 deletions
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7750.c b/arch/sh/kernel/cpu/sh4/setup-sh7750.c
index 851672d15cf4..2159c439dce9 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh7750.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh7750.c
@@ -14,6 +14,7 @@
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/sh_timer.h> 15#include <linux/sh_timer.h>
16#include <linux/serial_sci.h> 16#include <linux/serial_sci.h>
17#include <asm/machtypes.h>
17 18
18static struct resource rtc_resources[] = { 19static struct resource rtc_resources[] = {
19 [0] = { 20 [0] = {
@@ -35,32 +36,36 @@ static struct platform_device rtc_device = {
35 .resource = rtc_resources, 36 .resource = rtc_resources,
36}; 37};
37 38
38static struct plat_sci_port sci_platform_data[] = { 39static struct plat_sci_port sci_platform_data = {
39 { 40 .mapbase = 0xffe00000,
40#ifndef CONFIG_SH_RTS7751R2D 41 .flags = UPF_BOOT_AUTOCONF,
41 .mapbase = 0xffe00000, 42 .type = PORT_SCI,
42 .flags = UPF_BOOT_AUTOCONF, 43 .scscr = SCSCR_TE | SCSCR_RE,
43 .type = PORT_SCI, 44 .irqs = { 23, 23, 23, 0 },
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}; 45};
55 46
56static struct platform_device sci_device = { 47static struct platform_device sci_device = {
57 .name = "sh-sci", 48 .name = "sh-sci",
58 .id = -1,
59 .dev = { 49 .dev = {
60 .platform_data = sci_platform_data, 50 .platform_data = sci_platform_data,
61 }, 51 },
62}; 52};
63 53
54static struct plat_sci_port scif_platform_data = {
55 .mapbase = 0xffe80000,
56 .flags = UPF_BOOT_AUTOCONF,
57 .scscr = SCSCR_TE | SCSCR_RE | SCSCR_REIE,
58 .type = PORT_SCIF,
59 .irqs = { 40, 40, 40, 40 },
60};
61
62static struct platform_device scif_device = {
63 .name = "sh-sci",
64 .dev = {
65 .platform_data = scif_platform_data,
66 },
67};
68
64static struct sh_timer_config tmu0_platform_data = { 69static struct sh_timer_config tmu0_platform_data = {
65 .name = "TMU0", 70 .name = "TMU0",
66 .channel_offset = 0x04, 71 .channel_offset = 0x04,
@@ -222,7 +227,6 @@ static struct platform_device tmu4_device = {
222 227
223static struct platform_device *sh7750_devices[] __initdata = { 228static struct platform_device *sh7750_devices[] __initdata = {
224 &rtc_device, 229 &rtc_device,
225 &sci_device,
226 &tmu0_device, 230 &tmu0_device,
227 &tmu1_device, 231 &tmu1_device,
228 &tmu2_device, 232 &tmu2_device,
@@ -236,6 +240,14 @@ static struct platform_device *sh7750_devices[] __initdata = {
236 240
237static int __init sh7750_devices_setup(void) 241static int __init sh7750_devices_setup(void)
238{ 242{
243 if (mach_is_rts7751r2d()) {
244 scif_platform_data.scscr |= SCSCR_CKE1;
245 platform_register_device(&scif_device);
246 } else {
247 platform_register_device(&sci_device);
248 platform_register_device(&scif_device);
249 }
250
239 return platform_add_devices(sh7750_devices, 251 return platform_add_devices(sh7750_devices,
240 ARRAY_SIZE(sh7750_devices)); 252 ARRAY_SIZE(sh7750_devices));
241} 253}