public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 03/11] kconfig: add board Kconfig and defconfig files
Date: Thu, 24 Apr 2014 14:36:33 -0600	[thread overview]
Message-ID: <535975D1.2010503@wwwdotorg.org> (raw)
In-Reply-To: <1398315862-1537-4-git-send-email-yamada.m@jp.panasonic.com>

On 04/23/2014 11:04 PM, Masahiro Yamada wrote:
> This commit adds
>  - arch/*/Kconfig: provide a menu to select target boards
>  - board/*/Kconfig: set CONFIG macros to the appropriate values
>         for each board
>  - configs/*_defconfig: default setting of each board
> 
> (This commit was automatically generated by a conversion script
> based on boards.cfg)
> 
> In Linux Kernel, defconfig files are located under
> arch/${ARCH}/configs/ directory.
> It works in Linux Kernel because ARCH is always given from the
> command line for cross compile.
> 
> But in U-Boot, ARCH is not given from the command line.
> Which means we cannot know ARCH before the board configuration.
> That is why "*_defconfig" files over all architectures should be
> gathered into one directory ./configs/.
> (The problem is configs/ directory contains about 1200 files!)

Perhaps we can change the command-line used to build U-Boot, rather than
shoe-horning U-Boot's Kconfig usage to fit that current limitation.

> Besides, we must configure boards for SPL and TPL too
> if they are supported.
> For those boards, defconfig files with the same name are placed
> in configs/spl/, configs/tpl/ directories.

I really don't think we should have separate defconfig files for SPL/TPL/...

I don't think that the approach of a single huge Kconfig file (albeit
split into multiple included files per architecture and board) is going
to work; it requires a massive amount of irrelevant Kconfig to be
parsed, whereas scanning boards.cfg is a much simpler
scan-until-you-find-a-matching-line approach.

> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig

> +config TARGET_SEABOARD
> +	bool "Support seaboard"

If U-Boot is built like:

make seaboard_config
make

... then I'm not sure why there is a Kconfig option for TARGET_SEABAORD.
Are you intending for the .config file to dictate that we're building
for Seaboard? If so, then presumably the make commands above will no
longer be valid, and if we can change that aspect, why couldn't we
require the user to add the architecture to the build command-line, just
like the kernel does?

> diff --git a/board/nvidia/seaboard/Kconfig b/board/nvidia/seaboard/Kconfig
> new file mode 100644
> index 0000000..7d38a81
> --- /dev/null
> +++ b/board/nvidia/seaboard/Kconfig
> @@ -0,0 +1,32 @@
> +if TARGET_SEABOARD
> +
> +config SYS_CPU
> +	string
> +	default "arm720t" if SPL_BUILD
> +	default "armv7" if !SPL_BUILD
> +
> +config SYS_BOARD
> +	string
> +	default "seaboard"
> +
> +config SYS_VENDOR
> +	string
> +	default "nvidia"
> +
> +config SYS_SOC
> +	string
> +	default "tegra20"
> +
> +config SYS_CONFIG_NAME
> +	string
> +	default "seaboard"
> +
> +config BOARD_MAINTAINER
> +	string
> +	default "Tom Warren <twarren@nvidia.com>"
> +
> +config BOARD_STATUS
> +	string
> +	default "Active +4"
> +
> +endif

Maintainter information seems better in MAINTAINERS.

> diff --git a/configs/seaboard_defconfig b/configs/seaboard_defconfig
> new file mode 100644
> index 0000000..88819b9
> --- /dev/null
> +++ b/configs/seaboard_defconfig
> @@ -0,0 +1,3 @@
> +CONFIG_SPL=y
> +CONFIG_ARM=y
> +CONFIG_TARGET_SEABOARD=y

> diff --git a/configs/spl/seaboard_defconfig b/configs/spl/seaboard_defconfig
> new file mode 100644
> index 0000000..bc3eab4
> --- /dev/null
> +++ b/configs/spl/seaboard_defconfig
> @@ -0,0 +1,2 @@
> +CONFIG_ARM=y
> +CONFIG_TARGET_SEABOARD=y

This definitely feels wrong. We shouldn't need to repeat the content of
these files twice with/without CONFIG_SPL=y.

Should SPL/non-SPL be two build targets that get built when you ask to
build for Seaboard, not two entirely unrelated defconfig files?

I guess I'm having a hard time understanding how Kconfig applies to U-Boot.

It feels like we should have two levels of configuration:

1) You pick to build for a specific board name. This defines certain
parameters of the build, e.g.:

- Which SoC you're building for, which implies
-- CPU arch
-- SPL used or not
-- ...
- Other hard-coded board parameters

2) User option configuration, e.g.:

- Disable USB support on this board if I don't want it
- Enable some other feature not enabled by default

I'm not completely sure that using Kconfig for both of those is the
correct approach?

  reply	other threads:[~2014-04-24 20:36 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-24  5:04 [U-Boot] [PATCH 0/11] Kconfig for U-Boot Masahiro Yamada
2014-04-24  5:04 ` [U-Boot] [PATCH 01/11] kconfig: import Kconfig files from Linux v3.14 tag Masahiro Yamada
2014-04-26 22:48   ` Simon Glass
2014-04-24  5:04 ` [U-Boot] [PATCH 02/11] Do not apply: tools: add genkconfig Masahiro Yamada
2014-04-26 23:03   ` Simon Glass
2014-04-28  5:12     ` Masahiro Yamada
2014-04-24  5:04 ` [U-Boot] [PATCH 03/11] kconfig: add board Kconfig and defconfig files Masahiro Yamada
2014-04-24 20:36   ` Stephen Warren [this message]
2014-04-28  9:39     ` Masahiro Yamada
2014-04-28 17:47       ` Stephen Warren
2014-05-01 22:48         ` Scott Wood
2014-05-02 18:39           ` Stephen Warren
2014-05-16 18:55       ` Tom Rini
2014-05-16 19:48         ` Stephen Warren
2014-05-02 15:05   ` Timur Tabi
2014-04-24  5:04 ` [U-Boot] [PATCH 04/11] kconfig: add basic Kconfig files Masahiro Yamada
2014-04-28 17:21   ` Simon Glass
2014-04-30  4:22     ` Masahiro Yamada
2014-04-30 19:16       ` Simon Glass
2014-05-01 18:18         ` Scott Wood
2014-05-01 18:21   ` Scott Wood
2014-05-07  6:23     ` Masahiro Yamada
2014-04-24  5:04 ` [U-Boot] [PATCH 05/11] include: define CONFIG_SPL and CONFIG_TPL as 1 Masahiro Yamada
2014-04-28 17:30   ` Simon Glass
2014-04-24  5:04 ` [U-Boot] [PATCH 06/11] kconfig: switch to Kconfig Masahiro Yamada
2014-04-28 17:37   ` Simon Glass
2014-04-24  5:04 ` [U-Boot] [PATCH 07/11] MAKEALL: adjust for Kconfig Masahiro Yamada
2014-04-24  5:04 ` [U-Boot] [PATCH 08/11] buildman: " Masahiro Yamada
2014-04-24  5:04 ` [U-Boot] [PATCH 09/11] kconfig: delete redundant CONFIG_${ARCH} definition Masahiro Yamada
2014-04-28 17:40   ` Simon Glass
2014-04-24  5:04 ` [U-Boot] [PATCH 10/11] kbuild: remove CONFIG_SPL/CONFIG_TPL definition in config headers Masahiro Yamada
2014-04-28 17:41   ` Simon Glass
2014-04-24  5:04 ` [U-Boot] [PATCH 11/11] kconfig: remove old script Masahiro Yamada
2014-04-28 17:41   ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=535975D1.2010503@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox