diff --git a/Makefile b/Makefile index ddea829dbf..b9473f7495 100644 --- a/Makefile +++ b/Makefile @@ -887,6 +887,9 @@ endif quiet_cmd_copy = COPY $@ cmd_copy = cp $< $@ +quiet_cmd_truncate = ALIGN $@ + cmd_truncate = truncate -s "%8" $@ + ifeq ($(CONFIG_MULTI_DTB_FIT),y) fit-dtb.blob: dts/dt.dtb FORCE @@ -909,11 +912,13 @@ u-boot-dtb.bin: u-boot-nodtb.bin dts/dt-spl.dtb FORCE ifneq ($(wildcard dts/kern.dtb),) u-boot-dtb-kern.bin: u-boot-dtb.bin FORCE $(call if_changed,copy) + $(call if_changed,truncate) u-boot.bin: u-boot-dtb-kern.bin dts/kern.dtb FORCE $(call if_changed,cat) else u-boot.bin: u-boot-dtb.bin FORCE $(call if_changed,copy) + $(call if_changed,truncate) endif else diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 589cec3e94..5b637f2639 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -1286,8 +1286,8 @@ int fdtdec_setup(void) gd->fdt_blob = (ulong *)&_end; # ifdef CONFIG_USING_KERNEL_DTB - gd->fdt_blob_kern = - (ulong *)((ulong)gd->fdt_blob + fdt_totalsize(gd->fdt_blob)); + gd->fdt_blob_kern = (ulong *)((ulong)gd->fdt_blob + + ALIGN(fdt_totalsize(gd->fdt_blob), 8)); # endif # endif # elif defined(CONFIG_OF_BOARD)