diff --git a/payloads/libpayload/drivers/serial.c b/payloads/libpayload/drivers/serial.c index 0d26750941..4ae3e26dbe 100644 --- a/payloads/libpayload/drivers/serial.c +++ b/payloads/libpayload/drivers/serial.c @@ -97,11 +97,19 @@ void serial_init(void) serial_is_mem_mapped = (lib_sysinfo.serial->type == CB_SERIAL_TYPE_MEMORY_MAPPED); - if (!serial_is_mem_mapped && (inb(IOBASE + 0x05) == 0xFF) && - (inb(IOBASE + 0x06) == 0xFF)) { + if (!serial_is_mem_mapped) { +#ifdef CONFIG_IO_ADDRESS_SPACE + if ((inb(IOBASE + 0x05) == 0xFF) && + (inb(IOBASE + 0x06) == 0xFF)) { + return; + } +#else + printf("IO space mapped serial not supported."); return; +#endif } + serial_hardware_is_present = 1; #ifdef CONFIG_SERIAL_SET_SPEED