Skip to contentSkip to conversation

sh: sh4a scif pdata (sh7757/sh7763/sh7770/sh7780/sh7785/sh7786/x3)

PATCH New Magnus Damm 1 participant 1 message Dec 14, 2009 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 6/7 sh: sh4a scif pdata (sh7757/sh7763/sh7770/sh7780/sh7785/sh7786/x3)

From: Magnus Damm <[email protected]>

This patch breaks out the sh4a scif serial port platform data from a shared platform device to one platform device per port. Also, add serial ports to the list of early platform devices.

All sh4a except SuperH Mobile processors are modified by this patch.

While at it, sh7757 gets early platform device support.

---

 arch/sh/kernel/cpu/sh4a/setup-sh7757.c |   92 ++++++++-----
 arch/sh/kernel/cpu/sh4a/setup-sh7763.c |   81 +++++++----
 arch/sh/kernel/cpu/sh4a/setup-sh7770.c |  221 +++++++++++++++++++++++---------
 arch/sh/kernel/cpu/sh4a/setup-sh7780.c |   60 ++++----
 arch/sh/kernel/cpu/sh4a/setup-sh7785.c |  159 +++++++++++++++--------
 arch/sh/kernel/cpu/sh4a/setup-sh7786.c |  132 +++++++++++++------
 arch/sh/kernel/cpu/sh4a/setup-shx3.c   |   76 ++++++-----
 7 files changed, 551 insertions(+), 270 deletions(-)
arch/sh/kernel/cpu/sh4a/setup-sh7757.c +62 -30
@@ -17,6 +17,51 @@
 #include <linux/mm.h>
 #include <linux/sh_timer.h>
 
+static struct plat_sci_port scif2_platform_data = {
+	.mapbase	= 0xfe4b0000,		/* SCIF2 */
+	.flags		= UPF_BOOT_AUTOCONF,
+	.type		= PORT_SCIF,
+	.irqs		= { 40, 40, 40, 40 },
+};
+
+static struct platform_device scif2_device = {
+	.name		= "sh-sci",
+	.id		= 2,
+	.dev		= {
+		.platform_data	= &scif2_platform_data,
+	},
+};
+
+static struct plat_sci_port scif3_platform_data = {
+	.mapbase	= 0xfe4c0000,		/* SCIF3 */
+	.flags		= UPF_BOOT_AUTOCONF,
+	.type		= PORT_SCIF,
+	.irqs		= { 76, 76, 76, 76 },
+};
+
+static struct platform_device scif3_device = {
+	.name		= "sh-sci",
+	.id		= 3,
+	.dev		= {
+		.platform_data	= &scif3_platform_data,
+	},
+};
+
+static struct plat_sci_port scif4_platform_data = {
+	.mapbase	= 0xfe4d0000,		/* SCIF4 */
+	.flags		= UPF_BOOT_AUTOCONF,
+	.type		= PORT_SCIF,
+	.irqs		= { 104, 104, 104, 104 },
+};
+
+static struct platform_device scif4_device = {
+	.name		= "sh-sci",
+	.id		= 4,
+	.dev		= {
+		.platform_data	= &scif4_platform_data,
+	},
+};
+
 static struct sh_timer_config tmu0_platform_data = {
 	.name = "TMU0",
 	.channel_offset = 0x04,
@@ -79,39 +124,12 @@ static struct platform_device tmu1_devic
 	.num_resources	= ARRAY_SIZE(tmu1_resources),
 };
 
-static struct plat_sci_port sci_platform_data[] = {
-	{
-		.mapbase	= 0xfe4b0000,		/* SCIF2 */
-		.flags		= UPF_BOOT_AUTOCONF,
-		.type		= PORT_SCIF,
-		.irqs		= { 40, 40, 40, 40 },
-	}, {
-		.mapbase	= 0xfe4c0000,		/* SCIF3 */
-		.flags		= UPF_BOOT_AUTOCONF,
-		.type		= PORT_SCIF,
-		.irqs		= { 76, 76, 76, 76 },
-	}, {
-		.mapbase	= 0xfe4d0000,		/* SCIF4 */
-		.flags		= UPF_BOOT_AUTOCONF,
-		.type		= PORT_SCIF,
-		.irqs		= { 104, 104, 104, 104 },
-	}, {
-		.flags = 0,
-	}
-};
-
-static struct platform_device sci_device = {
-	.name		= "sh-sci",
-	.id		= -1,
-	.dev		= {
-		.platform_data	= sci_platform_data,
-	},
-};
-
 static struct platform_device *sh7757_devices[] __initdata = {
+	&scif2_device,
+	&scif3_device,
+	&scif4_device,
 	&tmu0_device,
 	&tmu1_device,
-	&sci_device,
 };
 
 static int __init sh7757_devices_setup(void)
@@ -121,6 +139,20 @@ static int __init sh7757_devices_setup(v
 }
 arch_initcall(sh7757_devices_setup);
 
+static struct platform_device *sh7757_early_devices[] __initdata = {
+	&scif2_device,
+	&scif3_device,
+	&scif4_device,
+	&tmu0_device,
+	&tmu1_device,
+};
+
+void __init plat_early_device_setup(void)
+{
+	early_platform_add_devices(sh7757_early_devices,
+				   ARRAY_SIZE(sh7757_early_devices));
+}
+
 enum {
 	UNUSED = 0,
 
arch/sh/kernel/cpu/sh4a/setup-sh7763.c +51 -30

111 lines not on this page · raw message

arch/sh/kernel/cpu/sh4a/setup-sh7770.c +163 -58

249 lines not on this page · raw message

arch/sh/kernel/cpu/sh4a/setup-sh7780.c +34 -26

91 lines not on this page · raw message

arch/sh/kernel/cpu/sh4a/setup-sh7785.c +108 -51

184 lines not on this page · raw message

arch/sh/kernel/cpu/sh4a/setup-sh7786.c +91 -41

155 lines not on this page · raw message

arch/sh/kernel/cpu/sh4a/setup-shx3.c +42 -34

101 lines not on this page · raw message