[PATCH v2 0/8] spl: binman: Fixes for BINMAN_SYMBOLS

Alper Nebi Yasak alpernebiyasak at gmail.com
Sat Jun 18 14:13:05 CEST 2022


There's some trouble with an i.MX8M series [1] trying to use binman
symbols. The crux of it is the 'u_boot_any' symbols BINMAN_SYMBOLS
configs declare, and the boards creating partial binman images including
an SPL without a U-Boot the symbol is referring to.

Normally this should be easy to resolve by disabling BINMAN_SYMBOLS
configs, but that causes a build error. Apparently some parts of the SPL
code (RAW_IMAGE_SUPPORT, RAM_DEVICE) use the symbols directly without
guarding them by BINMAN_SYMBOLS, implicitly requiring it.

The first patch fixes the issue above, the rest are related things I
tinkered with while trying to understand the issue and the i.MX8M use
case. Part of this is splitting binman symbols support from enabling
binman and from the u-boot-any symbols declarations. Another is to add a
new macro people can use to check if they can use binman symbols safely.

These apply onto u-boot/next. I have also triggered an Azure CI run [2]
via a Github pull request.

[1] arm64: binman: use binman symbols for imx
https://lore.kernel.org/u-boot/20220603071715.15212-1-peng.fan@oss.nxp.com/

[2] #20220616.1 spl: binman: Fixes for BINMAN_SYMBOLS
https://dev.azure.com/u-boot/u-boot/_build/results?buildId=4490&view=results

Changes in v2:
- Split binman symbols support from enabling binman
- Move U-Boot phase symbol declarations to BINMAN_UBOOT_SYMBOLS configs
- Merge in Peng's patch for binman_sym.h changes
- Update VPL configs for the new BINMAN_UBOOT_SYMBOLS
- Add new patch to check binman symbols at runtime
- Add new patch to disable u_boot_any symbols for i.MX8M boards
- Pick Peng's __image_copy_start fix

Alper Nebi Yasak (7):
  spl: binman: Fix use of undeclared u_boot_any symbols
  spl: binman: Make TPL_BINMAN_SYMBOLS depend on TPL_FRAMEWORK
  spl: binman: Declare extern symbols for VPL as well
  spl: binman: Split binman symbols support from enabling binman
  spl: binman: Add config options for binman symbols in VPL
  spl: binman: Check at runtime if binman symbols were filled in
  spl: binman: Disable u_boot_any symbols for i.MX8M boards

Peng Fan (1):
  armv8: u-boot-spl.lds: mark __image_copy_start as symbol

 arch/arm/cpu/armv8/u-boot-spl.lds           |  2 +-
 common/spl/Kconfig                          | 23 ++++++++--
 common/spl/Kconfig.tpl                      | 27 ++++++++---
 common/spl/Kconfig.vpl                      | 25 ++++++++++
 common/spl/spl.c                            | 16 +++++--
 common/spl/spl_ram.c                        |  2 +-
 include/binman_sym.h                        | 51 +++++++++++++++++++--
 include/spl.h                               |  2 +
 tools/binman/elf.py                         | 12 +++--
 tools/binman/elf_test.py                    | 12 +++--
 tools/binman/ftest.py                       | 33 ++++++-------
 tools/binman/test/021_image_pad.dts         |  2 +-
 tools/binman/test/024_sorted.dts            |  2 +-
 tools/binman/test/028_pack_4gb_outside.dts  |  2 +-
 tools/binman/test/029_x86_rom.dts           |  6 +--
 tools/binman/test/053_symbols.dts           |  2 +-
 tools/binman/test/149_symbols_tpl.dts       |  4 +-
 tools/binman/test/155_symbols_tpl_x86.dts   |  4 +-
 tools/binman/test/187_symbols_sub.dts       |  2 +-
 tools/binman/test/Makefile                  |  2 +-
 tools/binman/test/generated/autoconf.h      |  3 ++
 tools/binman/test/u_boot_binman_syms.c      |  6 ++-
 tools/binman/test/u_boot_binman_syms_size.c |  6 ++-
 23 files changed, 183 insertions(+), 63 deletions(-)
 create mode 100644 tools/binman/test/generated/autoconf.h

-- 
2.36.1



More information about the U-Boot mailing list