aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/sh3
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2009-12-14 07:30:05 -0500
committerPaul Mundt <lethal@linux-sh.org>2009-12-14 22:06:32 -0500
commit44658dfb660c4744b862571a3d8e1dae65e8b75a (patch)
tree0123bb959e8c96d9a49bc3cc7acc5f2293c964a5 /arch/sh/kernel/cpu/sh3
parentbe091d20efe7b045ca02bdf91c63c72d91f5899d (diff)
sh: sh3 scif pdata (sh7705/sh770x/sh7710/sh7720)
This patch breaks out the sh3 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. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/sh3')
-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
4 files changed, 142 insertions, 87 deletions
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,