Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux...
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / sh / kernel / cpu / sh2 / setup-sh7619.c
index 86acede777b99676b49b70a43474b37bda5c2c78..0f8befccf9fad37116e12172baf93184051da20f 100644 (file)
@@ -59,38 +59,54 @@ static struct intc_prio_reg prio_registers[] __initdata = {
 static DECLARE_INTC_DESC(intc_desc, "sh7619", vectors, NULL,
                         NULL, prio_registers, NULL);
 
-static struct plat_sci_port sci_platform_data[] = {
-       {
-               .mapbase        = 0xf8400000,
-               .flags          = UPF_BOOT_AUTOCONF,
-               .scscr          = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
-               .scbrr_algo_id  = SCBRR_ALGO_2,
-               .type           = PORT_SCIF,
-               .irqs           = { 88, 88, 88, 88 },
-       }, {
-               .mapbase        = 0xf8410000,
-               .flags          = UPF_BOOT_AUTOCONF,
-               .scscr          = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
-               .scbrr_algo_id  = SCBRR_ALGO_2,
-               .type           = PORT_SCIF,
-               .irqs           = { 92, 92, 92, 92 },
-       }, {
-               .mapbase        = 0xf8420000,
-               .flags          = UPF_BOOT_AUTOCONF,
-               .scscr          = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
-               .scbrr_algo_id  = SCBRR_ALGO_2,
-               .type           = PORT_SCIF,
-               .irqs           = { 96, 96, 96, 96 },
-       }, {
-               .flags = 0,
-       }
-};
-
-static struct platform_device sci_device = {
+static struct plat_sci_port scif0_platform_data = {
+       .mapbase        = 0xf8400000,
+       .flags          = UPF_BOOT_AUTOCONF,
+       .scscr          = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
+       .scbrr_algo_id  = SCBRR_ALGO_2,
+       .type           = PORT_SCIF,
+       .irqs           = { 88, 88, 88, 88 },
+};
+
+static struct platform_device scif0_device = {
+       .name           = "sh-sci",
+       .id             = 0,
+       .dev            = {
+               .platform_data  = &scif0_platform_data,
+       },
+};
+
+static struct plat_sci_port scif1_platform_data = {
+       .mapbase        = 0xf8410000,
+       .flags          = UPF_BOOT_AUTOCONF,
+       .scscr          = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
+       .scbrr_algo_id  = SCBRR_ALGO_2,
+       .type           = PORT_SCIF,
+       .irqs           = { 92, 92, 92, 92 },
+};
+
+static struct platform_device scif1_device = {
+       .name           = "sh-sci",
+       .id             = 1,
+       .dev            = {
+               .platform_data  = &scif1_platform_data,
+       },
+};
+
+static struct plat_sci_port scif2_platform_data = {
+       .mapbase        = 0xf8420000,
+       .flags          = UPF_BOOT_AUTOCONF,
+       .scscr          = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
+       .scbrr_algo_id  = SCBRR_ALGO_2,
+       .type           = PORT_SCIF,
+       .irqs           = { 96, 96, 96, 96 },
+};
+
+static struct platform_device scif2_device = {
        .name           = "sh-sci",
-       .id             = -1,
+       .id             = 2,
        .dev            = {
-               .platform_data  = sci_platform_data,
+               .platform_data  = &scif2_platform_data,
        },
 };
 
@@ -118,17 +134,14 @@ static struct platform_device eth_device = {
 };
 
 static struct sh_timer_config cmt0_platform_data = {
-       .name = "CMT0",
        .channel_offset = 0x02,
        .timer_bit = 0,
-       .clk = "peripheral_clk",
        .clockevent_rating = 125,
        .clocksource_rating = 0, /* disabled due to code generation issues */
 };
 
 static struct resource cmt0_resources[] = {
        [0] = {
-               .name   = "CMT0",
                .start  = 0xf84a0072,
                .end    = 0xf84a0077,
                .flags  = IORESOURCE_MEM,
@@ -150,17 +163,14 @@ static struct platform_device cmt0_device = {
 };
 
 static struct sh_timer_config cmt1_platform_data = {
-       .name = "CMT1",
        .channel_offset = 0x08,
        .timer_bit = 1,
-       .clk = "peripheral_clk",
        .clockevent_rating = 125,
        .clocksource_rating = 0, /* disabled due to code generation issues */
 };
 
 static struct resource cmt1_resources[] = {
        [0] = {
-               .name   = "CMT1",
                .start  = 0xf84a0078,
                .end    = 0xf84a007d,
                .flags  = IORESOURCE_MEM,
@@ -182,7 +192,9 @@ static struct platform_device cmt1_device = {
 };
 
 static struct platform_device *sh7619_devices[] __initdata = {
-       &sci_device,
+       &scif0_device,
+       &scif1_device,
+       &scif2_device,
        &eth_device,
        &cmt0_device,
        &cmt1_device,
@@ -193,7 +205,7 @@ static int __init sh7619_devices_setup(void)
        return platform_add_devices(sh7619_devices,
                                    ARRAY_SIZE(sh7619_devices));
 }
-__initcall(sh7619_devices_setup);
+arch_initcall(sh7619_devices_setup);
 
 void __init plat_irq_setup(void)
 {
@@ -201,6 +213,9 @@ void __init plat_irq_setup(void)
 }
 
 static struct platform_device *sh7619_early_devices[] __initdata = {
+       &scif0_device,
+       &scif1_device,
+       &scif2_device,
        &cmt0_device,
        &cmt1_device,
 };