Hi Massimo,

On 10/14/26 8:07 PM, Massimo Pegorer wrote:
Hi Quentin,

Il giorno mer 14 ott 2026 alle ore 11:31 Quentin Schulz ha scritto:

Hi Massimo,

On 10/2/26 6:35 PM, Massimo Pegorer wrote:
There is no need to define TPL linker script file through TPL_LDSCRIPT
configuration option value when CONFIG_TPL is not selected. Avoid this
useless row in the configuration with no side effect on binary outputs.


What is this helping with?

If you make generic-rk3328_defconfig which has ROCKCHIP_EXTERNAL_TPL=y (and
therefore CONFIG_TPL is not selected), you will see in the .config the line:


OK, clear now, thanks for the explanation. Please consider saying ".config" instead of "configuration", or "defconfig" whenever appropriate, I think this would have made things clear from the beginning.

CONFIG_TPL_LDSCRIPT="arch/arm/mach-rockchip/u-boot-tpl-v8.lds"

which is useless and misleading. As an example, if you use the qconfig tool,
it will report that generic-rk3328 is using TPL_LDSCRIPT. Indeed, the
generic-rk3328 configuration profile does not need any definition of
TPL_LDSCRIPT because it does not build TPL, being CONFIG_TPL not selected.


OK, I was about to say that I don't really care about the final .config but if this breaks qconfig.py, then it's not good.

We also have a bunch of other things in there that don't belong. A simple grep on TPL returns:

# CONFIG_TPL_SKIP_LOWLEVEL_INIT is not set
CONFIG_ROCKCHIP_EXTERNAL_TPL=y
CONFIG_TPL_LDSCRIPT="arch/arm/mach-rockchip/u-boot-tpl-v8.lds"
CONFIG_TPL_TEXT_BASE=0xff091000
CONFIG_TPL_STACK=0xff098000
CONFIG_TPL_SYS_MALLOC_F_LEN=0x800
# CONFIG_TPL_SILENT_CONSOLE is not set
CONFIG_SUPPORT_TPL=y
# CONFIG_TPL is not set
# CONFIG_TPL_GZIP is not set

CONFIG_TPL_SKIP_LOWLEVEL_INIT seems to be depending on SPL, but shouldn't that rather be TPL? I think that's a typo introduced in a2ac2b964bfb ("Convert CONFIG_SKIP_LOWLEVEL_INIT et al to Kconfig").

CONFIG_TPL_LDSCRIPT, CONFIG_TPL_TEXT_BASE, CONFIG_TPL_STACK, CONFIG_TPL_SYS_MALLOC_F_LEN being redefined in arch/arm/mach-rockchip/*/Kconfig means we need to respect the visibility of the "main" symbol otherwise we may actually define (and not redefine/extend it) the symbol. For those, I think the easiest solution is to guard them with an
if TPL
config ...
[...]
endif # TPL

We need the same mechanism in arch/arm/mach-rockchip/Kconfig.

CONFIG_TPL_SILENT_CONSOLE (as well as the SPL_SILENT_CONSOLE) should depend on TPL (respectively SPL).

CONFIG_SUPPORT_TPL shouldn't be hidden, the SoC supports it, we just decide to not use it (and use the external blob instead via ROCKCHIP_TPL).

CONFIG_TPL_GZIP depends on TPL_ZLIB which doesn't depend on TPL, but should. Same for SPL_GZIP/SPL_ZLIB, VPL_LZMA, SPL_LZMA_SIZE_OPTIMIZATION (probably should depend on SPL_LZMA?).

We may have to think about stopping to "redefine" symbols in arch/arm/mach-rockchip and instead have our defaults/additional restrictions added to the main symbol. The downside is that the Rockchip maintainer (me) won't necessarily see those patches as I wouldn't be automatically in Cc via get_maintainer.pl anymore. The other option is what we do today and start monitoring the visibility (or rather, reachability) of the symbol.

Cheers,
Quentin

Reply via email to