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 2E36CC433EF for ; Thu, 28 Oct 2021 18:56:26 +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 7C1D060EFE for ; Thu, 28 Oct 2021 18:56:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7C1D060EFE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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 847F5832AF; Thu, 28 Oct 2021 20:56:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.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=gmail.com header.i=@gmail.com header.b="QzoSu8ox"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 76DC3834A3; Thu, 28 Oct 2021 20:56:20 +0200 (CEST) Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) (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 97FC580234 for ; Thu, 28 Oct 2021 20:56:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rfried.dev@gmail.com Received: by mail-oi1-x22a.google.com with SMTP id m11so4867322oif.13 for ; Thu, 28 Oct 2021 11:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XEdKEkZbcGA/VmBLeVEnY4NlDSMn0PyZKjAw0wHwesY=; b=QzoSu8oxG6LiJvdwoeZPQs6aufCdjbFTsOcMmWWXeGezts4sfcZfn9nJNErPwRhayn vVwkc1D550jaGF98vth0VI2WsJ9G0aUuEf4vgxHF8Xfe6+RSPSRvwsZezmABWiCUTY5J m1iLygQsFPrX20oLlwLntsq9zOvU8iVPG5rb3ArbCYj2I7welqXIki5shmbJ9IFlB2Uv uGLFgsfkdLA+JKYYojoifY1Eyt2S2MY3bfA400P/w7CFJiUxxg0bi+bQ2FUO5fRsDrdg aE85zWHkBXXQUrXrkSFd59cu/xMieJf7oX5ewXJxvr8xXcRMdo7jSHSoDGWdeqNPUKmF 3ssA== 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=XEdKEkZbcGA/VmBLeVEnY4NlDSMn0PyZKjAw0wHwesY=; b=mExfHiUeEfdfZSq0iSnBmXAVu7iTQBE9W8p0bZtXpZKd4ZZghwVxvNha2zs3jMp5EU vRWkugNpSek5d7DtVUV8iFv62HpEvFBDOyVCB3RO/KLEGsC5D3QptLY6ufTrukzCxT1r e7c6SuIk1gyUiU1Uh87PJmMdiLJ92gbZlHYrR7GZOXELo6QebWrhi96iz77y2y/cXuNV dcJLIsT1VJI8K1lHlLO4LzEWiGYSzB4owQ2bY9HANI9bZ7fJpwQgkCW/rCF+a5MaBuL2 pydk+pnoho9uqfCc+IKBgcv7+hQnpoiOE5+iR4CmFWO76BXGiXpGgsKAwQNSkq/d8ir0 r+EA== X-Gm-Message-State: AOAM5312c9R2jlN7hwWepu0KW8xSHEf9ORQF6jRKGev78iNlHgHJnQtC ZgVaPKL876ij4CxWFB+8JmRExTcjGFyp5BS9Rf3xoQlUAJxmYQ== X-Google-Smtp-Source: ABdhPJyNjNIQO3PMXoh+ESGv7zIf93OpN5uqa9bE6FfGQ8Eqgh3puiY78ZES6kCkPFKKEQV4TZhI8I3Z1PBfG3GmNBg= X-Received: by 2002:a05:6808:490:: with SMTP id z16mr10423596oid.54.1635447367277; Thu, 28 Oct 2021 11:56:07 -0700 (PDT) MIME-Version: 1.0 References: <20211014084004.3173835-1-peter.hoyes@arm.com> <20211015122055.18406866@donnerap.cambridge.arm.com> In-Reply-To: From: Ramon Fried Date: Thu, 28 Oct 2021 21:55:56 +0300 Message-ID: Subject: Re: [PATCH] cmd: pxe_utils: Check fdtcontroladdr in label_boot To: Simon Glass Cc: Andre Przywara , Peter Hoyes , U-Boot Mailing List , Bin Meng , Kory Maincent , 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 On Sun, Oct 24, 2021 at 10:56 PM Simon Glass wrote: > > Hi, > > On Fri, 15 Oct 2021 at 05:21, Andre Przywara wrote: > > > > On Thu, 14 Oct 2021 12:24:45 -0600 > > Simon Glass wrote: > > > > Hi Simon, > > > > > 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. > > > > Yes, that is the idea. This DTB should be as good as any, and this is the > > last check before giving up on DTs completely, so "U-Boot's DTB" (actually > > there is no such thing) is better than none at all. In fact EFI boot does > > the very same thing: > > https://source.denx.de/u-boot/u-boot/-/blob/master/include/config_distro_bootcmd.h#L144-L148 > > > > > Can you not set fdt_addr to that, if you need to? Is it not > > > already set to that? > > > > According to doc/README.distro, fdt_addr is reserved for DTBs residing at > > a (fixed?) ROM address. We don't really know yet where the DT comes from, > > the cleanest seems to be to be passed down from TF-A, in which case this > > would definitely not be ROM. board_fdt_blob_setup() knows this address, > > and this is what will be written to $fdtcontroladdr. > > > > FWIW, this patch looks good to me. > > OK. > > But note that OF_BOARD is going to become an option, not something > that let's us leave out the DT. Board vendors must provide a DT in > U-Boot. So long as that is understood: > > Reviewed-by: Simon Glass > > Regards, > Simom applied to u-boot-net/next Thanks, Ramon.