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 E881BC433EF for ; Tue, 9 Nov 2021 06:27:07 +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 EC9D0610A8 for ; Tue, 9 Nov 2021 06:27:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EC9D0610A8 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 5D01383699; Tue, 9 Nov 2021 07:27:04 +0100 (CET) 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="D8afMXmo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F004083699; Tue, 9 Nov 2021 07:27:02 +0100 (CET) Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) (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 CAF4283691 for ; Tue, 9 Nov 2021 07:26:58 +0100 (CET) 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-ot1-x32c.google.com with SMTP id g91-20020a9d12e4000000b0055ae68cfc3dso26674415otg.9 for ; Mon, 08 Nov 2021 22:26:58 -0800 (PST) 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:content-transfer-encoding; bh=Mi9UfWTu4l9j03mTxJqfjfBcYof52PV+hJpS2//QuGQ=; b=D8afMXmo3SVfXGoADUfxsLTJ2mGdUWuXfJZ5mkuserDFJKY4kQYd6zrn8PBd2htD0p xdvgCtBUHTedrETxkZkOBBQFUOG8Q2kC0favByZ/cMv7JAOw2v+FSgFzmw0SV7fcge6X eImjS3Z8K/XX3sIvOaI+fVlGzPuBx0hgyIpa6yhFzOfsCIg5hLgnLYfm8PTZt4Qn+H9/ O1QElFDWkUVvH5Ld+3vlpgvanlntK4RjuO4wDJajgh87mjrbDivYo+36V2Qqjbl6wlB1 iGU2pkySRhMphfCeBdxr16HAPCiePKBYQUVA9WN/aBFEl45r6wpnKytUGE84bn99T+bi +ZEg== 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:content-transfer-encoding; bh=Mi9UfWTu4l9j03mTxJqfjfBcYof52PV+hJpS2//QuGQ=; b=YwONNaSASZwAfl0t8DdJ6fnc3j+PhP1L7PlPw5kZspf/PUOMtwUgGJetaW92ezDgyV 5YRORuuBdLsjhOB1ezEWTEGFYWybIsdrRqr7IJJbc2D6s/UWKAtyivAAeg9lg5uVPE9p wesnakSg9FxKdOYISaibwj0ZUwSj+7DcFBwC3/lx0zszOenQz5SPEQ8k/zb7yEDXw9Zd 6XLhgx30AZFsDzxR3eP+eHcudTJ4C+jvOy05C38+FsBw7vaot38T0PCkfrtVw/w98FtE EbFaKhyHMCzQpIvRZehuSu2a95T69DXBsfQz5S/qQFJA0Nlf6SXyrzdvfAeNQwKsQvbl isnQ== X-Gm-Message-State: AOAM532DpCXz1zqlts9eytk45JaDGFcdp2kHoKzkNa4sCLmzPt+BmU4X vaSFSYNmUtVMlasoxm75WIe3hop2YDUxeysDItHzZVPip5E= X-Google-Smtp-Source: ABdhPJziWJaCZuGfwk50kliIm8aNqB2+uevlmu3iO2t6/1/dIrVvm7R00+UL82hjdsAlLvz3BuSn/6FaMwgO9c3PpOg= X-Received: by 2002:a9d:6f09:: with SMTP id n9mr4018578otq.357.1636439217430; Mon, 08 Nov 2021 22:26:57 -0800 (PST) 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: Tue, 9 Nov 2021 08:26:46 +0200 Message-ID: Subject: Re: [PATCH] cmd: pxe_utils: Check fdtcontroladdr in label_boot To: Peter Hoyes Cc: Andre Przywara , U-Boot Mailing List , diego.sueiro@arm.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Mon, Nov 8, 2021 at 6:53 PM Peter Hoyes wrote: > > On 28/10/2021 19:55, Ramon Fried wrote: > > 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 wrot= e: > >>>>> From: Peter Hoyes > >>>>> > >>>>> If using OF_CONTROL, fdtcontroladdr is set to the fdt used to confi= gure > >>>>> 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 th= e > >>>>> PXE boot option to default to the fdt provided by board_fdt_blob_se= tup. > >>>>> > >>>>> 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, s= truct 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, pas= s 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, st= ruct 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 "-"; > >>>>> -- > >>>>> 2.25.1 > >>>>> > >>>> This is a bit strange as fdtcontroladdr is the control dtb that U-Bo= ot > >>>> 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" (act= ually > >>> 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_dis= tro_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 residin= g at > >>> a (fixed?) ROM address. We don't really know yet where the DT comes f= rom, > >>> the cleanest seems to be to be passed down from TF-A, in which case t= his > >>> would definitely not be ROM. board_fdt_blob_setup() knows this addres= s, > >>> 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. > > Hi, > > Thanks for accepting this patch. I wondered if you could give an > indication when it will reach u-boot/master? > > Cheers, > > Peter > > IMPORTANT NOTICE: The contents of this email and any attachments are conf= idential and may also be privileged. If you are not the intended recipient,= please notify the sender immediately and do not disclose the contents to a= ny other person, use it for any purpose, or store or copy the information i= n any medium. Thank you. Follow the pull request I sent to Tom.