mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-29 02:21:31 +00:00
riscv: booti: do not force relocation if force_reloc is not set
If force_reloc flag is not set and booti is called for an address ouside RAM (i. e. QSPI NOR flash), we should honor that and not try to force relocation in a bogus fashion. Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
This commit is contained in:
parent
66a21be674
commit
6ba8eeb6f1
1 changed files with 6 additions and 1 deletions
|
@ -50,7 +50,12 @@ int booti_setup(ulong image, ulong *relocated_addr, ulong *size,
|
|||
return -EINVAL;
|
||||
}
|
||||
*size = lhdr->image_size;
|
||||
*relocated_addr = gd->ram_base + lhdr->text_offset;
|
||||
if (force_reloc ||
|
||||
(gd->ram_base <= image && image < gd->ram_base + gd->ram_size)) {
|
||||
*relocated_addr = gd->ram_base + lhdr->text_offset;
|
||||
} else {
|
||||
*relocated_addr = image;
|
||||
}
|
||||
|
||||
unmap_sysmem(lhdr);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue