diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-05-12 06:21:11 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-05-12 06:53:09 -0400 |
commit | 2b23a8826a60268ec52302729911dd7ac6b10776 (patch) | |
tree | c4133606d3e8565035ac1a179482983b8041cf4a /arch/sh/kernel/cpu/sh3 | |
parent | 4a1a5a2f60ceabc026ba28cdbf81d7d47603b480 (diff) |
sh: CMT platform data for sh7720/sh7721
This patch adds CMT platform data for sh7720 and sh7721.
All 5 32-bit CMT channels unfortunately share a single IRQ.
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/cpu/sh3')
-rw-r--r-- | arch/sh/kernel/cpu/sh3/setup-sh7720.c | 161 |
1 files changed, 161 insertions, 0 deletions
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7720.c b/arch/sh/kernel/cpu/sh3/setup-sh7720.c index c09619c25d9d..d8b46f5dff60 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh7720.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh7720.c | |||
@@ -124,6 +124,157 @@ static struct platform_device usbf_device = { | |||
124 | .resource = usbf_resources, | 124 | .resource = usbf_resources, |
125 | }; | 125 | }; |
126 | 126 | ||
127 | static struct sh_timer_config cmt0_platform_data = { | ||
128 | .name = "CMT0", | ||
129 | .channel_offset = 0x10, | ||
130 | .timer_bit = 0, | ||
131 | .clk = "module_clk", | ||
132 | .clockevent_rating = 125, | ||
133 | .clocksource_rating = 125, | ||
134 | }; | ||
135 | |||
136 | static struct resource cmt0_resources[] = { | ||
137 | [0] = { | ||
138 | .name = "CMT0", | ||
139 | .start = 0x044a0010, | ||
140 | .end = 0x044a001b, | ||
141 | .flags = IORESOURCE_MEM, | ||
142 | }, | ||
143 | [1] = { | ||
144 | .start = 104, | ||
145 | .flags = IORESOURCE_IRQ, | ||
146 | }, | ||
147 | }; | ||
148 | |||
149 | static struct platform_device cmt0_device = { | ||
150 | .name = "sh_cmt", | ||
151 | .id = 0, | ||
152 | .dev = { | ||
153 | .platform_data = &cmt0_platform_data, | ||
154 | }, | ||
155 | .resource = cmt0_resources, | ||
156 | .num_resources = ARRAY_SIZE(cmt0_resources), | ||
157 | }; | ||
158 | |||
159 | static struct sh_timer_config cmt1_platform_data = { | ||
160 | .name = "CMT1", | ||
161 | .channel_offset = 0x20, | ||
162 | .timer_bit = 1, | ||
163 | .clk = "module_clk", | ||
164 | }; | ||
165 | |||
166 | static struct resource cmt1_resources[] = { | ||
167 | [0] = { | ||
168 | .name = "CMT1", | ||
169 | .start = 0x044a0020, | ||
170 | .end = 0x044a002b, | ||
171 | .flags = IORESOURCE_MEM, | ||
172 | }, | ||
173 | [1] = { | ||
174 | .start = 104, | ||
175 | .flags = IORESOURCE_IRQ, | ||
176 | }, | ||
177 | }; | ||
178 | |||
179 | static struct platform_device cmt1_device = { | ||
180 | .name = "sh_cmt", | ||
181 | .id = 1, | ||
182 | .dev = { | ||
183 | .platform_data = &cmt1_platform_data, | ||
184 | }, | ||
185 | .resource = cmt1_resources, | ||
186 | .num_resources = ARRAY_SIZE(cmt1_resources), | ||
187 | }; | ||
188 | |||
189 | static struct sh_timer_config cmt2_platform_data = { | ||
190 | .name = "CMT2", | ||
191 | .channel_offset = 0x30, | ||
192 | .timer_bit = 2, | ||
193 | .clk = "module_clk", | ||
194 | }; | ||
195 | |||
196 | static struct resource cmt2_resources[] = { | ||
197 | [0] = { | ||
198 | .name = "CMT2", | ||
199 | .start = 0x044a0030, | ||
200 | .end = 0x044a003b, | ||
201 | .flags = IORESOURCE_MEM, | ||
202 | }, | ||
203 | [1] = { | ||
204 | .start = 104, | ||
205 | .flags = IORESOURCE_IRQ, | ||
206 | }, | ||
207 | }; | ||
208 | |||
209 | static struct platform_device cmt2_device = { | ||
210 | .name = "sh_cmt", | ||
211 | .id = 2, | ||
212 | .dev = { | ||
213 | .platform_data = &cmt2_platform_data, | ||
214 | }, | ||
215 | .resource = cmt2_resources, | ||
216 | .num_resources = ARRAY_SIZE(cmt2_resources), | ||
217 | }; | ||
218 | |||
219 | static struct sh_timer_config cmt3_platform_data = { | ||
220 | .name = "CMT3", | ||
221 | .channel_offset = 0x40, | ||
222 | .timer_bit = 3, | ||
223 | .clk = "module_clk", | ||
224 | }; | ||
225 | |||
226 | static struct resource cmt3_resources[] = { | ||
227 | [0] = { | ||
228 | .name = "CMT3", | ||
229 | .start = 0x044a0040, | ||
230 | .end = 0x044a004b, | ||
231 | .flags = IORESOURCE_MEM, | ||
232 | }, | ||
233 | [1] = { | ||
234 | .start = 104, | ||
235 | .flags = IORESOURCE_IRQ, | ||
236 | }, | ||
237 | }; | ||
238 | |||
239 | static struct platform_device cmt3_device = { | ||
240 | .name = "sh_cmt", | ||
241 | .id = 3, | ||
242 | .dev = { | ||
243 | .platform_data = &cmt3_platform_data, | ||
244 | }, | ||
245 | .resource = cmt3_resources, | ||
246 | .num_resources = ARRAY_SIZE(cmt3_resources), | ||
247 | }; | ||
248 | |||
249 | static struct sh_timer_config cmt4_platform_data = { | ||
250 | .name = "CMT4", | ||
251 | .channel_offset = 0x50, | ||
252 | .timer_bit = 4, | ||
253 | .clk = "module_clk", | ||
254 | }; | ||
255 | |||
256 | static struct resource cmt4_resources[] = { | ||
257 | [0] = { | ||
258 | .name = "CMT4", | ||
259 | .start = 0x044a0050, | ||
260 | .end = 0x044a005b, | ||
261 | .flags = IORESOURCE_MEM, | ||
262 | }, | ||
263 | [1] = { | ||
264 | .start = 104, | ||
265 | .flags = IORESOURCE_IRQ, | ||
266 | }, | ||
267 | }; | ||
268 | |||
269 | static struct platform_device cmt4_device = { | ||
270 | .name = "sh_cmt", | ||
271 | .id = 4, | ||
272 | .dev = { | ||
273 | .platform_data = &cmt4_platform_data, | ||
274 | }, | ||
275 | .resource = cmt4_resources, | ||
276 | .num_resources = ARRAY_SIZE(cmt4_resources), | ||
277 | }; | ||
127 | 278 | ||
128 | static struct sh_timer_config tmu0_platform_data = { | 279 | static struct sh_timer_config tmu0_platform_data = { |
129 | .name = "TMU0", | 280 | .name = "TMU0", |
@@ -218,6 +369,11 @@ static struct platform_device tmu2_device = { | |||
218 | }; | 369 | }; |
219 | 370 | ||
220 | static struct platform_device *sh7720_devices[] __initdata = { | 371 | static struct platform_device *sh7720_devices[] __initdata = { |
372 | &cmt0_device, | ||
373 | &cmt1_device, | ||
374 | &cmt2_device, | ||
375 | &cmt3_device, | ||
376 | &cmt4_device, | ||
221 | &tmu0_device, | 377 | &tmu0_device, |
222 | &tmu1_device, | 378 | &tmu1_device, |
223 | &tmu2_device, | 379 | &tmu2_device, |
@@ -235,6 +391,11 @@ static int __init sh7720_devices_setup(void) | |||
235 | __initcall(sh7720_devices_setup); | 391 | __initcall(sh7720_devices_setup); |
236 | 392 | ||
237 | static struct platform_device *sh7720_early_devices[] __initdata = { | 393 | static struct platform_device *sh7720_early_devices[] __initdata = { |
394 | &cmt0_device, | ||
395 | &cmt1_device, | ||
396 | &cmt2_device, | ||
397 | &cmt3_device, | ||
398 | &cmt4_device, | ||
238 | &tmu0_device, | 399 | &tmu0_device, |
239 | &tmu1_device, | 400 | &tmu1_device, |
240 | &tmu2_device, | 401 | &tmu2_device, |