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 E9E42C433FE for ; Wed, 18 May 2022 08:40:24 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4D28283DEB; Wed, 18 May 2022 10:40:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.b="Gly5A77v"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CA71283C96; Wed, 18 May 2022 10:40:18 +0200 (CEST) Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (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 8C81483DEB for ; Wed, 18 May 2022 10:40:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=narmstrong@baylibre.com Received: by mail-wr1-x436.google.com with SMTP id k30so1628886wrd.5 for ; Wed, 18 May 2022 01:40:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=crbsRK1Ho1ebcjqyAlZOdVOUaL+k8cAYHEXH/DgSVtM=; b=Gly5A77v1Z2U/h+xmR5iPOTJZk54A5+k9+ia8NBVgJvYLjKagwvFPUh/MxhW/7MklD ucfuOhavHgQ0ZSmZQj0KSTgH5wH1fVSBdf53zJU9SHZxegGnXigs72Na4cR4yjwhKpSA dIoKgpmu0hdbmuGegY9asHN/zxQxf/x64UUwc96XEJeSSVvQ5oXGHg/C8DlgRv4GZV02 o8L5Dvvx6J0B/kRXaUqaqwywi3tNUZiUahOmiL6KLHDyTGEUovXm/RgI+f3QrN40l6Rr PeIwMQN5VmlPKXsq3jIpngd8KMulX7CVF1m6t094kRTJZ0nOepidV5PB5/29oNahcVv7 Xdog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=crbsRK1Ho1ebcjqyAlZOdVOUaL+k8cAYHEXH/DgSVtM=; b=2gsZWenjRgtP/nUQnmU4neRpXFiZnTsmSWXBBy1RTUia/WE7fJwQp0xCBHUQOoJXUk BZd3m8PSc1r9/ZKSKq8E8MBhe8P4GpCQaXUDjxbRXn8DIZazQWL9dLoz4NHSITXnUu2l fA0Qejd/jXpwOku6VeOKYhgs729+XeK0u1H6PssP7pUScstdA9kb+Z5DiGg+L2XDO/bt ahrbe/HZ/1IOlc3UTRiGeQQas5ZKG8xuHgruSCaS8wDNGqj00NJq+OVGKLWjUkEZMMMK KTw447YJtMVF3AMD7V/9iIfNtUNaaIzOO+e8vuC0+KHSs92lE3OMx4j4PKAtu3mfZgRl HFZA== X-Gm-Message-State: AOAM530DkuUcBrOreFGcBxRilosZpyVzBoaIEjhvQYvdH9uJYFUpRhhl 8w/vZG533uCTmdnFNgC2Bohq/w== X-Google-Smtp-Source: ABdhPJyM880lr8jBiQaLOJeQRWpHCooPSoeGNWFVTXlfNYl+nw4Q8P7uMqgBfoiYF6O9c2pqBJIyIA== X-Received: by 2002:adf:e106:0:b0:20a:b31b:213d with SMTP id t6-20020adfe106000000b0020ab31b213dmr21622835wrz.219.1652863213969; Wed, 18 May 2022 01:40:13 -0700 (PDT) Received: from ?IPV6:2001:861:44c0:66c0:dea9:338d:d500:c574? ([2001:861:44c0:66c0:dea9:338d:d500:c574]) by smtp.gmail.com with ESMTPSA id i19-20020adfa513000000b0020d0b60000csm1388619wrb.20.2022.05.18.01.40.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 May 2022 01:40:13 -0700 (PDT) Message-ID: Date: Wed, 18 May 2022 10:40:12 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH] cmd: pxe_utils: Check fdtcontroladdr in label_boot Content-Language: en-US To: Peter Hoyes , u-boot@lists.denx.de, Tom Rini Cc: bmeng.cn@gmail.com, sjg@chromium.org, kory.maincent@bootlin.com, andre.przywara@arm.com, diego.sueiro@arm.com References: <20211014084004.3173835-1-peter.hoyes@arm.com> From: Neil Armstrong Organization: Baylibre In-Reply-To: <20211014084004.3173835-1-peter.hoyes@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 Hi, On 14/10/2021 10:40, Peter Hoyes wrote: > From: Peter Hoyes > > 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. > > 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. > > Signed-off-by: Peter Hoyes > --- > cmd/pxe_utils.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > 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, struct 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] = 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] = env_get("fdt_addr"); > > + if (!bootm_argv[3]) > + bootm_argv[3] = env_get("fdtcontroladdr"); > + > if (bootm_argv[3]) { > if (!bootm_argv[2]) > bootm_argv[2] = "-"; This change makes a regression when using a FIT image as kernel image within an extlinux.conf Before this change, when a DT wasn't specified, the DT in the FIT image was selected, not the u-boot DT is selected. While it should work because the U-Boot DT should work in Linux, it's not always the case. Before: Found /extlinux/extlinux.conf Retrieving file: /extlinux/extlinux.conf 1: Yocto Retrieving file: /fitImage append: root=PARTUUID=fd26d57f-02 rootwait console=ttyAML0,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 = 9.5 MiB Architecture: AArch64 OS: Linux Load Address: 0x01080000 Entry Point: 0x01080000 Hash algo: sha256 Hash value: 5181a76e4e7a728e24cd8569f8e48c543ac259bf4d66591a3dc5e166d709429e 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 = 28.4 KiB Architecture: AArch64 Hash algo: sha256 Hash value: 72e5e4fcbb4aa59042377720e5636132ba790d85b6c3f6442446acc63f48cf67 Verifying Hash Integrity ... sha256+ OK Booting using the fdt blob at 0x89f7b78 Uncompressing Kernel Image Loading Device Tree to 000000007bf2f000, end 000000007bf391a3 ... OK After: Found /extlinux/extlinux.conf Retrieving file: /extlinux/extlinux.conf 1: Yocto Retrieving file: /fitImage append: root=PARTUUID=fd26d57f-02 rootwait console=ttyAML0,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 = 9.5 MiB Architecture: AArch64 OS: Linux Load Address: 0x01080000 Entry Point: 0x01080000 Hash algo: sha256 Hash value: 5181a76e4e7a728e24cd8569f8e48c543ac259bf4d66591a3dc5e166d709429e 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 Note this is the "best in town" boot method in Yocto/OE when using WIC, FIT Image and generating extlinux.conf from the WIC "bootimg-partition" plugin. So this change will regress all platforms using this scheme. In case we only want the FIT image and not DTB, the fdtdir is ommited at: https://github.com/openembedded/openembedded-core/blob/9015dec93233c7d45fd0c9885ff5d4ec23ad377d/scripts/lib/wic/plugins/source/bootimg-partition.py#L150 Neil