[PATCH master v2 0/7] firmware: optionally turn missing firmware errors into warnings

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Jun 26 22:52:32 PDT 2023


v1 -> v2:
   - mark firmware used for PBL as pbl-only (fixes unintended build
     error)
   - fix escape of newline character in firmware/Makefile
   - fix build failing even with CONFIG_MISSING_FIRMWARE_ERROR unset

Many of the ARMv8 defconfigs can require firmware external to barebox
for proper operation: TF-A as BL31, DDR PHY firmware, SDRAM setup
or OP-TEE. This led to defconfigs that fail to build by default
unless the user installs the firmware files into the firmware directory.

While this worked for the SoC-specific defconfigs, it's really annoying
for the multi_v8_defconfig:

  - The user will need to install firmware even for unrelated
    platforms

  - Some platforms like e.g. qemu-virt64, which need no firmware to
    be compiled into barebox, can't be built just by using the
    defconfig

For v2023.06.0, this was resolved by disabling boards that lack firmware
through hiding their Kconfig symbol. This has a few shortcomings:

  - Firmware is looked up relative to source tree and can't take
    CONFIG_EXTRA_FIRMWARE_DIR into account that early

  - Firmware needs to exist at configure stage, which breaks
    build system recipes that install firmware after configure
    stage

  - menuconfig e.g. in Yocto's cml1.bbclass doesn't take make options
    into account that are otherwise used for olddefconfig and build

This series resolves the underlying issue differently: We record
whether firmware is missing and just continue the build till the end
at which time the build would succeed (with warnings) if new option
CONFIG_MISSING_FIRMWARE_ERROR was unset.

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, e.g.  ** firmware missing for barebox-rk3568-bpi-r2pro.img**

  * 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


Ahmad Fatoum (7):
  firmware: reference pointer alignment defined in
    <asm-generic/pointer.h>
  firmware: mark firmware used in PBL as pbl-only
  firmware: turn missing firmware into linker error
  firmware: optionally turn missing firmware errors into warnings
  ARM64: Rockchip: gracefully handle missing firmware
  ARM64: unset CONFIG_MISSING_FIRMWARE_ERROR for Rockchip/i.MX
  firmware: don't hardcode firmware paths in srctree for existence check

 arch/arm/configs/imx_v8_defconfig      |  1 +
 arch/arm/configs/multi_v8_defconfig    |  1 +
 arch/arm/configs/rockchip_v8_defconfig |  1 +
 arch/arm/mach-imx/Kconfig              | 49 -------------------
 arch/arm/mach-rockchip/Kconfig         |  6 ---
 firmware/Kconfig                       | 49 +++++--------------
 firmware/Makefile                      | 47 +++++++++++-------
 images/Makefile                        | 23 ++++++---
 images/Makefile.rockchip               | 68 +++++++++-----------------
 scripts/Makefile.lib                   |  3 ++
 10 files changed, 88 insertions(+), 160 deletions(-)

-- 
2.39.2




More information about the barebox mailing list