DistroKit Mailinglist
 help / color / mirror / Atom feed
From: Alexander Dahl <ada@thorsis.com>
To: distrokit@pengutronix.de
Subject: [DistroKit] [PATCH 6/9] platform: v8a: firmware-imx: Move barebox injects to separate package
Date: Thu, 25 Apr 2024 10:02:59 +0200	[thread overview]
Message-ID: <20240425080303.171897-7-ada@thorsis.com> (raw)
In-Reply-To: <20240425080303.171897-1-ada@thorsis.com>

This is what 'barebox_firmware' was invented for.  Done to avoid
cluttering the firmware-imx package even more.

Before duplicating the firmware-imx package files in an upper layer and
adding more such stuff for a different bootloader, we rather move this
stuff to multiple barebox_firmware packages (which can also sit in other
layers) and inject files from there.

The same approach can then be followed by other bootloaders depending on
firmware-imx package.  This way we can depend on firmware-imx from one,
the other, or both bootloaders, respectively their firmware packages,
without the need to touch the firmware-imx package itself.

Approach inspired by the patch series which introduced that
infrastructure in ptxdist.

Link: https://lore.ptxdist.org/ptxdist/20220129070330.2601433-6-michael.riesch@wolfvision.net/
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
 configs/platform-v8a/platformconfig           |  1 +
 configs/platform-v8a/platforms/barebox.imx.in | 12 +++++++++
 .../platform-v8a/platforms/firmware-imx.in    |  2 --
 configs/platform-v8a/rules/barebox.imx.make   | 26 +++++++++++++++++++
 configs/platform-v8a/rules/firmware-imx.make  | 20 --------------
 5 files changed, 39 insertions(+), 22 deletions(-)
 create mode 100644 configs/platform-v8a/platforms/barebox.imx.in
 create mode 100644 configs/platform-v8a/rules/barebox.imx.make

diff --git a/configs/platform-v8a/platformconfig b/configs/platform-v8a/platformconfig
index 65c767a..ba33191 100644
--- a/configs/platform-v8a/platformconfig
+++ b/configs/platform-v8a/platformconfig
@@ -183,6 +183,7 @@ PTXCONF_BAREBOX_BUILDSYSTEM_VERSION="${PTXDIST_VCS_VERSION}"
 PTXCONF_BAREBOX_MD5="dcb443c48b64662b52974502c502427e"
 PTXCONF_BAREBOX_CONFIG="barebox.config"
 PTXCONF_BAREBOX_FIRMWARE=y
+PTXCONF_BAREBOX_NEEDS_FIRMWARE_IMX=y
 PTXCONF_BAREBOX_EXTRA_ENV=y
 PTXCONF_BAREBOX_EXTRA_ENV_PATH="barebox-common-defaultenv"
 # PTXCONF_BAREBOX_BAREBOXENV is not set
diff --git a/configs/platform-v8a/platforms/barebox.imx.in b/configs/platform-v8a/platforms/barebox.imx.in
new file mode 100644
index 0000000..971fc9b
--- /dev/null
+++ b/configs/platform-v8a/platforms/barebox.imx.in
@@ -0,0 +1,12 @@
+## SECTION=barebox_firmware
+
+config BAREBOX_NEEDS_FIRMWARE_IMX
+	bool
+	prompt "barebox needs firmware-imx"
+	help
+	  Select this if barebox needs the non-free IMX firmware blobs.
+
+config BAREBOX_DEPENDENCIES
+	tristate
+	select FIRMWARE_IMX if BAREBOX_NEEDS_FIRMWARE_IMX
+	select FIRMWARE_IMX_BOOTIMAGE_IMX8 if BAREBOX_NEEDS_FIRMWARE_IMX
diff --git a/configs/platform-v8a/platforms/firmware-imx.in b/configs/platform-v8a/platforms/firmware-imx.in
index c93e9f8..a08afbe 100644
--- a/configs/platform-v8a/platforms/firmware-imx.in
+++ b/configs/platform-v8a/platforms/firmware-imx.in
@@ -56,6 +56,4 @@ endif
 
 config BAREBOX_DEPENDENCIES
 	tristate
-	select FIRMWARE_IMX
-	select FIRMWARE_IMX_BOOTIMAGE_IMX8
 	select TF_A
diff --git a/configs/platform-v8a/rules/barebox.imx.make b/configs/platform-v8a/rules/barebox.imx.make
new file mode 100644
index 0000000..4c6404c
--- /dev/null
+++ b/configs/platform-v8a/rules/barebox.imx.make
@@ -0,0 +1,26 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2024 by Alexander Dahl <ada@thorsis.com>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+ifdef PTXCONF_FIRMWARE_IMX
+BAREBOX_INJECT_FILES	+= imx8mm-bl31.bin:firmware/imx8mm-bl31.bin
+BAREBOX_INJECT_FILES	+= imx8mn-bl31.bin:firmware/imx8mn-bl31.bin
+BAREBOX_INJECT_FILES	+= imx8mp-bl31.bin:firmware/imx8mp-bl31.bin
+BAREBOX_INJECT_FILES	+= imx8mq-bl31.bin:firmware/imx8mq-bl31.bin
+ifdef PTXCONF_FIRMWARE_IMX_BOOTIMAGE_IMX8
+BAREBOX_INJECT_FILES	+= ddr/synopsys/lpddr4_pmu_train_1d_dmem.bin:firmware/lpddr4_pmu_train_1d_dmem.bin
+BAREBOX_INJECT_FILES	+= ddr/synopsys/lpddr4_pmu_train_1d_imem.bin:firmware/lpddr4_pmu_train_1d_imem.bin
+BAREBOX_INJECT_FILES	+= ddr/synopsys/lpddr4_pmu_train_2d_dmem.bin:firmware/lpddr4_pmu_train_2d_dmem.bin
+BAREBOX_INJECT_FILES	+= ddr/synopsys/lpddr4_pmu_train_2d_imem.bin:firmware/lpddr4_pmu_train_2d_imem.bin
+BAREBOX_INJECT_FILES	+= ddr/synopsys/ddr4_dmem_1d.bin:firmware/ddr4_dmem_1d.bin
+BAREBOX_INJECT_FILES	+= ddr/synopsys/ddr4_dmem_2d.bin:firmware/ddr4_dmem_2d.bin
+BAREBOX_INJECT_FILES	+= ddr/synopsys/ddr4_imem_1d.bin:firmware/ddr4_imem_1d.bin
+BAREBOX_INJECT_FILES	+= ddr/synopsys/ddr4_imem_2d.bin:firmware/ddr4_imem_2d.bin
+endif
+endif
+
+# vim: syntax=make
diff --git a/configs/platform-v8a/rules/firmware-imx.make b/configs/platform-v8a/rules/firmware-imx.make
index 1cdc3ee..906691c 100644
--- a/configs/platform-v8a/rules/firmware-imx.make
+++ b/configs/platform-v8a/rules/firmware-imx.make
@@ -26,26 +26,6 @@ FIRMWARE_IMX_LICENSE	:= NXP-Software-License-Agreement
 FIRMWARE_IMX_LICENSE_FILES := \
 	file://COPYING;md5=44a8052c384584ba09077e85a3d1654f
 
-#
-# Firmware blobs for barebox
-#
-ifdef PTXCONF_FIRMWARE_IMX
-BAREBOX_INJECT_FILES	+= imx8mm-bl31.bin:firmware/imx8mm-bl31.bin
-BAREBOX_INJECT_FILES	+= imx8mn-bl31.bin:firmware/imx8mn-bl31.bin
-BAREBOX_INJECT_FILES	+= imx8mp-bl31.bin:firmware/imx8mp-bl31.bin
-BAREBOX_INJECT_FILES	+= imx8mq-bl31.bin:firmware/imx8mq-bl31.bin
-ifdef PTXCONF_FIRMWARE_IMX_BOOTIMAGE_IMX8
-BAREBOX_INJECT_FILES	+= ddr/synopsys/lpddr4_pmu_train_1d_dmem.bin:firmware/lpddr4_pmu_train_1d_dmem.bin
-BAREBOX_INJECT_FILES	+= ddr/synopsys/lpddr4_pmu_train_1d_imem.bin:firmware/lpddr4_pmu_train_1d_imem.bin
-BAREBOX_INJECT_FILES	+= ddr/synopsys/lpddr4_pmu_train_2d_dmem.bin:firmware/lpddr4_pmu_train_2d_dmem.bin
-BAREBOX_INJECT_FILES	+= ddr/synopsys/lpddr4_pmu_train_2d_imem.bin:firmware/lpddr4_pmu_train_2d_imem.bin
-BAREBOX_INJECT_FILES	+= ddr/synopsys/ddr4_dmem_1d.bin:firmware/ddr4_dmem_1d.bin
-BAREBOX_INJECT_FILES	+= ddr/synopsys/ddr4_dmem_2d.bin:firmware/ddr4_dmem_2d.bin
-BAREBOX_INJECT_FILES	+= ddr/synopsys/ddr4_imem_1d.bin:firmware/ddr4_imem_1d.bin
-BAREBOX_INJECT_FILES	+= ddr/synopsys/ddr4_imem_2d.bin:firmware/ddr4_imem_2d.bin
-endif
-endif
-
 # ----------------------------------------------------------------------------
 # Extract
 # ----------------------------------------------------------------------------
-- 
2.39.2




  parent reply	other threads:[~2024-04-25  8:03 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-25  8:02 [DistroKit] [PATCH 0/9] platform: v8a: firmware: Rework for upper layers with different boards Alexander Dahl
2024-04-25  8:02 ` [DistroKit] [PATCH 1/9] platform: v8a: firmware-imx: Fix dependencies Alexander Dahl
2024-05-27 16:13   ` Robert Schwebel
2024-04-25  8:02 ` [DistroKit] [PATCH 2/9] platform: v8a: firmware-imx: Rework extract, install, and targetinstall Alexander Dahl
2024-05-27 16:13   ` Robert Schwebel
2024-04-25  8:02 ` [DistroKit] [PATCH 3/9] platform: v8a: firmware-imx: Version bump 8.8 -> 8.23 Alexander Dahl
2024-05-27 16:13   ` Robert Schwebel
2024-04-25  8:02 ` [DistroKit] [PATCH 4/9] platform: v8a: firmware-imx: Install more files for U-Boot Alexander Dahl
2024-05-27 16:14   ` Robert Schwebel
2024-04-25  8:02 ` [DistroKit] [PATCH 5/9] platform: v8a: firmware-imx: Install more files for i.MX93 Alexander Dahl
2024-05-27 16:15   ` Robert Schwebel
2024-04-25  8:02 ` Alexander Dahl [this message]
2024-04-25 12:33   ` [DistroKit] [PATCH 6/9] platform: v8a: firmware-imx: Move barebox injects to separate package Alexander Dahl
2024-05-27 16:15     ` Robert Schwebel
2024-05-28  6:32       ` Alexander Dahl
2024-04-25  8:03 ` [DistroKit] [PATCH 7/9] platform: v8a: firmware-rockchip: " Alexander Dahl
2024-05-27 16:16   ` Robert Schwebel
2024-04-25  8:03 ` [DistroKit] [PATCH 8/9] platform: v8a: barebox: Remove extra host prog Alexander Dahl
2024-05-27 16:16   ` Robert Schwebel
2024-05-28  6:14     ` Alexander Dahl
2024-05-28  8:23       ` Robert Schwebel
2024-04-25  8:03 ` [DistroKit] [PATCH 8/8] platform: v8a: firmware-sentinel: Add new package Alexander Dahl
2024-04-25  8:03 ` [DistroKit] [PATCH 9/9] " Alexander Dahl
2024-05-27 16:17   ` Robert Schwebel

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=20240425080303.171897-7-ada@thorsis.com \
    --to=ada@thorsis.com \
    --cc=distrokit@pengutronix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox