U-Boot: How to completely disable console?

Hello,

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:
#define CONFIG_SILENT_CONSOLE
#define CONFIG_DISABLE_CONSOLE
#define CONFIG_SYS_DEVICE_NULLDEV

And on CONFIG_EXTRA_ENV_SETTINGS:

  • 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:
#define CONFIG_SILENT_CONSOLE_UPDATE_ON_SET
#define CONFIG_SILENT_CONSOLE_UPDATE_ON_RELOC
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

SM1:BL:511f6b:81ca2f;FEAT:A0F83180:20282000;POC:B;RCY:0;SPINOR:0;0.0;CHK:0;
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 ?

bootloader/uboot/common/console.c
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.