diff options
author | Simon Glass | 2023-05-04 16:50:55 -0600 |
---|---|---|
committer | Bin Meng | 2023-05-11 10:25:29 +0800 |
commit | 4e7cbf746f6ed1353244773b47aa1c7f92ed9d97 (patch) | |
tree | 8afbf82f252b25da84516b5452b50ea3a9a0b7db /arch/x86/lib | |
parent | 6624392d3bb633fe91b7cc4b75b6eec28f637f72 (diff) |
x86: Tidy up address for loading U-Boot from SPL
Use the binman symbols for this, to avoid hard-coding the value. We could
use CONFIG_X86_OFFSET_U_BOOT for the address, but it seems better to
obtain the offset and size through the same mechanism.
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/spl.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/arch/x86/lib/spl.c b/arch/x86/lib/spl.c index 5e47ffa7db7..479889aec6f 100644 --- a/arch/x86/lib/spl.c +++ b/arch/x86/lib/spl.c @@ -217,16 +217,9 @@ static int spl_board_load_image(struct spl_image_info *spl_image, spl_image->name = "U-Boot"; if (!IS_ENABLED(CONFIG_SYS_COREBOOT)) { - /* - * Copy U-Boot from ROM - * TODO(sjg@chromium.org): Figure out a way to get the text base - * correctly here, and in the device-tree binman definition. - * - * Also consider using FIT so we get the correct image length - * and parameters. - */ - memcpy((char *)spl_image->load_addr, (char *)0xfff00000, - 0x100000); + /* Copy U-Boot from ROM */ + memcpy((void *)spl_image->load_addr, + (void *)spl_get_image_pos(), spl_get_image_size()); } debug("Loading to %lx\n", spl_image->load_addr); |