ARM: shmobile: force enable of r8a7790 arch timer
authorMagnus Damm <damm@opensource.se>
Mon, 8 Apr 2013 01:23:28 +0000 (10:23 +0900)
committerSimon Horman <horms+renesas@verge.net.au>
Tue, 9 Apr 2013 12:37:36 +0000 (21:37 +0900)
Implement a SoC-specific timer init function for
r8a7790 that makes sure the architected timer
is started regardless of boot loader setting.

Signed-off-by: Magnus Damm <damm@opensource.se>
Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
arch/arm/mach-shmobile/include/mach/r8a7790.h
arch/arm/mach-shmobile/setup-r8a7790.c

index 9bd6f5c894bbe07a6440f6af00ae8d81fccb6e61..2e919e61fa0d3440c94ced629c6323692c86bc15 100644 (file)
@@ -4,5 +4,6 @@
 void r8a7790_add_standard_devices(void);
 void r8a7790_clock_init(void);
 void r8a7790_pinmux_init(void);
+void r8a7790_timer_init(void);
 
 #endif /* __ASM_R8A7790_H__ */
index cfccf6c1001b8738b5ee5a13f779700e50a37ddf..49de2d56f86db50bc18e66dd17ebb5bed986e812 100644 (file)
@@ -118,6 +118,18 @@ void __init r8a7790_add_standard_devices(void)
        r8a7790_register_irqc(0);
 }
 
+void __init r8a7790_timer_init(void)
+{
+       void __iomem *cntcr;
+
+       /* make sure arch timer is started by setting bit 0 of CNTCT */
+       cntcr = ioremap(0xe6080000, PAGE_SIZE);
+       iowrite32(1, cntcr);
+       iounmap(cntcr);
+
+       shmobile_timer_init();
+}
+
 #ifdef CONFIG_USE_OF
 void __init r8a7790_add_standard_devices_dt(void)
 {
@@ -132,7 +144,7 @@ static const char *r8a7790_boards_compat_dt[] __initdata = {
 DT_MACHINE_START(R8A7790_DT, "Generic R8A7790 (Flattened Device Tree)")
        .init_irq       = irqchip_init,
        .init_machine   = r8a7790_add_standard_devices_dt,
-       .init_time      = shmobile_timer_init,
+       .init_time      = r8a7790_timer_init,
        .dt_compat      = r8a7790_boards_compat_dt,
 MACHINE_END
 #endif /* CONFIG_USE_OF */