I am trying to understand to u-boot configuration process. Actually I want to reconfigure the CONFIG_EXTRA_ENV_SETTINGS definition in device's config file. I search that file in include/configs. But I wonder that, how to u-boot determine which config file to use in the compile process ?
Thanks for your answers.
how to u-boot determine which config file to use in the compile process ?
U-Boot configuration is an evolving topic , e.g. Kconfig replaced the prior configuration scheme starting with v2014.10-rc1.
You neglect to mention what version of U-Boot that you are using.
The following applies to version 2017.09.
The board's configuration header file is specified by a config variable defined in the Kconfig file.
For the Beaglebone Black, /board/ti/am335x/Kconfig specifies:
config SYS_CONFIG_NAME
default "am335x_evm"
which means include/configs/am335x_evm.h is used as the board configuration header file.
This is documented in doc/README.kconfig:
When adding a new board, the following steps are generally needed:
[1] Add a header file include/configs/<target>.h
[2] Make sure to define necessary CONFIG_SYS_* in Kconfig:
Define CONFIG_SYS_CPU="cpu" to compile arch/<arch>/cpu/<cpu>
Define CONFIG_SYS_SOC="soc" to compile arch/<arch>/cpu/<cpu>/<soc>
Define CONFIG_SYS_VENDOR="vendor" to compile board/<vendor>/common/*
and board/<vendor>/<board>/*
Define CONFIG_SYS_BOARD="board" to compile board/<board>/*
(or board/<vendor>/<board>/* if CONFIG_SYS_VENDOR is defined)
Define CONFIG_SYS_CONFIG_NAME="target" to include
include/configs/<target>.h
[3] Add a new entry to the board select menu in Kconfig.
The board select menu is located in arch/<arch>/Kconfig or
arch/<arch>/*/Kconfig.
[4] Add a MAINTAINERS file
It is generally placed at board/<board>/MAINTAINERS or
board/<vendor>/<board>/MAINTAINERS
[5] Add configs/<target>_defconfig
The MAINTAINERS file is apparently merely documentation that references both the defconfig file(s) and the configuration header file.