Hi Alper,
在 2022/6/18 20:13, Alper Nebi Yasak 写道:
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.
I have tested your patchset with branch : imx-ddr-binman-symbols
Tested-by: Peng Fan <peng....@nxp.com> #i.MX8MP-EVK
Would you send out the i.MX patches? or you need me to send a V7 version
based on your patchset?
Thanks,
Peng.
[1] arm64: binman: use binman symbols for imx
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kernel.org%2Fu-boot%2F20220603071715.15212-1-peng.fan%40oss.nxp.com%2F&data=05%7C01%7Cpeng.fan%40nxp.com%7C762c5e7536d8472a0eb308da51240074%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637911512361561438%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=1swOCCJNBUj5kgGx2RsWLZqnXhtdV6V3xZ%2BfzDkESVU%3D&reserved=0
[2] #20220616.1 spl: binman: Fixes for BINMAN_SYMBOLS
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdev.azure.com%2Fu-boot%2Fu-boot%2F_build%2Fresults%3FbuildId%3D4490%26view%3Dresults&data=05%7C01%7Cpeng.fan%40nxp.com%7C762c5e7536d8472a0eb308da51240074%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637911512361561438%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=ipiBvgKIx8nNIvZFgSZKzRxuyWFD0EZzHHJnPrzbqMA%3D&reserved=0
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