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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 5B76AC433EF for ; Wed, 18 May 2022 15:53:07 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 13A3983DEB; Wed, 18 May 2022 17:53:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (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="ZTqu636Z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B1F9080029; Wed, 18 May 2022 17:53:02 +0200 (CEST) Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) (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 3D906842A2 for ; Wed, 18 May 2022 17:52:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qv1-xf2a.google.com with SMTP id eq14so1820980qvb.4 for ; Wed, 18 May 2022 08:52:57 -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; bh=qnolT6/VjqcPgiXXV+A1dpXd+c6E+i7bLrSW/Asf5LU=; b=ZTqu636Zqk5DS0hGloREiOdfmN03I+le60dfYC0XHRi58BPYzJzHpQaqb4xrdOHXF0 u8QRsYEB2pFYEFkUoy2ROv3PO6s0KYhXU+EshdQtijmsLhOXi1U5r4Gl9tQpU7pcXkej Sd1h7G2lTFnQ1jJ7AyW3Cpq5btC3+Gt989Spo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=qnolT6/VjqcPgiXXV+A1dpXd+c6E+i7bLrSW/Asf5LU=; b=XLiMIx8dmWa2tVQ6gLVfdbeRX4v87asW8O2RpxbivIkVP0W3AiWwn73G2X22c48p6R iOx4H9uy4UiOuin182RnxabXcrua+wfYJfPFUbjQVZJFgTzZnL6xlTTxy6IXBtA5LzyS gVSacixKi3qqdEB57c3OfMPwg3L3R9Vi6UuH0n5OfjsFP5vjKhtgxTb61uRuZnitxLaj o7+BvPOI5CbLHcR87t80OKcqHVl3UXQlT0bIo6yE1R5yvOT7CtLBv/ubrN3RFw2/+E1N jk3NwYNtmu5c1c0MPu1r5y1s5st0cgj5e84L5nwKD6Me8xUla2OUT5mMJXLuInTJrPKm Zw5A== X-Gm-Message-State: AOAM533D6YgGYO3w+bWXcww10jY2K7eLFh3xAhO7IiePJQADwFYi5gHx g/0X9o5NihPR6AVNhlgL6/68Uw== X-Google-Smtp-Source: ABdhPJwAL9y2KmlprdTz/ZnxRBiQ/YPnpweCaJEKZjRCfTDP9Dsn0RE5vgQFUESRDMfN4lBw4f1HYQ== X-Received: by 2002:a05:6214:c21:b0:443:a2d2:a685 with SMTP id a1-20020a0562140c2100b00443a2d2a685mr201436qvd.52.1652889175916; Wed, 18 May 2022 08:52:55 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-4500-d95c-f120-8640-d523.res6.spectrum.com. [2603:6081:7b01:4500:d95c:f120:8640:d523]) by smtp.gmail.com with ESMTPSA id f80-20020a379c53000000b006a09515d012sm1713348qke.50.2022.05.18.08.52.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 08:52:55 -0700 (PDT) Date: Wed, 18 May 2022 11:52:53 -0400 From: Tom Rini To: Neil Armstrong Cc: Peter Hoyes , u-boot@lists.denx.de, bmeng.cn@gmail.com, sjg@chromium.org, kory.maincent@bootlin.com, andre.przywara@arm.com, diego.sueiro@arm.com Subject: Re: [PATCH] cmd: pxe_utils: Check fdtcontroladdr in label_boot Message-ID: <20220518155253.GF3901321@bill-the-cat> References: <20211014084004.3173835-1-peter.hoyes@arm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="gWPeGsYce+mZStT1" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean --gWPeGsYce+mZStT1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 18, 2022 at 10:40:12AM +0200, Neil Armstrong wrote: > Hi, >=20 > On 14/10/2021 10:40, Peter Hoyes wrote: > > From: Peter Hoyes > >=20 > > If using OF_CONTROL, fdtcontroladdr is set to the fdt used to configure > > U-Boot. When using PXE, if no fdt is defined in the menu file, and > > there is no fdt at fdt_addr, add fall back on fdtcontroladdr too. > >=20 > > We are developing board support for the Armv8r64 FVP using > > config_distro_bootcmd. We are also using OF_BOARD and would like the > > PXE boot option to default to the fdt provided by board_fdt_blob_setup. > >=20 > > Signed-off-by: Peter Hoyes > > --- > > cmd/pxe_utils.c | 8 +++++++- > > 1 file changed, 7 insertions(+), 1 deletion(-) > >=20 > > diff --git a/cmd/pxe_utils.c b/cmd/pxe_utils.c > > index 067c24e5ff..8f8e69ca97 100644 > > --- a/cmd/pxe_utils.c > > +++ b/cmd/pxe_utils.c > > @@ -556,7 +556,10 @@ static int label_boot(struct cmd_tbl *cmdtp, struc= t pxe_label *label) > > * Scenario 2: If there is an fdt_addr specified, pass it along to > > * bootm, and adjust argc appropriately. > > * > > - * Scenario 3: fdt blob is not available. > > + * Scenario 3: If there is an fdtcontroladdr specified, pass it along= to > > + * bootm, and adjust argc appropriately. > > + * > > + * Scenario 4: fdt blob is not available. > > */ > > bootm_argv[3] =3D env_get("fdt_addr_r"); > > @@ -646,6 +649,9 @@ static int label_boot(struct cmd_tbl *cmdtp, struct= pxe_label *label) > > if (!bootm_argv[3]) > > bootm_argv[3] =3D env_get("fdt_addr"); > > + if (!bootm_argv[3]) > > + bootm_argv[3] =3D env_get("fdtcontroladdr"); > > + > > if (bootm_argv[3]) { > > if (!bootm_argv[2]) > > bootm_argv[2] =3D "-"; >=20 > This change makes a regression when using a FIT image as kernel image wit= hin an extlinux.conf >=20 > Before this change, when a DT wasn't specified, the DT in the FIT image w= as selected, > not the u-boot DT is selected. >=20 > While it should work because the U-Boot DT should work in Linux, it's not= always the case. >=20 > Before: > Found /extlinux/extlinux.conf > Retrieving file: /extlinux/extlinux.conf > 1: Yocto > Retrieving file: /fitImage > append: root=3DPARTUUID=3Dfd26d57f-02 rootwait console=3DttyAML0,115200 > ## Loading kernel from FIT Image at 08080000 ... > Using 'conf-amlogic_meson-gxl-s905x-libretech-cc.dtb' configuration > Trying 'kernel-1' kernel subimage > Description: Linux kernel > Type: Kernel Image > Compression: gzip compressed > Data Start: 0x08080120 > Data Size: 9926956 Bytes =3D 9.5 MiB > Architecture: AArch64 > OS: Linux > Load Address: 0x01080000 > Entry Point: 0x01080000 > Hash algo: sha256 > Hash value: 5181a76e4e7a728e24cd8569f8e48c543ac259bf4d66591a3dc5e1= 66d709429e > Verifying Hash Integrity ... sha256+ OK > ## Loading fdt from FIT Image at 08080000 ... > Using 'conf-amlogic_meson-gxl-s905x-libretech-cc.dtb' configuration > Trying 'fdt-amlogic_meson-gxl-s905x-libretech-cc.dtb' fdt subimage > Description: Flattened Device Tree blob > Type: Flat Device Tree > Compression: uncompressed > Data Start: 0x089f7b78 > Data Size: 29092 Bytes =3D 28.4 KiB > Architecture: AArch64 > Hash algo: sha256 > Hash value: 72e5e4fcbb4aa59042377720e5636132ba790d85b6c3f6442446ac= c63f48cf67 > Verifying Hash Integrity ... sha256+ OK > Booting using the fdt blob at 0x89f7b78 > Uncompressing Kernel Image > Loading Device Tree to 000000007bf2f000, end 000000007bf391a3 ... OK >=20 >=20 > After: > Found /extlinux/extlinux.conf > Retrieving file: /extlinux/extlinux.conf > 1: Yocto > Retrieving file: /fitImage > append: root=3DPARTUUID=3Dfd26d57f-02 rootwait console=3DttyAML0,115200 > ## Loading kernel from FIT Image at 08080000 ... > Using 'conf-amlogic_meson-gxl-s905x-libretech-cc.dtb' configuration > Trying 'kernel-1' kernel subimage > Description: Linux kernel > Type: Kernel Image > Compression: gzip compressed > Data Start: 0x08080120 > Data Size: 9926956 Bytes =3D 9.5 MiB > Architecture: AArch64 > OS: Linux > Load Address: 0x01080000 > Entry Point: 0x01080000 > Hash algo: sha256 > Hash value: 5181a76e4e7a728e24cd8569f8e48c543ac259bf4d66591a3dc5e1= 66d709429e > Verifying Hash Integrity ... sha256+ OK > ## Flattened Device Tree blob at 7bf40210 > Booting using the fdt blob at 0x7bf40210 > Uncompressing Kernel Image > Loading Device Tree to 000000007bf2c000, end 000000007bf38ba7 ... OK >=20 >=20 > Note this is the "best in town" boot method in Yocto/OE when using WIC, F= IT Image and > generating extlinux.conf from the WIC "bootimg-partition" plugin. >=20 > So this change will regress all platforms using this scheme. >=20 > In case we only want the FIT image and not DTB, the fdtdir is ommited at: > https://github.com/openembedded/openembedded-core/blob/9015dec93233c7d45f= d0c9885ff5d4ec23ad377d/scripts/lib/wic/plugins/source/bootimg-partition.py#= L150 Well this is certainly tricky. Do we be "boring" and say that the built-in device tree should be used, or "boring" and say that the distro provided device tree should be used. I assume that in the OE case we're not always going to be booting U-Boot that was built, so updating the logic there to have the correct dtb isn't right either. --=20 Tom --gWPeGsYce+mZStT1 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmKFFlUACgkQFHw5/5Y0 tyyH0wv/S38an7TQmPdGoYb/FWOm2NMoVHS7FhhTtPEwPk2dyZKLKzP3rnNOHpsg 8zYHKmZXQOWC9OoIQgyM2mWw84+OOHhEXbQxle/izgouugs3ZNFxlyGbtkmdBviL OFkELZ1MMLPoXO84wDWNtMwHRvLE4b9wpv2mjkCU3srAMjuIPJ9TD7Mectt/cx8b PUNkfCqk3j4M+gQuaHv3qxIaiqvgrWFPxURz6Tqqlga7M2feslh3jymCxnzpwu0X qGZaYC2JNhM8K4eMH01Cf7QCDrkjJH8fm7iVM3kfz75ioFt463WHgPzf/mE+b23j rLkoftSe8lmnJaaoo+K8N5CY5HBUgPEHmm2tWPpkAts4/IzQmVy21pAttg+Gjczi Wcxy7M6JMAW22UkK5x5IaoxV7PHp4RJnVgeEaj2M78sU06IXNuABo6kpCJKa5g9y YxAduRhZDN6HAI7QiNqLBiT729uxWkJ3mui0Tbr3DAd4gTEHHEXBWHhF+VLJQPSf i732nvv9 =Yb0o -----END PGP SIGNATURE----- --gWPeGsYce+mZStT1--