common: fdt_support: remove earlycon if uart is disabled

If uart is required to be disabled during power on, it would be
not initialized by any pre-loader and U-Boot.

If we don't remove earlycon from commandline, kernel hangs while
using earlycon to putc/getc which may dead loop for waiting uart
status. (It seems the root cause is baundrate is not initilalized)

So let's remove earlycon from commandline.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I2edcf48cb4dd301f2e79d5e94b1477c55198708f
This commit is contained in:
Joseph Chen 2020-10-17 12:14:11 +08:00
parent 034db99592
commit a5aaa1e14d
1 changed files with 18 additions and 0 deletions

View File

@ -22,6 +22,8 @@
#include <linux/libfdt.h>
#include <linux/types.h>
DECLARE_GLOBAL_DATA_PTR;
/**
* fdt_getprop_u32_default_node - Return a node's property or a default
*
@ -342,6 +344,22 @@ int fdt_chosen(void *fdt)
* this for compatible with legacy parameter.txt
*/
env_delete("bootargs", "initrd=", 0);
/*
* If uart is required to be disabled during
* power on, it would be not initialized by
* any pre-loader and U-Boot.
*
* If we don't remove earlycon from commandline,
* kernel hangs while using earlycon to putc/getc
* which may dead loop for waiting uart status.
* (It seems the root cause is baundrate is not
* initilalized)
*
* So let's remove earlycon from commandline.
*/
if (gd->flags & GD_FLG_DISABLE_CONSOLE)
env_delete("bootargs", "earlycon=", 0);
}
#endif
}