All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v3 2/7] boot/opensbi: add options to enable/disable image installation
Date: Tue,  4 May 2021 22:51:33 +0200	[thread overview]
Message-ID: <20210504205139.1055360-3-thomas.petazzoni@bootlin.com> (raw)
In-Reply-To: <20210504205139.1055360-1-thomas.petazzoni@bootlin.com>

Until now, whenever a BR2_TARGET_OPENSBI_PLAT value was specified,
opensbi.mk was assuming that both fw_jump and fw_dynamic would be
produced. However, this is not the case: the OpenSBI per-platform
config.mk can decide which image to build.

As an example, the config.mk for VIC7100-based BeagleV only enables
producing the fw_payload image.

This commit adds three options to enable the installation of images:
one for fw_jump, one for fw_dynamic, one for fw_payload.

The options for fw_jump and fw_dynamic are "default y" when
BR2_TARGET_OPENSBI_PLAT is not empty, to preserve existing behavior.

The option for fw_payload is forcefully selected when either Linux or
U-Boot are selected as payloads.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 boot/opensbi/Config.in  | 20 ++++++++++++++++++++
 boot/opensbi/opensbi.mk | 16 ++++++++++------
 2 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/boot/opensbi/Config.in b/boot/opensbi/Config.in
index 236bf74a90..55a644506f 100644
--- a/boot/opensbi/Config.in
+++ b/boot/opensbi/Config.in
@@ -74,11 +74,30 @@ config BR2_TARGET_OPENSBI_PLAT
 	  the platform specific static library libplatsbi.a and firmware
 	  examples are built.
 
+config BR2_TARGET_OPENSBI_INSTALL_DYNAMIC_IMG
+	bool "Install fw_dynamic image"
+	default y if BR2_TARGET_OPENSBI_PLAT != ""
+	help
+	  This installs the fw_dynamic image.
+
+config BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG
+	bool "Install fw_jump image"
+	default y if BR2_TARGET_OPENSBI_PLAT != ""
+	help
+	  This installs the fw_jump image.
+
+config BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG
+	bool "Install fw_payload image"
+	help
+	  This option enables the installation of the fw_paylaod
+	  image.
+
 config BR2_TARGET_OPENSBI_LINUX_PAYLOAD
 	bool "Include Linux as OpenSBI Payload"
 	depends on BR2_TARGET_OPENSBI_PLAT != ""
 	depends on BR2_LINUX_KERNEL
 	depends on BR2_LINUX_KERNEL_IMAGE
+	select BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG
 	help
 	  Build OpenSBI with the Linux kernel as a Payload.
 
@@ -86,6 +105,7 @@ config BR2_TARGET_OPENSBI_UBOOT_PAYLOAD
 	bool "Include U-Boot as OpenSBI Payload"
 	depends on BR2_TARGET_OPENSBI_PLAT != ""
 	depends on BR2_TARGET_UBOOT
+	select BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG
 	help
 	  Build OpenSBI with the U-Boot as a Payload.
 
diff --git a/boot/opensbi/opensbi.mk b/boot/opensbi/opensbi.mk
index 8ebe4566fd..f8cbbb8fcc 100644
--- a/boot/opensbi/opensbi.mk
+++ b/boot/opensbi/opensbi.mk
@@ -50,15 +50,19 @@ define OPENSBI_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(OPENSBI_MAKE_ENV) $(MAKE) -C $(@D)
 endef
 
-ifneq ($(OPENSBI_PLAT),)
+ifeq ($(BR2_TARGET_OPENSBI_INSTALL_DYNAMIC_IMG),y)
 OPENSBI_INSTALL_IMAGES = YES
-OPENSBI_FW_IMAGES += jump dynamic
-ifeq ($(BR2_TARGET_OPENSBI_LINUX_PAYLOAD),y)
-OPENSBI_FW_IMAGES += payload
+OPENSBI_FW_IMAGES += dynamic
 endif
-ifeq ($(BR2_TARGET_OPENSBI_UBOOT_PAYLOAD),y)
-OPENSBI_FW_IMAGES = payload
+
+ifeq ($(BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG),y)
+OPENSBI_INSTALL_IMAGES = YES
+OPENSBI_FW_IMAGES += jump
 endif
+
+ifeq ($(BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG),y)
+OPENSBI_INSTALL_IMAGES = YES
+OPENSBI_FW_IMAGES += payload
 endif
 
 define OPENSBI_INSTALL_IMAGES_CMDS
-- 
2.30.2

  parent reply	other threads:[~2021-05-04 20:51 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-04 20:51 [Buildroot] [PATCH v3 0/7] Support for the BeagleV platform Thomas Petazzoni
2021-05-04 20:51 ` [Buildroot] [PATCH v3 1/7] package/Makefile.in: expose CONFIG_DIR to post-build/post-image scripts Thomas Petazzoni
2021-05-06 21:03   ` Yann E. MORIN
2021-05-08 14:32   ` Peter Korsgaard
2021-05-04 20:51 ` Thomas Petazzoni [this message]
2021-05-05  1:03   ` [Buildroot] [PATCH v3 2/7] boot/opensbi: add options to enable/disable image installation Alistair Francis
2021-05-04 20:51 ` [Buildroot] [PATCH v3 3/7] configs/beaglev_defconfig: new defconfig Thomas Petazzoni
2021-05-05  1:05   ` Alistair Francis
2021-05-07 22:02   ` Yann E. MORIN
2021-05-08 18:23     ` Thomas Petazzoni
2021-05-04 20:51 ` [Buildroot] [PATCH v3 4/7] package/riscv64-elf-toolchain: new package Thomas Petazzoni
2021-05-04 20:51 ` [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: " Thomas Petazzoni
2021-05-07 22:04   ` Yann E. MORIN
2021-05-07 22:06     ` Yann E. MORIN
2021-05-07 23:30     ` Drew Fustini
2021-05-08  7:37       ` Yann E. MORIN
2021-05-08  7:48         ` Drew Fustini
2021-05-08 16:01           ` Khem Raj
2021-05-08 18:20             ` Yann E. MORIN
2021-05-08 19:54               ` Drew Fustini
2021-05-08 21:10             ` Drew Fustini
2021-05-08 22:09               ` Khem Raj
2021-05-09 20:23                 ` Drew Fustini
2021-05-09 20:26                   ` Khem Raj
2021-05-09 20:34                     ` Drew Fustini
2021-05-08 18:21     ` Thomas Petazzoni
2021-05-09 11:03     ` Arnout Vandecappelle
2021-05-09 11:04       ` Arnout Vandecappelle
2021-05-09 20:29         ` Drew Fustini
2021-05-09 20:31           ` Khem Raj
2021-05-10  7:02           ` Drew Fustini
2021-05-10  9:07             ` Peter Korsgaard
2021-05-04 20:51 ` [Buildroot] [PATCH v3 6/7] boot/beaglev-secondboot: " Thomas Petazzoni
2021-05-07 22:07   ` Yann E. MORIN
2021-05-04 20:51 ` [Buildroot] [PATCH v3 7/7] configs/beaglev: enable building of low-level firmware Thomas Petazzoni
2021-05-07 22:08   ` Yann E. MORIN
2021-05-07 22:00 ` [Buildroot] [PATCH v3 0/7] Support for the BeagleV platform Yann E. MORIN
2021-05-14 21:06 ` Drew Fustini

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=20210504205139.1055360-3-thomas.petazzoni@bootlin.com \
    --to=thomas.petazzoni@bootlin.com \
    --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.