Search code examples
u-bootkbuild

How does `Depends on` and `Selected by` work in Kconfig when they conflict


To understand how SPL (secondary boot loader), I tried (in u-boot v2021.10)

make ARCH=arm CROSS_COMPILE=aarch64-none-elf- vexpress_ca9x4_defconfig

and

make ARCH=arm CROSS_COMPILE=aarch64-none-elf- vexpress_ca9x4_defconfig

I searched for SPL_OS_BOOT, which I need to test the SPL falcon mode. But it appears it is not enabled by default for this board.
enter image description here

So first I need to set CONFIG_SPL=y, but when I search for SPL, it shows this.
enter image description here

I can't clearly understand it here. Does Depends on: ARM [=y] && ARCH_STM32MP [=n] mean I should set the ARCH_STM32MP=y? and if I add a Selected by condition, should it still meet the Depends on condition above? I ask it because SPL should be avaiable for many boards but having ARCH_STM32MP, -- a very specific architecture condition --, in the Depends on list looks weird.


Solution

  • Kconfig in general can be difficult to follow (and a few things in how we use it in U-Boot need to be cleaned up as it makes things harder still to follow). It's often best to look at the Kconfig files directly, to better understand things. In this case as you've noted, SPL_OS_BOOT depends on SPL and if we look in common/spl/Kconfig we see:

    config SPL
            bool
            depends on SUPPORT_SPL
            prompt "Enable SPL"
            help
              If you want to build SPL as well as the normal image, say Y.
    

    which hints at the real problem you're facing, vexpress_ca9x4 does not support SPL. That's what the long list of things you were trying to figure out was showing, the places where SUPPORT_SPL is set.