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=-17.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,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 EF875C4338F for ; Thu, 19 Aug 2021 16:44:30 +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 2CF8160FDC for ; Thu, 19 Aug 2021 16:44:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2CF8160FDC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.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 DD6B480F47; Thu, 19 Aug 2021 18:44:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="eQ+4PN18"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B240080ECD; Thu, 19 Aug 2021 18:44:25 +0200 (CEST) Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1791780F47 for ; Thu, 19 Aug 2021 18:44:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qv1-xf29.google.com with SMTP id jz1so3907557qvb.13 for ; Thu, 19 Aug 2021 09:44:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/Bc/t+gBwatGitudGPdoMOwUIFrESb68aQclE0y+tBw=; b=eQ+4PN18i7xL2GSp+oenDqkGGzmmDdO84vxxEmXgwZA0/NQhz1ZNXS8aagnrJWFvh+ dAQmd3NBxKs83VQgJXHw4GtO/vvFOiFktQPVo//CQ294rf58d/l6MwrRm01GL19uxx0/ 3m1J8PufOM2hSnOiravNvZF1pUKF7bHNR09Yg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=/Bc/t+gBwatGitudGPdoMOwUIFrESb68aQclE0y+tBw=; b=V72JpJhVofcaoIClA1Lq46ZMX9J5QBdKGVSOrnWxAuVlMMBKB925C3ZVdXYiXr3UK8 mEHe1SoSrqe+vRjv65ci1KtBB/amcHfuZux85Qt2AsWXBhQSLuDg1rcuCLG6QiGzvrNn m17AQVuZlWIsqGTr3nbKHnKQue1KRxZ/caXFoZKTTcbXzAvEgLosyL2wQYPM1X+7UFAJ GBC92j17NEl72dR//unPknqfpxRY5bZltJrw/HXHIfoq1PnXKJeFjdTbiHtbSK3P0AjY +0Jtze9HGWwEuxUidgS0pF/amDAW32zR28VXOW+2RPQyy/SBmK2r1IfOyEzN86sdc6h9 lREA== X-Gm-Message-State: AOAM530289bINRnWaAR6TQ9xvhzN+gu/vGcF2g/w/KqSO+C6ivpSqXij sCiN5GhmGoXvlHX/50acoiX5Lw== X-Google-Smtp-Source: ABdhPJzNTNJkfcTHWUpco04xqYdpdKGZNg+BpQgnMJ1rSUOCm0xLrI60PJEp/pvMPckw+injCUJL+Q== X-Received: by 2002:a0c:e311:: with SMTP id s17mr15623256qvl.39.1629391459769; Thu, 19 Aug 2021 09:44:19 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-599d-dbbd-fe12-cbbd.res6.spectrum.com. [2603:6081:7b01:cbda:599d:dbbd:fe12:cbbd]) by smtp.gmail.com with ESMTPSA id n189sm1813738qka.69.2021.08.19.09.44.18 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Aug 2021 09:44:18 -0700 (PDT) Date: Thu, 19 Aug 2021 12:44:16 -0400 From: Tom Rini To: Michal Simek Cc: Andre Przywara , u-boot@lists.denx.de, git@xilinx.com, Bin Meng , Chee Hong Ang , Marek =?iso-8859-1?Q?Beh=FAn?= , Pali =?iso-8859-1?Q?Roh=E1r?= , Simon Glass Subject: Re: [PATCH 07/10] Makefile: Align fit-dtb.blob and u-boot.itb by 64bits for 64bit systems Message-ID: <20210819164416.GA858@bill-the-cat> References: <835b6be6-6f63-913c-7872-f043c82f8fe5@arm.com> <0f5c68ec-4396-1088-a650-b284d9007190@xilinx.com> <20210819161835.GZ858@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="NkGqNvMjI9Tjbmwd" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) 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 --NkGqNvMjI9Tjbmwd Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 19, 2021 at 06:31:25PM +0200, Michal Simek wrote: >=20 >=20 > On 8/19/21 6:18 PM, Tom Rini wrote: > > On Thu, Aug 19, 2021 at 06:01:39PM +0200, Michal Simek wrote: > >> Hi Andre, > >> > >> On 8/19/21 5:56 PM, Andre Przywara wrote: > >>> On 8/19/21 12:19 PM, Michal Simek wrote: > >>> > >>> Hi, > >>> > >>>> Enabling MULTI_DTB_FIT and DTB_RESELECT can end up with multi DTBs i= n 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 > >>>> --- > >>>> > >>>> =A0 Makefile | 7 +++++++ > >>>> =A0 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 =3D -f auto -A $(AR= CH) > >>>> -T firmware -C none -O u-boot \ > >>>> =A0=A0=A0=A0=A0 -a 0 -e 0 -E \ > >>>> =A0=A0=A0=A0=A0 $(patsubst %,-b arch/$(ARCH)/dts/%.dtb,$(subst > >>>> ",,$(CONFIG_OF_LIST))) -d /dev/null > >>>> =A0 +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 aligne= d. > >>> Granted this probably does not cause real issues on 32-bit systems, b= ut > >>> is violating the spec anyway. > >>> So I'd say we add the alignment requirement unconditionally. > >> > >> That's even better for me and we need to make sure that dtbs itself are > >> aligned and also dtbs inside FIT image are aligned too. > >=20 > > Right, all dtbs need to be 8 byte aligned to start with. Enforcing this > > is what will unblock moving to a newer libfdt where that's checked for > > up-front now. >=20 > As is in the second thread. Does it make sense to also align the end? > I did that in 8/10 patch. > The problem with these alignments is that you also need to align the > start of FIT image. Maybe would the best to copy fdt to different > aligned location. Right, so a good question. I have suggested before that we stop assuming that we (U-Boot SPL, etc) can use the device tree in-place and instead move it somewhere aligned. I'm not sure off-hand what ends up being best, someone would need to investigate a bit. --=20 Tom --NkGqNvMjI9Tjbmwd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmEeiloACgkQFHw5/5Y0 tyyk0Av+NVksCwYvDUQNJoIb1D6xY2BKJTGKxJFN6CtiabZXZNddxoU3sgHGXxns ECHpxXFQbMGBeX85kK2ha1i/XHNJViYUtJZCRTAuCk94sKoyVEcsSVxfzP4b0xuA CHDKK53WdHkoJE4r+tlk6rm6yFw+3dxuSYBgtqeSm+zK9SXcS2smFbFR6YXth5Ho IXcXnN0E9n3QAzeTdz5dOLPagbn48GNNWcwpsds27CfI1X28cRCx01RjfnoiX5rj vW6AF8OinqUfRyTcvBEl2OTGQSDvwd55PS5kUYqvsoLKg7PNVYQMWjDawgat99xX GZX/HZBQm6LW03bILeYCU5T6QoSRe6UWODND/FBHxlXJTzMqltYKDsmA8zxivFb4 k0lvFUU4LesyHdHX4B0HaqjiCFSxT/+ZGeOOmM+Mo1iZgzTXl/ZS1KermXm+r0+v NYkjtt1u9KrpbE6AXUNBJ2SJrtxl6hr30j8/rhm6ktsrJDSGxMSIN1H9qqusLw3O kSWb9nJA =/3J2 -----END PGP SIGNATURE----- --NkGqNvMjI9Tjbmwd--