linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: OMAP2+: Fix undefined reference to set_cntfreq
@ 2013-11-18 21:58 Tony Lindgren
  2013-11-18 23:11 ` Santosh Shilimkar
  0 siblings, 1 reply; 4+ messages in thread
From: Tony Lindgren @ 2013-11-18 21:58 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Tony Lindgren <tony@atomide.com>

--- a/arch/arm/mach-omap2/omap-smp.c
+++ b/arch/arm/mach-omap2/omap-smp.c
@@ -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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ARM: OMAP2+: Fix undefined reference to set_cntfreq
  2013-11-18 21:58 [PATCH] ARM: OMAP2+: Fix undefined reference to set_cntfreq Tony Lindgren
@ 2013-11-18 23:11 ` Santosh Shilimkar
  2013-11-18 23:21   ` Tony Lindgren
  0 siblings, 1 reply; 4+ messages in thread
From: Santosh Shilimkar @ 2013-11-18 23:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 18 November 2013 04:58 PM, Tony Lindgren wrote:
> 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.
> 
> Signed-off-by: Tony Lindgren <tony@atomide.com>
>
How about a dummy inline function of set_cntfreq() ?
Having #ifdef in middle of the code looks pretty ugly.

> --- a/arch/arm/mach-omap2/omap-smp.c
> +++ b/arch/arm/mach-omap2/omap-smp.c
> @@ -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
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ARM: OMAP2+: Fix undefined reference to set_cntfreq
  2013-11-18 23:11 ` Santosh Shilimkar
@ 2013-11-18 23:21   ` Tony Lindgren
  2013-11-19  0:04     ` Santosh Shilimkar
  0 siblings, 1 reply; 4+ messages in thread
From: Tony Lindgren @ 2013-11-18 23:21 UTC (permalink / raw)
  To: linux-arm-kernel

* Santosh Shilimkar <santosh.shilimkar@ti.com> [131118 15:11]:
> On Monday 18 November 2013 04:58 PM, Tony Lindgren wrote:
> > 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.
> > 
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
> >
> 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 <tony@atomide.com>
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.

Signed-off-by: Tony Lindgren <tony@atomide.com>

--- a/arch/arm/mach-omap2/omap-secure.h
+++ b/arch/arm/mach-omap2/omap-secure.h
@@ -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 */

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ARM: OMAP2+: Fix undefined reference to set_cntfreq
  2013-11-18 23:21   ` Tony Lindgren
@ 2013-11-19  0:04     ` Santosh Shilimkar
  0 siblings, 0 replies; 4+ messages in thread
From: Santosh Shilimkar @ 2013-11-19  0:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 18 November 2013 06:21 PM, Tony Lindgren wrote:
> * Santosh Shilimkar <santosh.shilimkar@ti.com> [131118 15:11]:
>> On Monday 18 November 2013 04:58 PM, Tony Lindgren wrote:
>>> 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.
>>>
>>> Signed-off-by: Tony Lindgren <tony@atomide.com>
>>>
>> 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.

> 
> 
> From: Tony Lindgren <tony@atomide.com>
> 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.
> 
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> 
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-11-19  0:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-18 21:58 [PATCH] ARM: OMAP2+: Fix undefined reference to set_cntfreq Tony Lindgren
2013-11-18 23:11 ` Santosh Shilimkar
2013-11-18 23:21   ` Tony Lindgren
2013-11-19  0:04     ` Santosh Shilimkar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).