From patchwork Sun May 2 21:21:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1472906 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FYJwK3ndvz9s1l for ; Mon, 3 May 2021 07:22:25 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 5D9128455F; Sun, 2 May 2021 21:22:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ySyxkinD2A0D; Sun, 2 May 2021 21:22:22 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id A94F984FCD; Sun, 2 May 2021 21:22:21 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 3067D1BF389 for ; Sun, 2 May 2021 21:21:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 1ED294060A for ; Sun, 2 May 2021 21:21:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4NEWZm8AGGje for ; Sun, 2 May 2021 21:21:54 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [217.70.178.232]) by smtp4.osuosl.org (Postfix) with ESMTPS id B6B86405F4 for ; Sun, 2 May 2021 21:21:53 +0000 (UTC) Received: from localhost (lfbn-tou-1-1158-148.w90-76.abo.wanadoo.fr [90.76.218.148]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 19E58200005; Sun, 2 May 2021 21:21:49 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Sun, 2 May 2021 23:21:29 +0200 Message-Id: <20210502212141.934384-2-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210502212141.934384-1-thomas.petazzoni@bootlin.com> References: <20210502212141.934384-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 1/6] boot/opensbi: add options to enable/disable image installation X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Drew Fustini , Alistair Francis , Thomas Petazzoni , Bin Meng Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" 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 Reviewed-by: Alistair Francis Reviewed-by: Bin Meng --- 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