DistroKit Mailinglist
 help / color / mirror / Atom feed
From: Roland Hieber <rhi@pengutronix.de>
To: distrokit@pengutronix.de
Cc: "Leonard Göhrs" <l.goehrs@pengutronix.de>,
	"Roland Hieber" <rhi@pengutronix.de>
Subject: [DistroKit] [PATCH 4/5] v7a: add and enable image generation for the LXA FairyTux 2
Date: Tue,  3 Feb 2026 18:33:14 +0100	[thread overview]
Message-ID: <20260203173409.3995749-4-rhi@pengutronix.de> (raw)
In-Reply-To: <20260203173409.3995749-1-rhi@pengutronix.de>

From: Leonard Göhrs <l.goehrs@pengutronix.de>

The LXA FairyTux exists in two different generational variants, which
are coded into the name of the device tree, so we need to introduce a
new environment variable in the image config for that case.

The barebox-stm32mp-generic-bl33.img image loads the device tree from
the FIP, but we want to support both FairyTux 2 generations in one image
(otherwise we would need to propagate the '-genX' prefix through all
other generated images), therefore build stm32mp153c-lxa-fairytux2.fip
with the specific barebox-stm32mp153c-lxa-fairytux2.img image which
contains the device trees for both generations, and chooses the correct
one in lowlevel board code based on GPIO strapping pins.

Co-authored-by: Roland Hieber <rhi@pengutronix.de>
Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
[rhi: ported from distrokit-fairytux; adapt image recipe for both
 FairyTux 2 generations]
Tested-by: Roland Hieber <rhi@pengutronix.de>
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 .../platform-v7a/config/images/stm32mp.config |  4 +-
 configs/platform-v7a/platformconfig           |  3 +-
 .../platforms/image-lxa-fairytux2.in          | 12 +++++
 .../rules/image-lxa-fairytux2.make            | 44 +++++++++++++++++++
 .../rules/image-lxa-mc1-scmi.make             |  6 ++-
 configs/platform-v7a/rules/image-lxa-mc1.make |  6 ++-
 .../rules/image-stm32mp157c-dk2.make          |  6 ++-
 .../rules/image-stm32mp157c-ev1.make          |  6 ++-
 .../lib/udev/rules.d/90-rauc-partitions.rules |  1 +
 9 files changed, 81 insertions(+), 7 deletions(-)
 create mode 100644 configs/platform-v7a/platforms/image-lxa-fairytux2.in
 create mode 100644 configs/platform-v7a/rules/image-lxa-fairytux2.make

diff --git a/configs/platform-v7a/config/images/stm32mp.config b/configs/platform-v7a/config/images/stm32mp.config
index 93743b3c3d5e..5a9f8342acd4 100644
--- a/configs/platform-v7a/config/images/stm32mp.config
+++ b/configs/platform-v7a/config/images/stm32mp.config
@@ -53,8 +53,8 @@ image @STM32MP_BOARD@@SCMI@-emmcboot.img {
 image @STM32MP_BOARD@@SCMI@.fip {
 	fip {
 		fw-config = "stm32mp1-@STM32MP_BOARD@-fw-config.dtb"
-		hw-config = "barebox-@STM32MP_BOARD@@SCMI@.dtb"
-		nt-fw = "barebox-stm32mp-generic-bl33.img"
+		hw-config = "barebox-@BAREBOX_DTB@@SCMI@.dtb"
+		nt-fw = "@BAREBOX_IMAGE@"
 		tos-fw = { "stm32mp1-bl32.bin" }
 		tos-fw-config = "stm32mp1-@STM32MP_BOARD@-bl32.dtb"
 	}
diff --git a/configs/platform-v7a/platformconfig b/configs/platform-v7a/platformconfig
index dcb55b529947..d4b29309e460 100644
--- a/configs/platform-v7a/platformconfig
+++ b/configs/platform-v7a/platformconfig
@@ -140,7 +140,7 @@ PTXCONF_KERNEL_IMAGE_Z=y
 PTXCONF_KERNEL_IMAGE="zImage"
 PTXCONF_KERNEL_DTB=y
 PTXCONF_KERNEL_DTS_PATH="${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts"
-PTXCONF_KERNEL_DTS="ti/omap/am335x-bone.dts ti/omap/am335x-boneblack.dts arm/vexpress-v2p-ca9.dts broadcom/bcm2836-rpi-2-b.dts nxp/imx/imx6q-sabrelite.dts nxp/imx/imx6sx-udoo-neo-full.dts nxp/imx/imx6dl-riotboard.dts nxp/imx/imx6q-nitrogen6x.dts nxp/imx/imx6qp-nitrogen6_max.dts nxp/imx/imx6ull-14x14-evk.dts broadcom/bcm2837-rpi-3-b.dts broadcom/bcm2837-rpi-cm3-io3.dts broadcom/bcm2711-rpi-4-b.dts broadcom/bcm2711-rpi-400.dts st/stm32mp157c-dk2.dts st/stm32mp157c-ev1.dts st/stm32mp157c-lxa-mc1.dts stm32mp157c-lxa-mc1-scmi.dts st/stm32mp135f-dk.dts microchip/at91-sama5d27_som1_ek.dts at91-sama5d27_giantboard.dts at91-sama5d4_wifx_l1.dts"
+PTXCONF_KERNEL_DTS="ti/omap/am335x-bone.dts ti/omap/am335x-boneblack.dts arm/vexpress-v2p-ca9.dts broadcom/bcm2836-rpi-2-b.dts nxp/imx/imx6q-sabrelite.dts nxp/imx/imx6sx-udoo-neo-full.dts nxp/imx/imx6dl-riotboard.dts nxp/imx/imx6q-nitrogen6x.dts nxp/imx/imx6qp-nitrogen6_max.dts nxp/imx/imx6ull-14x14-evk.dts broadcom/bcm2837-rpi-3-b.dts broadcom/bcm2837-rpi-cm3-io3.dts broadcom/bcm2711-rpi-4-b.dts broadcom/bcm2711-rpi-400.dts st/stm32mp157c-dk2.dts st/stm32mp157c-ev1.dts st/stm32mp157c-lxa-mc1.dts stm32mp157c-lxa-mc1-scmi.dts st/stm32mp153c-lxa-fairytux2-gen1.dts st/stm32mp153c-lxa-fairytux2-gen2.dts st/stm32mp135f-dk.dts microchip/at91-sama5d27_som1_ek.dts at91-sama5d27_giantboard.dts at91-sama5d4_wifx_l1.dts "
 # PTXCONF_KERNEL_DTBO is not set
 # PTXCONF_KERNEL_CODE_SIGNING is not set
 # PTXCONF_KERNEL_ZSTD is not set
@@ -281,6 +281,7 @@ PTXCONF_IMAGE_KERNEL_INSTALL_EARLY=y
 # PTXCONF_IMAGE_KERNEL_LZOP is not set
 # end of Generate images/linuximage    
 
+PTXCONF_IMAGE_LXA_FAIRYTUX2=y
 PTXCONF_IMAGE_LXA_MC1_SCMI=y
 PTXCONF_IMAGE_LXA_MC1=y
 PTXCONF_IMAGE_RAUC=y
diff --git a/configs/platform-v7a/platforms/image-lxa-fairytux2.in b/configs/platform-v7a/platforms/image-lxa-fairytux2.in
new file mode 100644
index 000000000000..06384168b70c
--- /dev/null
+++ b/configs/platform-v7a/platforms/image-lxa-fairytux2.in
@@ -0,0 +1,12 @@
+## SECTION=image
+
+config IMAGE_LXA_FAIRYTUX2
+	tristate
+	select HOST_GENIMAGE
+	select HOST_TF_A
+	select BAREBOX
+	select IMAGE_ROOT_EXT
+	select TF_A
+	prompt "Generate images/lxa-fairytux2.hdimg"
+	help
+	  Generate GPT image for the Linux Automation FairyTux 2
diff --git a/configs/platform-v7a/rules/image-lxa-fairytux2.make b/configs/platform-v7a/rules/image-lxa-fairytux2.make
new file mode 100644
index 000000000000..9332ccb2dd52
--- /dev/null
+++ b/configs/platform-v7a/rules/image-lxa-fairytux2.make
@@ -0,0 +1,44 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2020 by Ahmad Fatoum <a.fatoum@pengutronix.de>
+# Copyright (C) 2024 by Leonard Göhrs <l.goehrs@pengutronix.de>
+# Copyright (C) 2026 Roland Hieber, Pengutronix <rhi@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+IMAGE_PACKAGES-$(PTXCONF_IMAGE_LXA_FAIRYTUX2) += image-lxa-fairytux2
+
+# Note: though the -gen2 DTB is packaged into the FIP image, it is not really
+# used because barebox-stm32mp153c-lxa-fairytux2.img also contains both DTBs and
+# chooses the correct one in lowlevel code based on version strapping pins on
+# the board.
+IMAGE_LXA_FAIRYTUX2_ENV := \
+	STM32MP_BOARD=stm32mp153c-lxa-fairytux2 \
+	BAREBOX_DTB=stm32mp153c-lxa-fairytux2-gen2 \
+	BAREBOX_IMAGE=barebox-stm32mp153c-lxa-fairytux2.img \
+	SCMI=
+
+#
+# Paths and names
+#
+IMAGE_LXA_FAIRYTUX2		:= image-lxa-fairytux2
+IMAGE_LXA_FAIRYTUX2_DIR		:= $(BUILDDIR)/$(IMAGE_LXA_FAIRYTUX2)
+IMAGE_LXA_FAIRYTUX2_IMAGE	:= $(IMAGEDIR)/lxa-fairytux2.hdimg
+IMAGE_LXA_FAIRYTUX2_FILES	:= $(IMAGEDIR)/root.tgz
+IMAGE_LXA_FAIRYTUX2_CONFIG	:= stm32mp.config
+
+# ----------------------------------------------------------------------------
+# Image
+# ----------------------------------------------------------------------------
+
+$(IMAGE_LXA_FAIRYTUX2_IMAGE):
+	@$(call targetinfo)
+	@$(call image/genimage, IMAGE_LXA_FAIRYTUX2)
+	@$(call finish)
+
+# vim: syntax=make
diff --git a/configs/platform-v7a/rules/image-lxa-mc1-scmi.make b/configs/platform-v7a/rules/image-lxa-mc1-scmi.make
index 7dc7863012fa..16cec3413c8f 100644
--- a/configs/platform-v7a/rules/image-lxa-mc1-scmi.make
+++ b/configs/platform-v7a/rules/image-lxa-mc1-scmi.make
@@ -11,7 +11,11 @@
 #
 IMAGE_PACKAGES-$(PTXCONF_IMAGE_LXA_MC1_SCMI) += image-lxa-mc1-scmi
 
-IMAGE_LXA_MC1_SCMI_ENV := STM32MP_BOARD=stm32mp157c-lxa-mc1 SCMI=-scmi
+IMAGE_LXA_MC1_SCMI_ENV := \
+	STM32MP_BOARD=stm32mp157c-lxa-mc1 \
+	BAREBOX_DTB=stm32mp157c-lxa-mc1 \
+	BAREBOX_IMAGE=barebox-stm32mp-generic-bl33.img \
+	SCMI=-scmi
 
 #
 # Paths and names
diff --git a/configs/platform-v7a/rules/image-lxa-mc1.make b/configs/platform-v7a/rules/image-lxa-mc1.make
index 98a294304136..969de2874ab6 100644
--- a/configs/platform-v7a/rules/image-lxa-mc1.make
+++ b/configs/platform-v7a/rules/image-lxa-mc1.make
@@ -11,7 +11,11 @@
 #
 IMAGE_PACKAGES-$(PTXCONF_IMAGE_LXA_MC1) += image-lxa-mc1
 
-IMAGE_LXA_MC1_ENV := STM32MP_BOARD=stm32mp157c-lxa-mc1 SCMI=
+IMAGE_LXA_MC1_ENV := \
+	STM32MP_BOARD=stm32mp157c-lxa-mc1 \
+	BAREBOX_DTB=stm32mp157c-lxa-mc1 \
+	BAREBOX_IMAGE=barebox-stm32mp-generic-bl33.img \
+	SCMI=
 
 #
 # Paths and names
diff --git a/configs/platform-v7a/rules/image-stm32mp157c-dk2.make b/configs/platform-v7a/rules/image-stm32mp157c-dk2.make
index cc6c722a24e7..9a51469f4588 100644
--- a/configs/platform-v7a/rules/image-stm32mp157c-dk2.make
+++ b/configs/platform-v7a/rules/image-stm32mp157c-dk2.make
@@ -11,7 +11,11 @@
 #
 IMAGE_PACKAGES-$(PTXCONF_IMAGE_STM32MP157C_DK2) += image-stm32mp157c-dk2
 
-IMAGE_STM32MP157C_DK2_ENV := STM32MP_BOARD=stm32mp157c-dk2 SCMI=
+IMAGE_STM32MP157C_DK2_ENV := \
+	STM32MP_BOARD=stm32mp157c-dk2 \
+	BAREBOX_DTB=stm32mp157c-dk2 \
+	BAREBOX_IMAGE=barebox-stm32mp-generic-bl33.img \
+	SCMI=
 
 #
 # Paths and names
diff --git a/configs/platform-v7a/rules/image-stm32mp157c-ev1.make b/configs/platform-v7a/rules/image-stm32mp157c-ev1.make
index 081e2d93948c..1bdf960dc019 100644
--- a/configs/platform-v7a/rules/image-stm32mp157c-ev1.make
+++ b/configs/platform-v7a/rules/image-stm32mp157c-ev1.make
@@ -11,7 +11,11 @@
 #
 IMAGE_PACKAGES-$(PTXCONF_IMAGE_STM32MP157C_EV1) += image-stm32mp157c-ev1
 
-IMAGE_STM32MP157C_EV1_ENV := STM32MP_BOARD=stm32mp157c-ev1 SCMI=
+IMAGE_STM32MP157C_EV1_ENV := \
+	STM32MP_BOARD=stm32mp157c-ev1 \
+	BAREBOX_DTB=stm32mp157c-ev1 \
+	BAREBOX_IMAGE=barebox-stm32mp-generic-bl33.img \
+	SCMI=
 
 #
 # Paths and names
diff --git a/projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules b/projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules
index 8f918b1bdb0e..181f7e25c912 100644
--- a/projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules
+++ b/projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules
@@ -11,6 +11,7 @@ IMPORT{program}="of_base_compatible"
 
 # first part: find out the boot disk on known platforms
 ENV{OF_BASE_COMPATIBLE}=="*arm,vexpress,v2p-ca9*", ENV{ID_PATH}=="platform-bus@40000000:motherboard-bus@40000000:iofpga@7,00000000-amba-10005000.mmci", TAG+="boot_disk"
+ENV{OF_BASE_COMPATIBLE}=="*lxa,stm32mp153c-fairytux2*", ENV{ID_PATH}="=platform-soc-amba-58007000.mmc", TAG+="boot_disk"
 ENV{OF_BASE_COMPATIBLE}=="*lxa,stm32mp157c-mc1*", ENV{ID_PATH}=="platform-soc-amba-58005000.mmc", TAG+="boot_disk"
 ENV{OF_BASE_COMPATIBLE}=="*ti,am335x-bone-black*", ENV{ID_PATH}=="platform-48060000.mmc", TAG+="boot_disk"
 ENV{OF_BASE_COMPATIBLE}=="*raspberrypi,3-model-b*", ENV{ID_PATH}=="platform-3f202000.mmc", TAG+="boot_disk"
-- 
2.47.3




  parent reply	other threads:[~2026-02-03 17:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-03 17:33 [DistroKit] [PATCH 1/5] v7a: tf-a: version bump v2.12 -> v2.14 Roland Hieber
2026-02-03 17:33 ` [DistroKit] [PATCH 2/5] v7a: tf-a: enable support for LXA FairyTux 2 Roland Hieber
2026-02-03 17:33 ` [DistroKit] [PATCH 3/5] v7a: barebox: " Roland Hieber
2026-02-03 17:33 ` Roland Hieber [this message]
2026-02-03 17:33 ` [DistroKit] [PATCH 5/5] doc: add FairyTux 2 documentation Roland Hieber
2026-02-03 17:37   ` [DistroKit] [PATCH] fixup! " Roland Hieber

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=20260203173409.3995749-4-rhi@pengutronix.de \
    --to=rhi@pengutronix.de \
    --cc=distrokit@pengutronix.de \
    --cc=l.goehrs@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