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=-12.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,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 0CDAAC07E95 for ; Tue, 13 Jul 2021 13:47:20 +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 4500B61249 for ; Tue, 13 Jul 2021 13:47:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4500B61249 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 659848311D; Tue, 13 Jul 2021 15:47:17 +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="FdKv8zO4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7298483135; Tue, 13 Jul 2021 15:47:15 +0200 (CEST) Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) (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 79E818311D for ; Tue, 13 Jul 2021 15:47:07 +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-qt1-x82c.google.com with SMTP id d1so16652173qto.4 for ; Tue, 13 Jul 2021 06:47:07 -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=6FCDWQ2eU23etOXzvriuM8XszdOAuh1zKg4MlRYYSas=; b=FdKv8zO46xvmf1hGZO7tA5d2rAY/0R3Gd0tTWa0Q7BTgGoAB2mSE1YD5fgyTsh0FyB KMgea0BY+ir6lYT7SGq0D2/4BFJ8wOWn3rhRQqoE0Quhi3AutlyCMV9yghv8u5J6Jzcz tGnoCbWT4wG6/nSMTl5hI10dqND0y188ATuK4= 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=6FCDWQ2eU23etOXzvriuM8XszdOAuh1zKg4MlRYYSas=; b=EdxQVYHm+F3o080TMU3EoXOEoLafJmcPG+O8pNnMRPbrev/EUzph6mSyR9oHW6MQT0 D6dJMvTUKTy7UM5O+knVlk63kS+zk99+HOWeWubm1l7i2FH1VwGFdjzYccZqwiLUDmDf YH9R/rdAFtOF0g+8VG1KKF64pNNSZfvVn27G82oB6Uh/E03GOEnGyePYKGxjfgfx2a75 lqpXIoOKTMHopUB1+ZRhvw6sjCUN4+sr+6WFzZHyP8+NDN8c8ls55JcpLeYPEw8GcmQi BubIti27wjXumQ4huN9vGvl3s6xMtpVTA6T5uvJ+ip1wwsYCcSYWj6Aq+tzOvB2NtYjh Pxbg== X-Gm-Message-State: AOAM530w9DE/4orsKoKlrQaoKCeHQP7epYixBOD8GwlbfSpZ3bWdGF1P DoC9dEIAqtmOuEox9qHFohV/Og== X-Google-Smtp-Source: ABdhPJzww0DlP2+J/j8M9Ci6YhlGwZNN/jipDa7+5shauFiZdroXU0eWPG68ClFqfI8cbrwCuH6dPw== X-Received: by 2002:ac8:60d:: with SMTP id d13mr4125311qth.223.1626184026185; Tue, 13 Jul 2021 06:47:06 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-1c72-8d2e-073a-3455.res6.spectrum.com. [2603:6081:7b01:cbda:1c72:8d2e:73a:3455]) by smtp.gmail.com with ESMTPSA id k24sm1899157qkk.25.2021.07.13.06.47.04 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Jul 2021 06:47:05 -0700 (PDT) Date: Tue, 13 Jul 2021 09:47:03 -0400 From: Tom Rini To: "Alex G." Cc: Bin Meng , Reuben Dowle , Marek Vasut , Simon Glass , "u-boot@lists.denx.de" Subject: Re: [PATCH] spl: Align device tree blob address at 8-byte boundary Message-ID: <20210713134703.GF9516@bill-the-cat> References: <20210712035231.26475-1-bmeng.cn@gmail.com> <58187afcb4aa481a8302777aca599fa7@4rf.com> <20210712151510.GT9516@bill-the-cat> <300cbb2d-a343-aff8-2c73-00a81ec05af3@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="r0fGHqLcE2Tn1loh" Content-Disposition: inline In-Reply-To: <300cbb2d-a343-aff8-2c73-00a81ec05af3@gmail.com> 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 --r0fGHqLcE2Tn1loh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 12, 2021 at 11:01:24AM -0500, Alex G. wrote: > On 7/12/21 10:15 AM, Tom Rini wrote: > > On Mon, Jul 12, 2021 at 01:36:14PM +0800, Bin Meng wrote: > > > On Mon, Jul 12, 2021 at 1:21 PM Reuben Dowle w= rote: > > > >=20 > > > > I submitted an almost identical patch. See https://github.com/u-boo= t/u-boot/commit/eb39d8ba5f0d1468b01b89a2a464d18612d3ea76 > > > >=20 > > > > This patch eventually had to be reverted (https://github.com/u-boot= /u-boot/commit/5675ed7cb645f5ec13958726992daeeed16fd114), because it was ca= using issues on some platforms that had FIT on 32 bit boundary. However I c= ontinue to use it in production code, as without it the boot on my platform= aborts. > > > >=20 > > > > I don't have time to investigate why this was happening, but you ne= ed to check this code won't just cause exactly the same faults. > > >=20 > > > Thanks for your information. > > >=20 > > > +Marek who did the revert > > >=20 > > > The revert commit message says: > > >=20 > > > "The commit breaks booting of fitImage by SPL, the system simply > > > hangs. This is because on arm32, the fitImage and all of its content > > > can be aligned to 4 bytes and U-Boot expects just that." > > >=20 > > > I don't understand this. If an address is aligned to 8, it is already > > > aligned to 4, so how did this commit make the system hang on arm32? > >=20 > > I think this had something to do with embedding contents somewhere in > > the image? There is a thread on the ML from then but I don't know how > > informative it will end up being. >=20 > It's true that the flat devicetree spec requires an 8-byte alignment, even > on 32-bit. The issues here are specific to u-boot. >=20 > SPL and u-boot have to agree where u-boot's FDT is located. We'll look at > two cases: > 1) u-boot as a FIT (binary and FDT separately loaded) > 2) u-boot with embedded FDT >=20 > In case (1) SPL must place the FDT at a location where u-boot will find i= t. > The current logic is > SPL: fdt =3D ALIGN_4(u_boot + u_boot_size) > u-boot: fdt =3D ALIGN_4(u_boot + u_boot_size) >=20 > In case (2), SPL's view of the FDT is not relevant, but instead the build > system must place the FDT correctly: > build: fdt >> u-boot.bin > u-boot: fdt =3D ALIGN_4(u_boot + u_boot_size) >=20 > We have 3 places that must agree. A correct and complete patch could chan= ge > all three, but one has to consider compatibility issues when crossing u-b= oot > and SPL versions. >=20 > I had proposed in the revert discussion that SPL use r2 or similar mechan= ism > to pass the location of the FDT to u-boot. I'm not sure that we need to worry too much about mix-and-match SPL/U-Boot, but documenting what to go change if you must do it somewhere under doc/ would be good. I think we can just switch to ALIGN(8) not ALIGN(4) and be done with it? --=20 Tom --r0fGHqLcE2Tn1loh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmDtmVMACgkQFHw5/5Y0 tyyNDgv5ASQPLLitX/NVfIZGChjQA7P6Hd4YNRE9TWtlitbsuXzeOEfNtrDWruqm bCpyB/LKlu8ZWglp1Q3GdoQaTEIAeWKWOSrv+TwoLzvT+GjDnQ5yxcLQJYuzYKq8 wSl2x5bIO+2RAbJ7QS5Dp6MTjIDCMvY/xset4JZZOrNkI1MDi2Iov/vCCkZWP5AE 4D036tkoyl9hRixGRrrcnoMAIqIJdOb6HI7RuRMeKWYl9vfOZPA/mQzmmRQG8KCL sVeycgu9Pf/eU9F+SORQ3IGQtiw4IhmCN7XCnhnOFzsQIMumm8pT38Q+slKyvOAt FjEnOEzwdqHDL4fBOj83KdlPkgEBYIHYGF32i3eRLA7q73/QP/iUaJhy5Hg5RtNS tOzBeTcXbIiTtxPzPQMG6fibK/v4whMD9SmzzHGkp5wZ7JR7So3dlEXaGAiZ36Kl bX79KBOL7LzsSBZZUWQT6kbeo+F6+Ey06ty9j3dYMdaX5S6/vNtrb8azL+4DaOFW 5QWN1jUg =nKTh -----END PGP SIGNATURE----- --r0fGHqLcE2Tn1loh--