summaryrefslogtreecommitdiff
path: root/payloads/libpayload/drivers/serial/8250.c
diff options
context:
space:
mode:
Diffstat (limited to 'payloads/libpayload/drivers/serial/8250.c')
-rw-r--r--payloads/libpayload/drivers/serial/8250.c4
1 files changed, 4 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);