aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/sh4a/setup-sh7343.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel/cpu/sh4a/setup-sh7343.c')
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7343.c122
1 files changed, 114 insertions, 8 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7343.c b/arch/sh/kernel/cpu/sh4a/setup-sh7343.c
index c1549382c87c..6307e087c864 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7343.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7343.c
@@ -12,7 +12,7 @@
12#include <linux/serial.h> 12#include <linux/serial.h>
13#include <linux/serial_sci.h> 13#include <linux/serial_sci.h>
14#include <linux/uio_driver.h> 14#include <linux/uio_driver.h>
15#include <linux/sh_cmt.h> 15#include <linux/sh_timer.h>
16#include <asm/clock.h> 16#include <asm/clock.h>
17 17
18static struct resource iic0_resources[] = { 18static struct resource iic0_resources[] = {
@@ -141,7 +141,7 @@ static struct platform_device jpu_device = {
141 .num_resources = ARRAY_SIZE(jpu_resources), 141 .num_resources = ARRAY_SIZE(jpu_resources),
142}; 142};
143 143
144static struct sh_cmt_config cmt_platform_data = { 144static struct sh_timer_config cmt_platform_data = {
145 .name = "CMT", 145 .name = "CMT",
146 .channel_offset = 0x60, 146 .channel_offset = 0x60,
147 .timer_bit = 5, 147 .timer_bit = 5,
@@ -173,27 +173,123 @@ static struct platform_device cmt_device = {
173 .num_resources = ARRAY_SIZE(cmt_resources), 173 .num_resources = ARRAY_SIZE(cmt_resources),
174}; 174};
175 175
176static struct sh_timer_config tmu0_platform_data = {
177 .name = "TMU0",
178 .channel_offset = 0x04,
179 .timer_bit = 0,
180 .clk = "tmu0",
181 .clockevent_rating = 200,
182};
183
184static struct resource tmu0_resources[] = {
185 [0] = {
186 .name = "TMU0",
187 .start = 0xffd80008,
188 .end = 0xffd80013,
189 .flags = IORESOURCE_MEM,
190 },
191 [1] = {
192 .start = 16,
193 .flags = IORESOURCE_IRQ,
194 },
195};
196
197static struct platform_device tmu0_device = {
198 .name = "sh_tmu",
199 .id = 0,
200 .dev = {
201 .platform_data = &tmu0_platform_data,
202 },
203 .resource = tmu0_resources,
204 .num_resources = ARRAY_SIZE(tmu0_resources),
205};
206
207static struct sh_timer_config tmu1_platform_data = {
208 .name = "TMU1",
209 .channel_offset = 0x10,
210 .timer_bit = 1,
211 .clk = "tmu0",
212 .clocksource_rating = 200,
213};
214
215static struct resource tmu1_resources[] = {
216 [0] = {
217 .name = "TMU1",
218 .start = 0xffd80014,
219 .end = 0xffd8001f,
220 .flags = IORESOURCE_MEM,
221 },
222 [1] = {
223 .start = 17,
224 .flags = IORESOURCE_IRQ,
225 },
226};
227
228static struct platform_device tmu1_device = {
229 .name = "sh_tmu",
230 .id = 1,
231 .dev = {
232 .platform_data = &tmu1_platform_data,
233 },
234 .resource = tmu1_resources,
235 .num_resources = ARRAY_SIZE(tmu1_resources),
236};
237
238static struct sh_timer_config tmu2_platform_data = {
239 .name = "TMU2",
240 .channel_offset = 0x1c,
241 .timer_bit = 2,
242 .clk = "tmu0",
243};
244
245static struct resource tmu2_resources[] = {
246 [0] = {
247 .name = "TMU2",
248 .start = 0xffd80020,
249 .end = 0xffd8002b,
250 .flags = IORESOURCE_MEM,
251 },
252 [1] = {
253 .start = 18,
254 .flags = IORESOURCE_IRQ,
255 },
256};
257
258static struct platform_device tmu2_device = {
259 .name = "sh_tmu",
260 .id = 2,
261 .dev = {
262 .platform_data = &tmu2_platform_data,
263 },
264 .resource = tmu2_resources,
265 .num_resources = ARRAY_SIZE(tmu2_resources),
266};
267
176static struct plat_sci_port sci_platform_data[] = { 268static struct plat_sci_port sci_platform_data[] = {
177 { 269 {
178 .mapbase = 0xffe00000, 270 .mapbase = 0xffe00000,
179 .flags = UPF_BOOT_AUTOCONF, 271 .flags = UPF_BOOT_AUTOCONF,
180 .type = PORT_SCIF, 272 .type = PORT_SCIF,
181 .irqs = { 80, 80, 80, 80 }, 273 .irqs = { 80, 80, 80, 80 },
274 .clk = "scif0",
182 }, { 275 }, {
183 .mapbase = 0xffe10000, 276 .mapbase = 0xffe10000,
184 .flags = UPF_BOOT_AUTOCONF, 277 .flags = UPF_BOOT_AUTOCONF,
185 .type = PORT_SCIF, 278 .type = PORT_SCIF,
186 .irqs = { 81, 81, 81, 81 }, 279 .irqs = { 81, 81, 81, 81 },
280 .clk = "scif1",
187 }, { 281 }, {
188 .mapbase = 0xffe20000, 282 .mapbase = 0xffe20000,
189 .flags = UPF_BOOT_AUTOCONF, 283 .flags = UPF_BOOT_AUTOCONF,
190 .type = PORT_SCIF, 284 .type = PORT_SCIF,
191 .irqs = { 82, 82, 82, 82 }, 285 .irqs = { 82, 82, 82, 82 },
286 .clk = "scif2",
192 }, { 287 }, {
193 .mapbase = 0xffe30000, 288 .mapbase = 0xffe30000,
194 .flags = UPF_BOOT_AUTOCONF, 289 .flags = UPF_BOOT_AUTOCONF,
195 .type = PORT_SCIF, 290 .type = PORT_SCIF,
196 .irqs = { 83, 83, 83, 83 }, 291 .irqs = { 83, 83, 83, 83 },
292 .clk = "scif3",
197 }, { 293 }, {
198 .flags = 0, 294 .flags = 0,
199 } 295 }
@@ -209,6 +305,9 @@ static struct platform_device sci_device = {
209 305
210static struct platform_device *sh7343_devices[] __initdata = { 306static struct platform_device *sh7343_devices[] __initdata = {
211 &cmt_device, 307 &cmt_device,
308 &tmu0_device,
309 &tmu1_device,
310 &tmu2_device,
212 &iic0_device, 311 &iic0_device,
213 &iic1_device, 312 &iic1_device,
214 &sci_device, 313 &sci_device,
@@ -219,12 +318,6 @@ static struct platform_device *sh7343_devices[] __initdata = {
219 318
220static int __init sh7343_devices_setup(void) 319static int __init sh7343_devices_setup(void)
221{ 320{
222 clk_always_enable("uram0"); /* URAM */
223 clk_always_enable("xymem0"); /* XYMEM */
224 clk_always_enable("veu0"); /* VEU */
225 clk_always_enable("vpu0"); /* VPU */
226 clk_always_enable("jpu0"); /* JPU */
227
228 platform_resource_setup_memory(&vpu_device, "vpu", 1 << 20); 321 platform_resource_setup_memory(&vpu_device, "vpu", 1 << 20);
229 platform_resource_setup_memory(&veu_device, "veu", 2 << 20); 322 platform_resource_setup_memory(&veu_device, "veu", 2 << 20);
230 platform_resource_setup_memory(&jpu_device, "jpu", 2 << 20); 323 platform_resource_setup_memory(&jpu_device, "jpu", 2 << 20);
@@ -234,6 +327,19 @@ static int __init sh7343_devices_setup(void)
234} 327}
235__initcall(sh7343_devices_setup); 328__initcall(sh7343_devices_setup);
236 329
330static struct platform_device *sh7343_early_devices[] __initdata = {
331 &cmt_device,
332 &tmu0_device,
333 &tmu1_device,
334 &tmu2_device,
335};
336
337void __init plat_early_device_setup(void)
338{
339 early_platform_add_devices(sh7343_early_devices,
340 ARRAY_SIZE(sh7343_early_devices));
341}
342
237enum { 343enum {
238 UNUSED = 0, 344 UNUSED = 0,
239 345