aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2009-05-11 07:37:16 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-05-11 09:02:04 -0400
commitccc195655fb25d7d967b278c4a4725dc5e7a6bf4 (patch)
treece3ccdaae159b6034e28650f768e951b828d5948 /arch/sh/kernel
parent50e2d0d3b4ffc945a6c27f16d4e5e557e725ec67 (diff)
sh: TMU platform data for sh7780
This patch adds TMU platform data for sh7780. Both clockevent and clocksource support is enabled. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7780.c204
1 files changed, 204 insertions, 0 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
index 6f7227cd65bf..f1df02095062 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
@@ -12,6 +12,189 @@
12#include <linux/serial.h> 12#include <linux/serial.h>
13#include <linux/io.h> 13#include <linux/io.h>
14#include <linux/serial_sci.h> 14#include <linux/serial_sci.h>
15#include <linux/sh_timer.h>
16
17static struct sh_timer_config tmu0_platform_data = {
18 .name = "TMU0",
19 .channel_offset = 0x04,
20 .timer_bit = 0,
21 .clk = "module_clk",
22 .clockevent_rating = 200,
23};
24
25static struct resource tmu0_resources[] = {
26 [0] = {
27 .name = "TMU0",
28 .start = 0xffd80008,
29 .end = 0xffd80013,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .start = 28,
34 .flags = IORESOURCE_IRQ,
35 },
36};
37
38static struct platform_device tmu0_device = {
39 .name = "sh_tmu",
40 .id = 0,
41 .dev = {
42 .platform_data = &tmu0_platform_data,
43 },
44 .resource = tmu0_resources,
45 .num_resources = ARRAY_SIZE(tmu0_resources),
46};
47
48static struct sh_timer_config tmu1_platform_data = {
49 .name = "TMU1",
50 .channel_offset = 0x10,
51 .timer_bit = 1,
52 .clk = "module_clk",
53 .clocksource_rating = 200,
54};
55
56static struct resource tmu1_resources[] = {
57 [0] = {
58 .name = "TMU1",
59 .start = 0xffd80014,
60 .end = 0xffd8001f,
61 .flags = IORESOURCE_MEM,
62 },
63 [1] = {
64 .start = 29,
65 .flags = IORESOURCE_IRQ,
66 },
67};
68
69static struct platform_device tmu1_device = {
70 .name = "sh_tmu",
71 .id = 1,
72 .dev = {
73 .platform_data = &tmu1_platform_data,
74 },
75 .resource = tmu1_resources,
76 .num_resources = ARRAY_SIZE(tmu1_resources),
77};
78
79static struct sh_timer_config tmu2_platform_data = {
80 .name = "TMU2",
81 .channel_offset = 0x1c,
82 .timer_bit = 2,
83 .clk = "module_clk",
84};
85
86static struct resource tmu2_resources[] = {
87 [0] = {
88 .name = "TMU2",
89 .start = 0xffd80020,
90 .end = 0xffd8002f,
91 .flags = IORESOURCE_MEM,
92 },
93 [1] = {
94 .start = 30,
95 .flags = IORESOURCE_IRQ,
96 },
97};
98
99static struct platform_device tmu2_device = {
100 .name = "sh_tmu",
101 .id = 2,
102 .dev = {
103 .platform_data = &tmu2_platform_data,
104 },
105 .resource = tmu2_resources,
106 .num_resources = ARRAY_SIZE(tmu2_resources),
107};
108
109static struct sh_timer_config tmu3_platform_data = {
110 .name = "TMU3",
111 .channel_offset = 0x04,
112 .timer_bit = 0,
113 .clk = "module_clk",
114};
115
116static struct resource tmu3_resources[] = {
117 [0] = {
118 .name = "TMU3",
119 .start = 0xffdc0008,
120 .end = 0xffdc0013,
121 .flags = IORESOURCE_MEM,
122 },
123 [1] = {
124 .start = 96,
125 .flags = IORESOURCE_IRQ,
126 },
127};
128
129static struct platform_device tmu3_device = {
130 .name = "sh_tmu",
131 .id = 3,
132 .dev = {
133 .platform_data = &tmu3_platform_data,
134 },
135 .resource = tmu3_resources,
136 .num_resources = ARRAY_SIZE(tmu3_resources),
137};
138
139static struct sh_timer_config tmu4_platform_data = {
140 .name = "TMU4",
141 .channel_offset = 0x10,
142 .timer_bit = 1,
143 .clk = "module_clk",
144};
145
146static struct resource tmu4_resources[] = {
147 [0] = {
148 .name = "TMU4",
149 .start = 0xffdc0014,
150 .end = 0xffdc001f,
151 .flags = IORESOURCE_MEM,
152 },
153 [1] = {
154 .start = 97,
155 .flags = IORESOURCE_IRQ,
156 },
157};
158
159static struct platform_device tmu4_device = {
160 .name = "sh_tmu",
161 .id = 4,
162 .dev = {
163 .platform_data = &tmu4_platform_data,
164 },
165 .resource = tmu4_resources,
166 .num_resources = ARRAY_SIZE(tmu4_resources),
167};
168
169static struct sh_timer_config tmu5_platform_data = {
170 .name = "TMU5",
171 .channel_offset = 0x1c,
172 .timer_bit = 2,
173 .clk = "module_clk",
174};
175
176static struct resource tmu5_resources[] = {
177 [0] = {
178 .name = "TMU5",
179 .start = 0xffdc0020,
180 .end = 0xffdc002b,
181 .flags = IORESOURCE_MEM,
182 },
183 [1] = {
184 .start = 98,
185 .flags = IORESOURCE_IRQ,
186 },
187};
188
189static struct platform_device tmu5_device = {
190 .name = "sh_tmu",
191 .id = 5,
192 .dev = {
193 .platform_data = &tmu5_platform_data,
194 },
195 .resource = tmu5_resources,
196 .num_resources = ARRAY_SIZE(tmu5_resources),
197};
15 198
16static struct resource rtc_resources[] = { 199static struct resource rtc_resources[] = {
17 [0] = { 200 [0] = {
@@ -58,6 +241,12 @@ static struct platform_device sci_device = {
58}; 241};
59 242
60static struct platform_device *sh7780_devices[] __initdata = { 243static struct platform_device *sh7780_devices[] __initdata = {
244 &tmu0_device,
245 &tmu1_device,
246 &tmu2_device,
247 &tmu3_device,
248 &tmu4_device,
249 &tmu5_device,
61 &rtc_device, 250 &rtc_device,
62 &sci_device, 251 &sci_device,
63}; 252};
@@ -69,6 +258,21 @@ static int __init sh7780_devices_setup(void)
69} 258}
70__initcall(sh7780_devices_setup); 259__initcall(sh7780_devices_setup);
71 260
261static struct platform_device *sh7780_early_devices[] __initdata = {
262 &tmu0_device,
263 &tmu1_device,
264 &tmu2_device,
265 &tmu3_device,
266 &tmu4_device,
267 &tmu5_device,
268};
269
270void __init plat_early_device_setup(void)
271{
272 early_platform_add_devices(sh7780_early_devices,
273 ARRAY_SIZE(sh7780_early_devices));
274}
275
72enum { 276enum {
73 UNUSED = 0, 277 UNUSED = 0,
74 278