diff mbox series

[07/10] Makefile: Align fit-dtb.blob and u-boot.itb by 64bits

Message ID 07e38a4009054fba63f6e46f393ad33efb495f4b.1629704273.git.michal.simek@xilinx.com
State Accepted
Commit 570c4636808e77a18ccd8865b2654fff08f13328
Delegated to: Michal Simek
Headers show
Series xilinx: Add support for DTB reselection | expand

Commit Message

Michal Simek Aug. 23, 2021, 7:37 a.m. UTC
Enabling MULTI_DTB_FIT and DTB_RESELECT can end up with multi DTBs in FIT
image placed and aligned only by 32bits (4bytes). Based on device tree
specification:
"Specifically, the memory reservation block shall be aligned to an 8-byte boundary
and the structure block to a 4-byte boundary."
is 64bit (8bytes) alignment required. That's why make sure that
fit-dtb.blob and u-boot.itb as our primary target images for Xilinx ZynqMP
are all 64bit aligned.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

Changes in v2:
- Update subject and commit message
- Enable 64bit alignment for all - reported by Andre

 Makefile | 3 +++
 1 file changed, 3 insertions(+)

Comments

Andre Przywara Aug. 23, 2021, 11:19 a.m. UTC | #1
On Mon, 23 Aug 2021 09:37:54 +0200
Michal Simek <michal.simek@xilinx.com> wrote:

> Enabling MULTI_DTB_FIT and DTB_RESELECT can end up with multi DTBs in FIT
> image placed and aligned only by 32bits (4bytes). Based on device tree
> specification:
> "Specifically, the memory reservation block shall be aligned to an 8-byte boundary
> and the structure block to a 4-byte boundary."
> is 64bit (8bytes) alignment required. That's why make sure that
> fit-dtb.blob and u-boot.itb as our primary target images for Xilinx ZynqMP
> are all 64bit aligned.

Indeed, thanks for fixing this!

> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>

Reviewed-by: Andre Przywara <andre.przywara@arm.com>

Cheers,
Andre

> ---
> 
> Changes in v2:
> - Update subject and commit message
> - Enable 64bit alignment for all - reported by Andre
> 
>  Makefile | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Makefile b/Makefile
> index 269e353a28ad..0de909123cf9 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1169,6 +1169,8 @@ MKIMAGEFLAGS_fit-dtb.blob = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
>  	-a 0 -e 0 -E \
>  	$(patsubst %,-b arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST))) -d /dev/null
>  
> +MKIMAGEFLAGS_fit-dtb.blob += -B 0x8
> +
>  ifneq ($(EXT_DTB),)
>  u-boot-fit-dtb.bin: u-boot-nodtb.bin $(EXT_DTB)
>  		$(call if_changed,cat)
> @@ -1431,6 +1433,7 @@ MKIMAGEFLAGS_u-boot.itb =
>  else
>  MKIMAGEFLAGS_u-boot.itb = -E
>  endif
> +MKIMAGEFLAGS_u-boot.itb += -B 0x8
>  
>  ifdef U_BOOT_ITS
>  u-boot.itb: u-boot-nodtb.bin \
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 269e353a28ad..0de909123cf9 100644
--- a/Makefile
+++ b/Makefile
@@ -1169,6 +1169,8 @@  MKIMAGEFLAGS_fit-dtb.blob = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
 	-a 0 -e 0 -E \
 	$(patsubst %,-b arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST))) -d /dev/null
 
+MKIMAGEFLAGS_fit-dtb.blob += -B 0x8
+
 ifneq ($(EXT_DTB),)
 u-boot-fit-dtb.bin: u-boot-nodtb.bin $(EXT_DTB)
 		$(call if_changed,cat)
@@ -1431,6 +1433,7 @@  MKIMAGEFLAGS_u-boot.itb =
 else
 MKIMAGEFLAGS_u-boot.itb = -E
 endif
+MKIMAGEFLAGS_u-boot.itb += -B 0x8
 
 ifdef U_BOOT_ITS
 u-boot.itb: u-boot-nodtb.bin \