libpayload: use 32bit access when accessing 4byte wide uart registers

This fixes serial on rk3288.

Change-Id: I3dbf3cc165e516ed7b0132332624f882c0c9b27f
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/13636
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
This commit is contained in:
Patrick Georgi 2016-02-08 21:17:12 +01:00 committed by Patrick Georgi
parent 42636a7a0c
commit d4adf58e03
1 changed files with 8 additions and 2 deletions

View File

@ -46,6 +46,9 @@ static uint8_t serial_read_reg(int offset)
return inb(IOBASE + offset); return inb(IOBASE + offset);
else else
#endif #endif
if (lib_sysinfo.serial->regwidth == 4)
return readl(MEMBASE + offset) & 0xff;
else
return readb(MEMBASE + offset); return readb(MEMBASE + offset);
} }
@ -58,6 +61,9 @@ static void serial_write_reg(uint8_t val, int offset)
outb(val, IOBASE + offset); outb(val, IOBASE + offset);
else else
#endif #endif
if (lib_sysinfo.serial->regwidth == 4)
writel(val & 0xff, MEMBASE + offset);
else
writeb(val, MEMBASE + offset); writeb(val, MEMBASE + offset);
} }