【问题标题】:Understanding u-boot configuration step了解 u-boot 配置步骤
【发布时间】:2018-01-30 09:44:24
【问题描述】:

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

感谢您的回答。

【问题讨论】:

  • 在构建 U-Boot 之前,您必须使用 make <board_name>_defconfig 进行配置。应该有一个 board/.../myboard/MAINTAINERS 文件将 defconfig 文件与 include/configs/myboard.h 文件链接起来

标签: configuration u-boot


【解决方案1】:

u-boot 如何确定在编译过程中使用哪个配置文件?

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 文件和配置头文件的文档。

【讨论】:

    【解决方案2】:

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

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

    2. 我更改了 boards/ti/am335x 中的 MAINTAINERS 文件。 我将 MAINTAINERS 中的 include/configs/am335x_evm.h 行更改为 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 。在此标头中,仍然使用 am335x_evm.h。所以我把你的答案弄错了,或者你的答案错了。你能帮我提供更多信息吗?@sawdust

    【讨论】:

      猜你喜欢
      • 2016-05-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-28
      • 1970-01-01
      • 2015-03-23
      • 2016-04-21
      • 2022-10-06
      相关资源
      最近更新 更多