All of lore.kernel.org
 help / color / mirror / Atom feed
From: Drew Fustini <drew@beagleboard.org>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 2/4] boot/opensbi: introduce BR2_TARGET_OPENSBI_FW_FDT_PATH
Date: Tue, 15 Jun 2021 22:03:41 -0700	[thread overview]
Message-ID: <20210616050341.510702-3-drew@beagleboard.org> (raw)
In-Reply-To: <20210616050341.510702-1-drew@beagleboard.org>

If U-Boot CONFIG_OF_SEPARATE is defined [1], then the device tree will
be built and placed in a u-boot.dtb file alongside u-boot.bin.

When BR2_TARGET_UBOOT_FORMAT_DTB is enabled, buildroot will copy
u-boot.dtb to $(BINARIES_DIR).

This is useful for RISC-V platforms that want to build OpenSBI with an
external DTB by using FW_FDT_PATH [2].

[1] https://github.com/u-boot/u-boot/blob/master/doc/README.fdt-control
[2] https://github.com/riscv/opensbi/blob/master/docs/firmware/fw.md

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Drew Fustini <drew@beagleboard.org>
---
 boot/opensbi/Config.in  | 10 ++++++++++
 boot/opensbi/opensbi.mk |  3 +++
 2 files changed, 13 insertions(+)

diff --git a/boot/opensbi/Config.in b/boot/opensbi/Config.in
index 632eeec88d77..bd4bd5ee6175 100644
--- a/boot/opensbi/Config.in
+++ b/boot/opensbi/Config.in
@@ -109,4 +109,14 @@ config BR2_TARGET_OPENSBI_UBOOT_PAYLOAD
 	help
 	  Build OpenSBI with the U-Boot as a Payload.
 
+config BR2_TARGET_OPENSBI_FW_FDT_PATH
+	bool "Include U-Boot DTB in OpenSBI Payload"
+	depends on BR2_TARGET_OPENSBI_PLAT != ""
+	depends on BR2_TARGET_UBOOT
+	depends on BR2_TARGET_OPENSBI_UBOOT_PAYLOAD
+	select BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG
+	help
+	  Build OpenSBI with FW_FDT_PATH set to $(BINARIES_DIR)/u-boot.dtb
+	  Note that CONFIG_OF_SEPARATE must be set in the u-boot kconfig.
+
 endif
diff --git a/boot/opensbi/opensbi.mk b/boot/opensbi/opensbi.mk
index a525b8aea348..8e055633a82d 100644
--- a/boot/opensbi/opensbi.mk
+++ b/boot/opensbi/opensbi.mk
@@ -46,6 +46,9 @@ endif
 ifeq ($(BR2_TARGET_OPENSBI_UBOOT_PAYLOAD),y)
 OPENSBI_DEPENDENCIES += uboot
 OPENSBI_MAKE_ENV += FW_PAYLOAD_PATH="$(BINARIES_DIR)/u-boot.bin"
+ifeq ($(BR2_TARGET_OPENSBI_FW_FDT_PATH),y)
+OPENSBI_MAKE_ENV += FW_FDT_PATH="$(BINARIES_DIR)/u-boot.dtb"
+endif
 endif
 
 define OPENSBI_BUILD_CMDS
-- 
2.27.0

  parent reply	other threads:[~2021-06-16  5:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16  5:03 [Buildroot] [PATCH v2 0/4] beaglev: enable opensbi generic platform Drew Fustini
2021-06-16  5:03 ` [Buildroot] [PATCH v2 1/4] boot/uboot: introduce BR2_TARGET_UBOOT_FORMAT_DTB Drew Fustini
2021-07-18 20:13   ` Thomas Petazzoni
2021-06-16  5:03 ` Drew Fustini [this message]
2021-07-18 20:15   ` [Buildroot] [PATCH v2 2/4] boot/opensbi: introduce BR2_TARGET_OPENSBI_FW_FDT_PATH Thomas Petazzoni
2021-06-16  5:03 ` [Buildroot] [PATCH v2 3/4] configs/beaglev: update U-Boot to enable OF_SEPARATE Drew Fustini
2021-07-18 20:15   ` Thomas Petazzoni
2021-06-16  5:03 ` [Buildroot] [PATCH v2 4/4] configs/beaglev: switch to upstream opensbi generic platform Drew Fustini
2021-07-18 20:16   ` Thomas Petazzoni

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=20210616050341.510702-3-drew@beagleboard.org \
    --to=drew@beagleboard.org \
    --cc=buildroot@busybox.net \
    /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.