ARM: omap2: fix omap5_realtime_timer_init definition
Subsystems (3)
PATCH v2 1/1 ARM: omap2: fix omap5_realtime_timer_init definition
There is one more regression introduced by the last build fix:
arch/arm/mach-omap2/timer.c:170:6: error: attribute declaration must precede definition [-Werror,-Wignored-attributes] void __init omap5_realtime_timer_init(void)
^
arch/arm/mach-omap2/common.h:118:20: note: previous definition is here
static inline void omap5_realtime_timer_init(void)
^
arch/arm/mach-omap2/timer.c:170:13: error: redefinition of 'omap5_realtime_timer_init'
void __init omap5_realtime_timer_init(void)
^arch/arm/mach-omap2/common.h:118:20: note: previous definition is here static inline void omap5_realtime_timer_init(void)
As it turns out, the CONFIG_SOC_HAS_REALTIME_COUNTER option should never be disabled for OMAP5 as we realy on this to initialize the clocks and the timer. Just remove it here and make it the default.
Removing the guard around the set_cntfreq() definition, I noticed that this is not properly namespaced, so fix that as well.
---
I'll let this run randconfig builds overnight to be sure it doesn't cause another regression.
--- arch/arm/mach-omap2/Kconfig | 5 ----- arch/arm/mach-omap2/common.h | 6 ------ arch/arm/mach-omap2/omap-secure.h | 9 +-------- arch/arm/mach-omap2/omap-smp.c | 2 +- arch/arm/mach-omap2/timer.c | 14 ++------------ 5 files changed, 4 insertions(+), 32 deletions(-)
arch/arm/mach-omap2/Kconfig +0 -5
@@ -145,11 +145,6 @@ config ARCH_OMAP2PLUS_TYPICAL config SOC_HAS_OMAP2_SDRC bool "OMAP2 SDRAM Controller support" -config SOC_HAS_REALTIME_COUNTER - bool "Real time free running counter" - depends on SOC_OMAP5 || SOC_DRA7XX - default y - config POWER_AVS_OMAP bool "AVS(Adaptive Voltage Scaling) support for OMAP IP versions 1&2" depends on POWER_AVS && (ARCH_OMAP3 || ARCH_OMAP4) && PM
arch/arm/mach-omap2/common.h +0 -6
@@ -112,13 +112,7 @@ static inline int omap_l2_cache_init(void)#define omap4_l2c310_write_sec NULL#endif -#ifdef CONFIG_SOC_HAS_REALTIME_COUNTER extern void omap5_realtime_timer_init (void ); -#else -static inline void omap5_realtime_timer_init (void ) -{ -} -#endif void omap2420_init_early (void );void omap2430_init_early (void );
arch/arm/mach-omap2/omap-secure.h +1 -8
@@ -81,14 +81,7 @@ extern u32 rx51_secure_rng_call(u32 ptr, u32 count, u32 flag);extern bool optee_available;void omap_secure_init (void ); - -#ifdef CONFIG_SOC_HAS_REALTIME_COUNTER -void set_cntfreq (void ); -#else -static inline void set_cntfreq (void ) -{ -} -#endif +void omap5_set_cntfreq (void );#endif /* __ASSEMBLER__ */ #endif /* OMAP_ARCH_OMAP_SECURE_H */
arch/arm/mach-omap2/omap-smp.c +1 -1
@@ -162,7 +162,7 @@ static void omap4_secondary_init(unsigned int cpu)* Configure the CNTFRQ register for the secondary cpu's which * indicates the frequency of the cpu local timers. */ -set_cntfreq (); +omap5_set_cntfreq ();/* Configure ACR to disable streaming WA for 801819 */ omap5_erratum_workaround_801819 ();/* Enable ACR to allow for ICUALLU workaround */
arch/arm/mach-omap2/timer.c +2 -12
@@ -39,11 +39,9 @@#define INCREMENTER_DENUMERATOR_RELOAD_OFFSET 0x14#define NUMERATOR_DENUMERATOR_MASK 0xfffff000 -#ifdef CONFIG_SOC_HAS_REALTIME_COUNTER -static unsigned long arch_timer_freq; -void set_cntfreq (void ) +void omap5_set_cntfreq (void ) {omap_smc1 (OMAP5_DRA7_MON_SET_CNTFRQ_INDEX , arch_timer_freq); }
@@ -154,19 +152,11 @@ static void __init realtime_counter_init(void)writel_relaxed (reg, base +INCREMENTER_DENUMERATOR_RELOAD_OFFSET ); arch_timer_freq =DIV_ROUND_UP_ULL (rate * num, den); -set_cntfreq (); +omap5_set_cntfreq ();iounmap (base); } -#else - -static inline void realtime_counter_init (void ) -{ -} - -#endif /* CONFIG_SOC_HAS_REALTIME_COUNTER */ -void __init omap5_realtime_timer_init (void ) {omap_clk_init ();
Signature · 1 line
2.26.2
Quoted 14 lines · Arnd Bergmann
There is one more regression introduced by the last build fix:
arch/arm/mach-omap2/timer.c:170:6: error: attribute declaration must precede definition [-Werror,-Wignored-attributes] void__initomap5_realtime_timer_init(void)^ arch/arm/mach-omap2/common.h:118:20: note: previous definition is here static inline void omap5_realtime_timer_init(void) ^ arch/arm/mach-omap2/timer.c:170:13: error: redefinition of 'omap5_realtime_timer_init' void __init omap5_realtime_timer_init(void) ^
arch/arm/mach-omap2/common.h:118:20: note: previous definition is here static inline voidomap5_realtime_timer_init(void)
Quoted 6 lines
As it turns out, the
CONFIG_SOC_HAS_REALTIME_COUNTERoption should never be disabled for OMAP5 as we realy on this to initialize the clocks and the timer. Just remove it here and make it the default.Removing the guard around the
set_cntfreq()definition, I noticed that this is not properly namespaced, so fix that as well.
Looks good to me, thanks for fixing it: