summaryrefslogtreecommitdiff
path: root/src/drivers/uart
diff options
context:
space:
mode:
authorMarcello Sylvester Bauer <info@marcellobauer.com>2018-04-11 15:55:02 +0200
committerMartin Roth <martinroth@google.com>2018-04-13 16:47:54 +0000
commit24231893d62616be3325c0e3f8c2f21b7d40ac65 (patch)
treefa836c8dd2bbbad765188dfef2b32a459d396efb /src/drivers/uart
parent0af272c1a9b0c9ca8338456a56c2bac587cc5051 (diff)
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/uart')
-rw-r--r--src/drivers/uart/pl011.c6
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(&regs->fr) & PL011_UARTFR_RXFE)
+ ;
+ return read8(&regs->dr);
}
#ifndef __PRE_RAM__