diff mbox

[U-Boot,04/11] kconfig: add basic Kconfig files

Message ID 1398315862-1537-5-git-send-email-yamada.m@jp.panasonic.com
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Masahiro Yamada April 24, 2014, 5:04 a.m. UTC
This commit adds more Kconfig files, which were written by hand.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---

 Kconfig      | 47 +++++++++++++++++++++++++++++++++++++++++++
 arch/Kconfig | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 113 insertions(+)
 create mode 100644 Kconfig
 create mode 100644 arch/Kconfig

Comments

Simon Glass April 28, 2014, 5:21 p.m. UTC | #1
HI Masahiro,

On 23 April 2014 23:04, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
> This commit adds more Kconfig files, which were written by hand.
>
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> ---
>
>  Kconfig      | 47 +++++++++++++++++++++++++++++++++++++++++++
>  arch/Kconfig | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 113 insertions(+)
>  create mode 100644 Kconfig
>  create mode 100644 arch/Kconfig
>
> diff --git a/Kconfig b/Kconfig
> new file mode 100644
> index 0000000..4e383d2
> --- /dev/null
> +++ b/Kconfig
> @@ -0,0 +1,47 @@
> +#
> +# For a description of the syntax of this configuration file,
> +# see Documentation/kbuild/kconfig-language.txt.
> +#
> +mainmenu "U-Boot $UBOOTVERSION $BUILD_MODE Configuration"
> +
> +config UBOOTVERSION
> +       string
> +       option env="UBOOTVERSION"
> +
> +config KCONFIG_OBJDIR
> +       string
> +       option env="KCONFIG_OBJDIR"
> +
> +config BUILD_MODE
> +       string
> +       default "SPL" if $KCONFIG_OBJDIR="spl/"
> +       default "TPL" if $KCONFIG_OBJDIR="tpl/"
> +       default "Main"
> +
> +menu "General setup"
> +
> +config SPL_BUILD
> +       bool
> +       depends on BUILD_MODE="SPL" || BUILD_MODE="TPL"

What is the TPL term for?

> +       default y
> +
> +config TPL_BUILD
> +       bool
> +       depends on BUILD_MODE="TPL"
> +       default y
> +
> +config SPL
> +       bool
> +       prompt "Build SPL image" if !SPL_BUILD
> +       default y if SPL_BUILD
> +
> +config TPL
> +       bool
> +       depends on SPL
> +       prompt "Build TPL image" if !SPL_BUILD
> +       default y if TPL_BUILD
> +
> +endmenu                # General setup
[snip]

Regards,
Simon
Masahiro Yamada April 30, 2014, 4:22 a.m. UTC | #2
Hi Simon,

> > +
> > +config SPL_BUILD
> > +       bool
> > +       depends on BUILD_MODE="SPL" || BUILD_MODE="TPL"
> 
> What is the TPL term for?

Please note that both CONFIG_SPL_BUILD and CONFIG_TPL_BUILD
must be defined during the build of TPL image.

To sum up in a matrix, the definition of the these macros is like this:

                            CONFIG_SPL_BUILD    CONFIG_TPL_BUILD
non-SPL build:              undefined                  undefined
SPL build                      defined                      undefined
TPL build                      defined                      defined


Maybe do you think it looks weird? ( Me too.)
But the implementation has been like this
since TPL infrastructure was introduced by commit 3aa29de.

Defining only CONFIG_TPL_BUILD does not work.

Best Regards
Masahiro Yamada
Simon Glass April 30, 2014, 7:16 p.m. UTC | #3
Hi Masahiro,

On 29 April 2014 21:22, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
> Hi Simon,
>
>> > +
>> > +config SPL_BUILD
>> > +       bool
>> > +       depends on BUILD_MODE="SPL" || BUILD_MODE="TPL"
>>
>> What is the TPL term for?
>
> Please note that both CONFIG_SPL_BUILD and CONFIG_TPL_BUILD
> must be defined during the build of TPL image.
>
> To sum up in a matrix, the definition of the these macros is like this:
>
>                             CONFIG_SPL_BUILD    CONFIG_TPL_BUILD
> non-SPL build:              undefined                  undefined
> SPL build                      defined                      undefined
> TPL build                      defined                      defined
>
>
> Maybe do you think it looks weird? ( Me too.)
> But the implementation has been like this
> since TPL infrastructure was introduced by commit 3aa29de.
>
> Defining only CONFIG_TPL_BUILD does not work.

OK, thanks for explaining this. It seems wrong to me, but that should
be a separate discussion for later and does not affect your series.

Regards,
Simon
Scott Wood May 1, 2014, 6:18 p.m. UTC | #4
On Wed, 2014-04-30 at 12:16 -0700, Simon Glass wrote:
> Hi Masahiro,
> 
> On 29 April 2014 21:22, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
> > Hi Simon,
> >
> >> > +
> >> > +config SPL_BUILD
> >> > +       bool
> >> > +       depends on BUILD_MODE="SPL" || BUILD_MODE="TPL"
> >>
> >> What is the TPL term for?
> >
> > Please note that both CONFIG_SPL_BUILD and CONFIG_TPL_BUILD
> > must be defined during the build of TPL image.
> >
> > To sum up in a matrix, the definition of the these macros is like this:
> >
> >                             CONFIG_SPL_BUILD    CONFIG_TPL_BUILD
> > non-SPL build:              undefined                  undefined
> > SPL build                      defined                      undefined
> > TPL build                      defined                      defined
> >
> >
> > Maybe do you think it looks weird? ( Me too.)
> > But the implementation has been like this
> > since TPL infrastructure was introduced by commit 3aa29de.
> >
> > Defining only CONFIG_TPL_BUILD does not work.
> 
> OK, thanks for explaining this. It seems wrong to me, but that should
> be a separate discussion for later and does not affect your series.

TPL is an additional SPL (for three-stage boot).  CONFIG_SPL_BUILD
should be set for both the TPL and for the regular SPL.

-Scott
Scott Wood May 1, 2014, 6:21 p.m. UTC | #5
On Thu, 2014-04-24 at 14:04 +0900, Masahiro Yamada wrote:
> +config KCONFIG_OBJDIR
> +	string
> +	option env="KCONFIG_OBJDIR"
> +
> +config BUILD_MODE
> +	string
> +	default "SPL" if $KCONFIG_OBJDIR="spl/"
> +	default "TPL" if $KCONFIG_OBJDIR="tpl/"
> +	default "Main"

Why does this need to be a string?

> +menu "General setup"
> +
> +config SPL_BUILD
> +	bool
> +	depends on BUILD_MODE="SPL" || BUILD_MODE="TPL"
> +	default y
> +
> +config TPL_BUILD
> +	bool
> +	depends on BUILD_MODE="TPL"
> +	default y

You could get rid of BUILD_MODE and just have:

config SPL_BUILD
	bool
	default y if $KCONFIG_OBJDIR="spl/"

config TPL_BUILD
	bool
	default y if $KCONFIG_OBJDIR="tpl/"
	select SPL_BUILD

-Scott
Masahiro Yamada May 7, 2014, 6:23 a.m. UTC | #6
Hi Scott,

On Thu, 1 May 2014 13:21:08 -0500
Scott Wood <scottwood@freescale.com> wrote:

> On Thu, 2014-04-24 at 14:04 +0900, Masahiro Yamada wrote:
> > +config KCONFIG_OBJDIR
> > +	string
> > +	option env="KCONFIG_OBJDIR"
> > +
> > +config BUILD_MODE
> > +	string
> > +	default "SPL" if $KCONFIG_OBJDIR="spl/"
> > +	default "TPL" if $KCONFIG_OBJDIR="tpl/"
> > +	default "Main"
> 
> Why does this need to be a string?

I want to show $BUILD_MODE in the top menu.

> +# see Documentation/kbuild/kconfig-language.txt.
> +#
> +mainmenu "U-Boot $UBOOTVERSION $BUILD_MODE Configuration"

here.


Best Regards
Masahiro Yamada
diff mbox

Patch

diff --git a/Kconfig b/Kconfig
new file mode 100644
index 0000000..4e383d2
--- /dev/null
+++ b/Kconfig
@@ -0,0 +1,47 @@ 
+#
+# For a description of the syntax of this configuration file,
+# see Documentation/kbuild/kconfig-language.txt.
+#
+mainmenu "U-Boot $UBOOTVERSION $BUILD_MODE Configuration"
+
+config UBOOTVERSION
+	string
+	option env="UBOOTVERSION"
+
+config KCONFIG_OBJDIR
+	string
+	option env="KCONFIG_OBJDIR"
+
+config BUILD_MODE
+	string
+	default "SPL" if $KCONFIG_OBJDIR="spl/"
+	default "TPL" if $KCONFIG_OBJDIR="tpl/"
+	default "Main"
+
+menu "General setup"
+
+config SPL_BUILD
+	bool
+	depends on BUILD_MODE="SPL" || BUILD_MODE="TPL"
+	default y
+
+config TPL_BUILD
+	bool
+	depends on BUILD_MODE="TPL"
+	default y
+
+config SPL
+	bool
+	prompt "Build SPL image" if !SPL_BUILD
+	default y if SPL_BUILD
+
+config TPL
+	bool
+	depends on SPL
+	prompt "Build TPL image" if !SPL_BUILD
+	default y if TPL_BUILD
+
+endmenu		# General setup
+
+source "arch/Kconfig"
+source "board/Kconfig"
diff --git a/arch/Kconfig b/arch/Kconfig
new file mode 100644
index 0000000..8620a4f
--- /dev/null
+++ b/arch/Kconfig
@@ -0,0 +1,66 @@ 
+choice
+	prompt "Architecture select"
+	default SANDBOX
+
+config ARC
+	bool "ARC architecture"
+
+config ARM
+	bool "ARM architecture"
+
+config AVR32
+	bool "AVR32 architecture"
+
+config BLACKFIN
+	bool "Blackfin architecture"
+
+config M68K
+	bool "M68000 architecture"
+
+config MICROBLAZE
+	bool "MicroBlaze architecture"
+
+config MIPS
+	bool "MIPS architecture"
+
+config NDS32
+	bool "NDS32 architecture"
+
+config NIOS2
+	bool "Nios II architecture"
+
+config OPENRISC
+	bool "OpenRISC architecture"
+
+config PPC
+	bool "PowerPC architecture"
+
+config SANDBOX
+	bool "Sandbox"
+
+config SH
+	bool "SuperH architecture"
+
+config SPARC
+	bool "SPARC architecture"
+
+config X86
+	bool "x86 architecture"
+
+endchoice
+
+source "arch/arc/Kconfig"
+source "arch/arm/Kconfig"
+source "arch/avr32/Kconfig"
+source "arch/blackfin/Kconfig"
+source "arch/m68k/Kconfig"
+source "arch/microblaze/Kconfig"
+source "arch/mips/Kconfig"
+source "arch/nds32/Kconfig"
+source "arch/nios2/Kconfig"
+source "arch/openrisc/Kconfig"
+source "arch/powerpc/Kconfig"
+source "arch/sandbox/Kconfig"
+source "arch/sh/Kconfig"
+source "arch/sparc/Kconfig"
+source "arch/x86/Kconfig"