From a5a8ecc162e4d85b90006f411148aab144f039f4 Mon Sep 17 00:00:00 2001 From: Jiaqing Zhao Date: Tue, 9 Jan 2024 02:01:39 +0000 Subject: [PATCH] Support disabling serial output On systems without serial port, currently efiwrapper still tries to initialize serial output, causing boot hang. A new serail_type 0 is added to support disabling serial output by command line. Tracked-On: OAM-114713 Signed-off-by: Jiaqing Zhao --- drivers/s8250mem32/s8250mem32.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/s8250mem32/s8250mem32.c b/drivers/s8250mem32/s8250mem32.c index 176083c..bec98f4 100644 --- a/drivers/s8250mem32/s8250mem32.c +++ b/drivers/s8250mem32/s8250mem32.c @@ -41,6 +41,8 @@ #define SBL_SERIAL_TYPE "serail_type" #define SBL_SERIAL_REGWIDTH "serail_regwidth" +#define SBL_SERIAL_TYPE_DISABLED 0 + #ifndef SERIAL_BASEADDR #include #define SERIAL_BASEADDR GetPciUartBase(SERIAL_PCI_DID) @@ -83,6 +85,10 @@ static EFI_STATUS s8250mem32_init(__attribute__((__unused__)) EFI_SYSTEM_TABLE * s.regwidth = HW_SERIAL_REG_WIDTH; } + if (s.type == SBL_SERIAL_TYPE_DISABLED) { + return EFI_SUCCESS; + } + lib_sysinfo.serial = &s; serial_console_init();