diff options
author | Marcello Sylvester Bauer <info@marcellobauer.com> | 2018-04-11 15:55:02 +0200 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2018-04-13 16:47:54 +0000 |
commit | 24231893d62616be3325c0e3f8c2f21b7d40ac65 (patch) | |
tree | fa836c8dd2bbbad765188dfef2b32a459d396efb /src/drivers | |
parent | 0af272c1a9b0c9ca8338456a56c2bac587cc5051 (diff) | |
download | coreboot-24231893d62616be3325c0e3f8c2f21b7d40ac65.tar.xz |
drivers/uart/pl011.c Add read support
Implement uart_rx_byte
Change-Id: I5a33b3cd4b333fb244bc55747014a301021e25e0
Signed-off-by: Marcello Sylvester Bauer <info@marcellobauer.com>
Reviewed-on: https://review.coreboot.org/25623
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/uart/pl011.c | 6 |
1 files changed, 5 insertions, 1 deletions
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__ |