diff --git a/common/Kconfig b/common/Kconfig index 59ad5fd411..c0708ec76a 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -256,6 +256,11 @@ config CONSOLE_DISABLE_CLI help This disable CLI interactive in verified-boot. +config CONSOLE_SERIAL_SKIP_INIT + bool "Skip console serial init" + help + Skip console serial init and always use debug uart. + config DISABLE_CONSOLE bool "disable console in & out" help diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index c397356125..47e24e874d 100644 --- a/drivers/serial/serial-uclass.c +++ b/drivers/serial/serial-uclass.c @@ -28,6 +28,7 @@ static const unsigned long baudrate_table[] = CONFIG_SYS_BAUDRATE_TABLE; #error "Serial is required before relocation - define CONFIG_$(SPL_)SYS_MALLOC_F_LEN to make this work" #endif +#ifndef CONFIG_CONSOLE_SERIAL_SKIP_INIT static int serial_check_stdout(const void *blob, struct udevice **devp) { int node; @@ -87,8 +88,9 @@ static int serial_check_stdout(const void *blob, struct udevice **devp) return -ENODEV; } +#endif -#ifdef CONFIG_OF_LIVE +#if defined(CONFIG_OF_LIVE) && !defined(CONFIG_CONSOLE_SERIAL_SKIP_INIT) /* * Hide and present pinctrl prop int live device tree * @@ -146,6 +148,7 @@ static inline void serial_console_hide_prop(char **p1, char **p2) {} static inline void serial_console_present_prop(char *p1, char *p2) {} #endif +#ifndef CONFIG_CONSOLE_SERIAL_SKIP_INIT static void serial_find_console_or_panic(void) { const void *blob = gd->fdt_blob; @@ -227,6 +230,9 @@ int serial_init(void) return 0; } +#else +int serial_init(void) { return 0; } +#endif /* Called after relocation */ void serial_initialize(void)