How to disable serial console (not kernel) in u-boot

I am creating a Yocto image for Intel Edison.

One of the components of the image is u-boot with the Edison patch. By default, the Edison UART port is used for the u-boot console. I want to disable this feature, but only on the serial interface (u-boot is also listening on USB and should remain).

My main task is to " press any key to stop the autoload function " on the UART port. I need this port to connect an accessory that can 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 change the sources?

Thanks in advance!

+5
source share
3 answers

I come back to this problem almost a year later, now I managed to find the right solution.

The panel I was working on had a fairly new u-boot in BSP . To disable the serial console, I had to do the following:

  • Add the following settings to the board configuration header (located in include / configs / board.h ):

    #define CONFIG_DISABLE_CONSOLE #define CONFIG_SILENT_CONSOLE #define CONFIG_SYS_DEVICE_NULLDEV 
  • Check if your board supports early_init_f in the same file:

     #define CONFIG_BOARD_EARLY_INIT_F 1 
  • Find the archive file (something like arch / x86 / cpu / architecture / architecture.c ) and add this call to its early_init_f function. It actually modifies the global board 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 an entire function

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

What is it. Hope this helps someone else!

+6
source

It is impossible to do this without changing the source (configuration) of the U-Boot.

To disable the serial console in U-Boot, you need to reconfigure U-Boot. U-Boot Main Documentation : Readme.silent

In accordance with this, you need to install:

 CONFIG_SILENT_CONSOLE CONFIG_SILENT_CONSOLE_UPDATE_ON_SET CONFIG_SYS_DEVICE_NULLDEV 

CONFIG_SILENT_U_BOOT_ONLY also required if you want only the U-Boot to be quiet.

You may also need to test with CONFIG_SILENT_CONSOLE_UPDATE_ON_RELOC and possibly add silent 1 to CONFIG_EXTRA_ENV_SETTINGS .

== UPDATE ==

For a possible workaround, see the following options:

 CONFIG_ZERO_BOOTDELAY_CHECK CONFIG_AUTOBOOT_KEYED CONFIG_AUTOBOOT_KEYED_CTRLC CONFIG_AUTOBOOT_PROMPT CONFIG_AUTOBOOT_DELAY_STR CONFIG_AUTOBOOT_STOP_STR 

These options will at least give you the option to require the magic line to stop loading. This may be enough to help you. See README.autoboot

+3
source

Setting the u-boot boot environment variable to bootdelay -2 disables the ability of UART to interrupt the boot process in the release of U-Boot 2017.01 . It seems that -1 is a special case.

See common/autoboot.c from the U-Boot source tree for details .

0
source

Source: https://habr.com/ru/post/1238639/


All Articles