]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
x86: spl: Change the condition for copying U-Boot to RAM
authorSimon Glass <sjg@chromium.org>
Thu, 7 Sep 2023 15:58:17 +0000 (09:58 -0600)
committerBin Meng <bmeng@tinylab.org>
Thu, 21 Sep 2023 22:03:46 +0000 (06:03 +0800)
Make this depend on whether the address matches the offset, rather than
a particular board build. For samus_tpl we don't need to copy, for
example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/lib/spl.c

index 58fa572b71aea03062692442284442f6690b2868..335dacf47fd04a3f5db201c60cf095f32ce143d8 100644 (file)
@@ -258,7 +258,7 @@ static int spl_board_load_image(struct spl_image_info *spl_image,
        spl_image->os = IH_OS_U_BOOT;
        spl_image->name = "U-Boot";
 
-       if (!IS_ENABLED(CONFIG_SYS_COREBOOT)) {
+       if (spl_image->load_addr != spl_get_image_pos()) {
                /* Copy U-Boot from ROM */
                memcpy((void *)spl_image->load_addr,
                       (void *)spl_get_image_pos(), spl_get_image_size());