fdt/Makefile: make u-boot-dtb.bin 8-byte aligned

The dts/kern.dtb is appended after u-boot-dtb.bin for U-disk boot.

Make sure u-boot-dtb.bin is 8-byte aligned to avoid data-abort on
calling: fdt_check_header(gd->fdt_blob_kern).

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Id5f2daf0c5446e7ea828cb970d3d4879e3acda86
This commit is contained in:
Joseph Chen 2019-12-12 18:07:07 +08:00
parent 9f8dc1751f
commit 369e944c84
2 changed files with 7 additions and 2 deletions

View File

@ -887,6 +887,9 @@ endif
quiet_cmd_copy = COPY $@ quiet_cmd_copy = COPY $@
cmd_copy = cp $< $@ cmd_copy = cp $< $@
quiet_cmd_truncate = ALIGN $@
cmd_truncate = truncate -s "%8" $@
ifeq ($(CONFIG_MULTI_DTB_FIT),y) ifeq ($(CONFIG_MULTI_DTB_FIT),y)
fit-dtb.blob: dts/dt.dtb FORCE 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),) ifneq ($(wildcard dts/kern.dtb),)
u-boot-dtb-kern.bin: u-boot-dtb.bin FORCE u-boot-dtb-kern.bin: u-boot-dtb.bin FORCE
$(call if_changed,copy) $(call if_changed,copy)
$(call if_changed,truncate)
u-boot.bin: u-boot-dtb-kern.bin dts/kern.dtb FORCE u-boot.bin: u-boot-dtb-kern.bin dts/kern.dtb FORCE
$(call if_changed,cat) $(call if_changed,cat)
else else
u-boot.bin: u-boot-dtb.bin FORCE u-boot.bin: u-boot-dtb.bin FORCE
$(call if_changed,copy) $(call if_changed,copy)
$(call if_changed,truncate)
endif endif
else else

View File

@ -1286,8 +1286,8 @@ int fdtdec_setup(void)
gd->fdt_blob = (ulong *)&_end; gd->fdt_blob = (ulong *)&_end;
# ifdef CONFIG_USING_KERNEL_DTB # ifdef CONFIG_USING_KERNEL_DTB
gd->fdt_blob_kern = gd->fdt_blob_kern = (ulong *)((ulong)gd->fdt_blob +
(ulong *)((ulong)gd->fdt_blob + fdt_totalsize(gd->fdt_blob)); ALIGN(fdt_totalsize(gd->fdt_blob), 8));
# endif # endif
# endif # endif
# elif defined(CONFIG_OF_BOARD) # elif defined(CONFIG_OF_BOARD)