[U-Boot] Quick guide to Kconfig

Masahiro Yamada yamada.m at jp.panasonic.com
Fri Aug 1 06:37:54 CEST 2014


Hi Hans,


On Thu, 31 Jul 2014 16:38:47 +0200
Hans de Goede <hdegoede at redhat.com> wrote:

> Hi,
> 
> On 07/31/2014 06:51 AM, Masahiro Yamada wrote:
> > Hi all,
> > 
> > 
> > 
> > The mainline has switched to Kconfig.
> > 
> > Please make sure to use "make <board>_defconfig"
> > instead of "make <board>_config".
> > 
> > 
> > 
> > [1] Board Configuration
> > 
> >      make  <board_name>_defconfig
> > 
> > 
> > 
> > [2] Modify configuration
> > 
> > 
> >  make config,  make menuconfig,  make nconfig, ... etc.
> > 
> > 
> >  For SPL,
> >    make spl/config,  make spl/menuconfig,  make spl/nconfig, ... etc.
> 
> I'm a bit confused here, a single "make" will build both the SPL +
> the regular u-boot binary, so why 2 separate menuconfig commands for them ?

A single "make <board>_defconfig" will configure both the Normal U-boot and SPL.
(It will create  .config and additionally spl/.config if SPL is supported )

Likewise a single "make" will build both.

This keeps the same build process as we had prior to Kconfig,
except the command name difference between  <board>_config and <board>_defconfig.

But "config", "menuconfig", "nconfig", etc. are interactive configuration
tools, which can not be run for Normal and SPL at one time.

So I think it is reasonable to allow users to invoke menuconfig and spl/menuconfig
separately.




> To be a bit more specific, currently for sunxi for some boards
> (the ones most used by devs) we have both Foo_defconfig and Foo_FEL_defconfig
> with the latter one being identical to the first one, except that it not only
> defines SPL (all our builds use SPL) but also SPL_FEL, this changes some
> compile time settings as well as leads to using a different linker script
> for the SPL. The end result is a SPL binary which can be loaded through the
> "FEL" allwinner usb firmware loading / update mechanism, rather then written
> to a sdcard as our regular builds.
> 
> Rather then doubling the amount of defconfigs we have to allow using FEL
> on any sunxi board, I would like to remove the Foo_FEL_defconfig files
> and make it possible to do a FEL build by doing something like this:
> 
> make Foo_defconfig
> make menuconfig
> <select FEL>
> make

Yes, this is exactly what I expect board maintainers.

We had multiple entries in boards.cfg per board
(with some differences in the options field)
and I generated the correspoing defconfig files.

But I guess it would be painful to maintain lots of defconfigs.

I expect board maintainers will consolidate defconfigs like you are trying to do,
and eventually, we will have one defconfig per board in the future.


> I was planning on taking a shot at this, but the different make menuconfig
> and make spl/menuconfigs have me somewhat confused (I've a decent knowledge of
> Kconfig from my kernel work).
> 
> Perhaps you can give me some hints on how I can best implement the above ?


Sounds good!


I think it is good to add

config FEL
     bool

or something allowing users to enable/disable it.


If it is a sunxi-specifi option, please add it to
arch/arm/cpu/armv7/sunxi/Kconfig or board/sunxi/Kconfig.



Best Regards
Masahiro Yamada



More information about the U-Boot mailing list