diff options
author | Magnus Damm <damm@opensource.se> | 2010-12-21 03:40:59 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-12-21 23:46:15 -0500 |
commit | 5010f3db952b19cd353d1e90838818922d995697 (patch) | |
tree | 98180c6380ed5c8f9bde0d046b1ae7a220c89882 /arch | |
parent | 5f53a56af50c002cdb091914aa98df80b1b28ec8 (diff) |
ARM: mach-shmobile: sh73a0 TMU support
Add support for 2 TMU timer channels on sh73a0.
One timer channel is used for clocksource and
the other is used for clockevents. All channels
in the same TMU block share MSTP bit as usual.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-shmobile/clock-sh73a0.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/setup-sh73a0.c | 63 |
2 files changed, 67 insertions, 1 deletions
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c index 7c8b5179e444..d9990fa6ea84 100644 --- a/arch/arm/mach-shmobile/clock-sh73a0.c +++ b/arch/arm/mach-shmobile/clock-sh73a0.c | |||
@@ -255,7 +255,7 @@ static struct clk div6_clks[DIV6_NR] = { | |||
255 | }; | 255 | }; |
256 | 256 | ||
257 | enum { MSTP001, | 257 | enum { MSTP001, |
258 | MSTP116, | 258 | MSTP125, MSTP116, |
259 | MSTP219, | 259 | MSTP219, |
260 | MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, | 260 | MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, |
261 | MSTP331, MSTP329, MSTP323, | 261 | MSTP331, MSTP329, MSTP323, |
@@ -267,6 +267,7 @@ enum { MSTP001, | |||
267 | 267 | ||
268 | static struct clk mstp_clks[MSTP_NR] = { | 268 | static struct clk mstp_clks[MSTP_NR] = { |
269 | [MSTP001] = MSTP(&div4_clks[DIV4_HP], SMSTPCR0, 1, 0), /* IIC2 */ | 269 | [MSTP001] = MSTP(&div4_clks[DIV4_HP], SMSTPCR0, 1, 0), /* IIC2 */ |
270 | [MSTP125] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR1, 25, 0), /* TMU0 */ | ||
270 | [MSTP116] = MSTP(&div4_clks[DIV4_HP], SMSTPCR1, 16, 0), /* IIC0 */ | 271 | [MSTP116] = MSTP(&div4_clks[DIV4_HP], SMSTPCR1, 16, 0), /* IIC0 */ |
271 | [MSTP219] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 19, 0), /* SCIFA7 */ | 272 | [MSTP219] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 19, 0), /* SCIFA7 */ |
272 | [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */ | 273 | [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */ |
@@ -292,6 +293,8 @@ static struct clk_lookup lookups[] = { | |||
292 | 293 | ||
293 | /* MSTP32 clocks */ | 294 | /* MSTP32 clocks */ |
294 | CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */ | 295 | CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */ |
296 | CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP125]), /* TMU00 */ | ||
297 | CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP125]), /* TMU01 */ | ||
295 | CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* I2C0 */ | 298 | CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* I2C0 */ |
296 | CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP219]), /* SCIFA7 */ | 299 | CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP219]), /* SCIFA7 */ |
297 | CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */ | 300 | CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */ |
diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c index 53f1ea66efbc..f1eff8b37bd6 100644 --- a/arch/arm/mach-shmobile/setup-sh73a0.c +++ b/arch/arm/mach-shmobile/setup-sh73a0.c | |||
@@ -208,6 +208,67 @@ static struct platform_device cmt10_device = { | |||
208 | .num_resources = ARRAY_SIZE(cmt10_resources), | 208 | .num_resources = ARRAY_SIZE(cmt10_resources), |
209 | }; | 209 | }; |
210 | 210 | ||
211 | /* TMU */ | ||
212 | static struct sh_timer_config tmu00_platform_data = { | ||
213 | .name = "TMU00", | ||
214 | .channel_offset = 0x4, | ||
215 | .timer_bit = 0, | ||
216 | .clockevent_rating = 200, | ||
217 | }; | ||
218 | |||
219 | static struct resource tmu00_resources[] = { | ||
220 | [0] = { | ||
221 | .name = "TMU00", | ||
222 | .start = 0xfff60008, | ||
223 | .end = 0xfff60013, | ||
224 | .flags = IORESOURCE_MEM, | ||
225 | }, | ||
226 | [1] = { | ||
227 | .start = intcs_evt2irq(0x0e80), /* TMU0_TUNI00 */ | ||
228 | .flags = IORESOURCE_IRQ, | ||
229 | }, | ||
230 | }; | ||
231 | |||
232 | static struct platform_device tmu00_device = { | ||
233 | .name = "sh_tmu", | ||
234 | .id = 0, | ||
235 | .dev = { | ||
236 | .platform_data = &tmu00_platform_data, | ||
237 | }, | ||
238 | .resource = tmu00_resources, | ||
239 | .num_resources = ARRAY_SIZE(tmu00_resources), | ||
240 | }; | ||
241 | |||
242 | static struct sh_timer_config tmu01_platform_data = { | ||
243 | .name = "TMU01", | ||
244 | .channel_offset = 0x10, | ||
245 | .timer_bit = 1, | ||
246 | .clocksource_rating = 200, | ||
247 | }; | ||
248 | |||
249 | static struct resource tmu01_resources[] = { | ||
250 | [0] = { | ||
251 | .name = "TMU01", | ||
252 | .start = 0xfff60014, | ||
253 | .end = 0xfff6001f, | ||
254 | .flags = IORESOURCE_MEM, | ||
255 | }, | ||
256 | [1] = { | ||
257 | .start = intcs_evt2irq(0x0ea0), /* TMU0_TUNI01 */ | ||
258 | .flags = IORESOURCE_IRQ, | ||
259 | }, | ||
260 | }; | ||
261 | |||
262 | static struct platform_device tmu01_device = { | ||
263 | .name = "sh_tmu", | ||
264 | .id = 1, | ||
265 | .dev = { | ||
266 | .platform_data = &tmu01_platform_data, | ||
267 | }, | ||
268 | .resource = tmu01_resources, | ||
269 | .num_resources = ARRAY_SIZE(tmu01_resources), | ||
270 | }; | ||
271 | |||
211 | static struct resource i2c0_resources[] = { | 272 | static struct resource i2c0_resources[] = { |
212 | [0] = { | 273 | [0] = { |
213 | .name = "IIC0", | 274 | .name = "IIC0", |
@@ -324,6 +385,8 @@ static struct platform_device *sh73a0_early_devices[] __initdata = { | |||
324 | &scif7_device, | 385 | &scif7_device, |
325 | &scif8_device, | 386 | &scif8_device, |
326 | &cmt10_device, | 387 | &cmt10_device, |
388 | &tmu00_device, | ||
389 | &tmu01_device, | ||
327 | }; | 390 | }; |
328 | 391 | ||
329 | static struct platform_device *sh73a0_late_devices[] __initdata = { | 392 | static struct platform_device *sh73a0_late_devices[] __initdata = { |