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>
This commit is contained in:
Paul Mundt
2009-06-24 17:53:33 +09:00
parent bb38c222e0
commit 00b9de9c24
27 changed files with 140 additions and 59 deletions

View File

@@ -14,6 +14,7 @@
#include <linux/io.h>
#include <linux/sh_timer.h>
#include <linux/serial_sci.h>
#include <asm/machtypes.h>
static struct resource rtc_resources[] = {
[0] = {
@@ -35,32 +36,36 @@ static struct platform_device rtc_device = {
.resource = rtc_resources,
};
static struct plat_sci_port sci_platform_data[] = {
{
#ifndef CONFIG_SH_RTS7751R2D
.mapbase = 0xffe00000,
.flags = UPF_BOOT_AUTOCONF,
.type = PORT_SCI,
.irqs = { 23, 23, 23, 0 },
}, {
#endif
.mapbase = 0xffe80000,
.flags = UPF_BOOT_AUTOCONF,
.type = PORT_SCIF,
.irqs = { 40, 40, 40, 40 },
}, {
.flags = 0,
}
static struct plat_sci_port sci_platform_data = {
.mapbase = 0xffe00000,
.flags = UPF_BOOT_AUTOCONF,
.type = PORT_SCI,
.scscr = SCSCR_TE | SCSCR_RE,
.irqs = { 23, 23, 23, 0 },
};
static struct platform_device sci_device = {
.name = "sh-sci",
.id = -1,
.dev = {
.platform_data = sci_platform_data,
},
};
static struct plat_sci_port scif_platform_data = {
.mapbase = 0xffe80000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_TE | SCSCR_RE | SCSCR_REIE,
.type = PORT_SCIF,
.irqs = { 40, 40, 40, 40 },
};
static struct platform_device scif_device = {
.name = "sh-sci",
.dev = {
.platform_data = scif_platform_data,
},
};
static struct sh_timer_config tmu0_platform_data = {
.name = "TMU0",
.channel_offset = 0x04,
@@ -222,7 +227,6 @@ static struct platform_device tmu4_device = {
static struct platform_device *sh7750_devices[] __initdata = {
&rtc_device,
&sci_device,
&tmu0_device,
&tmu1_device,
&tmu2_device,
@@ -236,6 +240,14 @@ static struct platform_device *sh7750_devices[] __initdata = {
static int __init sh7750_devices_setup(void)
{
if (mach_is_rts7751r2d()) {
scif_platform_data.scscr |= SCSCR_CKE1;
platform_register_device(&scif_device);
} else {
platform_register_device(&sci_device);
platform_register_device(&scif_device);
}
return platform_add_devices(sh7750_devices,
ARRAY_SIZE(sh7750_devices));
}