[coreboot-gerrit] Patch set updated for coreboot: libpayload: use 32bit access when accessing 4byte wide uart registers

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Tue Feb 9 18:29:07 CET 2016


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13636

-gerrit

commit 7f171c9d86dd0aa8e091b84f71c07eca4e7e918e
Author: Patrick Georgi <pgeorgi at chromium.org>
Date:   Mon Feb 8 21:17:12 2016 +0100

    libpayload: use 32bit access when accessing 4byte wide uart registers
    
    This fixes serial on rk3288.
    
    Change-Id: I3dbf3cc165e516ed7b0132332624f882c0c9b27f
    Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
---
 payloads/libpayload/drivers/serial/8250.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/payloads/libpayload/drivers/serial/8250.c b/payloads/libpayload/drivers/serial/8250.c
index 7fe9920..0386f23 100644
--- a/payloads/libpayload/drivers/serial/8250.c
+++ b/payloads/libpayload/drivers/serial/8250.c
@@ -46,7 +46,10 @@ static uint8_t serial_read_reg(int offset)
 		return inb(IOBASE + offset);
 	else
 #endif
-		return readb(MEMBASE + offset);
+		if (lib_sysinfo.serial->regwidth == 4)
+			return readl(MEMBASE + offset) & 0xff;
+		else
+			return readb(MEMBASE + offset);
 }
 
 static void serial_write_reg(uint8_t val, int offset)
@@ -58,7 +61,10 @@ static void serial_write_reg(uint8_t val, int offset)
 		outb(val, IOBASE + offset);
 	else
 #endif
-		writeb(val, MEMBASE + offset);
+		if (lib_sysinfo.serial->regwidth == 4)
+			writel(val & 0xff, MEMBASE + offset);
+		else
+			writeb(val, MEMBASE + offset);
 }
 
 #if IS_ENABLED(CONFIG_LP_SERIAL_SET_SPEED)



More information about the coreboot-gerrit mailing list