freebsd-dev/sys/riscv/sifive
Jessica Clarke a1f9cdb1ab sifive_uart: Fix input character dropping in ddb and at a mountroot prompt
These use the raw console interface and poll. Unfortunately, the SiFive
UART puts the FIFO empty bit inside the FIFO data register, which means
that the act of checking whether a character is available also dequeues
any character from the FIFO, requiring the user to press each key twice.
However, since we configure the watermark to be 0 and, when the UART has
been grabbed for the console, we have interrupts off, we can abuse the
interrupt pending register to act as a substitute for the FIFO empty
bit.

This perhaps suggests that the console interface should move from having
rxready and getc to having getc_nonblock and getc (or make getc take a
bool), as all the places that call rxready do so to avoid blocking on
getc when there is no character available.

Reviewed by:	kp, philip
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31025
2021-07-21 02:51:25 +01:00
..
fe310_aon.c riscv/sifive: add FE310 Always-on driver 2020-04-02 00:33:15 +00:00
files.sifive riscv/sifive: add FE310 Always-on driver 2020-04-02 00:33:15 +00:00
fu540_prci.c riscv: Fix build by using the correct device-tree include path 2021-01-16 11:31:39 +01:00
fu540_spi.c fuspi: silence build warning, plug resource leak 2020-03-09 04:09:36 +00:00
sifive_uart.c sifive_uart: Fix input character dropping in ddb and at a mountroot prompt 2021-07-21 02:51:25 +01:00
std.sifive