Commit Graph

6 Commits

Author SHA1 Message Date
Junjie Mao 5f6a10f1e1 kconfig: use defconfig instead of default values in silentoldconfig
Currently silentoldconfig uses the default values in Kconfig when .config does
not exist or is for a different platform from the one specified in command line
options. This makes it impossible to leverage defconfigs when a simple 'make' is
invoked to build the hypervisor, as 'make' calls oldconfig instead of defconfig
for creating a configuration file.

With DEFCONFIG_LIST in Kconfig, now silentoldconfig is also able to know which
defconfig is appropriate given the specified board. This patch changes the
behavior of oldsilentconfig as follows.

    1. When an old .config for the given board exists, the script updates the
       .config per configurations specified from the command line. Instead of
       manually resetting all symbols, the script now relies on Kconfiglib's
       internal logic to automatically update invisible symbols after symbol
       value changes.

    2. When an old .config does not exist or is not for the specified board, the
       defconfig for that board is used as base line and further tweaked per
       configurations from the command line.

v3 -> v4:

* Rephrase comments in silentoldconfig.py.

v2 -> v3:

* Keep backward compatibility of silentoldconfig.py since vmcfg also uses the
  script.

v1 -> v2:

* Include .config when it is edited manually so that new configurations
  overwritten the old (in the outdated config.mk).

* Compare the board in .config with the one in the defconfig instead of what is
  specified in the environment variable BOARD, as defconfig and BOARD may use
  different names (e.g. aliases or different cases)

Tracked-On: #1588
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Reviewed-by: Anthony Xu <anthony.xu@intel.com>
2018-10-30 10:49:12 +08:00
Junjie Mao b9d54f4ab3 kconfig: support board-specific defconfig
The current defconfigs are BIOS-specific which makes it difficult to maintain
multiple defconfigs for boards running the same BIOS.

This patch re-organizes the defconfigs to be board-specific. A command line
option BOARD is introduced to specify a board on which the current build targets
at. The original PLATFORM is kept for backward compatibility which redirects to
apl-mrb and nuc6cayh for sbl and uefi, respectively.

The getting started guide is also updated accordingly.

v1 -> v2:

* Rewrite 'up2' to 'UP2'.

Tracked-On: #1588
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Reviewed-by: Anthony Xu <anthony.xu@intel.com>
2018-10-30 10:49:12 +08:00
Huihuang Shi d859182d41 customize function to generate config.h with proper suffixes
Add new format to parsed by kconfig to support
U and UL.
When config is 'int',if this symbol have 'range'
key words and bigger or qeual to 0,the int macro
will have suffix 'U'.
When config is 'hex',the suffix is 'U'.
When config have 'help' keywords,and the help contents
have the string "64-bit integer",it will add suffix 'L'.

V1->V2:
     1.modified the comments to let it much eaisy to understand.
     2.change the values' name protected_foot,protected_tai to
     guard_begin and guard_end.
     3.add regex to identified the '64-bit' and 'integer'.

V2->V3:
     1.remove kconfiglib internal attribute
     2.use config_string to avoid no active config entry

Tracked-On: #861
Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
2018-10-12 16:32:25 +08:00
Junjie Mao 5251f42574 HV: make: rename minimalconfig to savedefconfig
... following the naming convention of Linux kbuild.

v1 -> v2:

    * Introduced.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
Acked-by: Geoffroy VanCutsem <geoffroy.vancutsem@intel.com>
2018-06-15 15:50:09 +08:00
Junjie Mao c4493cc1f8 HV: make: skip duplicated PLATFORM= on command line
Since .config has PLATFORM now, it is expected that the PLATFORM= command line
option is no longer necessary as long as a proper .config exists.

This patch implements this expectation. Now the platform to be selected is
determined by the following steps.

    1. If PLATFORM= is provided on the command line, the specified value is
       used.
    2. If there is no PLATFORM= on the command line and PLATFORM is defined in
       config.mk, its value is used.
    3. If neither PLATFORM= on the command line nor config.mk is available, a
       predefined default value is used.

v1 -> v2:

    * 'make oldconfig' should not pass CONFIG_xxx to the script since config.mk
      can be out-dated.
    * Change the default value of PLATFORM to SBL for backward compatibility of
      'make all'.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
Acked-by: Geoffroy VanCutsem <geoffroy.vancutsem@intel.com>
2018-06-15 15:50:09 +08:00
Junjie Mao 647aee6e34 scripts: introduce .config/config.h generators
This patch introduces some scripts that takes a Kconfig script and generates
.config or config.h. These scripts are general and can be used by the
hypervisor, dm, tools, etc. as long as proper make targets are added.

Note: Kconfiglib by Ulf Magnusson is ISC licensed.

v4 -> v5:

    * Add minimalconfig which creates a defconfig by minimizing a given .config.

v3 -> v4:

    * silentoldconfig now properly generate a .config if an old one does not
      exist.

v2 -> v3:

    * Add license info and the permission notice of Kconfiglib.
    * Mention the input Kconfig in the script descriptions.

v1 -> v2:

    * Drop kconfiglib.py. The getting started guide will be updated accordingly
      and dependency checks will be added to Makefile in the following patches.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
2018-06-08 17:21:13 +08:00