hwmon: coretemp: documentation update and cleanup
[linux-2.6/kvm.git] / arch / arm / mach-shmobile / setup-sh7367.c
blobeca90716140e25c69aa3e07d1a71962e7c262e90
1 /*
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>
27 #include <linux/io.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,
37 .type = PORT_SCIF,
38 .irqs = { 80, 80, 80, 80 },
41 static struct platform_device scif0_device = {
42 .name = "sh-sci",
43 .id = 0,
44 .dev = {
45 .platform_data = &scif0_platform_data,
49 static struct plat_sci_port scif1_platform_data = {
50 .mapbase = 0xe6c50000,
51 .flags = UPF_BOOT_AUTOCONF,
52 .type = PORT_SCIF,
53 .irqs = { 81, 81, 81, 81 },
56 static struct platform_device scif1_device = {
57 .name = "sh-sci",
58 .id = 1,
59 .dev = {
60 .platform_data = &scif1_platform_data,
64 static struct plat_sci_port scif2_platform_data = {
65 .mapbase = 0xe6c60000,
66 .flags = UPF_BOOT_AUTOCONF,
67 .type = PORT_SCIF,
68 .irqs = { 82, 82, 82, 82 },
71 static struct platform_device scif2_device = {
72 .name = "sh-sci",
73 .id = 2,
74 .dev = {
75 .platform_data = &scif2_platform_data,
79 static struct plat_sci_port scif3_platform_data = {
80 .mapbase = 0xe6c70000,
81 .flags = UPF_BOOT_AUTOCONF,
82 .type = PORT_SCIF,
83 .irqs = { 83, 83, 83, 83 },
86 static struct platform_device scif3_device = {
87 .name = "sh-sci",
88 .id = 3,
89 .dev = {
90 .platform_data = &scif3_platform_data,
94 static struct plat_sci_port scif4_platform_data = {
95 .mapbase = 0xe6c80000,
96 .flags = UPF_BOOT_AUTOCONF,
97 .type = PORT_SCIF,
98 .irqs = { 89, 89, 89, 89 },
101 static struct platform_device scif4_device = {
102 .name = "sh-sci",
103 .id = 4,
104 .dev = {
105 .platform_data = &scif4_platform_data,
109 static struct plat_sci_port scif5_platform_data = {
110 .mapbase = 0xe6cb0000,
111 .flags = UPF_BOOT_AUTOCONF,
112 .type = PORT_SCIF,
113 .irqs = { 90, 90, 90, 90 },
116 static struct platform_device scif5_device = {
117 .name = "sh-sci",
118 .id = 5,
119 .dev = {
120 .platform_data = &scif5_platform_data,
124 static struct plat_sci_port scif6_platform_data = {
125 .mapbase = 0xe6c30000,
126 .flags = UPF_BOOT_AUTOCONF,
127 .type = PORT_SCIF,
128 .irqs = { 91, 91, 91, 91 },
131 static struct platform_device scif6_device = {
132 .name = "sh-sci",
133 .id = 6,
134 .dev = {
135 .platform_data = &scif6_platform_data,
139 static struct sh_timer_config cmt10_platform_data = {
140 .name = "CMT10",
141 .channel_offset = 0x10,
142 .timer_bit = 0,
143 .clk = "r_clk",
144 .clockevent_rating = 125,
145 .clocksource_rating = 125,
148 static struct resource cmt10_resources[] = {
149 [0] = {
150 .name = "CMT10",
151 .start = 0xe6138010,
152 .end = 0xe613801b,
153 .flags = IORESOURCE_MEM,
155 [1] = {
156 .start = 72,
157 .flags = IORESOURCE_IRQ,
161 static struct platform_device cmt10_device = {
162 .name = "sh_cmt",
163 .id = 10,
164 .dev = {
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 = {
172 &scif0_device,
173 &scif1_device,
174 &scif2_device,
175 &scif3_device,
176 &scif4_device,
177 &scif5_device,
178 &scif6_device,
179 &cmt10_device,
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));