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 BC7A3C32771 for ; Wed, 21 Sep 2022 13:27:59 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DB8028497B; Wed, 21 Sep 2022 15:27:57 +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="OjCXJCYJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 93A1F848CF; Wed, 21 Sep 2022 15:27:56 +0200 (CEST) Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) (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 875B9849C5 for ; Wed, 21 Sep 2022 15:27:53 +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=e.tomell@gmail.com Received: by mail-wr1-x42d.google.com with SMTP id n15so2966136wrq.5 for ; Wed, 21 Sep 2022 06:27:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=wbbaQBy5jkW6clp21SeJoKHPcYr17cUb7kUd3TqTIeI=; b=OjCXJCYJu3UrKOvDgLtyNYVC+w8U35kp8fV9La5E1KEC27sSARI80uJz+JQESJW5nG 1uy3+jjrzWupDuGTU8wpCLHpksLRA5xw1tXv1e3rOIC/zCqU+cE5RaNqF9QQ9nUbv/Nx ytlGH7L1q9+dF/Mv2dwQtqhsuFcnlHSxp7Opdo156R90LlGT/h3ez6/gGyFz8FjfIglV q9nGqvdnUrl/PBiJiDrpVe1Kd/W4WGylvKlLw90InHHcSBs1CSFddPTI0pB09x2wEmBC QZBKHLhFwT3MuARdHmr6He5j+HRSlF+dhzx0iiI1CGhIEzh1yYygcrTWagegCgzsZ+Sk qddA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=wbbaQBy5jkW6clp21SeJoKHPcYr17cUb7kUd3TqTIeI=; b=S58ev4Gwe0bSoqzpXg2O0X9qO8j7CbR0ISRLdD9/2+Ggczpepsn6OxJwa1c/m7ioIW H/fO+EXGWM6CNW41ZJcFtaQpZXaQBOOVZw33puzLDW3DG6RQrwp+h18ExLXKcjSS1vC2 YCa6ZCoNgTEZDvlxD7lelEkpW97fO7GuSResbtx5IYi6+kPja5uwGBzaRKS0kUQMuM+y LTCCi1IJJ9sNU8tEgTPxMHVLKJuvwQLucbNUikLQ+Hts5U4WkK7HNx+bVHxR3HRnZGIF FRSs9KkHObA33MqnpRepvgZK9bmgS6dz0IToGtu9300zrmJdg6ODp3zHgBRXHvAvYT2x +U8Q== X-Gm-Message-State: ACrzQf1+O4NkZFe94UNv98McfqibY/VJT/PnKuk7W9m3c/0XRTwnec48 tBarmrJ9esYkbeMIR+rdM/zZ/z1CN5i+2yfv X-Google-Smtp-Source: AMsMyM6PzcbtnBTGb17YHsDS7o2xEW9G8/DCaQXTFa7Tv3cRuT+wMqMygXC6ljgltocu8Tcxot6Esw== X-Received: by 2002:adf:ed81:0:b0:226:a509:14b6 with SMTP id c1-20020adfed81000000b00226a50914b6mr17165506wro.150.1663766872659; Wed, 21 Sep 2022 06:27:52 -0700 (PDT) Received: from localhost.localdomain ([2001:b07:5d38:6a65:a6bb:6dff:fe7c:d4d7]) by smtp.gmail.com with ESMTPSA id z10-20020adfec8a000000b0022afe4fb459sm2559998wrn.51.2022.09.21.06.27.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Sep 2022 06:27:52 -0700 (PDT) From: Edoardo Tomelleri To: u-boot@lists.denx.de Cc: Art Nikpal , Edoardo Tomelleri , Amjad Ouled-Ameur , Heinrich Schuchardt , Jerome Brunet , Neil Armstrong , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Ramon Fried , Simon Glass , Wolfgang Denk , Zhang Ning , Zhaofeng Li Subject: [PATCH v2] cmd: pxe: add alias devicetree-overlay for fdtoverlays Date: Wed, 21 Sep 2022 15:26:33 +0200 Message-Id: <20220921132634.630337-1-e.tomell@gmail.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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. -- 2.37.3