All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH v4 09/13] binman: Support packaging U-Boot for scenarios like OF_BOARD or OF_PRIOR_STAGE
Date: Mon, 10 May 2021 14:58:33 +0800	[thread overview]
Message-ID: <20210510065837.2008556-10-bmeng.cn@gmail.com> (raw)
In-Reply-To: <20210510065837.2008556-1-bmeng.cn@gmail.com>

For scenarios like OF_BOARD or OF_PRIOR_STAGE, no device tree blob is
provided in the U-Boot build phase hence the binman node information
is not available. In order to support such use case, a new Kconfig
option BINMAN_STANDALONE_FDT is introduced, to tell the build system
that a device tree blob containing binman node is explicitly required
when using binman to package U-Boot.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>

---

Changes in v4:
- update the makefile dependency on u-boot.img instead of u-boot.bin

Changes in v3:
- rename the Kconfig option name to BINMAN_STANDALONE_FDT
- make BINMAN_STANDALONE_FDT default y for OF_BOARD as well
- reword the Kconfig option help message a little bit

Changes in v2:
- new patch: "binman: Support packaging U-Boot for scenarios like OF_PRIOR_STAGE"

 Makefile    |  3 ++-
 dts/Kconfig | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 3d88559b67..1dbf0b0b8c 100644
--- a/Makefile
+++ b/Makefile
@@ -918,6 +918,7 @@ endif
 endif
 INPUTS-$(CONFIG_TPL) += tpl/u-boot-tpl.bin
 INPUTS-$(CONFIG_OF_SEPARATE) += u-boot.dtb
+INPUTS-$(CONFIG_BINMAN_STANDALONE_FDT) += u-boot.dtb
 ifeq ($(CONFIG_SPL_FRAMEWORK),y)
 INPUTS-$(CONFIG_OF_SEPARATE) += u-boot-dtb.img
 endif
@@ -1392,7 +1393,7 @@ u-boot-lzma.img: u-boot.bin.lzma FORCE
 
 u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl u-boot-ivt.img: \
 		$(if $(CONFIG_SPL_LOAD_FIT),u-boot-nodtb.bin \
-			$(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_OF_HOSTFILE),dts/dt.dtb) \
+			$(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_OF_HOSTFILE)$(CONFIG_BINMAN_STANDALONE_FDT),dts/dt.dtb) \
 		,$(UBOOT_BIN)) FORCE
 	$(call if_changed,mkimage)
 	$(BOARD_SIZE_CHECK)
diff --git a/dts/Kconfig b/dts/Kconfig
index 99ce75e1a2..dabe0080c1 100644
--- a/dts/Kconfig
+++ b/dts/Kconfig
@@ -19,6 +19,24 @@ config BINMAN
 	bool
 	select DTOC
 
+config BINMAN_STANDALONE_FDT
+	bool
+	depends on BINMAN
+	default y if OF_BOARD || OF_PRIOR_STAGE
+	help
+	  This option tells U-Boot build system that a standalone device tree
+	  source is explicitly required when using binman to package U-Boot.
+
+	  This is not necessary in a common scenario where a device tree source
+	  that contains the binman node is provided in the arch/<arch>/dts
+	  directory for a specific board. Such device tree sources are built for
+	  OF_SEPARATE or OF_EMBED. However for a scenario like the board device
+	  tree blob is not provided in the U-Boot build tree, but fed to U-Boot
+	  in the runtime, e.g.: in the OF_PRIOR_STAGE case that it is passed by
+	  a prior stage bootloader. For such scenario, a standalone device tree
+	  blob containing binman node to describe how to package U-Boot should
+	  be provided explicitly.
+
 menu "Device Tree Control"
 	depends on SUPPORT_OF_CONTROL
 
-- 
2.25.1

  parent reply	other threads:[~2021-05-10  6:58 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-10  6:58 [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb Bin Meng
2021-05-10  6:58 ` [PATCH v4 01/13] common: kconfig: Correct a typo in SPL_LOAD_FIT Bin Meng
2021-05-10  6:58 ` [PATCH v4 02/13] binman: Correct '-a' description in the doc Bin Meng
2021-05-10  6:58 ` [PATCH v4 03/13] binman: Correct the comment for ATF entry type Bin Meng
2021-05-10  6:58 ` [PATCH v4 04/13] binman: test: Rename 172_fit_fdt.dts to 170_fit_fdt.dts Bin Meng
2021-05-10  6:58 ` [PATCH v4 05/13] binman: Add support for RISC-V OpenSBI fw_dynamic blob Bin Meng
2021-05-10  6:58 ` [PATCH v4 06/13] makefile: Pass OpenSBI blob to binman make rules Bin Meng
2021-05-10  6:58 ` [PATCH v4 07/13] riscv: sifive: unleashed: Switch to use binman to generate u-boot.itb Bin Meng
2021-05-10  6:58 ` [PATCH v4 08/13] lib: kconfig: Limit BINMAN_FDT for OF_SEPARATE or OF_EMBED Bin Meng
2021-05-10  6:58 ` Bin Meng [this message]
2021-05-10  6:58 ` [PATCH v4 10/13] riscv: dts: Sort build targets in alphabetical order Bin Meng
2021-05-10  6:58 ` [PATCH v4 11/13] riscv: qemu: Switch to use binman to generate u-boot.itb Bin Meng
2021-05-10  6:58 ` [PATCH v4 12/13] riscv: ae350: " Bin Meng
2021-05-10  6:58 ` [PATCH v4 13/13] riscv: Drop USE_SPL_FIT_GENERATOR Bin Meng
2021-05-10  7:02 ` [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb Bin Meng
     [not found] ` <752D002CFF5D0F4FA35C0100F1D73F3FE5EA0826@ATCPCS12.andestech.com>
2021-05-10  7:06   ` FW: " Rick Chen
2021-05-10  7:22     ` Rick Chen
2021-05-10  7:32       ` Bin Meng
2021-05-11  0:49         ` Rick Chen
2021-05-11  3:48           ` Bin Meng
2021-05-11  3:51             ` Rick Chen
2021-05-12  3:25               ` Rick Chen
2021-05-12  3:32                 ` Bin Meng
2021-05-17  2:09                 ` Bin Meng
2021-05-17  8:09                   ` Rick Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210510065837.2008556-10-bmeng.cn@gmail.com \
    --to=bmeng.cn@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.