How to disable serial console(non-kernel) in u-boot
I'm getting back to this issue almost a year later, now I've managed to find a proper solution.
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:
Add the following defines to the board's config header(located in include/configs/board.h):
#define CONFIG_DISABLE_CONSOLE #define CONFIG_SILENT_CONSOLE #define CONFIG_SYS_DEVICE_NULLDEV
Check if your board has early_init_f enabled in the same file:
#define CONFIG_BOARD_EARLY_INIT_F 1
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; }
That's it. Hope this helps someone else!
There's no way to do this, without modifying the source (configuration) of U-Boot.
To disable the serial console in U-Boot, you need to reconfigure U-Boot. The documentation from the master branch of U-Boot: Readme.silent
According to that one, you need to set:
CONFIG_SILENT_CONSOLE
CONFIG_SILENT_CONSOLE_UPDATE_ON_SET
CONFIG_SYS_DEVICE_NULLDEV
CONFIG_SILENT_U_BOOT_ONLY
is also needed if you want only U-Boot to be silent.
You might also need to test with CONFIG_SILENT_CONSOLE_UPDATE_ON_RELOC
and possibly adding silent 1
to CONFIG_EXTRA_ENV_SETTINGS
.
== UPDATE ==
See the following options for a possible workaround:
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 a way of requiring a magic string to stop the boot. It might be enough to help you. See README.autoboot
Setting the u-boot environment variable bootdelay
to -2
disables the ability for the UART to interrupt the boot process on U-Boot 2017.01
release. It appears that -1
is a special case.
See common/autoboot.c
from your U-Boot source tree for details.