summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2023-06-27 07:52:36 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2023-06-28 08:14:14 +0200
commit1bfbe86d7978efa90d079ade93a6ca939f337599 (patch)
tree6cefcd66c286bd0a0d8920e98af1697526f6dc5f /firmware
parent5b171b7b7edaf75e310c7a583c1a975f78f41cc1 (diff)
downloadbarebox-1bfbe86d7978efa90d079ade93a6ca939f337599.tar.gz
barebox-1bfbe86d7978efa90d079ade93a6ca939f337599.tar.xz
firmware: optionally turn missing firmware errors into warnings
Previous commit turned compile-time errors into link-time errors. This commit goes a step further and allows the link to succeed unconditionally for build coverage and then dependent on the newly introduced CONFIG_MISSING_FIRMWARE_ERROR option abort the build with an error code and a listing of missing firmware printed to stderr. In any case, barebox images which contain firmware in their PBL that's not available will be marked specially to reduce the risk of accidentally putting them to use: * They're truncated to zero size * The final "images built:" section marks them as having firmware missing * They are omitted from the listing in the barebox-flash-images file * Each barebox-broken.img is accompanied with a barebox-broken.img.missing-firmware containing a newline delimited list of missing firmware images Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230627055239.3908872-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'firmware')
-rw-r--r--firmware/Kconfig14
-rw-r--r--firmware/Makefile5
2 files changed, 19 insertions, 0 deletions
diff --git a/firmware/Kconfig b/firmware/Kconfig
index 56ced00bc4..56d6d0d6c0 100644
--- a/firmware/Kconfig
+++ b/firmware/Kconfig
@@ -6,6 +6,20 @@ config EXTRA_FIRMWARE_DIR
string "Firmware blobs root directory"
default "firmware"
+config MISSING_FIRMWARE_ERROR
+ bool "Fail the build when required firmware is missing"
+ default y
+ help
+ In-tree Defconfigs that enable multiple boards with different firmware
+ binary requirements would say y here, so you don't need unrelated firmware
+ for the build to succeed.
+
+ Defconfigs custom-tailored to products would say n here as all boards
+ being built should be functional and have their firmware available.
+
+ If in doubt, say Y and refer to the documentation on where to acquire the
+ needed firmware.
+
config HAVE_FIRMWARE_IMX_LPDDR4_PMU_TRAIN
bool
default y
diff --git a/firmware/Makefile b/firmware/Makefile
index 924ff0da14..8d3bfb0752 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -59,6 +59,11 @@ filechk_fwbin = { \
echo "\#endif" ;\
echo ".global _fw_$(FWSTR)_end" ;\
echo "_fw_$(FWSTR)_end:" ;\
+ echo "\#ifdef __PBL__" ;\
+ echo " .section .missing_fw,\"a\"" ;\
+ echo "_fwname_$(FWSTR):" ;\
+ echo ".ascii \"firmware/$(FWNAME)\\\\n\"" ;\
+ echo "\#endif" ;\
}
__fwbin_sha = { \