From: Michael Grzeschik <grzeschik@puzzle.ch>
To: Sascha Hauer <s.hauer@pengutronix.de>,
"open list:BAREBOX" <barebox@lists.infradead.org>
Cc: Michael Grzeschik <grzeschik@puzzle.ch>
Subject: [PATCH 1/6] images: mvebu: skip images whose binary header is missing
Date: Tue, 03 Nov 2026 22:31:07 +0100 [thread overview]
Message-ID: <20261103-orion_kw_mvebu-v1-1-86442c0d283e@puzzle.ch> (raw)
In-Reply-To: <20261103-orion_kw_mvebu-v1-0-86442c0d283e@puzzle.ch>
The Armada 370/XP/38x boards embed DDR training code from
arch/arm/boards/*/binary.0, which is not part of barebox. A missing file
stopped the whole build:
No rule to make target 'arch/arm/boards/globalscale-mirabox/binary.0',
needed by 'images/start_globalscale_mirabox.pblb.mvebu1img'. Stop.
so mvebu_defconfig could not be built without the firmware for every
board, not even for boards that need none.
Use the missing firmware handling that the Rockchip images already use:
depend on the binary headers only if they exist, and if one is missing,
record it in <image>.missing-firmware and create an empty image. The
images step then reports the image as skipped, or fails the build with
CONFIG_MISSING_FIRMWARE_ERROR=y.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Michael Grzeschik <grzeschik@puzzle.ch>
---
images/Makefile.mvebu | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/images/Makefile.mvebu b/images/Makefile.mvebu
index 7c918cb9f1..d4f2476aae 100644
--- a/images/Makefile.mvebu
+++ b/images/Makefile.mvebu
@@ -8,11 +8,24 @@
$(obj)/%.kwbimg: $(obj)/% FORCE
$(call if_changed,kwb_image)
+# Binary headers (DDR training code, arch/arm/boards/*/binary.0) are not part
+# of barebox. If one is missing, report the image as missing firmware instead
+# of failing the build, so multi-board builds produce all other images. The
+# image is only skipped unless CONFIG_MISSING_FIRMWARE_ERROR=y.
+mvebu_missing_binhdr = $(filter-out $(wildcard $(BINHDR_$(@F))),$(BINHDR_$(@F)))
+
+define mvebu_binhdr_image
+ $(Q)$(if $(mvebu_missing_binhdr), \
+ echo $(patsubst $(srctree)/%,%,$(mvebu_missing_binhdr)) >$@.missing-firmware, \
+ rm -f $@.missing-firmware)
+ $(call if_changed,$(if $(mvebu_missing_binhdr),0size,$(1)))
+endef
+
$(obj)/%.mvebu0img: $(obj)/% scripts/mvebuimg FORCE
- $(call if_changed,mvebu0_image)
+ $(call mvebu_binhdr_image,mvebu0_image)
$(obj)/%.mvebu1img: $(obj)/% scripts/mvebuimg FORCE
- $(call if_changed,mvebu1_image)
+ $(call mvebu_binhdr_image,mvebu1_image)
KWBOPTS = -c -d 0x1000000 -e 0x1000000
@@ -127,6 +140,6 @@ pblb-$(CONFIG_MACH_USI_TOPKICK) += start_usi_topkick
image-$(CONFIG_MACH_USI_TOPKICK) += barebox-usi-topkick.img
image-$(CONFIG_MACH_USI_TOPKICK) += barebox-usi-topkick-2nd.img
-# ensure that an image depends on its included binhdrs
-$(foreach f,$(pblb-y),$(eval $$(obj)/$f.pblb.mvebu0img: $$(BINHDR_$f.pblb.mvebu0img)))
-$(foreach f,$(pblb-y),$(eval $$(obj)/$f.pblb.mvebu1img: $$(BINHDR_$f.pblb.mvebu1img)))
+# ensure that an image depends on its included binhdrs, as far as they exist
+$(foreach f,$(pblb-y),$(eval $$(obj)/$f.pblb.mvebu0img: $$(wildcard $$(BINHDR_$f.pblb.mvebu0img))))
+$(foreach f,$(pblb-y),$(eval $$(obj)/$f.pblb.mvebu1img: $$(wildcard $$(BINHDR_$f.pblb.mvebu1img))))
--
2.53.0
next prev parent reply other threads:[~2026-11-03 21:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 21:31 [PATCH 0/6] orion/kw/mvebu: stability/usability patches Michael Grzeschik
2026-11-03 21:31 ` Michael Grzeschik [this message]
2026-11-03 21:31 ` [PATCH 2/6] mtd: nand: orion: set Hamming ECC algorithm in ->attach_chip() Michael Grzeschik
2026-11-03 21:31 ` [PATCH 3/6] gpio: orion: do not let banks without alias collide Michael Grzeschik
2026-11-03 21:31 ` [PATCH 4/6] filetype: detect kwbimage v0 images for NAND boot Michael Grzeschik
2026-11-03 21:31 ` [PATCH 5/6] mtd: nand: orion: register the NAND device as "nand" Michael Grzeschik
2026-11-03 21:31 ` [PATCH 6/6] gpio: orion: register at coredevice level Michael Grzeschik
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=20261103-orion_kw_mvebu-v1-1-86442c0d283e@puzzle.ch \
--to=grzeschik@puzzle.ch \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@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