summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorBen Stoltz <stoltz@google.com>2015-07-31 09:31:37 -0600
committerSimon Glass <sjg@chromium.org>2015-08-05 08:42:41 -0600
commit9b2174984e58972e657292dc8ff08e8d58dfbf06 (patch)
treeb97daa0ceed4eb9e4d93903201ba0b9bb1599dc5 /common
parent867a6ac86dd823de409752e9ca5dc8f4d4880f26 (diff)
efi: Avoid using non-existent text base
When U-Boot runs as an EFI application is does not have a definition of CONFIG_SYS_TEXT_BASE. U-Boot is a relocatable application and the relocation is done by EFI. U-Boot can be loaded at any address. This is similar to how sandbox works. Adjust the early board init to deal with this. Signed-off-by: Ben Stoltz <stoltz@google.com> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'common')
-rw-r--r--common/board_f.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/common/board_f.c b/common/board_f.c
index 21be26f8e4..6d922b8c86 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -144,7 +144,7 @@ static int init_baud_rate(void)
static int display_text_info(void)
{
-#ifndef CONFIG_SANDBOX
+#if !defined(CONFIG_SANDBOX) && !defined(CONFIG_EFI_APP)
ulong bss_start, bss_end, text_base;
bss_start = (ulong)&__bss_start;
@@ -267,7 +267,7 @@ static int setup_mon_len(void)
{
#if defined(__ARM__) || defined(__MICROBLAZE__)
gd->mon_len = (ulong)&__bss_end - (ulong)_start;
-#elif defined(CONFIG_SANDBOX)
+#elif defined(CONFIG_SANDBOX) || defined(CONFIG_EFI_APP)
gd->mon_len = (ulong)&_end - (ulong)_init;
#elif defined(CONFIG_BLACKFIN) || defined(CONFIG_NIOS2)
gd->mon_len = CONFIG_SYS_MONITOR_LEN;
@@ -968,7 +968,8 @@ void board_init_f(ulong boot_flags)
if (initcall_run_list(init_sequence_f))
hang();
-#if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX)
+#if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX) && \
+ !defined(CONFIG_EFI_APP)
/* NOTREACHED - jump_to_copy() does not return */
hang();
#endif