board_f.c: Ensure 16 alignment of start_addr_sp and reserved memory
authorPatrick Delaunay <patrick.delaunay@st.com>
Tue, 10 Mar 2020 09:15:05 +0000 (10:15 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 17 Apr 2020 03:06:54 +0000 (23:06 -0400)
commit65c141ebbd68b70d6934b4fb965f3219d0e99817
treedd145ccf787512306926b0e5f327046ccfbee33c
parent6de299230fa63d3865501b069657ac26cedebd9a
board_f.c: Ensure 16 alignment of start_addr_sp and reserved memory

Add a function reserve_stack_aligned() to reserved memory with 16 bits
alignment after the stack pointer (gd->start_addr_sp) and use this new
function in board_f.c to reserve all the memory area (malloc, board, gd,
fdt, bootstage, stacks).

This 16 byte alignment is needed for cast on struct pointer
for the reserved memory, for example:
+ x86_64 ABI: https://reviews.llvm.org/D30049: 16 bytes
+ ARMv8 Instruction Set Overview: quad word, 16 bytes

An other alignment value could be needed for other architecture.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
common/board_f.c