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 43BFCECAAD8 for ; Wed, 21 Sep 2022 13:30:22 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 68FF98497B; Wed, 21 Sep 2022 15:30:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="y3+yoR0h"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0EF9D848CF; Wed, 21 Sep 2022 15:30:19 +0200 (CEST) Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) (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 06A098497B for ; Wed, 21 Sep 2022 15:30:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=neil.armstrong@linaro.org Received: by mail-wm1-x334.google.com with SMTP id d12-20020a05600c3acc00b003b4c12e47f3so3763222wms.4 for ; Wed, 21 Sep 2022 06:30:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:references:cc:to :content-language:subject:from:user-agent:mime-version:date :message-id:from:to:cc:subject:date; bh=EArbPGRCuaOUptnl+2/RKR0Pkq67g5HhNF5QyTNZ+3E=; b=y3+yoR0hNWAox+3OEgVawZZDsxLiHUUCT6P0x4pYSdyqJs0Ji0CFjDrqCO6IPT4Dqk ATYSkWbATO96KAdf/nodd9xs1L7EWESibebt0IUV38YvMfeyvAHNz9tMU0LykiVXSvbf 5jFiCZk9TJvbMeHB2BLBKNZ7s69F5OKYBg9BzKJ8BC9hMHUuGg4zyBhBc/j/hMRVWE7E Ta3UNyM/BZ4LJNoByxC7hzHTt2OdXD1dLmnzwyVeldWtoRUKm5vH5v40fFZmL73X7zun 00pKkbL8iZJREfmJjqikRRcQjiA0kiEbMbARJ15eJVZKsbwu/VjAOSAENhjfJRW48xdC Fc4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:references:cc:to :content-language:subject:from:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date; bh=EArbPGRCuaOUptnl+2/RKR0Pkq67g5HhNF5QyTNZ+3E=; b=axpgoKMUQ1BmLw4MBYLhrnd/lE5B2b6oW01qi+pa8LwtWm6/IH2EDuqzyxId9w68wi 5Lu+yWpH1UcC7SkwrvYCCxhRmjSra4xInFL29rmRh7ohJwEwXMpi2xDDsyCmluaT+o7N Y6kt7EJnw2DR0uhTeMBnDY5p45NEiumd8sufy6kytwUcgIccc1TN9s4j0ZLbZzEAFyWx hSzt9499kIK5DjTv9/BrsoDJy0KmOomtihp14/BUydUISsQnTj3bnNoEd+4k54CYid+x cvQw7KGzp6PDnQaS5U07wTKPi1J1hCXTU2zlIfmsXK+8Hinq3OGew5vuC/lBgmXuud+B Zu9A== X-Gm-Message-State: ACrzQf3yFaud+3JAZmFMMt0Ce5FPn0uAv825X+f3SLuaCQ7nia/sg7Pw kX1Fzgx835uIDXaFc8oArLcaig== X-Google-Smtp-Source: AMsMyM5RFIQAksQFH1S38DtifT1wmXshe/ZshAu1Ro0DeLSkxS4h2kgctfoWr2SFF3tCBlIOj0b5nQ== X-Received: by 2002:a05:600c:19d2:b0:3b4:cbad:e541 with SMTP id u18-20020a05600c19d200b003b4cbade541mr5924523wmq.106.1663767014447; Wed, 21 Sep 2022 06:30:14 -0700 (PDT) Received: from ?IPV6:2a01:e0a:982:cbb0:8ce3:ff4e:ae9b:55f3? ([2a01:e0a:982:cbb0:8ce3:ff4e:ae9b:55f3]) by smtp.gmail.com with ESMTPSA id m21-20020a05600c3b1500b003b47a99d928sm3153705wms.18.2022.09.21.06.30.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Sep 2022 06:30:13 -0700 (PDT) Message-ID: <48d339bb-970c-4786-aff4-fe0f2f17919d@linaro.org> Date: Wed, 21 Sep 2022 15:30:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 From: Neil Armstrong Subject: Re: [PATCH v2] cmd: pxe: add alias devicetree-overlay for fdtoverlays Content-Language: en-US To: Edoardo Tomelleri , u-boot@lists.denx.de Cc: Art Nikpal , Amjad Ouled-Ameur , Heinrich Schuchardt , Jerome Brunet , =?UTF-8?Q?Pali_Roh=c3=a1r?= , Ramon Fried , Simon Glass , Wolfgang Denk , Zhang Ning , Zhaofeng Li References: <20220921132634.630337-1-e.tomell@gmail.com> Organization: Linaro In-Reply-To: <20220921132634.630337-1-e.tomell@gmail.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.6 at phobos.denx.de X-Virus-Status: Clean On 21/09/2022 15:26, Edoardo Tomelleri wrote: > This adds keyword devicetree-overlay as an alias for fdtoverlays in > extlinux (sysboot) and pxe to better follow the Boot Loader Specification > [1], improves documentation around them by adding an example for both > fdtoverlays and devicetree-overlay and the environment variable required > for this feature. The link for the spec is updated to the current one. > > [1] https://systemd.io/BOOT_LOADER_SPECIFICATION/ > > Signed-off-by: Edoardo Tomelleri > --- > > Changes in v2: > - Updated link to Boot Loader Specification > - Added link to Boot Loader Specification to the patch commit > - Changed README.pxe reusing the same wording as of the aliased commands > > boot/pxe_utils.c | 2 ++ > doc/README.pxe | 12 ++++++++++++ > doc/develop/distro.rst | 32 +++++++++++++++++++++++++++++--- > 3 files changed, 43 insertions(+), 3 deletions(-) > > diff --git a/boot/pxe_utils.c b/boot/pxe_utils.c > index a364fa8bb5..d5c215ae2c 100644 > --- a/boot/pxe_utils.c > +++ b/boot/pxe_utils.c > @@ -380,6 +380,7 @@ err: > > /** > * label_boot_fdtoverlay() - Loads fdt overlays specified in 'fdtoverlays' > + * or 'devicetree-overlay' > * > * @ctx: PXE context > * @label: Label to process > @@ -809,6 +810,7 @@ static const struct token keywords[] = { > {"devicetreedir", T_FDTDIR}, > {"fdtdir", T_FDTDIR}, > {"fdtoverlays", T_FDTOVERLAYS}, > + {"devicetree-overlay", T_FDTOVERLAYS}, > {"ontimeout", T_ONTIMEOUT,}, > {"ipappend", T_IPAPPEND,}, > {"background", T_BACKGROUND,}, > diff --git a/doc/README.pxe b/doc/README.pxe > index 75caa01c4a..d14d2bdcc9 100644 > --- a/doc/README.pxe > +++ b/doc/README.pxe > @@ -163,6 +163,13 @@ fdtoverlays [...] - if this label is chosen, use tftp to retrieve the DT > and then applied in the load order to the fdt blob stored at the > address indicated in the fdt_addr_r environment variable. > > +devicetree-overlay [...] - if this label is chosen, use tftp to retrieve the DT > + overlay(s) at . it will be temporarily stored at the > + address indicated in the fdtoverlay_addr_r environment variable, > + and then applied in the load order to the fdt blob stored at the > + address indicated in the fdt_addr_r environment variable. > + Alias for fdtoverlays. > + > kaslrseed - set this label to request random number from hwrng as kaslr seed. > > append - use as the kernel command line when booting this > @@ -178,6 +185,11 @@ fdt - if this label is chosen, use tftp to retrieve the fdt blob > the fdt_addr_r environment variable, and that address will > be passed to bootm. > > +devicetree - if this label is chosen, use tftp to retrieve the fdt blob > + at . it will be stored at the address indicated in > + the fdt_addr_r environment variable, and that address will > + be passed to bootm. Alias for fdt. > + > fdtdir - if this label is chosen, use tftp to retrieve a fdt blob > relative to . If the fdtfile environment variable > is set, / is retrieved. Otherwise, the > diff --git a/doc/develop/distro.rst b/doc/develop/distro.rst > index 3ee3dac6a2..bc72aa951e 100644 > --- a/doc/develop/distro.rst > +++ b/doc/develop/distro.rst > @@ -68,10 +68,10 @@ Boot Configuration Files > > The standard format for boot configuration files is that of extlinux.conf, as > handled by U-Boot's "syslinux" (disk) or "pxe boot" (network). This is roughly > -as specified at BootLoaderSpec_: > +as specified at `Boot Loader Specification`_: > > > -... with the exceptions that the BootLoaderSpec document: > +... with the exceptions that the Boot Loader Specification document: > > * Prescribes a separate configuration per boot menu option, whereas U-Boot > lumps all options into a single extlinux.conf file. Hence, U-Boot searches > @@ -81,6 +81,8 @@ as specified at BootLoaderSpec_: > * Does not document the fdtdir option, which automatically selects the DTB to > pass to the kernel. > > +See also doc/README.pxe under 'pxe file format'. > + > One example extlinux.conf generated by the Fedora installer is:: > > # extlinux.conf generated by anaconda > @@ -115,6 +117,25 @@ One example extlinux.conf generated by the Fedora installer is:: > fdtdir /boot/dtb-3.16.0-0.rc6.git1.1.fc22.armv7hl+lpae > > > +One example of hand-crafted extlinux.conf:: > + > + menu title Select kernel > + timeout 100 > + > + label Arch with uart devicetree overlay > + kernel /arch/Image.gz > + initrd /arch/initramfs-linux.img > + fdt /dtbs/arch/board.dtb > + fdtoverlays /dtbs/arch/overlay/uart0-gpio0-1.dtbo > + append console=ttyS0,115200 console=tty1 rw root=UUID=fc0d0284-ca84-4194-bf8a-4b9da8d66908 > + > + label Arch with uart devicetree overlay but with Boot Loader Specification keys > + kernel /arch/Image.gz > + initrd /arch/initramfs-linux.img > + devicetree /dtbs/arch/board.dtb > + devicetree-overlay /dtbs/arch/overlay/uart0-gpio0-1.dtbo > + append console=ttyS0,115200 console=tty1 rw root=UUID=fc0d0284-ca84-4194-bf8a-4b9da8d66908 > + > Another hand-crafted network boot configuration file is:: > > TIMEOUT 100 > @@ -214,6 +235,11 @@ fdt_addr_r: > > A size of 1MB for the FDT/DTB seems reasonable. > > +fdtoverlay_addr_r: > + Mandatory. The location in RAM where DTB overlays will be temporarily > + stored and then applied in the load order to the fdt blob stored at the > + address indicated in the fdt_addr_r environment variable. > + > fdtfile: > Mandatory. the name of the DTB file for the specific board for instance > the espressobin v5 board the value is "marvell/armada-3720-espressobin.dtb" > @@ -408,7 +434,7 @@ way in future u-boot versions. In particular the _boot > variables (e.g. mmc_boot, usb_boot) are a strictly internal implementation > detail and must not be used as a public interface. > > -.. _BootLoaderSpec: http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/ > +.. _`Boot Loader Specification`: https://systemd.io/BOOT_LOADER_SPECIFICATION/ > > .. sectionauthor:: (C) Copyright 2014 Red Hat Inc. > .. sectionauthor:: Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. Thanks for updating the doc and link to the spec ! Reviewed-by: Neil Armstrong