summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/spl/spl_fit.c2
-rw-r--r--common/spl/spl_opensbi.c5
2 files changed, 6 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++);
diff --git a/common/spl/spl_opensbi.c b/common/spl/spl_opensbi.c
index 5a26d7c31a4..0ed6afeacc6 100644
--- a/common/spl/spl_opensbi.c
+++ b/common/spl/spl_opensbi.c
@@ -57,6 +57,11 @@ void __noreturn spl_invoke_opensbi(struct spl_image_info *spl_image)
hang();
}
+ if (!IS_ALIGNED((uintptr_t)spl_image->fdt_addr, 8)) {
+ pr_err("SPL image loaded an improperly-aligned device tree\n");
+ hang();
+ }
+
/*
* Originally, u-boot-spl will place DTB directly after the kernel,
* but the size of the kernel did not include the BSS section, which