From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-22.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 786FCC4338F for ; Thu, 19 Aug 2021 15:56:23 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DBCE1601FE for ; Thu, 19 Aug 2021 15:56:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DBCE1601FE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5406F8201E; Thu, 19 Aug 2021 17:56:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id A16EE829C6; Thu, 19 Aug 2021 17:56:18 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id EB71780725 for ; Thu, 19 Aug 2021 17:56:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 67DF21042; Thu, 19 Aug 2021 08:56:08 -0700 (PDT) Received: from [10.1.36.13] (e110479.cambridge.arm.com [10.1.36.13]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 57D5C3F70D; Thu, 19 Aug 2021 08:56:07 -0700 (PDT) Subject: Re: [PATCH 07/10] Makefile: Align fit-dtb.blob and u-boot.itb by 64bits for 64bit systems To: Michal Simek , u-boot@lists.denx.de, git@xilinx.com Cc: Bin Meng , Chee Hong Ang , =?UTF-8?Q?Marek_Beh=c3=ban?= , =?UTF-8?Q?Pali_Roh=c3=a1r?= , Simon Glass References: From: Andre Przywara Message-ID: <835b6be6-6f63-913c-7872-f043c82f8fe5@arm.com> Date: Thu, 19 Aug 2021 16:56:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On 8/19/21 12:19 PM, Michal Simek wrote: Hi, > Enabling MULTI_DTB_FIT and DTB_RESELECT can end up with multi DTBs in FIT > image placed and aligned only by 32bits (4bytes). For 64bit systems there > 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. The patch is using CONFIG_PHYS_64BIT macro to > identify 64bit systems (including 32bit systems with PAE). > > Signed-off-by: Michal Simek > --- > > Makefile | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/Makefile b/Makefile > index 269e353a28ad..1bbe95595efe 100644 > --- a/Makefile > +++ b/Makefile > @@ -1169,6 +1169,10 @@ 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 > > +ifeq ($(CONFIG_PHYS_64BIT),y) Why is this restricted to 64-bit "systems"? The DT spec[1] clearly states that some DT parts (/memreserved/ block, for instance), must be 64-bit aligned, which means the whole blobs needs to be 64-bit aligned. Granted this probably does not cause real issues on 32-bit systems, but is violating the spec anyway. So I'd say we add the alignment requirement unconditionally. Cheers, Andre [1] https://github.com/devicetree-org/devicetree-specification/releases/download/v0.3/devicetree-specification-v0.3.pdf > +MKIMAGEFLAGS_fit-dtb.blob += -B 0x8 > +endif > + > ifneq ($(EXT_DTB),) > u-boot-fit-dtb.bin: u-boot-nodtb.bin $(EXT_DTB) > $(call if_changed,cat) > @@ -1431,6 +1435,9 @@ MKIMAGEFLAGS_u-boot.itb = > else > MKIMAGEFLAGS_u-boot.itb = -E > endif > +ifeq ($(CONFIG_PHYS_64BIT),y) > +MKIMAGEFLAGS_u-boot.itb += -B 0x8 > +endif > > ifdef U_BOOT_ITS > u-boot.itb: u-boot-nodtb.bin \ >