Commit 2b256e28 authored by Paul Walmsley's avatar Paul Walmsley Committed by Tony Lindgren

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: default avatarPaul Walmsley <paul@pwsan.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 6094b32c
......@@ -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();
}
......
......@@ -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();
}
......
......@@ -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);
......
......@@ -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();
}
......
......@@ -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();
}
......
......@@ -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();
}
......
......@@ -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();
}
......
......@@ -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
......@@ -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 */
......@@ -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
......
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment