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>
34 static struct plat_sci_port scif0_platform_data
= {
35 .mapbase
= 0xe6c40000,
36 .flags
= UPF_BOOT_AUTOCONF
,
38 .irqs
= { 80, 80, 80, 80 },
41 static struct platform_device scif0_device
= {
45 .platform_data
= &scif0_platform_data
,
49 static struct plat_sci_port scif1_platform_data
= {
50 .mapbase
= 0xe6c50000,
51 .flags
= UPF_BOOT_AUTOCONF
,
53 .irqs
= { 81, 81, 81, 81 },
56 static struct platform_device scif1_device
= {
60 .platform_data
= &scif1_platform_data
,
64 static struct plat_sci_port scif2_platform_data
= {
65 .mapbase
= 0xe6c60000,
66 .flags
= UPF_BOOT_AUTOCONF
,
68 .irqs
= { 82, 82, 82, 82 },
71 static struct platform_device scif2_device
= {
75 .platform_data
= &scif2_platform_data
,
79 static struct plat_sci_port scif3_platform_data
= {
80 .mapbase
= 0xe6c70000,
81 .flags
= UPF_BOOT_AUTOCONF
,
83 .irqs
= { 83, 83, 83, 83 },
86 static struct platform_device scif3_device
= {
90 .platform_data
= &scif3_platform_data
,
94 static struct plat_sci_port scif4_platform_data
= {
95 .mapbase
= 0xe6c80000,
96 .flags
= UPF_BOOT_AUTOCONF
,
98 .irqs
= { 89, 89, 89, 89 },
101 static struct platform_device scif4_device
= {
105 .platform_data
= &scif4_platform_data
,
109 static struct plat_sci_port scif5_platform_data
= {
110 .mapbase
= 0xe6cb0000,
111 .flags
= UPF_BOOT_AUTOCONF
,
113 .irqs
= { 90, 90, 90, 90 },
116 static struct platform_device scif5_device
= {
120 .platform_data
= &scif5_platform_data
,
124 static struct plat_sci_port scif6_platform_data
= {
125 .mapbase
= 0xe6c30000,
126 .flags
= UPF_BOOT_AUTOCONF
,
128 .irqs
= { 91, 91, 91, 91 },
131 static struct platform_device scif6_device
= {
135 .platform_data
= &scif6_platform_data
,
139 static struct sh_timer_config cmt10_platform_data
= {
141 .channel_offset
= 0x10,
144 .clockevent_rating
= 125,
145 .clocksource_rating
= 125,
148 static struct resource cmt10_resources
[] = {
153 .flags
= IORESOURCE_MEM
,
157 .flags
= IORESOURCE_IRQ
,
161 static struct platform_device cmt10_device
= {
165 .platform_data
= &cmt10_platform_data
,
167 .resource
= cmt10_resources
,
168 .num_resources
= ARRAY_SIZE(cmt10_resources
),
171 static struct platform_device
*sh7367_early_devices
[] __initdata
= {
182 void __init
sh7367_add_standard_devices(void)
184 platform_add_devices(sh7367_early_devices
,
185 ARRAY_SIZE(sh7367_early_devices
));
188 #define SYMSTPCR2 0xe6158048
189 #define SYMSTPCR2_CMT1 (1 << 29)
191 void __init
sh7367_add_early_devices(void)
193 /* enable clock to CMT1 */
194 __raw_writel(__raw_readl(SYMSTPCR2
) & ~SYMSTPCR2_CMT1
, SYMSTPCR2
);
196 early_platform_add_devices(sh7367_early_devices
,
197 ARRAY_SIZE(sh7367_early_devices
));