Stefan Reinauer (stefan.reinauer@coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2660
-gerrit
commit ed253df995db52f738f10966d4e143bc1f16d311 Author: Gabe Black gabeblack@google.com Date: Fri Jan 18 18:37:29 2013 -0800
libpayload: If there's no IO address space, don't try to use it for serial
Change-Id: I01b1fa42139af925716cd5d57f96dc24da6df5a7 Signed-off-by: Gabe Black gabeblack@google.com --- payloads/libpayload/drivers/serial.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/payloads/libpayload/drivers/serial.c b/payloads/libpayload/drivers/serial.c index 4ae3e26..df0f2e3 100644 --- a/payloads/libpayload/drivers/serial.c +++ b/payloads/libpayload/drivers/serial.c @@ -39,18 +39,22 @@ static int serial_is_mem_mapped = 0;
static uint8_t serial_read_reg(int offset) { - if (serial_is_mem_mapped) - return readb(MEMBASE + offset); - else +#ifdef CONFIG_IO_ADDRESS_SPACE + if (!serial_is_mem_mapped) return inb(IOBASE + offset); + else +#endif + return readb(MEMBASE + offset); }
static void serial_write_reg(uint8_t val, int offset) { - if (serial_is_mem_mapped) - writeb(val, MEMBASE + offset); - else +#ifdef CONFIG_IO_ADDRESS_SPACE + if (!serial_is_mem_mapped) outb(val, IOBASE + offset); + else +#endif + writeb(val, MEMBASE + offset); }
#ifdef CONFIG_SERIAL_SET_SPEED