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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9D55C433EF for ; Thu, 14 Oct 2021 18:25:14 +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 71E7461037 for ; Thu, 14 Oct 2021 18:25:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 71E7461037 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org 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 492EB83804; Thu, 14 Oct 2021 20:25:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="IZT4ut+T"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 53C51837FD; Thu, 14 Oct 2021 20:25:03 +0200 (CEST) Received: from mail-ua1-x935.google.com (mail-ua1-x935.google.com [IPv6:2607:f8b0:4864:20::935]) (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 3A68683677 for ; Thu, 14 Oct 2021 20:24:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-ua1-x935.google.com with SMTP id e2so13099475uax.7 for ; Thu, 14 Oct 2021 11:24:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=W3ELW4u4Pzys9b6Ihi7eRnalFb53jRevAD89mOI+5V8=; b=IZT4ut+Tz6TRK06Kofip3ZBof70hOFWIXJadqND0L7D2hfMNVHBPYBudonmZNot1eI dhA+NZeljbaj8uTi3F/xTdEyZDEG4baKcXsK+AGAnYUQRzlRUS4EuD5SNdhRXJFIGJqS D8p6Uc2VSaMtkARBRgm5lI0NUwprcWD4waEzc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=W3ELW4u4Pzys9b6Ihi7eRnalFb53jRevAD89mOI+5V8=; b=JvGupgz5OYGGqUYFifhtRIGVMR0KgxsoL16L0e3xY0H1UFlKU7ik7ecXJN8C8TptTG MxFxKetn0hcYDN3/YcpwsDpsZ9aU11nSG0/aBLWeYaO2oDrHXxDpSaXcksm4r8Z/CU8f XZrw3nbVkHK2V+WG2Yn4iElJhGKAGUXnVFaDWwVQQEb4rY0exLGGAw3akntDoODL6Dp9 cNjUI0SSadSzVC8+dCOvecvdQT9FpWEaRdkc0UAkbHyVETPtwExayO3vJd7BbbZ0+X0+ tturze8XbtvGrqtYhJqAyt4j8AoSdbSPs1lRZ9eN7uKJp2XX2YZoLRbMGYzvTg8NUv7n xxBw== X-Gm-Message-State: AOAM530yyuBe0OF69aH0/r0tFGcbvTYGqKtAAxcFIMc0bjtrm8jrudvv XD5ZNpLwvqQ9auUBIUSMx8maCa7oME/XFw/oa5dHzw== X-Google-Smtp-Source: ABdhPJxoBF41IihLagJCbii0VyX9Rpmh4lWsOv0pmqWk0044zfXtIbIjmHMsuQ29rllx0OosMoq1MuZ9WLCeDoxog6M= X-Received: by 2002:a67:d498:: with SMTP id g24mr9066350vsj.15.1634235895785; Thu, 14 Oct 2021 11:24:55 -0700 (PDT) MIME-Version: 1.0 References: <20211014084004.3173835-1-peter.hoyes@arm.com> In-Reply-To: <20211014084004.3173835-1-peter.hoyes@arm.com> From: Simon Glass Date: Thu, 14 Oct 2021 12:24:45 -0600 Message-ID: Subject: Re: [PATCH] cmd: pxe_utils: Check fdtcontroladdr in label_boot To: Peter Hoyes Cc: U-Boot Mailing List , Bin Meng , Kory Maincent , Andre Przywara , diego.sueiro@arm.com Content-Type: text/plain; charset="UTF-8" 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 Hi Peter, On Thu, 14 Oct 2021 at 02: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] = "-"; > -- > 2.25.1 > This is a bit strange as fdtcontroladdr is the control dtb that U-Boot uses. Can you not set fdt_addr to that, if you need to? Is it not already set to that? Also, there is a clean-up series for this code outstanding. I will send v3 and copy you, if you are able to review it. Regards, Simon