summaryrefslogtreecommitdiff
path: root/arch/arm/mach-shmobile/setup-r8a7790.c
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2013-06-28 20:27:04 +0900
committerSimon Horman <horms+renesas@verge.net.au>2013-07-17 14:26:49 +0900
commit99ade1a0f02e086248874d9908def3e8e4539418 (patch)
treea3e1dd561b672543ec3a5cabdc87904d676734dc /arch/arm/mach-shmobile/setup-r8a7790.c
parent29eb2ba89c63c6f57dc3a8b1a89241c7a877a3c8 (diff)
ARM: shmobile: Add r8a7790 CMT00 clock event
Add clock event support for CMT0 timer channel 0 to the r8a7790 SoC code. On most ARM mach-shmobile the CMT is hooked up to a 32KHz clock but on r8a7790 a 31.7KHz clock is instead used. 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-r8a7790.c')
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7790.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c
index bc40a44de127..ece60c635de7 100644
--- a/arch/arm/mach-shmobile/setup-r8a7790.c
+++ b/arch/arm/mach-shmobile/setup-r8a7790.c
@@ -21,9 +21,10 @@
#include <linux/irq.h>
#include <linux/kernel.h>
#include <linux/of_platform.h>
-#include <linux/serial_sci.h>
#include <linux/platform_data/gpio-rcar.h>
#include <linux/platform_data/irq-renesas-irqc.h>
+#include <linux/serial_sci.h>
+#include <linux/sh_timer.h>
#include <mach/common.h>
#include <mach/irqs.h>
#include <mach/r8a7790.h>
@@ -159,6 +160,25 @@ static struct resource thermal_resources[] __initdata = {
thermal_resources, \
ARRAY_SIZE(thermal_resources))
+static struct sh_timer_config cmt00_platform_data = {
+ .name = "CMT00",
+ .timer_bit = 0,
+ .clockevent_rating = 80,
+};
+
+static struct resource cmt00_resources[] = {
+ DEFINE_RES_MEM(0xffca0510, 0x0c),
+ DEFINE_RES_MEM(0xffca0500, 0x04),
+ DEFINE_RES_IRQ(gic_spi(142)), /* CMT0_0 */
+};
+
+#define r8a7790_register_cmt(idx) \
+ platform_device_register_resndata(&platform_bus, "sh_cmt", \
+ idx, cmt##idx##_resources, \
+ ARRAY_SIZE(cmt##idx##_resources), \
+ &cmt##idx##_platform_data, \
+ sizeof(struct sh_timer_config))
+
void __init r8a7790_add_standard_devices(void)
{
r8a7790_register_scif(SCIFA0);
@@ -173,6 +193,7 @@ void __init r8a7790_add_standard_devices(void)
r8a7790_register_scif(HSCIF1);
r8a7790_register_irqc(0);
r8a7790_register_thermal();
+ r8a7790_register_cmt(00);
}
void __init r8a7790_timer_init(void)