[PATCH] fdt: Fix TPL SEPARATE_BSS check when locating DTB

Tom Rini trini at konsulko.com
Sat Apr 23 14:09:00 CEST 2022


On Sat, Apr 16, 2022 at 10:12:31AM +1000, Andrew Abbott wrote:

> Commit 690af71850149bf242502f688eca80fb302d1f76 changed this condition
> from an explicit
> 
> IS_ENABLED(CONFIG_SPL_SEPARATE_BSS)
> 
> to
> 
> CONFIG_IS_ENABLED(SEPARATE_BSS)
> 
> The documentation for CONFIG_IS_ENABLED() in include/linux/kconfig.h
> implies that we will get the correct behaviour, but the actual behaviour
> differs such that this condition is now always false.
> 
> This stopped TPL being able to load the device tree blob at least on the
> ROCKPro64 board (RK3399 SoC), since the wrong device tree location was
> chosen.
> 
> The issues causing this behaviour with CONFIG_IS_ENABLED() are:
> 
> 1. The documentation implies that CONFIG_SPL_BUILD =>
>    CONFIG_SPL_<option> is considered before the TPL equivalent.
> 
>    Actually, the TPL options have higher priority - see definition of
>    _CONFIG_PREFIX.
> 
> 2. The documentation implies a fallthrough, eg. if CONFIG_SPL_BUILD is
>    defined but the CONFIG_SPL_<option> is not, then it will proceed to
>    check if CONFIG_TPL_BUILD
> 
>    Actually, if CONFIG_TPL_BUILD is defined, then it stops there
>    and CONFIG_SPL_BUILD is not considered - see definition of
>    _CONFIG_PREFIX.
> 
>    During TPL build, at least for the ROCKPro64, both CONFIG_TPL_BUILD
>    and CONFIG_SPL_BUILD are defined, but because of the above, only TPL
>    options are considered. Since there is no CONFIG_TPL_SEPARATE_BSS,
>    this fails.
> 
> Fixes: 690af71850 ("fdt: Correct condition for SEPARATE_BSS")
> Signed-off-by: Andrew Abbott <andrew at mirx.dev>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20220423/f6ccd076/attachment.sig>


More information about the U-Boot mailing list