mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master v2 0/7] firmware: optionally turn missing firmware errors into warnings
@ 2023-06-27  5:52 Ahmad Fatoum
  2023-06-27  5:52 ` [PATCH master v2 1/7] firmware: reference pointer alignment defined in <asm-generic/pointer.h> Ahmad Fatoum
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Ahmad Fatoum @ 2023-06-27  5:52 UTC (permalink / raw)
  To: barebox; +Cc: uol

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




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-06-28  8:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-27  5:52 [PATCH master v2 0/7] firmware: optionally turn missing firmware errors into warnings Ahmad Fatoum
2023-06-27  5:52 ` [PATCH master v2 1/7] firmware: reference pointer alignment defined in <asm-generic/pointer.h> Ahmad Fatoum
2023-06-28  7:14   ` Sascha Hauer
2023-06-27  5:52 ` [PATCH master v2 2/7] firmware: mark firmware used in PBL as pbl-only Ahmad Fatoum
2023-06-27  5:52 ` [PATCH master v2 3/7] firmware: turn missing firmware into linker error Ahmad Fatoum
2023-06-27  5:52 ` [PATCH master v2 4/7] firmware: optionally turn missing firmware errors into warnings Ahmad Fatoum
2023-06-27  5:52 ` [PATCH master v2 5/7] ARM64: Rockchip: gracefully handle missing firmware Ahmad Fatoum
2023-06-27  5:52 ` [PATCH master v2 6/7] ARM64: unset CONFIG_MISSING_FIRMWARE_ERROR for Rockchip/i.MX Ahmad Fatoum
2023-06-27  5:52 ` [PATCH master v2 7/7] firmware: don't hardcode firmware paths in srctree for existence check Ahmad Fatoum
2023-06-28  8:45 ` [PATCH master v2 0/7] firmware: optionally turn missing firmware errors into warnings Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox