From 24231893d62616be3325c0e3f8c2f21b7d40ac65 Mon Sep 17 00:00:00 2001 From: Marcello Sylvester Bauer Date: Wed, 11 Apr 2018 15:55:02 +0200 Subject: drivers/uart/pl011.c Add read support Implement uart_rx_byte Change-Id: I5a33b3cd4b333fb244bc55747014a301021e25e0 Signed-off-by: Marcello Sylvester Bauer Reviewed-on: https://review.coreboot.org/25623 Reviewed-by: Patrick Rudolph Reviewed-by: Patrick Rudolph Tested-by: build bot (Jenkins) --- src/drivers/uart/pl011.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/drivers') diff --git a/src/drivers/uart/pl011.c b/src/drivers/uart/pl011.c index 415dce13bc..9cb702f952 100644 --- a/src/drivers/uart/pl011.c +++ b/src/drivers/uart/pl011.c @@ -42,7 +42,11 @@ void uart_tx_flush(int idx) unsigned char uart_rx_byte(int idx) { - return 0; + struct pl011_uart *regs = uart_platform_baseptr(idx); + + while (read32(®s->fr) & PL011_UARTFR_RXFE) + ; + return read8(®s->dr); } #ifndef __PRE_RAM__ -- cgit v1.2.3