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 sci_platform_data
[] = {
21 .mapbase
= PHYS_PERIPHERAL_BLOCK
+ 0x01030000,
22 .flags
= UPF_BOOT_AUTOCONF
| UPF_IOREMAP
,
24 .irqs
= { 39, 40, 42, 0 },
30 static struct platform_device sci_device
= {
34 .platform_data
= sci_platform_data
,
38 static struct resource rtc_resources
[] = {
40 .start
= PHYS_PERIPHERAL_BLOCK
+ 0x01040000,
41 .end
= PHYS_PERIPHERAL_BLOCK
+ 0x01040000 + 0x58 - 1,
42 .flags
= IORESOURCE_IO
,
47 .flags
= IORESOURCE_IRQ
,
52 .flags
= IORESOURCE_IRQ
,
57 .flags
= IORESOURCE_IRQ
,
61 static struct platform_device rtc_device
= {
64 .num_resources
= ARRAY_SIZE(rtc_resources
),
65 .resource
= rtc_resources
,
68 #define TMU_BLOCK_OFF 0x01020000
69 #define TMU_BASE PHYS_PERIPHERAL_BLOCK + TMU_BLOCK_OFF
70 #define TMU0_BASE (TMU_BASE + 0x8 + (0xc * 0x0))
71 #define TMU1_BASE (TMU_BASE + 0x8 + (0xc * 0x1))
72 #define TMU2_BASE (TMU_BASE + 0x8 + (0xc * 0x2))
74 static struct sh_timer_config tmu0_platform_data
= {
76 .channel_offset
= 0x04,
78 .clk
= "peripheral_clk",
79 .clockevent_rating
= 200,
82 static struct resource tmu0_resources
[] = {
86 .end
= TMU0_BASE
+ 0xc - 1,
87 .flags
= IORESOURCE_MEM
,
91 .flags
= IORESOURCE_IRQ
,
95 static struct platform_device tmu0_device
= {
99 .platform_data
= &tmu0_platform_data
,
101 .resource
= tmu0_resources
,
102 .num_resources
= ARRAY_SIZE(tmu0_resources
),
105 static struct sh_timer_config tmu1_platform_data
= {
107 .channel_offset
= 0x10,
109 .clk
= "peripheral_clk",
110 .clocksource_rating
= 200,
113 static struct resource tmu1_resources
[] = {
117 .end
= TMU1_BASE
+ 0xc - 1,
118 .flags
= IORESOURCE_MEM
,
122 .flags
= IORESOURCE_IRQ
,
126 static struct platform_device tmu1_device
= {
130 .platform_data
= &tmu1_platform_data
,
132 .resource
= tmu1_resources
,
133 .num_resources
= ARRAY_SIZE(tmu1_resources
),
136 static struct sh_timer_config tmu2_platform_data
= {
138 .channel_offset
= 0x1c,
140 .clk
= "peripheral_clk",
143 static struct resource tmu2_resources
[] = {
147 .end
= TMU2_BASE
+ 0xc - 1,
148 .flags
= IORESOURCE_MEM
,
152 .flags
= IORESOURCE_IRQ
,
156 static struct platform_device tmu2_device
= {
160 .platform_data
= &tmu2_platform_data
,
162 .resource
= tmu2_resources
,
163 .num_resources
= ARRAY_SIZE(tmu2_resources
),
166 static struct platform_device
*sh5_early_devices
[] __initdata
= {
172 static struct platform_device
*sh5_devices
[] __initdata
= {
177 static int __init
sh5_devices_setup(void)
181 ret
= platform_add_devices(sh5_early_devices
,
182 ARRAY_SIZE(sh5_early_devices
));
183 if (unlikely(ret
!= 0))
186 return platform_add_devices(sh5_devices
,
187 ARRAY_SIZE(sh5_devices
));
189 arch_initcall(sh5_devices_setup
);
191 void __init
plat_early_device_setup(void)
193 early_platform_add_devices(sh5_early_devices
,
194 ARRAY_SIZE(sh5_early_devices
));