[U-Boot] [PATCH 3/3] Kconfig: move CONFIG_STANDALONE_LOAD_ADDR to Kconfig

Max Filippov jcmvbkbc at gmail.com
Wed Sep 26 19:35:16 UTC 2018


Hi Daniel,

On Mon, Sep 24, 2018 at 12:40 PM, Daniel Schwierzeck
<daniel.schwierzeck at gmail.com> wrote:
> I see you set the SYS_CPU string manually. I think this is error-prone
> and not user-friendly. I suggest to convert this to Kconfig symbols like
> this:
>
> config SYS_CPU
>         default "dc232b" if CPU_DC232B
>         default "dc233c" if CPU_DC233C
>         default "de212" if CPU_DE212
>
> choice
>         prompt "Xtensa Core Variant"
>         default CPU_DC233C
>
> config CPU_DC232B
>         bool "dc232b"
>
> config CPU_DC233C
>         bool "dc233c"
>
> config CPU_DE212
>         bool "de212"
>
> endchoice

These cpus are just a few examples included into the u-boot that cover
three major xtensa MMU types. There's no fixed list of xtensa CPUs and
users are expected to add CPUs that they configure themselves.

> Then the user can only choose between the three supported cores and
> SYS_CPU will be automatically updated. The default value for
> STANDALONE_LOAD_ADDR could be set like this:
>/fac/proj_software/filippov/git/homewood/logs/log.DC_212GP.7441
> config STANDALONE_LOAD_ADDR
>         default 0xd0800000 if CPU_DC232B
>         default 0x00800000 if CPU_DC233C
>         default 0x60800000 if CPU_DE212
>
> Alternatively you model the MMU configuration also as Kconfig symbol
> which can be selected by those CPU_* symbols. Then you set the default
> value of STANDALONE_LOAD_ADDR dependent on that MMU setting.
> What do you think?

That is possible, but is also not user-friendly: the headers that describe
CPU are generated by the xtensa CPU build process and currently the
user just copies them into arch/xtensa/include/asm and selects correct
CPU name. Remaining information is extracted from these headers.

If the user is asked to select CPU MMU type in Kconfig that's a space
for an error. We can add a check that MMU type configured in Kconfig
matches selected CPU type.

Or we could generate Kconfig snippet for each CPU and make Kconfig
include it. Let me look at it closer.

-- 
Thanks.
-- Max


More information about the U-Boot mailing list