Page MenuHomeFreeBSD

uart: Support EARLY_PRINTF on x86 for port-mapped COM ports
ClosedPublic

Authored by imp on Oct 19 2023, 6:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 18, 9:05 PM
Unknown Object (File)
Fri, Oct 18, 9:05 PM
Unknown Object (File)
Fri, Oct 18, 9:05 PM
Unknown Object (File)
Fri, Oct 18, 8:54 PM
Unknown Object (File)
Fri, Oct 18, 8:00 PM
Unknown Object (File)
Wed, Oct 9, 12:49 PM
Unknown Object (File)
Sep 8 2024, 8:22 PM
Unknown Object (File)
Sep 8 2024, 4:54 PM
Subscribers

Details

Summary

Support early printf for the ns8250 uart driver. Adding
options UART_NS8250_EARLY_PORT=0xYYY
options EARLY_PRINTF
to your kernel config will enable it. The code is rather simple minded,
so caveat emptor. This will enable printf before cninit. cninit
automatically disables this and switches to the real routine. It only
works for port-mapped COM ports, and only if you know the port's address
at compile time. It's intended for be a debugging aide, not a general
purpose thing.

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imp requested review of this revision.Oct 19 2023, 6:26 PM
imp created this revision.
sys/conf/options
665 ↗(On Diff #129126)

a comment that it's x86-only?

sys/dev/uart/uart_dev_ns8250.c
91

u_int to match inb/outb?

make more x86 specific and clear that it's x86 specific so it doesn't interfere
on other architectures. Opted to do that vs #ifdefing based on
UART_NS8250_EARLY_PORT being defined.

Considering this is not enabled by default it should be low risk

This revision is now accepted and ready to land.Oct 20 2023, 3:34 PM