Merge pull request #807 from nmenon/upstream/fix-16650-rx
uart: 16550: Fix getc
This commit is contained in:
commit
44f1c0bded
|
@ -146,7 +146,7 @@ endfunc console_core_putc
|
||||||
func console_core_getc
|
func console_core_getc
|
||||||
/* Check if the receive FIFO is empty */
|
/* Check if the receive FIFO is empty */
|
||||||
1: ldr w1, [x0, #UARTLSR]
|
1: ldr w1, [x0, #UARTLSR]
|
||||||
tbz w1, #UARTLSR_RDR, 1b
|
tbz w1, #UARTLSR_RDR_BIT, 1b
|
||||||
ldr w0, [x0, #UARTRX]
|
ldr w0, [x0, #UARTRX]
|
||||||
ret
|
ret
|
||||||
getc_error:
|
getc_error:
|
||||||
|
|
|
@ -88,6 +88,7 @@
|
||||||
#define UARTLSR_FERR (1 << 3) /* Framing Error */
|
#define UARTLSR_FERR (1 << 3) /* Framing Error */
|
||||||
#define UARTLSR_PERR (1 << 3) /* Parity Error */
|
#define UARTLSR_PERR (1 << 3) /* Parity Error */
|
||||||
#define UARTLSR_OVRF (1 << 2) /* Rx Overrun Error */
|
#define UARTLSR_OVRF (1 << 2) /* Rx Overrun Error */
|
||||||
#define UARTLSR_RDR (1 << 2) /* Rx Data Ready */
|
#define UARTLSR_RDR_BIT (0) /* Rx Data Ready Bit */
|
||||||
|
#define UARTLSR_RDR (1 << UARTLSR_RDR_BIT) /* Rx Data Ready */
|
||||||
|
|
||||||
#endif /* __UART_16550_H__ */
|
#endif /* __UART_16550_H__ */
|
||||||
|
|
Loading…
Reference in New Issue