[PATCH v2 4/8] spl: binman: Split binman symbols support from enabling binman

Simon Glass sjg at chromium.org
Tue Jun 28 15:37:46 CEST 2022


Enabling CONFIG_BINMAN makes binman run after a build to package any
images specified in the device-tree. It also enables a mechanism for
SPL/TPL to declare and use special linker symbols that refer to other
entries in the same binman image. A similar feature that gets this info
from the device-tree exists for U-Boot proper, but it is gated behind a
CONFIG_BINMAN_FDT unlike the symbols.

Confusingly, CONFIG_SPL/TPL_BINMAN_SYMBOLS also exist. These configs
don't actually enable/disable the symbols mechanism as one would expect,
but declare some symbols for U-Boot using this mechanism.

Reuse the BINMAN_SYMBOLS configs to make them toggle the symbols
mechanism, and declare symbols for the U-Boot phases in a dependent
BINMAN_UBOOT_SYMBOLS config. Extend it to cover symbols of all phases.
Update the config prompt and help message to make it clearer about this.
Fix binman test binaries to work with CONFIG_IS_ENABLED(BINMAN_SYMBOLS).

Co-developed-by: Peng Fan <peng.fan at nxp.com>
[Alper: New config for phase symbols, update Kconfigs, commit message]
Signed-off-by: Alper Nebi Yasak <alpernebiyasak at gmail.com>
---
See Peng's patch [1] included in these changes.

[1] binman_sym: guard with CONFIG_IS_ENABLED(BINMAN_SYMBOLS)
https://lore.kernel.org/u-boot/20220603071715.15212-8-peng.fan@oss.nxp.com/

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

 common/spl/Kconfig                          | 22 ++++++++++++++-----
 common/spl/Kconfig.tpl                      | 24 +++++++++++++++------
 common/spl/spl.c                            |  9 ++++----
 include/binman_sym.h                        |  6 +++---
 tools/binman/test/Makefile                  |  2 +-
 tools/binman/test/generated/autoconf.h      |  3 +++
 tools/binman/test/u_boot_binman_syms.c      |  2 +-
 tools/binman/test/u_boot_binman_syms_size.c |  2 +-
 8 files changed, 49 insertions(+), 21 deletions(-)
 create mode 100644 tools/binman/test/generated/autoconf.h

Applied to u-boot-dm, thanks!


More information about the U-Boot mailing list