From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: distrokit@pengutronix.de
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [DistroKit] [PATCH 2/2] barebox: make use of new env/match.of_compatible feature
Date: Wed, 20 May 2026 10:04:58 +0200 [thread overview]
Message-ID: <20260520080500.2471785-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20260520080500.2471785-1-a.fatoum@pengutronix.de>
We switched most boards to use a single barebox recipe a while ago. This
meant that the same environment is used on all boards sharing the recipe
and so we had to add some calls to the of_compatible command to prevent
board-specific init script to run outside of their specific board.
The newest barebox release provides an alternative in the form of
board-specific environment directories:
If we want /boot/9p to be specific only to arm,vexpress compatible
boards, we can move it to match.of_compatible/arm,vexpress/boot/9p and
it will only be available there.
Let's make use of it for the two scripts that are targeting only a
single board. Further simplification may be possible in future by
replacing other users of the of_compatible command as well.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
.../{ => match.of_compatible/arm,vexpress}/boot/9p | 7 +------
.../fsl,imx8mq-evk/init/disable-imx8mq-pci | 5 +++++
.../barebox-common-defaultenv/init/disable-imx8mq-pci | 7 -------
3 files changed, 6 insertions(+), 13 deletions(-)
rename configs/platform-v7a/barebox-defaultenv/{ => match.of_compatible/arm,vexpress}/boot/9p (69%)
create mode 100755 configs/platform-v7a/barebox-defaultenv/match.of_compatible/fsl,imx8mq-evk/init/disable-imx8mq-pci
delete mode 100755 configs/platform-v8a/barebox-common-defaultenv/init/disable-imx8mq-pci
diff --git a/configs/platform-v7a/barebox-defaultenv/boot/9p b/configs/platform-v7a/barebox-defaultenv/match.of_compatible/arm,vexpress/boot/9p
similarity index 69%
rename from configs/platform-v7a/barebox-defaultenv/boot/9p
rename to configs/platform-v7a/barebox-defaultenv/match.of_compatible/arm,vexpress/boot/9p
index 3f388a47064a..4e4985c9aff2 100644
--- a/configs/platform-v7a/barebox-defaultenv/boot/9p
+++ b/configs/platform-v7a/barebox-defaultenv/match.of_compatible/arm,vexpress/boot/9p
@@ -1,10 +1,5 @@
#!/bin/sh
-if ! of_compatible arm,vexpress ; then
- echo "9p is currently only available on QEMU ARM Vexpress"
- return 1
-fi
-
addpart /dev/nor0 "8M@32M(kernel)"
addpart /dev/nor0 "512k@40M(dtb)"
global.bootm.image="/dev/nor0.kernel"
@@ -12,4 +7,4 @@ global.bootm.oftree="/dev/nor0.dtb"
global linux.bootargs.base="console=ttyAMA0,115200 loglevel=5 ptxdist-devel"
-global linux.bootargs.root="root=/dev/root rootfstype=9p rootflags=trans=virtio"
\ No newline at end of file
+global linux.bootargs.root="root=/dev/root rootfstype=9p rootflags=trans=virtio"
diff --git a/configs/platform-v7a/barebox-defaultenv/match.of_compatible/fsl,imx8mq-evk/init/disable-imx8mq-pci b/configs/platform-v7a/barebox-defaultenv/match.of_compatible/fsl,imx8mq-evk/init/disable-imx8mq-pci
new file mode 100755
index 000000000000..a0eae2501eb9
--- /dev/null
+++ b/configs/platform-v7a/barebox-defaultenv/match.of_compatible/fsl,imx8mq-evk/init/disable-imx8mq-pci
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+echo "Disabling PCI to avoid issues with older EVK revisions"
+of_property -fs /soc@0/pcie@33800000 status disabled
+of_property -fs /soc@0/pcie@33c00000 status disabled
diff --git a/configs/platform-v8a/barebox-common-defaultenv/init/disable-imx8mq-pci b/configs/platform-v8a/barebox-common-defaultenv/init/disable-imx8mq-pci
deleted file mode 100755
index 68536e7baa5f..000000000000
--- a/configs/platform-v8a/barebox-common-defaultenv/init/disable-imx8mq-pci
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-if of_compatible -k fsl,imx8mq-evk; then
- echo "Disabling PCI to avoid issues with older EVK revisions"
- of_property -fs /soc@0/pcie@33800000 status disabled
- of_property -fs /soc@0/pcie@33c00000 status disabled
-fi
--
2.47.3
prev parent reply other threads:[~2026-05-20 8:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-20 8:04 [DistroKit] [PATCH 1/2] barebox: update to v2026.05.0 Ahmad Fatoum
2026-05-20 8:04 ` Ahmad Fatoum [this message]
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=20260520080500.2471785-2-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--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