2 * SH5-101/SH5-103 CPU Setup
4 * Copyright (C) 2009 Paul Mundt
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
10 #include <linux/platform_device.h>
11 #include <linux/init.h>
12 #include <linux/serial.h>
13 #include <linux/serial_sci.h>
16 #include <linux/sh_timer.h>
17 #include <asm/addrspace.h>
19 static struct plat_sci_port scif0_platform_data
= {
20 .mapbase
= PHYS_PERIPHERAL_BLOCK
+ 0x01030000,
21 .flags
= UPF_BOOT_AUTOCONF
| UPF_IOREMAP
,
23 .irqs
= { 39, 40, 42, 0 },
26 static struct platform_device scif0_device
= {
30 .platform_data
= &scif0_platform_data
,
34 static struct resource rtc_resources
[] = {
36 .start
= PHYS_PERIPHERAL_BLOCK
+ 0x01040000,
37 .end
= PHYS_PERIPHERAL_BLOCK
+ 0x01040000 + 0x58 - 1,
38 .flags
= IORESOURCE_IO
,
43 .flags
= IORESOURCE_IRQ
,
48 .flags
= IORESOURCE_IRQ
,
53 .flags
= IORESOURCE_IRQ
,
57 static struct platform_device rtc_device
= {
60 .num_resources
= ARRAY_SIZE(rtc_resources
),
61 .resource
= rtc_resources
,
64 #define TMU_BLOCK_OFF 0x01020000
65 #define TMU_BASE PHYS_PERIPHERAL_BLOCK + TMU_BLOCK_OFF
66 #define TMU0_BASE (TMU_BASE + 0x8 + (0xc * 0x0))
67 #define TMU1_BASE (TMU_BASE + 0x8 + (0xc * 0x1))
68 #define TMU2_BASE (TMU_BASE + 0x8 + (0xc * 0x2))
70 static struct sh_timer_config tmu0_platform_data
= {
71 .channel_offset
= 0x04,
73 .clockevent_rating
= 200,
76 static struct resource tmu0_resources
[] = {
79 .end
= TMU0_BASE
+ 0xc - 1,
80 .flags
= IORESOURCE_MEM
,
84 .flags
= IORESOURCE_IRQ
,
88 static struct platform_device tmu0_device
= {
92 .platform_data
= &tmu0_platform_data
,
94 .resource
= tmu0_resources
,
95 .num_resources
= ARRAY_SIZE(tmu0_resources
),
98 static struct sh_timer_config tmu1_platform_data
= {
99 .channel_offset
= 0x10,
101 .clocksource_rating
= 200,
104 static struct resource tmu1_resources
[] = {
107 .end
= TMU1_BASE
+ 0xc - 1,
108 .flags
= IORESOURCE_MEM
,
112 .flags
= IORESOURCE_IRQ
,
116 static struct platform_device tmu1_device
= {
120 .platform_data
= &tmu1_platform_data
,
122 .resource
= tmu1_resources
,
123 .num_resources
= ARRAY_SIZE(tmu1_resources
),
126 static struct sh_timer_config tmu2_platform_data
= {
127 .channel_offset
= 0x1c,
131 static struct resource tmu2_resources
[] = {
134 .end
= TMU2_BASE
+ 0xc - 1,
135 .flags
= IORESOURCE_MEM
,
139 .flags
= IORESOURCE_IRQ
,
143 static struct platform_device tmu2_device
= {
147 .platform_data
= &tmu2_platform_data
,
149 .resource
= tmu2_resources
,
150 .num_resources
= ARRAY_SIZE(tmu2_resources
),
153 static struct platform_device
*sh5_early_devices
[] __initdata
= {
160 static struct platform_device
*sh5_devices
[] __initdata
= {
164 static int __init
sh5_devices_setup(void)
168 ret
= platform_add_devices(sh5_early_devices
,
169 ARRAY_SIZE(sh5_early_devices
));
170 if (unlikely(ret
!= 0))
173 return platform_add_devices(sh5_devices
,
174 ARRAY_SIZE(sh5_devices
));
176 arch_initcall(sh5_devices_setup
);
178 void __init
plat_early_device_setup(void)
180 early_platform_add_devices(sh5_early_devices
,
181 ARRAY_SIZE(sh5_early_devices
));