In reserve_bootstage(), in case size is odd, gd->new_bootstage
is not aligned. In bootstage_relocate(), the platform hangs when
getting access to data->record[i].name.
To avoid this issue, make gd->new_bootstage 16 byte aligned.

Fixes: ac9cd4805c8b ("bootstage: Correct relocation algorithm")

Signed-off-by: Patrice Chotard <[email protected]>
Reviewed-by: Vikas MANOCHA <[email protected]>
---

 common/board_f.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/board_f.c b/common/board_f.c
index e3591cbaeb..9cd4cfaf5f 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -559,6 +559,7 @@ static int reserve_bootstage(void)
        int size = bootstage_get_size();
 
        gd->start_addr_sp -= size;
+       gd->start_addr_sp = ALIGN_DOWN(gd->start_addr_sp, 16);
        gd->new_bootstage = map_sysmem(gd->start_addr_sp, size);
        debug("Reserving %#x Bytes for bootstage at: %08lx\n", size,
              gd->start_addr_sp);
-- 
2.17.1

_______________________________________________
U-Boot mailing list
[email protected]
https://lists.denx.de/listinfo/u-boot

Reply via email to