summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Edwards <cfsworks@gmail.com>2025-03-15 15:18:13 -0700
committerTom Rini <trini@konsulko.com>2025-04-02 14:33:50 -0600
commit358d1cc232c30091767ce192e74169e7861ae58a (patch)
tree2eb587dad7472ffa905860a64c4a29dce0604fde
parent17d830cb4b6cdbac56d41938d455820fd7a96a89 (diff)
spl: Align FDT load address
While the image size is generally a multiple of 8 bytes, this is not actually guaranteed; some linkers (like LLD) will shave a few bytes off of the end of output sections if there are no content bytes there. Since libfdt imposes a hard rule of 8-byte alignment, make the SPL also be explicit about the alignment when loading the FDT. Signed-off-by: Sam Edwards <CFSworks@gmail.com>
-rw-r--r--common/spl/spl_fit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index 49b4df60560..86506d6905c 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -397,7 +397,7 @@ static int spl_fit_append_fdt(struct spl_image_info *spl_image,
* Use the address following the image as target address for the
* device tree.
*/
- image_info.load_addr = spl_image->load_addr + spl_image->size;
+ image_info.load_addr = ALIGN(spl_image->load_addr + spl_image->size, 8);
/* Figure out which device tree the board wants to use */
node = spl_fit_get_image_node(ctx, FIT_FDT_PROP, index++);