diff options
author | Gabe Black <gabeblack@google.com> | 2013-01-18 18:24:46 -0800 |
---|---|---|
committer | Ronald G. Minnich <rminnich@gmail.com> | 2013-03-13 23:04:54 +0100 |
commit | d8d4d113f005c28f3b8d9cc2c6b57627bdf35de1 (patch) | |
tree | fca6e040f5137f7d0563cbbdecc1d06d9a17fb1b | |
parent | 1c1171208ff9978ec45d01ade8a0836c3f93b59f (diff) | |
download | coreboot-d8d4d113f005c28f3b8d9cc2c6b57627bdf35de1.tar.xz |
libpayload: If there's no IO space, complain if the serial claims to use it
Change-Id: I36c750d520ff034c9ca9b9af46bd99bd49af7355
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://review.coreboot.org/2659
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
-rw-r--r-- | payloads/libpayload/drivers/serial.c | 12 |
1 files changed, 10 insertions, 2 deletions
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 |