]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Add a way to skip relocation
authorSimon Glass <sjg@chromium.org>
Tue, 4 Aug 2015 18:33:39 +0000 (12:33 -0600)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 10 Sep 2015 06:00:54 +0000 (08:00 +0200)
When running U-Boot as an EFI application we cannot relocate since we do not
have relocation information. U-Boot has already been relocated to a suitable
address.

Add a global_data flag to control skipping relocation.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
common/board_f.c
include/asm-generic/global_data.h

index f32ee9407e8bac392c2775f8d6661fe29438b1d9..dbbfbed39775c2628b3370bb9b4c38802baf5fdf 100644 (file)
@@ -659,6 +659,8 @@ static int setup_dram_config(void)
 
 static int reloc_fdt(void)
 {
+       if (gd->flags & GD_FLG_SKIP_RELOC)
+               return 0;
        if (gd->new_fdt) {
                memcpy(gd->new_fdt, gd->fdt_blob, gd->fdt_size);
                gd->fdt_blob = gd->new_fdt;
@@ -669,6 +671,11 @@ static int reloc_fdt(void)
 
 static int setup_reloc(void)
 {
+       if (gd->flags & GD_FLG_SKIP_RELOC) {
+               debug("Skipping relocation due to flag\n");
+               return 0;
+       }
+
 #ifdef CONFIG_SYS_TEXT_BASE
 #if defined(CONFIG_M68K)
        /*
@@ -697,6 +704,8 @@ static int setup_reloc(void)
 
 static int jump_to_copy(void)
 {
+       if (gd->flags & GD_FLG_SKIP_RELOC)
+               return 0;
        /*
         * x86 is special, but in a nice way. It uses a trampoline which
         * enables the dcache if possible.
index 9f5db0f5afb9f57c39e2bc10965f4bbeb96fa051..21552650025a108f4136267e4c63ea01584ea34c 100644 (file)
@@ -117,5 +117,6 @@ typedef struct global_data {
 #define GD_FLG_SERIAL_READY    0x00100 /* Pre-reloc serial console ready  */
 #define GD_FLG_FULL_MALLOC_INIT        0x00200 /* Full malloc() is ready          */
 #define GD_FLG_SPL_INIT                0x00400 /* spl_init() has been called      */
+#define GD_FLG_SKIP_RELOC      0x00800 /* Don't relocate */
 
 #endif /* __ASM_GENERIC_GBL_DATA_H */