Skip to contentSkip to conversation

arm: omap2: timer: always define omap4_local_timer_init

PATCH New Felipe Balbi 3 participants 4 messages Sep 29, 2015 – Sep 30, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 arm: omap2: timer: always define omap4_local_timer_init

omap4_local_timer_init() can be used by other platforms as is. At least AM437x wants to use it. Instead of making omap4-only and providing a stub for builds without OMAP4, we can just make sure that function is always available for all SoCs that need it.

---

changes since v3:
- modify commit log slightly

changes since v2:
- move ifdefs around

changes since v1:
- make sure result builds on AM43xx-only builds

 arch/arm/mach-omap2/timer.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)
arch/arm/mach-omap2/timer.c +3 -13
index e4d8701f99f9..3ebe16cd645e 100644
@@ -634,32 +634,22 @@ OMAP_SYS_32K_TIMER_INIT(3_secure, 12, "secure_32k_fck", "ti,timer-secure",
 			2, "timer_sys_ck", NULL);
 #endif /* CONFIG_ARCH_OMAP3 */
 
-#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX) || \
-	defined(CONFIG_SOC_AM43XX)
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX)
 OMAP_SYS_GP_TIMER_INIT(3, 2, "timer_sys_ck", NULL,
 		       1, "timer_sys_ck", "ti,timer-alwon");
 #endif
 
 #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
-	defined(CONFIG_SOC_DRA7XX)
+	defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX)
 static OMAP_SYS_32K_TIMER_INIT(4, 1, "timer_32k_ck", "ti,timer-alwon",
 			       2, "sys_clkin_ck", NULL);
-#endif
 
-#ifdef CONFIG_ARCH_OMAP4
-#ifdef CONFIG_HAVE_ARM_TWD
 void __init omap4_local_timer_init(void)
 {
 	omap4_sync32k_timer_init();
 	clocksource_of_init();
 }
-#else
-void __init omap4_local_timer_init(void)
-{
-	omap4_sync32k_timer_init();
-}
-#endif /* CONFIG_HAVE_ARM_TWD */
-#endif /* CONFIG_ARCH_OMAP4 */
+#endif
 
 #if defined(CONFIG_SOC_OMAP5) || defined(CONFIG_SOC_DRA7XX)
 void __init omap5_realtime_timer_init(void)
Signature · 1 line
2.5.3
#1 lore raw

PATCH v4 1/1 arm: omap2: timer: always define omap4_local_timer_init

Quoted 6 lines · Felipe Balbi

omap4_local_timer_init() can be used by other platforms as is. At least AM437x wants to use it. Instead of making omap4-only and providing a stub for builds without OMAP4, we can just make sure that function is always available for all SoCs that need it.

Sounds right now. $subject needs fixing. if Tony is ok picking and fixing it up himself...

Quoted 58 lines

---

changes since v3:
- modify commit log slightly

changes since v2:
- move ifdefs around

changes since v1:
- make sure result builds on AM43xx-only builds

 arch/arm/mach-omap2/timer.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)
arch/arm/mach-omap2/timer.c +3 -13
index e4d8701f99f9..3ebe16cd645e 100644
@@ -634,32 +634,22 @@ OMAP_SYS_32K_TIMER_INIT(3_secure, 12, "secure_32k_fck", "ti,timer-secure",
 			2, "timer_sys_ck", NULL);
 #endif /* CONFIG_ARCH_OMAP3 */
 
-#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX) || \
-	defined(CONFIG_SOC_AM43XX)
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX)
 OMAP_SYS_GP_TIMER_INIT(3, 2, "timer_sys_ck", NULL,
 		       1, "timer_sys_ck", "ti,timer-alwon");
 #endif
 
 #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
-	defined(CONFIG_SOC_DRA7XX)
+	defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX)
 static OMAP_SYS_32K_TIMER_INIT(4, 1, "timer_32k_ck", "ti,timer-alwon",
 			       2, "sys_clkin_ck", NULL);
-#endif
 
-#ifdef CONFIG_ARCH_OMAP4
-#ifdef CONFIG_HAVE_ARM_TWD
 void __init omap4_local_timer_init(void)
 {
 	omap4_sync32k_timer_init();
 	clocksource_of_init();
 }
-#else
-void __init omap4_local_timer_init(void)
-{
-	omap4_sync32k_timer_init();
-}
-#endif /* CONFIG_HAVE_ARM_TWD */
-#endif /* CONFIG_ARCH_OMAP4 */
+#endif
 
 #if defined(CONFIG_SOC_OMAP5) || defined(CONFIG_SOC_DRA7XX)
 void __init omap5_realtime_timer_init(void)
Signature · 2 lines
Regards,
Nishanth Menon
#2 lore raw

PATCH v4 1/1 arm: omap2: timer: always define omap4_local_timer_init

In reply to Felipe Balbi

Hi Felipe,

Quoted 6 lines · Felipe Balbi

omap4_local_timer_init() can be used by other platforms as is. At least AM437x wants to use it. Instead of making omap4-only and providing a stub for builds without OMAP4, we can just make sure that function is always available for all SoCs that need it.

You might also want to update init_time function pointer for AM43xx in board_generic.c or is there any dependency for this patch? With this patch alone AM43xx only build is broken.

arch/arm/mach-omap2/built-in.o:(.arch.info.init+0x54): undefined reference to `omap3_gptimer_timer_init'
Makefile:944: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1

Thanks and regards,
Lokesh

#3 lore raw

PATCH v4 1/1 arm: omap2: timer: always define omap4_local_timer_init

Quoted 9 lines · Lokesh Vutla

Hi Felipe,

Quoted 6 lines · Felipe Balbi

omap4_local_timer_init() can be used by other platforms as is. At least AM437x wants to use it. Instead of making omap4-only and providing a stub for builds without OMAP4, we can just make sure that function is always available for all SoCs that need it.

Quoted 8 lines

You might also want to update init_time function pointer for AM43xx in board_generic.c or is there any dependency for this patch? With this patch alone AM43xx only build is broken.

arch/arm/mach-omap2/built-in.o:(.arch.info.init+0x54): undefined reference to `omap3_gptimer_timer_init'
Makefile:944: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1

I think the following series needs to be applied.
http://www.mail-archive.com/linux-omap%40vger.kernel.org/msg119840.html
Sorry for the noise.

Thanks and regards,
Lokesh