[U-Boot] [PATCH v2 21/44] Convert CONFIG_SPL_GPIO_SUPPORT to Kconfig

Masahiro Yamada yamada.masahiro at socionext.com
Mon Sep 5 04:40:04 CEST 2016


2016-09-02 23:35 GMT+09:00 Tom Rini <trini at konsulko.com>:

>> >> diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
>> >> index c25fcf3..d4a5bc9 100644
>> >> --- a/arch/arm/mach-exynos/Kconfig
>> >> +++ b/arch/arm/mach-exynos/Kconfig
>> >> @@ -61,6 +61,9 @@ endif
>> >>
>> >>  if ARCH_EXYNOS5
>> >>
>> >> +config SPL_GPIO_SUPPORT
>> >> +       default y
>> >> +
>> >
>> >
>> > As we discussed before,
>> > we decided to not do this.
>>
>> Tom was keen to avoid changing every defconfig file. It is there
>> another way to express common defaults?
>
> I was thinking in the Kconfig with the entry for SPL_GPIO_SUPPORT, for
> optional stuff and select in the board, etc, Kconfig for non-optional
> stuff.  Now, I realize that optional vs non-optional is more the domain
> of the individual SoC custodians, so we'll have some clean up afterwards
> that isn't on you (well, aside from the SoCs you know like rockchip ;)).

config SPL_GPIO_SUPPORT
       default y

is incorrect because it could violate
the dependency in the proper Kconfig entry in spl/Kconfig.




Basically, we are supposed to use "select FOO" when it is mandatory,
or add CONFIG_FOO=y in a defconfig when the board wants it, but
can still make it optional.


I know our pain comes from that "include" is not supported by Kconfig.

What I can suggest now is:



[1]  Add ARCH_WANT_* to specify a SoC-common default.


       config SPL_GPIO_SUPPORT
                bool "GPIO support for SPL"
                default  ARCH_WANT_SPL_GPIO_SUPPORT


       config ARCH_WANT_SPL_GPIO_SUPPORT
                bool


       config ARCH_EXYNOS5
               select ARCH_WANT_SPL_GPIO_SUPPORT


Linux used to have ARCH_WANT_OPTIONAL_GPIOLIB to do similar things.
(they stopped this way, though)



[2] Support multi boards with one defconfig
    (barebox supports multi-platform like Linux does.)


[3] use pre-processor to support #include <...>





BTW, SPL_GPIO_SUPPORT is optional in this case?

U-Boot proper supports a command line interface,
while SPL is usually run in a non-interactive mode.

So, what SPL needs is generally mandatory,
so we can "select" it,  I guess.

-- 
Best Regards
Masahiro Yamada


More information about the U-Boot mailing list