U-Boot: How to completely disable console?


We need to completely disable the U-Boot console output sicne /dev/ttyS0 will be used for a different purpose on our project (Android VIM3).

We have added the following lines to board/khadas/configs/kvim3.h:


  • We have added the line "silent=1\0" \.
  • And removed console=ttyS0,115200 no_console_suspend earlycon=aml-uart,0xff803000 from initargs.

We managed to suppress the Linux console, but the U-Boot console output is still present.

We have also tried to add:
but it had no effect.

Can you assist us in completely disabling all output to /dev/ttyS0?

Thank you!

@JorgeVila @Terry @jasonl Please help this .

no need rebuild uboot (may be :wink: ) - check next example - may be its enough

  1. break boot (press space or any key) and goto uboot shell
  2. change environment
setenv stdout vidconsole ; setenv stderr vidconsole ; setenv stdin usbkbd ; saveenv ; reset
  1. change your Linux kernel start command line remove console (console=ttyAML0,115200n8)

NOTE: in any case soc boot loader which start uboot same have some output to serial

bl2_stage_init 0x01
bl2_stage_init 0x81
hw id: 0x0000 - pwm id 0x01
bl2_stage_init 0xc1
bl2_stage_init 0x02

Thank you for your reply; however it does not resolve our problem.

NOTE: in any case soc boot loader which start uboot same have some output to serial

This is exactly the output we need to suppress.

We have both Khadas serial ports (/dev/ttyS0 and /dev/ttyS3) connected to external devices that malfunction if they receive that bootloader serial ouput.

maybe @numbqq can have some ideas ?

void puts(const char *s)
+ return ;
int printf(const char *fmt, ...)
+ return 0;

@JorgeVila Maybe you can get rid of the log in uboot through the above method, but you can’t disable the printing of the first level loader, because this part of the source code is not open source.
So you should solve the problem from another angle.
You can make the external device turn off the power before entering the kernel to prevent it from working normally. Maybe the log printing in front of the kernel will not affect it.