From d8d4d113f005c28f3b8d9cc2c6b57627bdf35de1 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Fri, 18 Jan 2013 18:24:46 -0800 Subject: libpayload: If there's no IO space, complain if the serial claims to use it Change-Id: I36c750d520ff034c9ca9b9af46bd99bd49af7355 Signed-off-by: Gabe Black Reviewed-on: http://review.coreboot.org/2659 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich --- payloads/libpayload/drivers/serial.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'payloads/libpayload') 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 -- cgit v1.2.3