summaryrefslogtreecommitdiff
path: root/arch/arm/mach-shmobile/setup-r7s72100.c
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2013-11-06 19:43:32 +0900
committerSimon Horman <horms+renesas@verge.net.au>2013-12-04 15:11:14 +0900
commitd18e06116d5e7b277e73e3bdc6e08208aabcedc7 (patch)
treef0a74e6c22cee3223f737dfaf5d1119c5752db58 /arch/arm/mach-shmobile/setup-r7s72100.c
parent3dd3b1cf068a64a71f1b40319ca33fcb50842bc0 (diff)
ARM: shmobile: Enable MTU2 on r7s72100
Add MTU2 as r7s72100 system timer. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm/mach-shmobile/setup-r7s72100.c')
-rw-r--r--arch/arm/mach-shmobile/setup-r7s72100.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/setup-r7s72100.c b/arch/arm/mach-shmobile/setup-r7s72100.c
index d4eb509a1c87..55f0b9c7c482 100644
--- a/arch/arm/mach-shmobile/setup-r7s72100.c
+++ b/arch/arm/mach-shmobile/setup-r7s72100.c
@@ -22,6 +22,7 @@
#include <linux/kernel.h>
#include <linux/of_platform.h>
#include <linux/serial_sci.h>
+#include <linux/sh_timer.h>
#include <mach/common.h>
#include <mach/irqs.h>
#include <mach/r7s72100.h>
@@ -58,6 +59,26 @@ static inline void r7s72100_register_scif(int idx)
sizeof(struct plat_sci_port));
}
+
+static struct sh_timer_config mtu2_0_platform_data __initdata = {
+ .name = "MTU2_0",
+ .timer_bit = 0,
+ .channel_offset = -0x80,
+ .clockevent_rating = 200,
+};
+
+static struct resource mtu2_0_resources[] __initdata = {
+ DEFINE_RES_MEM(0xfcff0300, 0x27),
+ DEFINE_RES_IRQ(gic_iid(139)), /* MTU2 TGI0A */
+};
+
+#define r7s72100_register_mtu2(idx) \
+ platform_device_register_resndata(&platform_bus, "sh_mtu2", \
+ idx, mtu2_##idx##_resources, \
+ ARRAY_SIZE(mtu2_##idx##_resources), \
+ &mtu2_##idx##_platform_data, \
+ sizeof(struct sh_timer_config))
+
void __init r7s72100_add_dt_devices(void)
{
r7s72100_register_scif(SCIF0);
@@ -68,6 +89,7 @@ void __init r7s72100_add_dt_devices(void)
r7s72100_register_scif(SCIF5);
r7s72100_register_scif(SCIF6);
r7s72100_register_scif(SCIF7);
+ r7s72100_register_mtu2(0);
}
void __init r7s72100_init_early(void)