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 9C75CEB64DA for ; Thu, 22 Jun 2023 20:25:37 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0C0E0863C1; Thu, 22 Jun 2023 22:25:34 +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="AnDV6mn6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4BDB786398; Thu, 22 Jun 2023 22:25:25 +0200 (CEST) Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (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 7259986398 for ; Thu, 22 Jun 2023 22:25:15 +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@chromium.org Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3112f2b9625so6027003f8f.1 for ; Thu, 22 Jun 2023 13:25:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1687465514; x=1690057514; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hrlkuII7JDGpTbXWDZDj4EH5pDSPRDragBAOW9vLlqM=; b=AnDV6mn6FVH7FKobmbQL9tGgS8Ff6k/KLulnMPGvUoXuN2UTFJXVJuYtyrvX95VOlu H9QPtmxC/fbGAIJHo++I2MC1+GkIlKnZgn7lAftw/Q7jNABTGR4jUtJHKeDU946X37W9 AbBmDoKn3GweFGyPvVX7XCNmHG4FUPV66dbaI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687465514; x=1690057514; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hrlkuII7JDGpTbXWDZDj4EH5pDSPRDragBAOW9vLlqM=; b=QYG7XKNmwD7VF+poKoIMlCr06V1ShNGuHKy9kMcUpmviiRip6AP5LpmiIFT0g/5uKW hIsAQyhTNsPNmiabjJ52oN2V99F1M1g3SwbZPDlRU2zxx7Yex6i2EX8oVq0wrPwMFD9F FkB6iI3/fXcP8ggMjOVyrXk+522HNgyabszTiuC9o+I0pY9ywTKjBOpEsj5zY/qdiagA nxXuxZ4+zigz69hJPka/B0AR2xfZqWFFUUl9TY3FRRQGyrxWAFcar2y++oO/cc790iqR Dx3/H70HNOlY8f3WcKk00urUsgvqljzGYi5YHyWdS6F+isEo0zIbHNHXlZIieJwV87VG g4XA== X-Gm-Message-State: AC+VfDybXi6TdOvHSTmATYrekFAVY+oLAEV9Fnmbly7zygcniqRB8llj 5Js3OIaeYSKQPV/bs+6+GbCG2TFMbW1lOUwCAqkOow== X-Google-Smtp-Source: ACHHUZ46jvtrULmtE9I2BXmcVPpkh5ovUbSTwAhyMW8ldjrFDuKfnCKNgDmzr5XAp/PUMnL8cmSrAw== X-Received: by 2002:a5d:40ca:0:b0:311:df7:a23 with SMTP id b10-20020a5d40ca000000b003110df70a23mr13482313wrq.59.1687465514466; Thu, 22 Jun 2023 13:25:14 -0700 (PDT) Received: from sjg1.roam.corp.google.com (82-132-213-210.dab.02.net. [82.132.213.210]) by smtp.gmail.com with ESMTPSA id x24-20020a05600c21d800b003f8e4b22bc2sm352770wmj.44.2023.06.22.13.25.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 13:25:14 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Tom Rini , Simon Glass Subject: [PATCH 8/9] doc: Bring in the FIT overlay information Date: Thu, 22 Jun 2023 21:21:15 +0100 Message-ID: <20230622202120.2182848-8-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog In-Reply-To: <20230622202120.2182848-1-sjg@chromium.org> References: <20230622202120.2182848-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean Bring this file into the documentation. Signed-off-by: Simon Glass --- doc/uImage.FIT/overlay-fdt-boot.txt | 225 --------------------------- doc/usage/fit/index.rst | 1 + doc/usage/fit/overlay-fdt-boot.rst | 227 ++++++++++++++++++++++++++++ 3 files changed, 228 insertions(+), 225 deletions(-) delete mode 100644 doc/uImage.FIT/overlay-fdt-boot.txt create mode 100644 doc/usage/fit/overlay-fdt-boot.rst diff --git a/doc/uImage.FIT/overlay-fdt-boot.txt b/doc/uImage.FIT/overlay-fdt-boot.txt deleted file mode 100644 index dddc4db1a67d..000000000000 --- a/doc/uImage.FIT/overlay-fdt-boot.txt +++ /dev/null @@ -1,225 +0,0 @@ -U-Boot FDT Overlay FIT usage -============================ - -Introduction ------------- -In many cases it is desirable to have a single FIT image support a multitude -of similar boards and their expansion options. The same kernel on DT enabled -platforms can support this easily enough by providing a DT blob upon boot -that matches the desired configuration. - -This document focuses on specifically using overlays as part of a FIT image. -General information regarding overlays including its syntax and building it -can be found in doc/README.fdt-overlays - -Configuration without overlays ------------------------------- - -Take a hypothetical board named 'foo' where there are different supported -revisions, reva and revb. Assume that both board revisions can use add a bar -add-on board, while only the revb board can use a baz add-on board. - -Without using overlays the configuration would be as follows for every case. - - /dts-v1/; - / { - images { - kernel { - data = /incbin/("./zImage"); - type = "kernel"; - arch = "arm"; - os = "linux"; - load = <0x82000000>; - entry = <0x82000000>; - }; - fdt-1 { - data = /incbin/("./foo-reva.dtb"); - type = "flat_dt"; - arch = "arm"; - }; - fdt-2 { - data = /incbin/("./foo-revb.dtb"); - type = "flat_dt"; - arch = "arm"; - }; - fdt-3 { - data = /incbin/("./foo-reva-bar.dtb"); - type = "flat_dt"; - arch = "arm"; - }; - fdt-4 { - data = /incbin/("./foo-revb-bar.dtb"); - type = "flat_dt"; - arch = "arm"; - }; - fdt-5 { - data = /incbin/("./foo-revb-baz.dtb"); - type = "flat_dt"; - arch = "arm"; - }; - fdt-6 { - data = /incbin/("./foo-revb-bar-baz.dtb"); - type = "flat_dt"; - arch = "arm"; - }; - }; - - configurations { - default = "foo-reva.dtb; - foo-reva.dtb { - kernel = "kernel"; - fdt = "fdt-1"; - }; - foo-revb.dtb { - kernel = "kernel"; - fdt = "fdt-2"; - }; - foo-reva-bar.dtb { - kernel = "kernel"; - fdt = "fdt-3"; - }; - foo-revb-bar.dtb { - kernel = "kernel"; - fdt = "fdt-4"; - }; - foo-revb-baz.dtb { - kernel = "kernel"; - fdt = "fdt-5"; - }; - foo-revb-bar-baz.dtb { - kernel = "kernel"; - fdt = "fdt-6"; - }; - }; - }; - -Note the blob needs to be compiled for each case and the combinatorial explosion of -configurations. A typical device tree blob is in the low hunderds of kbytes so a -multitude of configuration grows the image quite a bit. - -Booting this image is done by using - - # bootm # - -Where config is one of: - foo-reva.dtb, foo-revb.dtb, foo-reva-bar.dtb, foo-revb-bar.dtb, - foo-revb-baz.dtb, foo-revb-bar-baz.dtb - -This selects the DTB to use when booting. - -Configuration using overlays ----------------------------- - -Device tree overlays can be applied to a base DT and result in the same blob -being passed to the booting kernel. This saves on space and avoid the combinatorial -explosion problem. - - /dts-v1/; - / { - images { - kernel { - data = /incbin/("./zImage"); - type = "kernel"; - arch = "arm"; - os = "linux"; - load = <0x82000000>; - entry = <0x82000000>; - }; - fdt-1 { - data = /incbin/("./foo.dtb"); - type = "flat_dt"; - arch = "arm"; - load = <0x87f00000>; - }; - fdt-2 { - data = /incbin/("./reva.dtbo"); - type = "flat_dt"; - arch = "arm"; - load = <0x87fc0000>; - }; - fdt-3 { - data = /incbin/("./revb.dtbo"); - type = "flat_dt"; - arch = "arm"; - load = <0x87fc0000>; - }; - fdt-4 { - data = /incbin/("./bar.dtbo"); - type = "flat_dt"; - arch = "arm"; - load = <0x87fc0000>; - }; - fdt-5 { - data = /incbin/("./baz.dtbo"); - type = "flat_dt"; - arch = "arm"; - load = <0x87fc0000>; - }; - }; - - configurations { - default = "foo-reva.dtb; - foo-reva.dtb { - kernel = "kernel"; - fdt = "fdt-1", "fdt-2"; - }; - foo-revb.dtb { - kernel = "kernel"; - fdt = "fdt-1", "fdt-3"; - }; - foo-reva-bar.dtb { - kernel = "kernel"; - fdt = "fdt-1", "fdt-2", "fdt-4"; - }; - foo-revb-bar.dtb { - kernel = "kernel"; - fdt = "fdt-1", "fdt-3", "fdt-4"; - }; - foo-revb-baz.dtb { - kernel = "kernel"; - fdt = "fdt-1", "fdt-3", "fdt-5"; - }; - foo-revb-bar-baz.dtb { - kernel = "kernel"; - fdt = "fdt-1", "fdt-3", "fdt-4", "fdt-5"; - }; - bar { - fdt = "fdt-4"; - }; - baz { - fdt = "fdt-5"; - }; - }; - }; - -Booting this image is exactly the same as the non-overlay example. -u-boot will retrieve the base blob and apply the overlays in sequence as -they are declared in the configuration. - -Note the minimum amount of different DT blobs, as well as the requirement for -the DT blobs to have a load address; the overlay application requires the blobs -to be writeable. - -Configuration using overlays and feature selection --------------------------------------------------- - -Although the configuration in the previous section works is a bit inflexible -since it requires all possible configuration options to be laid out before -hand in the FIT image. For the add-on boards the extra config selection method -might make sense. - -Note the two bar & baz configuration nodes. To boot a reva board with -the bar add-on board enabled simply use: - - # bootm #foo-reva.dtb#bar - -While booting a revb with bar and baz is as follows: - - # bootm #foo-revb.dtb#bar#baz - -The limitation for a feature selection configuration node is that a single -fdt option is currently supported. - -Pantelis Antoniou -pantelis.antoniou@konsulko.com -12/6/2017 diff --git a/doc/usage/fit/index.rst b/doc/usage/fit/index.rst index 83bc4d01ca42..bd25bd30b284 100644 --- a/doc/usage/fit/index.rst +++ b/doc/usage/fit/index.rst @@ -16,3 +16,4 @@ doc/uImage.FIT signature verified-boot beaglebone_vboot + overlay-fdt-boot diff --git a/doc/usage/fit/overlay-fdt-boot.rst b/doc/usage/fit/overlay-fdt-boot.rst new file mode 100644 index 000000000000..8f8f5e307d26 --- /dev/null +++ b/doc/usage/fit/overlay-fdt-boot.rst @@ -0,0 +1,227 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +U-Boot FDT Overlay FIT usage +============================ + +Introduction +------------ + +In many cases it is desirable to have a single FIT image support a multitude +of similar boards and their expansion options. The same kernel on DT enabled +platforms can support this easily enough by providing a DT blob upon boot +that matches the desired configuration. + +This document focuses on specifically using overlays as part of a FIT image. +General information regarding overlays including its syntax and building it +can be found in doc/README.fdt-overlays + +Configuration without overlays +------------------------------ + +Take a hypothetical board named 'foo' where there are different supported +revisions, reva and revb. Assume that both board revisions can use add a bar +add-on board, while only the revb board can use a baz add-on board. + +Without using overlays the configuration would be as follows for every case:: + + /dts-v1/; + / { + images { + kernel { + data = /incbin/("./zImage"); + type = "kernel"; + arch = "arm"; + os = "linux"; + load = <0x82000000>; + entry = <0x82000000>; + }; + fdt-1 { + data = /incbin/("./foo-reva.dtb"); + type = "flat_dt"; + arch = "arm"; + }; + fdt-2 { + data = /incbin/("./foo-revb.dtb"); + type = "flat_dt"; + arch = "arm"; + }; + fdt-3 { + data = /incbin/("./foo-reva-bar.dtb"); + type = "flat_dt"; + arch = "arm"; + }; + fdt-4 { + data = /incbin/("./foo-revb-bar.dtb"); + type = "flat_dt"; + arch = "arm"; + }; + fdt-5 { + data = /incbin/("./foo-revb-baz.dtb"); + type = "flat_dt"; + arch = "arm"; + }; + fdt-6 { + data = /incbin/("./foo-revb-bar-baz.dtb"); + type = "flat_dt"; + arch = "arm"; + }; + }; + + configurations { + default = "foo-reva.dtb; + foo-reva.dtb { + kernel = "kernel"; + fdt = "fdt-1"; + }; + foo-revb.dtb { + kernel = "kernel"; + fdt = "fdt-2"; + }; + foo-reva-bar.dtb { + kernel = "kernel"; + fdt = "fdt-3"; + }; + foo-revb-bar.dtb { + kernel = "kernel"; + fdt = "fdt-4"; + }; + foo-revb-baz.dtb { + kernel = "kernel"; + fdt = "fdt-5"; + }; + foo-revb-bar-baz.dtb { + kernel = "kernel"; + fdt = "fdt-6"; + }; + }; + }; + +Note the blob needs to be compiled for each case and the combinatorial explosion of +configurations. A typical device tree blob is in the low hunderds of kbytes so a +multitude of configuration grows the image quite a bit. + +Booting this image is done by using:: + + # bootm # + +Where config is one of:: + + foo-reva.dtb, foo-revb.dtb, foo-reva-bar.dtb, foo-revb-bar.dtb, + foo-revb-baz.dtb, foo-revb-bar-baz.dtb + +This selects the DTB to use when booting. + +Configuration using overlays +---------------------------- + +Device tree overlays can be applied to a base DT and result in the same blob +being passed to the booting kernel. This saves on space and avoid the combinatorial +explosion problem:: + + /dts-v1/; + / { + images { + kernel { + data = /incbin/("./zImage"); + type = "kernel"; + arch = "arm"; + os = "linux"; + load = <0x82000000>; + entry = <0x82000000>; + }; + fdt-1 { + data = /incbin/("./foo.dtb"); + type = "flat_dt"; + arch = "arm"; + load = <0x87f00000>; + }; + fdt-2 { + data = /incbin/("./reva.dtbo"); + type = "flat_dt"; + arch = "arm"; + load = <0x87fc0000>; + }; + fdt-3 { + data = /incbin/("./revb.dtbo"); + type = "flat_dt"; + arch = "arm"; + load = <0x87fc0000>; + }; + fdt-4 { + data = /incbin/("./bar.dtbo"); + type = "flat_dt"; + arch = "arm"; + load = <0x87fc0000>; + }; + fdt-5 { + data = /incbin/("./baz.dtbo"); + type = "flat_dt"; + arch = "arm"; + load = <0x87fc0000>; + }; + }; + + configurations { + default = "foo-reva.dtb; + foo-reva.dtb { + kernel = "kernel"; + fdt = "fdt-1", "fdt-2"; + }; + foo-revb.dtb { + kernel = "kernel"; + fdt = "fdt-1", "fdt-3"; + }; + foo-reva-bar.dtb { + kernel = "kernel"; + fdt = "fdt-1", "fdt-2", "fdt-4"; + }; + foo-revb-bar.dtb { + kernel = "kernel"; + fdt = "fdt-1", "fdt-3", "fdt-4"; + }; + foo-revb-baz.dtb { + kernel = "kernel"; + fdt = "fdt-1", "fdt-3", "fdt-5"; + }; + foo-revb-bar-baz.dtb { + kernel = "kernel"; + fdt = "fdt-1", "fdt-3", "fdt-4", "fdt-5"; + }; + bar { + fdt = "fdt-4"; + }; + baz { + fdt = "fdt-5"; + }; + }; + }; + +Booting this image is exactly the same as the non-overlay example. +u-boot will retrieve the base blob and apply the overlays in sequence as +they are declared in the configuration. + +Note the minimum amount of different DT blobs, as well as the requirement for +the DT blobs to have a load address; the overlay application requires the blobs +to be writeable. + +Configuration using overlays and feature selection +-------------------------------------------------- + +Although the configuration in the previous section works is a bit inflexible +since it requires all possible configuration options to be laid out before +hand in the FIT image. For the add-on boards the extra config selection method +might make sense. + +Note the two bar & baz configuration nodes. To boot a reva board with +the bar add-on board enabled simply use:: + + # bootm #foo-reva.dtb#bar + +While booting a revb with bar and baz is as follows:: + + # bootm #foo-revb.dtb#bar#baz + +The limitation for a feature selection configuration node is that a single +fdt option is currently supported. + +.. sectionauthor:: Pantelis Antoniou , 12/6/2017 -- 2.41.0.162.gfafddb0af9-goog