如何在 u-boot 中禁用串行控制台(非内核) [英] How to disable serial console(non-kernel) in u-boot

查看:44
本文介绍了如何在 u-boot 中禁用串行控制台(非内核)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为 Intel Edison 构建 Yocto 映像.

I am building a Yocto image for Intel Edison.

图像的一个组件是带有 Edison 特定补丁的 u-boot.默认情况下,Edison 的 UART 端口用于 u-boot 控制台.我想禁用此功能,但只能在串行接口上​​(u-boot 也侦听 USB 并且需要保留).

One of the image's components is u-boot with an Edison-specific patch. By default, Edison's UART port is used for u-boot console. I want to disable this feature, but only on the serial interface(u-boot also listens on USB and that needs to stay).

我主要关心的是 UART 端口上的按任意键停止自动启动"功能.我需要这个端口来连接一个附件,它可能会在主设备的启动过程中发送一些东西.

My main concern is the "Press any key to stop autoboot" feature on the UART port. I need this port to connect an accessory that might send something during the boot process of the main device.

我该如何解决这个问题?是否有用于此的环境变量,或者我是否需要修改源?

How do I approach this problem? Is there an environment variable for this, or do I need to modify the sources?

提前致谢!

推荐答案

将近一年后我又回到了这个问题,现在我已经设法找到了合适的解决方案.

I'm getting back to this issue almost a year later, now I've managed to find a proper solution.

我正在开发的电路板在其 BSP 中有一个相当新的 u-boot.要禁用串行控制台,我必须执行以下操作:

The board I was working on had a reasonably new u-boot in its BSP. To disable the serial console I had to do the following:

  • 将以下定义添加到板的配置标头(位于include/configs/board.h):

  #define CONFIG_DISABLE_CONSOLE
  #define CONFIG_SILENT_CONSOLE
  #define CONFIG_SYS_DEVICE_NULLDEV

  • 检查您的电路板是否在同一文件中启用了early_init_f:

      #define CONFIG_BOARD_EARLY_INIT_F 1
    

  • 找到 arch 文件(类似于 arch/x86/cpu/architecture/architecture.c)并将这个调用添加到它的 early_init_f 函数中.它实际上修改了板的全局数据变量以具有这些标志:

  • Find the arch file(Something like arch/x86/cpu/architecture/architecture.c) and add this call to its early_init_f function. It actually modifies board's global data variable to have these flags:

      gd->flags |= (GD_FLG_SILENT | GD_FLG_DISABLE_CONSOLE);
    

  • 我的板子没有,所以我不得不添加整个功能

  • My board did not have one, so I had to add the whole function

       int board_early_init_f(void)
       {
            gd->flags |= (GD_FLG_SILENT | GD_FLG_DISABLE_CONSOLE);
            return 0;
       }
    

  • 示例:如果您正在寻找 Orange Pi 4B 的 board_early_init_f,它位于/build/cache/sources/u-boot/v2020.10/board/rockchip/evb_rk3399/evb-rk3399.c

    Example: If you are looking for board_early_init_f of Orange Pi 4B it is in /build/cache/sources/u-boot/v2020.10/board/rockchip/evb_rk3399/evb-rk3399.c

    就是这样.希望这对其他人有帮助!

    That's it. Hope this helps someone else!

    参见另见

    这篇关于如何在 u-boot 中禁用串行控制台(非内核)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆