summaryrefslogtreecommitdiffstats
path: root/arch/x86/lib
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-08-04 12:33:44 -0600
committerSimon Glass <sjg@chromium.org>2015-08-05 08:44:05 -0600
commit981dca69f6a1df3b71f45350499cda12a40fd5ee (patch)
tree4be70749eaaacaae385288a9636f5c930929047d /arch/x86/lib
parent08aeb8b5fe7381a23e8f207744095814c17932ff (diff)
downloadu-boot-981dca69f6a1df3b71f45350499cda12a40fd5ee.tar.gz
u-boot-981dca69f6a1df3b71f45350499cda12a40fd5ee.tar.xz
u-boot-981dca69f6a1df3b71f45350499cda12a40fd5ee.zip
x86: Support skipping relocation for EFI
When running as an EFI application we must skip relocation. Add support for this in the x86 relocation code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/x86/lib')
-rw-r--r--arch/x86/lib/relocate.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/lib/relocate.c b/arch/x86/lib/relocate.c
index 1a62142a1e..9e748d254f 100644
--- a/arch/x86/lib/relocate.c
+++ b/arch/x86/lib/relocate.c
@@ -28,6 +28,8 @@ int copy_uboot_to_ram(void)
{
size_t len = (size_t)&__data_end - (size_t)&__text_start;
+ if (gd->flags & GD_FLG_SKIP_RELOC)
+ return 0;
memcpy((void *)gd->relocaddr, (void *)&__text_start, len);
return 0;
@@ -38,6 +40,8 @@ int clear_bss(void)
ulong dst_addr = (ulong)&__bss_start + gd->reloc_off;
size_t len = (size_t)&__bss_end - (size_t)&__bss_start;
+ if (gd->flags & GD_FLG_SKIP_RELOC)
+ return 0;
memset((void *)dst_addr, 0x00, len);
return 0;
@@ -58,6 +62,8 @@ int do_elf_reloc_fixups(void)
/* The size of the region of u-boot that runs out of RAM. */
uintptr_t size = (uintptr_t)&__bss_end - (uintptr_t)&__text_start;
+ if (gd->flags & GD_FLG_SKIP_RELOC)
+ return 0;
if (re_src == re_end)
panic("No relocation data");