include: define CONFIG_SPL and CONFIG_TPL as 1

We are about to switch to Kconfig in the next commit.
But there are something to get done beforehand.

In Kconfig, include/generated/autoconf.h defines boolean
CONFIG macros as 1.

CONFIG_SPL and CONFIG_TPL, if defined, must be defined as 1.
Otherwise, when switching to Kconfig, the build log
would be sprinkled with warning messages like this:
  warning: "CONFIG_SPL" redefined [enabled by default]

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
kconfig: switch to Kconfig

This commit enables Kconfig.
Going forward, we use Kconfig for board configuration.
mkconfig will never be used. Nor will include/config.mk be generated.

Kconfig must be adjusted for U-Boot because our situation is
a little more complicated than Linux Kernel.
We have to generate multiple binary images (Full U-Boot, SPL, TPL)
from one source tree.
Each image needs each configuration input.

Our approach is like this:

Every board has a signle defconfig file under "configs" directory.
SPL/TPL image, if it is supported, shares the same defconfig file
with the full U-boot image.

First, you need to configure for the target baord like this.

     make <board_name>_defconfig

A file ".config" will be created, storing configs setting
for all the images of the  target board.
You can use "make config", "make menuconfig" etc. to create
a new .config or modify the existing one.

And then run "make".

Kbuild will automatically invoke "make silentoldconfig" if auto.conf
is missing or need to be updated.
The full, SPL, TPL image has its own auto.conf:
  - include/config/auto.conf      (for full image)
  - spl/include/config/auto.conf  (for SPL)
  - tpl/include/config/auto.conf  (for TPL)

How to generate three different auto.conf file from the same .config ?

The key is CONFIG_SPL_BUILD and CONFIG_TPL_BUILD.
CONFIG_SPL_BUILD is defined for both SPL and TPL, while CONFIG_TPL
is only for TPL image.

Some config macros only make sense for the full U-Boot.

For instance,

If you describe Kconfig entry like this:

    config SYS_HUSH_PARSER
            bool "Hush Parser"
            depends on !SPL_BUILD

CONFIG_SYS_HUSH_PARSER will be conceiled from SPL/TPL auto.conf.

If you want to set a config macro for each image separately,
you need to define another CONFIG.
Maybe CONFIG_SPL_ or CPNFIG_TPL_ prefix would be better for clarification.
For example,  CONFIG_SYS_TEXT_BASE, CONFIG_SPL_TEXT_BASE,
CONFIG_TPL_TEXT_BASE, respectively.

I have to admit duplicating config macros is painful but we get
a single defconfig file in return.

By the way, there is another item worth remarking here:
coexistence of Kconfig and board herder files.

Prior to Kconfig, we used C headers to define define a set of configs.

We expect a very long term to move existing config macros to Kconfig.
Two different infractructure must coexist in the interim.

In our former configuration scheme, include/autoconf.mk was generated
for the use in makefiles.
It is still generated in include/, spl/include/, tpl/include/ directory
for the full, SPL, TPL image, respectively.
Don't send: do not clean scripts/kconfig/* by make mrproper
MAKEALL: adjust for Kconfig

Use "make <board>_defconfig" instead of "make <board>_config".

FIXME!
This fixup is bad because it spends still depends on boards.cfg
to support options such as -a <ARCH>, -c <CPU> etc.
We want to delete it when switching to Kconfig.

We have to invent another method without using boards.cfg.
buildman: adjust for Kconfig

Use "make <board>_defconfig" instead of "make <board>_config".

FIXME!
This fixup is bad because it spends still depends on boards.cfg
to support options such as -a <ARCH>, -c <CPU> etc.
We want to delete it when switching to Kconfig.

We have to invent another method without using boards.cfg.
MAKEALL: Show configuration
kconfig: delete redundant CONFIG_${ARCH} definition

CONFIG_${ARCH} is defined by Kconfig.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
kbuild: remove CONFIG_SPL/CONFIG_TPL definition in config headers

CONFIG_SPL and CONFIG_TPL are defined in Kconfig.

Remove the redundant definition in config headers.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
kconfig: remove old script

mkconfig is no longer used in Kconfig.
kconfig: add CONFIG_CROSS_COMPILE

Copy from Linux Kernel (with a few adjustments in comments).
kconfig: Add CONFIG_CC_OPTIMIZE_FOR_SIZE
Do not apply: tools: add updatedefconfig
Do not apply: tools: move_config
build: split CONFIG_SPL_TEXT_BASE into two different macros

We are about to move CONFIG_SPL_TEXT_BASE from header files to defconfig.
But we cannot move them as they are.

The problem is that #ifdef statements are used in board headers with
TPL support. Like this:

  #ifdef CONFIG_TPL_BUILD
  #define CONFIG_SPL_TEXT_BASE    0xD0001000
  #elif defined(CONFIG_SPL_BUILD)
  #define CONFIG_SPL_TEXT_BASE    0xff800000
  #endif

We cannot describe conditinal statments in defconfig.
One possible solution is to add CONFIG_TPL_TEXT_BASE.

This commit modifies the code as follow:

  #ifdef CONFIG_TPL_BUILD
  #define CONFIG_TPL_TEXT_BASE    0xD0001000
  #elif defined(CONFIG_SPL_BUILD)
  #define CONFIG_SPL_TEXT_BASE    0xff800000
  #endif

(include/config_fallbakcs.h should also be tweaked because some other
parts still reference to CONFIG_SPL_TEXT_BASE)

In the next commit, it will be converted into defconfig like this:

  CONFIG_SPL_TEXT_BASE=0xff800000
  CONFIG_TPL_TEXT_BASE=0xd0001000
kconfig: move CONFIG_{SPL,TPL}_TEXT_BASE to Kconfig

This commit was automatically generated by a conversion tool.
remove CONFIG_{SPL,TPL}_TEXT_BASE from config headers