History log of /seL4-test-master/tools/riscv-pk/machine/uart16550.h
Revision Date Author Comments
# 16476bd8 09-Jul-2018 Andrew Waterman <andrew@sifive.com>

Properly license all nontrivial files


# 132c6292 12-Dec-2017 Palmer Dabbelt <palmer@dabbelt.com>

Add a 16550 UART driver to back the SBI console

QEMU currently provides the console via HTIF and the SBI. That's a bit
messy because BBL polls for serial input, which means that typing too
quickly loses characters. While QEMU has a standard 16550 device model,
there's no way to have two consoles share the console in QEMU (as they'd
step all over each other) so that means we can't have both the HTIF
console and the 16550 console.

With this patch, QEMU can be changed to use a 16650 instead of the HTIF
for serial output. Linux will use the SBI for early printk support
(which is fine, polling for output is stable) and then swap over as soon
as it detects the UART. When Linux swaps it prints out the whole
history, but there's probably a way to get around that. There's a few
lines that are output to both, but it appears the Linux driver is close
enough to ours that nothing catastrophic happens -- there's not much to
the device, so hopefully that pans out on real hardware too.

Once Linux swaps over to natively using the driver we get reliable
console input. If you don't have the in-kernel driver then Linux never
swaps over and keeps using the SBI console just like before.