2 * sh7367 processor support
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2008 Yoshihiro Shimoda
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #include <linux/kernel.h>
21 #include <linux/init.h>
22 #include <linux/interrupt.h>
23 #include <linux/irq.h>
24 #include <linux/platform_device.h>
25 #include <linux/delay.h>
26 #include <linux/input.h>
28 #include <linux/serial_sci.h>
29 #include <linux/sh_timer.h>
30 #include <mach/hardware.h>
31 #include <asm/mach-types.h>
32 #include <asm/mach/arch.h>
35 static struct plat_sci_port scif0_platform_data
= {
36 .mapbase
= 0xe6c40000,
37 .flags
= UPF_BOOT_AUTOCONF
,
39 .irqs
= { evt2irq(0xc00), evt2irq(0xc00),
40 evt2irq(0xc00), evt2irq(0xc00) },
43 static struct platform_device scif0_device
= {
47 .platform_data
= &scif0_platform_data
,
52 static struct plat_sci_port scif1_platform_data
= {
53 .mapbase
= 0xe6c50000,
54 .flags
= UPF_BOOT_AUTOCONF
,
56 .irqs
= { evt2irq(0xc20), evt2irq(0xc20),
57 evt2irq(0xc20), evt2irq(0xc20) },
60 static struct platform_device scif1_device
= {
64 .platform_data
= &scif1_platform_data
,
69 static struct plat_sci_port scif2_platform_data
= {
70 .mapbase
= 0xe6c60000,
71 .flags
= UPF_BOOT_AUTOCONF
,
73 .irqs
= { evt2irq(0xc40), evt2irq(0xc40),
74 evt2irq(0xc40), evt2irq(0xc40) },
77 static struct platform_device scif2_device
= {
81 .platform_data
= &scif2_platform_data
,
86 static struct plat_sci_port scif3_platform_data
= {
87 .mapbase
= 0xe6c70000,
88 .flags
= UPF_BOOT_AUTOCONF
,
90 .irqs
= { evt2irq(0xc60), evt2irq(0xc60),
91 evt2irq(0xc60), evt2irq(0xc60) },
94 static struct platform_device scif3_device
= {
98 .platform_data
= &scif3_platform_data
,
103 static struct plat_sci_port scif4_platform_data
= {
104 .mapbase
= 0xe6c80000,
105 .flags
= UPF_BOOT_AUTOCONF
,
107 .irqs
= { evt2irq(0xd20), evt2irq(0xd20),
108 evt2irq(0xd20), evt2irq(0xd20) },
111 static struct platform_device scif4_device
= {
115 .platform_data
= &scif4_platform_data
,
120 static struct plat_sci_port scif5_platform_data
= {
121 .mapbase
= 0xe6cb0000,
122 .flags
= UPF_BOOT_AUTOCONF
,
124 .irqs
= { evt2irq(0xd40), evt2irq(0xd40),
125 evt2irq(0xd40), evt2irq(0xd40) },
128 static struct platform_device scif5_device
= {
132 .platform_data
= &scif5_platform_data
,
137 static struct plat_sci_port scif6_platform_data
= {
138 .mapbase
= 0xe6c30000,
139 .flags
= UPF_BOOT_AUTOCONF
,
141 .irqs
= { evt2irq(0xd60), evt2irq(0xd60),
142 evt2irq(0xd60), evt2irq(0xd60) },
145 static struct platform_device scif6_device
= {
149 .platform_data
= &scif6_platform_data
,
153 static struct sh_timer_config cmt10_platform_data
= {
155 .channel_offset
= 0x10,
158 .clockevent_rating
= 125,
159 .clocksource_rating
= 125,
162 static struct resource cmt10_resources
[] = {
167 .flags
= IORESOURCE_MEM
,
170 .start
= evt2irq(0xb00), /* CMT1_CMT10 */
171 .flags
= IORESOURCE_IRQ
,
175 static struct platform_device cmt10_device
= {
179 .platform_data
= &cmt10_platform_data
,
181 .resource
= cmt10_resources
,
182 .num_resources
= ARRAY_SIZE(cmt10_resources
),
185 static struct platform_device
*sh7367_early_devices
[] __initdata
= {
196 void __init
sh7367_add_standard_devices(void)
198 platform_add_devices(sh7367_early_devices
,
199 ARRAY_SIZE(sh7367_early_devices
));
202 #define SYMSTPCR2 0xe6158048
203 #define SYMSTPCR2_CMT1 (1 << 29)
205 void __init
sh7367_add_early_devices(void)
207 /* enable clock to CMT1 */
208 __raw_writel(__raw_readl(SYMSTPCR2
) & ~SYMSTPCR2_CMT1
, SYMSTPCR2
);
210 early_platform_add_devices(sh7367_early_devices
,
211 ARRAY_SIZE(sh7367_early_devices
));