Page MenuHomeFreeBSD

sys: Simplify enabling EARLY_PRINTF uarts
ClosedPublic

Authored by andrew on Jan 8 2024, 5:26 PM.
Tags
None
Referenced Files
F102729466: D43360.id134245.diff
Sat, Nov 16, 11:20 AM
F102728659: D43360.id132486.diff
Sat, Nov 16, 11:08 AM
Unknown Object (File)
Oct 9 2024, 7:36 PM
Unknown Object (File)
Oct 9 2024, 7:34 PM
Unknown Object (File)
Oct 9 2024, 7:30 PM
Unknown Object (File)
Oct 9 2024, 7:30 PM
Unknown Object (File)
Oct 9 2024, 7:10 PM
Unknown Object (File)
Sep 30 2024, 6:25 PM
Subscribers

Details

Summary

Support selecting the early uart with "options EARLY_PRINTF=foo" in
the kernel configuration file. This allows us to not have to change
source files when enabling EARLY_PRINTF, simplifying enabling it.

New uart drivers can be enabled by defining a new early_printf_foo
value to be unique, then using "#if CHECK_EARLY_PRINTF(foo)" to decide
when to enable the uart.

While here add pl011 early printf support.

Sponsored by: Arm Ltd

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 55320
Build 52209: arc lint + arc unit

Event Timeline

andrew requested review of this revision.Jan 8 2024, 5:26 PM
andrew created this revision.

What do existing kernel configs do with the new system? Looks like a compile error from the pre-processor when early_printf_ isn't defined.
If so, that's fine. there's half a dozen ways to do this, and this one is more straight forward to diagnose problems with and to understand the code and if the old config file is the only issue, people using this option have the skills to debug the change. An UPDATING entry wouldn't be bad though to document the change.

sys/dev/uart/uart_dev_ns8250.c
88

Do you need quotes around the error message? We're about 50/50 in the kernel. I think they are only required syntactically when there's weird quotes etc. style(9) is silent on the issue and the #errors in the kernel are a mixed bag: 342 / 675 have quotes.

This revision is now accepted and ready to land.Jan 8 2024, 6:14 PM

Check for "options EARLY_PRINTF" and report why the build failed

This revision now requires review to proceed.Jan 9 2024, 11:54 AM

It checks for early_printf_1. I've added a check for this with a #error to tell the user what the issue is.

sys/dev/uart/uart_dev_ns8250.c
88

Given it's about 50/50 I'll leave as is.

This revision was not accepted when it landed; it landed in state Needs Review.Feb 13 2024, 11:53 AM
This revision was automatically updated to reflect the committed changes.