diff options
author | Magnus Damm <damm@opensource.se> | 2013-11-06 05:43:32 -0500 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-12-04 01:11:14 -0500 |
commit | d18e06116d5e7b277e73e3bdc6e08208aabcedc7 (patch) | |
tree | f0a74e6c22cee3223f737dfaf5d1119c5752db58 /arch/arm | |
parent | 3dd3b1cf068a64a71f1b40319ca33fcb50842bc0 (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')
-rw-r--r-- | arch/arm/mach-shmobile/clock-r7s72100.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/setup-r7s72100.c | 22 |
2 files changed, 23 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/clock-r7s72100.c b/arch/arm/mach-shmobile/clock-r7s72100.c index 4aba20ca127e..1c9d261df03f 100644 --- a/arch/arm/mach-shmobile/clock-r7s72100.c +++ b/arch/arm/mach-shmobile/clock-r7s72100.c | |||
@@ -178,6 +178,7 @@ static struct clk_lookup lookups[] = { | |||
178 | CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP42]), | 178 | CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP42]), |
179 | CLKDEV_ICK_ID("sci_fck", "sh-sci.6", &mstp_clks[MSTP41]), | 179 | CLKDEV_ICK_ID("sci_fck", "sh-sci.6", &mstp_clks[MSTP41]), |
180 | CLKDEV_ICK_ID("sci_fck", "sh-sci.7", &mstp_clks[MSTP40]), | 180 | CLKDEV_ICK_ID("sci_fck", "sh-sci.7", &mstp_clks[MSTP40]), |
181 | CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP33]), | ||
181 | }; | 182 | }; |
182 | 183 | ||
183 | void __init r7s72100_clock_init(void) | 184 | void __init r7s72100_clock_init(void) |
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 @@ | |||
22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/of_platform.h> | 23 | #include <linux/of_platform.h> |
24 | #include <linux/serial_sci.h> | 24 | #include <linux/serial_sci.h> |
25 | #include <linux/sh_timer.h> | ||
25 | #include <mach/common.h> | 26 | #include <mach/common.h> |
26 | #include <mach/irqs.h> | 27 | #include <mach/irqs.h> |
27 | #include <mach/r7s72100.h> | 28 | #include <mach/r7s72100.h> |
@@ -58,6 +59,26 @@ static inline void r7s72100_register_scif(int idx) | |||
58 | sizeof(struct plat_sci_port)); | 59 | sizeof(struct plat_sci_port)); |
59 | } | 60 | } |
60 | 61 | ||
62 | |||
63 | static struct sh_timer_config mtu2_0_platform_data __initdata = { | ||
64 | .name = "MTU2_0", | ||
65 | .timer_bit = 0, | ||
66 | .channel_offset = -0x80, | ||
67 | .clockevent_rating = 200, | ||
68 | }; | ||
69 | |||
70 | static struct resource mtu2_0_resources[] __initdata = { | ||
71 | DEFINE_RES_MEM(0xfcff0300, 0x27), | ||
72 | DEFINE_RES_IRQ(gic_iid(139)), /* MTU2 TGI0A */ | ||
73 | }; | ||
74 | |||
75 | #define r7s72100_register_mtu2(idx) \ | ||
76 | platform_device_register_resndata(&platform_bus, "sh_mtu2", \ | ||
77 | idx, mtu2_##idx##_resources, \ | ||
78 | ARRAY_SIZE(mtu2_##idx##_resources), \ | ||
79 | &mtu2_##idx##_platform_data, \ | ||
80 | sizeof(struct sh_timer_config)) | ||
81 | |||
61 | void __init r7s72100_add_dt_devices(void) | 82 | void __init r7s72100_add_dt_devices(void) |
62 | { | 83 | { |
63 | r7s72100_register_scif(SCIF0); | 84 | r7s72100_register_scif(SCIF0); |
@@ -68,6 +89,7 @@ void __init r7s72100_add_dt_devices(void) | |||
68 | r7s72100_register_scif(SCIF5); | 89 | r7s72100_register_scif(SCIF5); |
69 | r7s72100_register_scif(SCIF6); | 90 | r7s72100_register_scif(SCIF6); |
70 | r7s72100_register_scif(SCIF7); | 91 | r7s72100_register_scif(SCIF7); |
92 | r7s72100_register_mtu2(0); | ||
71 | } | 93 | } |
72 | 94 | ||
73 | void __init r7s72100_init_early(void) | 95 | void __init r7s72100_init_early(void) |