From 2b256e28e8e70592f0c38a862cc4ba0498c9db7b Mon Sep 17 00:00:00 2001 From: Paul Walmsley Date: Tue, 20 Nov 2007 17:16:21 -0700 Subject: [PATCH] Runtime constants: introduce omap2_set_globals_*() Add the omap2_set_globals_{242x,243x,343x}() functions. These functions are called early upon boot in the map_io() functions in the board-specific init files. The functions are currently no-ops. Later patches augment these functions to set global variables to the base virtual addresses of OMAP modules. This makes it possible to write code that can run without modification on multiple OMAP chip revisions. The *_set_globals_* functions are added into arch/arm/plat-omap/common.c. This patch currently only introduces OMAP2 and OMAP3 functions, but a later patch introduces an OMAP16XX-specific version, omap1_set_globals_16xx(). Also, while we are here, we get rid of the unused OMAP_L4_BASE define. Signed-off-by: Paul Walmsley Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/board-2430osk.c | 1 + arch/arm/mach-omap2/board-2430sdp.c | 1 + arch/arm/mach-omap2/board-3430sdp.c | 1 + arch/arm/mach-omap2/board-apollon.c | 1 + arch/arm/mach-omap2/board-generic.c | 1 + arch/arm/mach-omap2/board-h4.c | 1 + arch/arm/mach-omap2/board-n800.c | 1 + arch/arm/plat-omap/common.c | 21 +++++++++++++++++++++ include/asm-arm/arch-omap/common.h | 4 ++++ include/asm-arm/arch-omap/omap24xx.h | 2 -- include/asm-arm/arch-omap/omap34xx.h | 1 - 11 files changed, 32 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-omap2/board-2430osk.c b/arch/arm/mach-omap2/board-2430osk.c index 116fb6e391b..146dba3ce77 100644 --- a/arch/arm/mach-omap2/board-2430osk.c +++ b/arch/arm/mach-omap2/board-2430osk.c @@ -125,6 +125,7 @@ static void __init omap_2430osk_init(void) static void __init omap_2430osk_map_io(void) { + omap2_set_globals_243x(); omap2_map_common_io(); } diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index 0886f51c80b..5e6801929bd 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c @@ -392,6 +392,7 @@ static void __init omap_2430sdp_init(void) static void __init omap_2430sdp_map_io(void) { + omap2_set_globals_243x(); omap2_map_common_io(); } diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index cd5f4f71330..55691b52e0f 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -320,6 +320,7 @@ static void __init omap_3430sdp_init(void) static void __init omap_3430sdp_map_io(void) { + omap2_set_globals_343x(); omap2_map_common_io(); } arch_initcall(omap3430_i2c_init); diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index 1932d73463f..9cff0278aa0 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c @@ -390,6 +390,7 @@ static void __init omap_apollon_init(void) static void __init omap_apollon_map_io(void) { + omap2_set_globals_242x(); omap2_map_common_io(); } diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 4226464b465..6e7b13215c4 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c @@ -67,6 +67,7 @@ static void __init omap_generic_init(void) static void __init omap_generic_map_io(void) { + omap2_set_globals_242x(); /* should be 242x, 243x, or 343x */ omap2_map_common_io(); } diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index 8fde8388cb4..03b5da21619 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c @@ -715,6 +715,7 @@ static void __init omap_h4_init(void) static void __init omap_h4_map_io(void) { + omap2_set_globals_242x(); omap2_map_common_io(); } diff --git a/arch/arm/mach-omap2/board-n800.c b/arch/arm/mach-omap2/board-n800.c index 1604513271b..4473fd54e34 100644 --- a/arch/arm/mach-omap2/board-n800.c +++ b/arch/arm/mach-omap2/board-n800.c @@ -479,6 +479,7 @@ static void __init nokia_n800_map_io(void) omap_board_config = n800_config; omap_board_config_size = ARRAY_SIZE(n800_config); + omap2_set_globals_242x(); omap2_map_common_io(); } diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c index 7cb91222dbe..d129ccb3eba 100644 --- a/arch/arm/plat-omap/common.c +++ b/arch/arm/plat-omap/common.c @@ -253,3 +253,24 @@ static int __init omap_init_clocksource_32k(void) arch_initcall(omap_init_clocksource_32k); #endif /* TIMER_32K_SYNCHRONIZED */ + +/* Global address base setup code */ + +#if defined(CONFIG_ARCH_OMAP2420) +void __init omap2_set_globals_242x(void) +{ +} +#endif + +#if defined(CONFIG_ARCH_OMAP2430) +void __init omap2_set_globals_243x(void) +{ +} +#endif + +#if defined(CONFIG_ARCH_OMAP3430) +void __init omap2_set_globals_343x(void) +{ +} +#endif + diff --git a/include/asm-arm/arch-omap/common.h b/include/asm-arm/arch-omap/common.h index 17979272b6a..0255d822d7c 100644 --- a/include/asm-arm/arch-omap/common.h +++ b/include/asm-arm/arch-omap/common.h @@ -44,4 +44,8 @@ extern int omap_register_i2c_bus(int bus_id, u32 clkrate, #define omap_register_i2c_bus(...) do { } while (0) #endif +void omap2_set_globals_242x(void); +void omap2_set_globals_243x(void); +void omap2_set_globals_343x(void); + #endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */ diff --git a/include/asm-arm/arch-omap/omap24xx.h b/include/asm-arm/arch-omap/omap24xx.h index 1eb574974e4..8c74186f27b 100644 --- a/include/asm-arm/arch-omap/omap24xx.h +++ b/include/asm-arm/arch-omap/omap24xx.h @@ -85,7 +85,6 @@ #define OMAP2_PRM_BASE OMAP2420_PRM_BASE #define OMAP2_SDRC_BASE OMAP2420_SDRC_BASE #define OMAP2_SMS_BASE OMAP2420_SMS_BASE -#define OMAP2_L4_BASE L4_24XX_BASE #define OMAP2_VA_IC_BASE IO_ADDRESS(OMAP24XX_IC_BASE) #define OMAP2_CTRL_BASE OMAP2420_CTRL_BASE @@ -97,7 +96,6 @@ #define OMAP2_PRM_BASE OMAP2430_PRM_BASE #define OMAP2_SDRC_BASE OMAP243X_SDRC_BASE #define OMAP2_SMS_BASE OMAP243X_SMS_BASE -#define OMAP2_L4_BASE L4_24XX_BASE #define OMAP2_VA_IC_BASE IO_ADDRESS(OMAP24XX_IC_BASE) #define OMAP2_CTRL_BASE OMAP243X_CTRL_BASE diff --git a/include/asm-arm/arch-omap/omap34xx.h b/include/asm-arm/arch-omap/omap34xx.h index 93275826d83..f54dedf82c0 100644 --- a/include/asm-arm/arch-omap/omap34xx.h +++ b/include/asm-arm/arch-omap/omap34xx.h @@ -69,7 +69,6 @@ #define OMAP2_PRM_BASE OMAP3430_PRM_BASE #define OMAP2_SDRC_BASE OMAP343X_SDRC_BASE #define OMAP2_SMS_BASE OMAP343X_SMS_BASE -#define OMAP2_L4_BASE L4_34XX_BASE #define OMAP2_VA_IC_BASE IO_ADDRESS(OMAP34XX_IC_BASE) #define OMAP2_CTRL_BASE OMAP3430_CTRL_BASE #define OMAP34XX_CONTROL_DEVCONF0 (L4_34XX_BASE + 0x2274) -- 2.41.1