Commit 9b217498 authored by Ben Stoltz's avatar Ben Stoltz Committed by Simon Glass
Browse files

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: default avatarBen Stoltz <stoltz@google.com>
Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarBin Meng <bmeng.cn@gmail.com>
parent 867a6ac8
...@@ -144,7 +144,7 @@ static int init_baud_rate(void) ...@@ -144,7 +144,7 @@ static int init_baud_rate(void)
static int display_text_info(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; ulong bss_start, bss_end, text_base;
bss_start = (ulong)&__bss_start; bss_start = (ulong)&__bss_start;
...@@ -267,7 +267,7 @@ static int setup_mon_len(void) ...@@ -267,7 +267,7 @@ static int setup_mon_len(void)
{ {
#if defined(__ARM__) || defined(__MICROBLAZE__) #if defined(__ARM__) || defined(__MICROBLAZE__)
gd->mon_len = (ulong)&__bss_end - (ulong)_start; 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; gd->mon_len = (ulong)&_end - (ulong)_init;
#elif defined(CONFIG_BLACKFIN) || defined(CONFIG_NIOS2) #elif defined(CONFIG_BLACKFIN) || defined(CONFIG_NIOS2)
gd->mon_len = CONFIG_SYS_MONITOR_LEN; gd->mon_len = CONFIG_SYS_MONITOR_LEN;
...@@ -968,7 +968,8 @@ void board_init_f(ulong boot_flags) ...@@ -968,7 +968,8 @@ void board_init_f(ulong boot_flags)
if (initcall_run_list(init_sequence_f)) if (initcall_run_list(init_sequence_f))
hang(); 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 */ /* NOTREACHED - jump_to_copy() does not return */
hang(); hang();
#endif #endif
......
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