[coreboot-gerrit] Patch set updated for coreboot: uart8250mem: Change the delay for uart (Don't merge)

Zheng Bao (zheng.bao@amd.com) gerrit at coreboot.org
Sat Nov 21 05:24:32 CET 2015


Zheng Bao (zheng.bao at amd.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/12343

-gerrit

commit 33dc75cd67c861172d6e6dd6dc055f68f504a357
Author: Zheng Bao <fishbaozi at gmail.com>
Date:   Sat Nov 21 12:23:10 2015 +0800

    uart8250mem: Change the delay for uart (Don't merge)
    
    Change-Id: I6131adbe24a0ee6dfd47d00265fd8583ef22ec0d
    Signed-off-by: Zheng Bao <fishbaozi at gmail.com>
---
 src/drivers/uart/uart8250mem.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/drivers/uart/uart8250mem.c b/src/drivers/uart/uart8250mem.c
index 278ddb8..9cb29f0 100644
--- a/src/drivers/uart/uart8250mem.c
+++ b/src/drivers/uart/uart8250mem.c
@@ -32,6 +32,12 @@
 #define SINGLE_CHAR_TIMEOUT	(50 * 1000)
 #define FIFO_TIMEOUT		(16 * SINGLE_CHAR_TIMEOUT)
 
+static void my_delay(int delay)
+{
+	while (delay --)
+		outb(0xaa, 0x80);
+}
+
 #if IS_ENABLED(CONFIG_DRIVERS_UART_8250MEM_32)
 static uint8_t uart8250_read(void *base, uint8_t reg)
 {
@@ -63,7 +69,7 @@ static void uart8250_mem_tx_byte(void *base, unsigned char data)
 {
 	unsigned long int i = SINGLE_CHAR_TIMEOUT;
 	while(i-- && !uart8250_mem_can_tx_byte(base))
-		udelay(1);
+		 my_delay(1);
 	uart8250_write(base, UART8250_TBR, data);
 }
 
@@ -71,7 +77,7 @@ static void uart8250_mem_tx_flush(void *base)
 {
 	unsigned long int i = FIFO_TIMEOUT;
 	while(i-- && !(uart8250_read(base, UART8250_LSR) & UART8250_LSR_TEMT))
-		udelay(1);
+		my_delay(1);
 }
 
 static int uart8250_mem_can_rx_byte(void *base)
@@ -83,7 +89,7 @@ static unsigned char uart8250_mem_rx_byte(void *base)
 {
 	unsigned long int i = SINGLE_CHAR_TIMEOUT;
 	while(i-- && !uart8250_mem_can_rx_byte(base))
-		udelay(1);
+		my_delay(1);
 	if (i)
 		return uart8250_read(base, UART8250_RBR);
 	else



More information about the coreboot-gerrit mailing list