aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2013-01-11 14:24:18 -0500
committerTony Lindgren <tony@atomide.com>2013-01-11 14:24:18 -0500
commit816a65ef4ce1848d8083d9e198922ddafbe221f2 (patch)
treeb25932011f109ec7ad52691f68c97fb77b27acf2
parent9931faca02c604c22335f5a935a501bb2ace6e20 (diff)
ARM: OMAP2+: Limit omap initcalls to omap only on multiplatform kernels
We need to make sure that multiplatform kernels don't run omap initcalls when booted on other SoCs. Do this by adding wrapper macros for the initcalls that return early if soc_is_omap() test fails. This allows us to easily change the defines later if we have SoC specific init sections available. Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r--arch/arm/mach-omap2/soc.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h
index f31d90774de0..092aedd7ed13 100644
--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -42,6 +42,9 @@
42#undef MULTI_OMAP2 42#undef MULTI_OMAP2
43#undef OMAP_NAME 43#undef OMAP_NAME
44 44
45#ifdef CONFIG_ARCH_MULTIPLATFORM
46#define MULTI_OMAP2
47#endif
45#ifdef CONFIG_SOC_OMAP2420 48#ifdef CONFIG_SOC_OMAP2420
46# ifdef OMAP_NAME 49# ifdef OMAP_NAME
47# undef MULTI_OMAP2 50# undef MULTI_OMAP2
@@ -112,6 +115,11 @@ int omap_type(void);
112 */ 115 */
113unsigned int omap_rev(void); 116unsigned int omap_rev(void);
114 117
118static inline int soc_is_omap(void)
119{
120 return omap_rev() != 0;
121}
122
115/* 123/*
116 * Get the CPU revision for OMAP devices 124 * Get the CPU revision for OMAP devices
117 */ 125 */
@@ -465,5 +473,26 @@ static inline unsigned int omap4_has_ ##feat(void) \
465 473
466OMAP4_HAS_FEATURE(perf_silicon, PERF_SILICON) 474OMAP4_HAS_FEATURE(perf_silicon, PERF_SILICON)
467 475
476/*
477 * We need to make sure omap initcalls don't run when
478 * multiplatform kernels are booted on other SoCs.
479 */
480#define omap_initcall(level, fn) \
481static int __init __used __##fn(void) \
482{ \
483 if (!soc_is_omap()) \
484 return 0; \
485 return fn(); \
486} \
487level(__##fn);
488
489#define omap_early_initcall(fn) omap_initcall(early_initcall, fn)
490#define omap_core_initcall(fn) omap_initcall(core_initcall, fn)
491#define omap_postcore_initcall(fn) omap_initcall(postcore_initcall, fn)
492#define omap_arch_initcall(fn) omap_initcall(arch_initcall, fn)
493#define omap_subsys_initcall(fn) omap_initcall(subsys_initcall, fn)
494#define omap_device_initcall(fn) omap_initcall(device_initcall, fn)
495#define omap_late_initcall(fn) omap_initcall(late_initcall, fn)
496
468#endif /* __ASSEMBLY__ */ 497#endif /* __ASSEMBLY__ */
469 498