了解u-boot配置步骤

Understanding u-boot configuration step

我想了解u-boot的配置过程。实际上我想重新配置设备配置文件中的 CONFIG_EXTRA_ENV_SETTINGS 定义。我在 include/configs 中搜索该文件。但我想知道,u-boot 如何确定在编译过程中使用哪个配置文件?

感谢您的回答。

感谢您的回复。 我做了以下步骤来确认您的回复。顺便说一下,我用的是 beaglebone black。

  1. 我在 am335x_evm.h 中添加了警告行,例如 #warning CONFIG_SPL_BUILD IS NOT DEFINED!

  2. 我更改了 boards/ti/am335x 中的 MAINTAINERS 文件。 我将 include/configs/am335x_evm.hMAINTAINERS 更改为 include/configs/pico-imx7d_spl_defconfig 只是为了测试。

  3. 我执行了make ARCH=arm am335x_boneblack_defconfig.

  4. 最后我执行了make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4.

RESULT :我在编译日志中看到了 warning: #warning CONFIG_SPL_BUILD IS NOT DEFINED!。编译后我还检查了 include/config.h 。在这个headers中,仍然使用am335x_evm.h。所以我把你的答案弄错了,或者你的答案错了。你能帮我提供更多信息吗?@sawdust

how to u-boot determine which config file to use in the compile process ?

U-Boot 配置是一个不断发展的话题,例如kconfig替换了之前v2014.10-rc1开头的配置方案。
您忘记提及您使用的 U-Boot 版本。
以下适用于2017.09版本

开发板的配置头文件由 Kconfig 文件中定义的配置变量指定。
对于 Beaglebone Black,/board/ti/am335x/Kconfig 指定:

config SYS_CONFIG_NAME
    default "am335x_evm"

表示include/configs/am335x_evm.h作为板子配置头文件

这记录在 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

MAINTAINERS 文件显然只是引用 defconfig 文件和配置头文件的文档。