[U-Boot] moveconfig.py removes defconfig entries for "choice" Kconfig settings ?

Masahiro Yamada yamada.masahiro at socionext.com
Sat Jun 11 17:50:15 CEST 2016


Hi Hans,

2016-06-11 23:07 GMT+09:00 Hans de Goede <hdegoede at redhat.com>:
> Hi All,
>
> While looking into adding a DISTRO_DEFAULTS Kconfig option,
> I noted that commit bb597c0eeb7e besides introducing the
> BOOT_DELAY issues we've been discussing also removes
>
> CONFIG_MACH_SUN4I=y
>
> From the defconfig of all sun4i (Allwinner A10) based boards.
>
> This is defined in  board/sunxi/Kconfig :
>
> choice
>         prompt "Sunxi SoC Variant"
>
> config MACH_SUN4I
>         bool "sun4i (Allwinner A10)"
>         select CPU_V7
>         select SUNXI_GEN_SUN4I
>         select SUPPORT_SPL
>
> config MACH_SUN5I
>         bool "sun5i (Allwinner A13)"
>         select CPU_V7
>         select SUNXI_GEN_SUN4I
>         select SUPPORT_SPL
>
> config MACH_SUN6I
>         bool "sun6i (Allwinner A31)"
>         select CPU_V7
>         select CPU_V7_HAS_NONSEC
>         select CPU_V7_HAS_VIRT
>         select SUNXI_GEN_SUN6I
>         select SUPPORT_SPL
>         select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
>
> ...
>
> endchoice
>
> And it seems that moveconfig.py now has decided to remove
> the explicit setting of this from all defconfig's which
> were setting it to the first choice, this seems wrong,
> since this means that if we now choose to sort choice
> options differently all of a sudden things change.

More precisely, it is decided by "make savedefconfig".

To prevent the moveconfig tool from dropping the
first choice, "optional" was added by
commit a26cd04920dc069fd6e91abb785426cf6c29f45f

This is, I think, not the best solution, though.


> I guess this may be caused by:
>
> http://git.denx.de/?p=u-boot.git;a=commitdiff;h=1a5f0de08e86f2f127aaac928fee5ea0f2a9236e
>
> But that commit in itself seems sensible, and this
> seems like a surprising result, since there is no
> default defined in the Kconfig.

If neither "default" nor "optional" is specified in
a choice menu, the first entry is considered as its default.

So, "make savedefconfig" dropped CONFIG_MACH_SUN4I=y
because having default values in a defconfig is redundant.



> Anyways if this considered not a bug from the
> moveconfig.py pov then I'll revert the above commit,
> as I do want the sun?i family to be clearly stated in the
> defconfig in all cases.

This was discussed in this thread:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/220748/focus=220804

Then commit a26cd04920dc069fd6e91abb785426cf6c29f45f
was applied.

But, SoC/board maintainers can replace the
"optional" with a reasonable default in the SoC/board select menu.

Please see my
commit 7fff91ffc0d7517dd8b3e5fc8289c380638770e2
commit ff560a13056a565a4e9ce1761bd04276a3cace88



-- 
Best Regards
Masahiro Yamada


More information about the U-Boot mailing list