summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-11-28 10:22:16 -0600
committerTom Rini <[email protected]>2025-11-28 10:22:16 -0600
commit626cb9993fba6cd5e91bb4a788f401ee916f5144 (patch)
treea590c5fe6f07e78d4489159d80b567dba7740256 /boot
parent4a4871e3dc38f3f771d2713b805e79e6191b4297 (diff)
parent534eaa4d4dec9efed662189fd68f78b3b7b1e636 (diff)
Merge branch 'assorted-dtb-alignment-fixes' into next
This merges a number of fixes from Marek Vasut that will allow us to move to a newer dtc release (that enforces the 8 byte alignment requirement that has long existed).
Diffstat (limited to 'boot')
-rw-r--r--boot/image-fit.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/boot/image-fit.c b/boot/image-fit.c
index 2f2d3e9304d..cccaa48f683 100644
--- a/boot/image-fit.c
+++ b/boot/image-fit.c
@@ -23,7 +23,6 @@
#include <log.h>
#include <mapmem.h>
#include <asm/io.h>
-#include <malloc.h>
#include <memalign.h>
#include <asm/global_data.h>
#ifdef CONFIG_DM_HASH
@@ -36,6 +35,7 @@ DECLARE_GLOBAL_DATA_PTR;
#include <bootm.h>
#include <image.h>
#include <bootstage.h>
+#include <malloc.h>
#include <upl.h>
#include <u-boot/crc.h>
@@ -2279,7 +2279,7 @@ int fit_image_load(struct bootm_headers *images, ulong addr,
log_debug("decompressing image\n");
if (load == data) {
- loadbuf = malloc(max_decomp_len);
+ loadbuf = memalign(8, max_decomp_len);
load = map_to_sysmem(loadbuf);
} else {
loadbuf = map_sysmem(load, max_decomp_len);
@@ -2291,6 +2291,11 @@ int fit_image_load(struct bootm_headers *images, ulong addr,
return -ENOEXEC;
}
len = load_end - load;
+ } else if (load_op != FIT_LOAD_IGNORED && image_type == IH_TYPE_FLATDT &&
+ ((uintptr_t)buf & 7)) {
+ loadbuf = memalign(8, len);
+ load = map_to_sysmem(loadbuf);
+ memcpy(loadbuf, buf, len);
} else if (load != data) {
log_debug("copying\n");
loadbuf = map_sysmem(load, len);