summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2013-03-11 07:06:48 +0000
committerTom Rini <trini@ti.com>2013-03-15 16:14:00 -0400
commit632efa744013205c5f9a2a5fe21bfd0f968d00c7 (patch)
tree421d10f0b5f432bebd6a66db5a6d5ac62e90320e
parent959daa21d4da6a7d3f1afa682395066bf9a9e48d (diff)
downloadu-boot-imx-632efa744013205c5f9a2a5fe21bfd0f968d00c7.zip
u-boot-imx-632efa744013205c5f9a2a5fe21bfd0f968d00c7.tar.gz
u-boot-imx-632efa744013205c5f9a2a5fe21bfd0f968d00c7.tar.bz2
Add CONFIG_SYS_SYM_OFFSETS to support offset symbols
Link symbols as created by the link script can either be absolute or relative to the text start. This option switches between the two options so that we can support both. As we convert architectures over to generic board, we can see if this option is actually needed, or whether it is possible to unify this feature also. Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--README7
-rw-r--r--common/board_f.c14
2 files changed, 21 insertions, 0 deletions
diff --git a/README b/README
index bdce275..a620f0a 100644
--- a/README
+++ b/README
@@ -3222,6 +3222,13 @@ Configuration Settings:
its config.mk file). If you find problems enabling this option on
your board please report the problem and send patches!
+- CONFIG_SYS_SYM_OFFSETS
+ This is set by architectures that use offsets for link symbols
+ instead of absolute values. So bss_start is obtained using an
+ offset _bss_start_ofs from CONFIG_SYS_TEXT_BASE, rather than
+ directly. You should not need to touch this setting.
+
+
The following definitions that deal with the placement and management
of environment data (variable area); in general, we support the
following configurations:
diff --git a/common/board_f.c b/common/board_f.c
index 42042cc..b625ccb 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -107,8 +107,13 @@ static int display_text_info(void)
{
ulong bss_start, bss_end;
+#ifdef CONFIG_SYS_SYM_OFFSETS
bss_start = _bss_start_ofs + _TEXT_BASE;
bss_end = _bss_end_ofs + _TEXT_BASE;
+#else
+ bss_start = (ulong)&__bss_start;
+ bss_end = (ulong)&__bss_end;
+#endif
debug("U-Boot code: %08X -> %08lX BSS: -> %08lX\n",
CONFIG_SYS_TEXT_BASE, bss_start, bss_end);
@@ -174,7 +179,11 @@ static int zero_global_data(void)
static int setup_mon_len(void)
{
+#ifdef CONFIG_SYS_SYM_OFFSETS
gd->mon_len = _bss_end_ofs;
+#else
+ gd->mon_len = (ulong)&__bss_end - (ulong)&__text_start;
+#endif
return 0;
}
@@ -190,7 +199,11 @@ static int setup_fdt(void)
gd->fdt_blob = _binary_dt_dtb_start;
#elif defined CONFIG_OF_SEPARATE
/* FDT is at end of image */
+# ifdef CONFIG_SYS_SYM_OFFSETS
gd->fdt_blob = (void *)(_end_ofs + CONFIG_SYS_TEXT_BASE);
+# else
+ gd->fdt_blob = (ulong *)&_end;
+# endif
#endif
/* Allow the early environment to override the fdt address */
gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16,
@@ -483,6 +496,7 @@ static int mark_bootstage(void)
}
static init_fnc_t init_sequence_f[] = {
+ zero_global_data,
setup_fdt,
setup_mon_len,
arch_cpu_init, /* basic arch cpu dependent setup */