Skip to contentSkip to conversation

ARM: OMAP2+: Fix undefined reference to set_cntfreq

PATCH New Tony Lindgren 2 participants 4 messages Nov 18, 2013 – Nov 19, 2013

Subsystems (3)
lore
Share & tools
lore

Tony Lindgren

author maintainer
#0 lore raw

PATCH 1/1 ARM: OMAP2+: Fix undefined reference to set_cntfreq

If CONFIG_SOC_HAS_REALTIME_COUNTER is not selected for omap5 or dra7xx, we can get the following error:

arch/arm/mach-omap2/built-in.o: In function `omap4_secondary_init':
:(.text+0x7ab0): undefined reference to `set_cntfreq'

Fix the issue by not trying to initalize the realtime counter unles CONFIG_SOC_HAS_REALTIME_COUNTER is selected.

arch/arm/mach-omap2/omap-smp.c +2 -0
@@ -65,12 +65,14 @@ static void omap4_secondary_init(unsigned int cpu)
 		omap_secure_dispatcher(OMAP4_PPA_CPU_ACTRL_SMP_INDEX,
 							4, 0, 0, 0, 0, 0);
 
+#ifdef CONFIG_SOC_HAS_REALTIME_COUNTER
 	/*
 	 * Configure the CNTFRQ register for the secondary cpu's which
 	 * indicates the frequency of the cpu local timers.
 	 */
 	if (soc_is_omap54xx() || soc_is_dra7xx())
 		set_cntfreq();
+#endif
 
 	/*
 	 * Synchronise with the boot thread.
#1 lore raw

PATCH 1/1 ARM: OMAP2+: Fix undefined reference to set_cntfreq

Quoted 11 lines · Tony Lindgren

If CONFIG_SOC_HAS_REALTIME_COUNTER is not selected for omap5 or dra7xx, we can get the following error:

arch/arm/mach-omap2/built-in.o: In function `omap4_secondary_init':
:(.text+0x7ab0): undefined reference to `set_cntfreq'

Fix the issue by not trying to initalize the realtime counter unles CONFIG_SOC_HAS_REALTIME_COUNTER is selected.

How about a dummy inline function of set_cntfreq() ? Having #ifdef in middle of the code looks pretty ugly.

Quoted 22 lines
arch/arm/mach-omap2/omap-smp.c +2 -1
@@ -65,12 +65,14 @@ static void omap4_secondary_init(unsigned int cpu)
 		omap_secure_dispatcher(OMAP4_PPA_CPU_ACTRL_SMP_INDEX,
 							4, 0, 0, 0, 0, 0);
 
+#ifdef CONFIG_SOC_HAS_REALTIME_COUNTER
 	/*
 	 * Configure the CNTFRQ register for the secondary cpu's which
 	 * indicates the frequency of the cpu local timers.
 	 */
 	if (soc_is_omap54xx() || soc_is_dra7xx())
 		set_cntfreq();
+#endif
 
 	/*
 	 * Synchronise with the boot thread.
--

To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

author maintainer
#2 lore raw

PATCH 1/1 ARM: OMAP2+: Fix undefined reference to set_cntfreq

Quoted 7 lines · Santosh Shilimkar
Quoted 6 lines · Tony Lindgren

If CONFIG_SOC_HAS_REALTIME_COUNTER is not selected for omap5 or dra7xx, we can get the following error:

arch/arm/mach-omap2/built-in.o: In function `omap4_secondary_init':
:(.text+0x7ab0): undefined reference to `set_cntfreq'

Quoted 7 lines
Quoted 5 lines

Fix the issue by not trying to initalize the realtime counter unles CONFIG_SOC_HAS_REALTIME_COUNTER is selected.

How about a dummy inline function of set_cntfreq() ? Having #ifdef in middle of the code looks pretty ugly.

Sure, here's an updated version.

Tony

From: Tony Lindgren <[email protected]>
Date: Mon, 18 Nov 2013 13:56:48 -0800
Subject: [PATCH] ARM: OMAP2+: Fix undefined reference to set_cntfreq

If CONFIG_SOC_HAS_REALTIME_COUNTER is not selected for omap5 or dra7xx, we can get the following error:

arch/arm/mach-omap2/built-in.o: In function `omap4_secondary_init':
:(.text+0x7ab0): undefined reference to `set_cntfreq'

Fix the issue by not trying to initalize the realtime counter unles CONFIG_SOC_HAS_REALTIME_COUNTER is selected.

arch/arm/mach-omap2/omap-secure.h +7 -0
@@ -76,6 +76,13 @@ static inline void omap_barrier_reserve_memblock(void)
 { }
 #endif
 
+#ifdef CONFIG_SOC_HAS_REALTIME_COUNTER
 void set_cntfreq(void);
+#else
+static inline void set_cntfreq(void)
+{
+}
+#endif
+
 #endif /* __ASSEMBLER__ */
 #endif /* OMAP_ARCH_OMAP_SECURE_H */
#3 lore raw

PATCH 1/1 ARM: OMAP2+: Fix undefined reference to set_cntfreq

Quoted 11 lines · Tony Lindgren
Quoted 10 lines · Santosh Shilimkar
Quoted 9 lines · Tony Lindgren

If CONFIG_SOC_HAS_REALTIME_COUNTER is not selected for omap5 or dra7xx, we can get the following error:

arch/arm/mach-omap2/built-in.o: In function `omap4_secondary_init':
:(.text+0x7ab0): undefined reference to `set_cntfreq'

Fix the issue by not trying to initalize the realtime counter unles CONFIG_SOC_HAS_REALTIME_COUNTER is selected.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

How about a dummy inline function of set_cntfreq() ? Having #ifdef in middle of the code looks pretty ugly.

Sure, here's an updated version.

Thanks for quick spin.

Quoted 9 lines

From: Tony Lindgren <[email protected]>
Date: Mon, 18 Nov 2013 13:56:48 -0800
Subject: [PATCH] ARM: OMAP2+: Fix undefined reference to set_cntfreq

If CONFIG_SOC_HAS_REALTIME_COUNTER is not selected for omap5 or dra7xx, we can get the following error:

Quoted 8 lines

arch/arm/mach-omap2/built-in.o: In function `omap4_secondary_init':
:(.text+0x7ab0): undefined reference to `set_cntfreq'

Fix the issue by not trying to initalize the realtime counter unles CONFIG_SOC_HAS_REALTIME_COUNTER is selected.