Skip to content
Snippets Groups Projects
  1. Sep 15, 2015
  2. Aug 18, 2015
    • Masahiro Yamada's avatar
      linux/kconfig.h: add CPP macros useful for per-image config options · 8be60f06
      Masahiro Yamada authored
      
      The previous commit introduced a useful macro used in makefiles,
      in order to reference to different variables (CONFIG_... or
      CONFIG_SPL_...) depending on the build context.
      
      Per-image config option control is a PITA in C sources, too.
      Here are some macros useful in C/CPP expressions.
      
      CONFIG_IS_ENABLED(FOO) can be used as a shorthand for
      
        (!defined(CONFIG_SPL_BUILD) && defined(CONFIG_FOO)) || \
         (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_FOO))
      
      For example, it is useful to describe C code as follows,
      
        #if CONFIG_IS_ENABLED(OF_CONTROL)
            (device tree code)
        #else
            (board file code)
        #endif
      
      The ifdef conditional above is switched by CONFIG_OF_CONTROL during
      the U-Boot proper building (CONFIG_SPL_BUILD is not defined), and by
      CONFIG_SPL_OF_CONTROL during SPL building (CONFIG_SPL_BUILD is
      defined).
      
      The macro can be used in C context as well, so you can also write the
      equivalent code as follows:
      
        if (CONFIG_IS_ENABLED(OF_CONTROL)) {
            (device tree code)
        } else {
            (board file code)
        }
      
      Another useful macro is CONFIG_VALUE().
      CONFIG_VALUE(FOO) is expanded into CONFIG_FOO if CONFIG_SPL_BUILD is
      undefined, and into CONFIG_SPL_FOO if CONFIG_SPL_BUILD is defined.
      
      You can write as follows:
      
        text_base = CONFIG_VALUE(TEXT_BASE);
      
      instead of:
      
        #ifdef CONFIG_SPL_BUILD
            text_base = CONFIG_SPL_TEXT_BASE;
        #else
            text_base = CONFIG_TEXT_BASE;
        #endif
      
      This commit also adds slight hacking on fixdep so that it can
      output a correct list of fixed dependencies.
      
      If the fixdep finds CONFIG_IS_ENABLED(FOO) in a source file,
      we want
          $(wildcard include/config/foo.h)
      in the U-boot proper building context, while we want
          $(wildcard include/config/spl/foo.h)
      in the SPL build context.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: default avatarTom Rini <trini@konsulko.com>
      Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
      8be60f06
    • Masahiro Yamada's avatar
      kbuild: fixdep: optimize code slightly · 29974f77
      Masahiro Yamada authored
      
      If the target string matches "CONFIG_", move the pointer p
      forward.  This saves several 7-chars adjustments.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: default avatarTom Rini <trini@konsulko.com>
      Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
      29974f77
  3. Mar 06, 2015
  4. Jul 30, 2014
    • Masahiro Yamada's avatar
      kconfig: switch to Kconfig · 51148790
      Masahiro Yamada authored
      
      This commit enables Kconfig.
      Going forward, we use Kconfig for the 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 boot images (Normal, SPL, TPL)
      from one source tree.
      Each image needs its own configuration input.
      
      Usage:
      
      Run "make <board>_defconfig" to do the board configuration.
      
      It will create the .config file and additionally spl/.config, tpl/.config
      if SPL, TPL is enabled, respectively.
      
      You can use "make config", "make menuconfig" etc. to create
      a new .config or modify the existing one.
      
      Use "make spl/config", "make spl/menuconfig" etc. for spl/.config
      and do likewise for tpl/.config file.
      
      The generic syntax of configuration targets for SPL, TPL is:
      
        <target_image>/<config_command>
      
      Here, <target_image> is either 'spl' or 'tpl'
            <config_command> is 'config', 'menuconfig', 'xconfig', etc.
      
      When the configuration is done, run "make".
      (Or "make <board>_defconfig all" will do the configuration and build
      in one time.)
      
      For futher information of how Kconfig works in U-Boot,
      please read the comment block of scripts/multiconfig.py.
      
      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 a set of configs.
      
      We expect a very long term to migrate from C headers to Kconfig.
      Two different infractructure must coexist in the interim.
      
      In our former configuration scheme, include/autoconf.mk was generated
      for use in makefiles.
      It is still generated under include/, spl/include/, tpl/include/ directory
      for the Normal, SPL, TPL image, respectively.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.m@jp.panasonic.com>
      Acked-by: default avatarSimon Glass <sjg@chromium.org>
      51148790
  5. Jun 20, 2014
  6. Feb 19, 2014
Loading