summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--payloads/libpayload/drivers/serial/8250.c4
-rw-r--r--payloads/libpayload/include/coreboot_tables.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/payloads/libpayload/drivers/serial/8250.c b/payloads/libpayload/drivers/serial/8250.c
index 0651f5201f..bca0057bb3 100644
--- a/payloads/libpayload/drivers/serial/8250.c
+++ b/payloads/libpayload/drivers/serial/8250.c
@@ -39,6 +39,8 @@ static int serial_is_mem_mapped = 0;
static uint8_t serial_read_reg(int offset)
{
+ offset *= lib_sysinfo.serial->regwidth;
+
#ifdef CONFIG_LP_IO_ADDRESS_SPACE
if (!serial_is_mem_mapped)
return inb(IOBASE + offset);
@@ -49,6 +51,8 @@ static uint8_t serial_read_reg(int offset)
static void serial_write_reg(uint8_t val, int offset)
{
+ offset *= lib_sysinfo.serial->regwidth;
+
#ifdef CONFIG_LP_IO_ADDRESS_SPACE
if (!serial_is_mem_mapped)
outb(val, IOBASE + offset);
diff --git a/payloads/libpayload/include/coreboot_tables.h b/payloads/libpayload/include/coreboot_tables.h
index 1a189e5e4e..c46fbf9227 100644
--- a/payloads/libpayload/include/coreboot_tables.h
+++ b/payloads/libpayload/include/coreboot_tables.h
@@ -120,6 +120,7 @@ struct cb_serial {
u32 type;
u32 baseaddr;
u32 baud;
+ u32 regwidth;
};
#define CB_TAG_CONSOLE 0x00010