From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 06 May 2024 15:13:19 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1s3y9f-00648Z-0c for lore@lore.pengutronix.de; Mon, 06 May 2024 15:13:19 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1s3y9e-0004FL-DW; Mon, 06 May 2024 15:13:18 +0200 Received: from mail.thorsis.com ([2003:a:e28:26e4::10]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s3y9F-0003yp-Ll for ptxdist@pengutronix.de; Mon, 06 May 2024 15:12:56 +0200 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 320511487FC0 for ; Mon, 6 May 2024 15:12:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=dkim; t=1715001173; h=from:subject:date:message-id:to:mime-version: content-transfer-encoding:in-reply-to:references; bh=yUf2xaJjfuZHoGXh617KPBFnLkSwtAjyQqpSuSgGfWc=; b=MxvIJX0/1Gp60Mti/niHuVh1Ep7M8EHBL1rM+REGbuPZ2yQFDjyrlCrh51uZHwt++bWFyA 2dxpt/s6rEVkJl5Or6hyNuWmoyo1Ufuq9jAEyu3ELXSf6fZZ+loRmc0LvPryf2gtxvdHQU caz3sVwDztFwkZf/90JGovZgCO5qzoTM2Gr92GaDTN3itzJZsYFe5FgGGKisX0h53T8QwW 6DtlUVlU3PQvtOOawoHAqsFfEth0891LLLgb/ybzJcogDqZmuAJLxcgxpLsWakvLd0uI18 0cnVtHKCyihU9qR5kwRZ/6rKpDyeZ/s8hnqojErVmjyZH8qxtM78bcBGn99SjQ== From: Alexander Dahl To: ptxdist@pengutronix.de Date: Mon, 6 May 2024 15:12:44 +0200 Message-Id: <20240506131244.401909-4-ada@thorsis.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240506131244.401909-1-ada@thorsis.com> References: <20240506131244.401909-1-ada@thorsis.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.whiteo.stw.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=4.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Subject: [ptxdist] [PATCH 3/3] u-boot: Add integration of firmware blobs X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false Almost same approach as done for barebox with commit 6684c552fbd7 ("barebox: add integration of firmware blobs") already. For some boards it is required to inject files to build dir. This is cleaner and not cluttering your source dir. In U-Boot it seems to work in both ways, injecting to source or build dir, so we opt for build dir. Signed-off-by: Alexander Dahl --- platforms/u-boot.firmware.in | 7 +++++++ platforms/u-boot.in | 8 ++++++++ rules/u-boot.make | 20 ++++++++++++++++---- 3 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 platforms/u-boot.firmware.in diff --git a/platforms/u-boot.firmware.in b/platforms/u-boot.firmware.in new file mode 100644 index 000000000..da7f8128f --- /dev/null +++ b/platforms/u-boot.firmware.in @@ -0,0 +1,7 @@ +## SECTION=u_boot_firmware + +# +# This file does only exist to create a defined entry in the "u_boot_firmware" +# section, so that the toplevel Kconfig can include generated/u_boot_firmware.in +# even if no package is in that category. +# diff --git a/platforms/u-boot.in b/platforms/u-boot.in index 9163a8378..5ce7387e4 100644 --- a/platforms/u-boot.in +++ b/platforms/u-boot.in @@ -90,6 +90,14 @@ config U_BOOT_CONFIG endif +menuconfig U_BOOT_FIRMWARE + bool + prompt "integrate firmware blobs " + +if U_BOOT_FIRMWARE +source "generated/u_boot_firmware.in" +endif + config U_BOOT_CUSTOM_MAKE_ENV prompt "Custom (additional) make environment" string diff --git a/rules/u-boot.make b/rules/u-boot.make index e4c963d0c..2a8059170 100644 --- a/rules/u-boot.make +++ b/rules/u-boot.make @@ -36,6 +36,9 @@ endif # Prepare # ---------------------------------------------------------------------------- +U_BOOT_INJECT_PATH := ${PTXDIST_SYSROOT_TARGET}/usr/lib/firmware +U_BOOT_INJECT_OOT := $(call ptx/ifdef, PTXCONF_U_BOOT_BUILD_OOT,YES,NO) + ifdef PTXCONF_U_BOOT_BOOT_SCRIPT U_BOOT_BOOT_SCRIPT_TXT := $(call ptx/in-platformconfigdir, uboot.scr) U_BOOT_BOOT_SCRIPT_BIN := $(call remove_quotes, \ @@ -93,14 +96,23 @@ $(U_BOOT_CONFIG): @exit 1 endif - -ifdef PTXCONF_U_BOOT_CONFIGSYSTEM_LEGACY $(STATEDIR)/u-boot.prepare: @$(call targetinfo) - $(U_BOOT_CONF_ENV) $(MAKE) $(U_BOOT_CONF_OPT) - @$(call touch) + +ifdef PTXCONF_U_BOOT_CONFIGSYSTEM_KCONFIG + @$(call world/prepare, U_BOOT) endif +ifdef PTXCONF_U_BOOT_CONFIGSYSTEM_LEGACY + $(U_BOOT_CONF_ENV) $(MAKE) $(U_BOOT_CONF_OPT) +endif + +ifdef PTXCONF_U_BOOT_FIRMWARE + @$(call world/inject, U_BOOT) +endif + + @$(call touch) + # ---------------------------------------------------------------------------- # Compile # ---------------------------------------------------------------------------- -- 2.39.2