-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uart #1468
base: main
Are you sure you want to change the base?
Uart #1468
Commits on Oct 13, 2024
-
uart: Prefer rclk passed in over rclk in the class
If rclk is set in sysdev, then it was set during the boot process and is intended to override the defaults. By prefering the sysdev one over the class, xo=XXXX in hw.uart.console can give the user a usable console for non-traditional UARTs, especially on !x86 platforms. The default rclk generally only is good for I/O mapped UARTS or PCI ones that we can do a table lookup on. Other times, it can be hard to know what a good default is without more information. Sponsored by: Netflix
Configuration menu - View commit details
-
Copy full SHA for 5e63468 - Browse repository at this point
Copy the full SHA 5e63468View commit details -
To help debugging, export the rclk a uart is using as dev.uart.X.rclk. It can be opaque when it is wrong since any error messages printed to the system console using the wrong rclk aren't informative. Sponsored by: Netflix
Configuration menu - View commit details
-
Copy full SHA for c305a26 - Browse repository at this point
Copy the full SHA c305a26View commit details -
uart: Document the hw.uart.console string format.
Sponsored by: Netflix
Configuration menu - View commit details
-
Copy full SHA for f97db8f - Browse repository at this point
Copy the full SHA f97db8fView commit details -
uart: Add a signal to compute rclk from baudrate
With newer, more diverse hardware designs, the rclk can be unknown. Currently deployed systems have no standard way to discover the baud-clock generator frequency. However, sometimes we have a fairly good idea that the firmware programmed the UART to be the baud rate that it's telling us it's at. Create a way to instruct the uart class drivers to compute the baud clock frequency the first time their init routines are called. Usually the 'divisors' are relatively small, meaning we will likely have a fairly large error (goes as 1 / (divisor + 1). However, we also know that the baud-generator clock needs to be divided down to the baud-rate +/- about 5% (so while the error could be large for an arbitrary baud-clock, standard baud rates generally will give an error of 5% or less). Often, the console speed and the getty-configured speed are the same, so this heuristic allows boot messages and login sessions to work. Sponsored by: Netflix
Configuration menu - View commit details
-
Copy full SHA for d2a91c5 - Browse repository at this point
Copy the full SHA d2a91c5View commit details -
uart/ns8250: Tweak printfs to always prefix messages with uart:
It can be confusing when the ns8250 driver prints error messages with just ns8250 as the prefix. Add uart: to the live and commented out printfs. Sponsored by: Netflix
Configuration menu - View commit details
-
Copy full SHA for a2516b0 - Browse repository at this point
Copy the full SHA a2516b0View commit details -
uart/ns8250: Factor out reading the divisor
We have two copies (soon to be three) of reading the divisor. Since it's a complicated tricky process, abstract it to its own routine. Sponsored by: Netflix
Configuration menu - View commit details
-
Copy full SHA for 883c9c2 - Browse repository at this point
Copy the full SHA 883c9c2View commit details -
uart/ns8250: Disable interrupts sooner
Disable interrupts before we set the parameters for the UART. Usually, it makes no difference, but it's possible that setting the baud rate, etc could create problems if there's data pending, so move the interrupt disabling ealier. Sponsored by: Netflix
Configuration menu - View commit details
-
Copy full SHA for f658764 - Browse repository at this point
Copy the full SHA f658764View commit details -
uart/ns8250: Add support for computing rclk
When instructed to do so, compute the rclk (baud rate generator clock) based on the currently programmed divisor and the communicated baud rate. We only do this once and only for consoles that tell us the configured rate and flag we can likely safely compute rclk. Sponsored by: Netflix
Configuration menu - View commit details
-
Copy full SHA for a38cac5 - Browse repository at this point
Copy the full SHA a38cac5View commit details
Commits on Oct 14, 2024
-
uart/pl011: Add support for computing rclk
When instructed to do so, compute the rclk (baud rate generator clock) based on the currently programmed divisor and the communicated baud rate. We only do this once and only for consoles that tell us the configured rate and flag we can likely safely compute rclk. Sponsored by: Netflix
Configuration menu - View commit details
-
Copy full SHA for a0d98f4 - Browse repository at this point
Copy the full SHA a0d98f4View commit details -
uart: uart_getenv: check for NULL class last, not first
This allows one to specify dt:XXXX when the default class isn't compiled into the kernel. It's not an error to not have a class until we're done parsing the spec, so defer checking until then. Sponsored by: Netflix
Configuration menu - View commit details
-
Copy full SHA for a231de2 - Browse repository at this point
Copy the full SHA a231de2View commit details -
Switch from the long obsolete hint.0.acpi.rsdp to acpi.rsdp to get the root of the ACPI tables. MFC After: 1 week Sponsored by: Netflix
Configuration menu - View commit details
-
Copy full SHA for 5fe44f6 - Browse repository at this point
Copy the full SHA 5fe44f6View commit details -
acpidump: Use ACPI_NAMESEG_SIZE instead of 4
In a couple of places, we use 4 instead of ACPI_NAMESEG_SIZE. Use the Sponsored by: Netflix
Configuration menu - View commit details
-
Copy full SHA for b783b07 - Browse repository at this point
Copy the full SHA b783b07View commit details -
acpidump: Document the alphabit soup of ACPI Table names
Clarify what's reported with -t (it's all the fixed acpi tables, not just the listed ones). The listed tables are more fully decoded, while all other tables just have their headers decoded. Sponsored by: Netflix
Configuration menu - View commit details
-
Copy full SHA for a5992a4 - Browse repository at this point
Copy the full SHA a5992a4View commit details -
acpidump: Sort signature ifs alphabetically and make table driven
Sort the ACPI signatures alphabetically and move it into a table we can iterate through Sponsored by: Netflix
Configuration menu - View commit details
-
Copy full SHA for df08d9b - Browse repository at this point
Copy the full SHA df08d9bView commit details -
acpidump: Add -T TBLN to print a specific ACPI fixed table
Add the ability to dump a specific ACPI table rather than all of them. Sponsored by: Netflix
Configuration menu - View commit details
-
Copy full SHA for 37be330 - Browse repository at this point
Copy the full SHA 37be330View commit details -
Make rsdp pointer to the RSDP global so we can look up other tables. Sponsored by: Netflix
Configuration menu - View commit details
-
Copy full SHA for 263101c - Browse repository at this point
Copy the full SHA 263101cView commit details -
loader.efi: |= the boot flags how
how is assumed to be 0, so we directly assign to it. It might not always be 0, so or-in these bits. Sponsored by: Netflix
Configuration menu - View commit details
-
Copy full SHA for be4861f - Browse repository at this point
Copy the full SHA be4861fView commit details -
loader.efi: Parse SPCR table entry in ACPI tables
If there's a SPCR, then use it to create and pass the right values to the uart. Ideally, I'd just pass this all in hw.uart.console, but old kernels completely ignore the value if there's any extra entries. So I have to pass newly invented values to replace kernel values in a new kenv hw.uart.console.extra. so we pass xo=-1 in to calcuate the xo from the baud rate, and pv and pd for PCI Vendor ID and PCI Device ID of the serial console to use. Old kernels will ignore this and completely get this data from parsing SPCR itself. New kernels will dig it our of here w/o needing to parse it. We don't support Rev3 or Rev4 SPCR yet. It's too new to be in real hardware yet. Sponsored by: Netflix
Configuration menu - View commit details
-
Copy full SHA for adca7a8 - Browse repository at this point
Copy the full SHA adca7a8View commit details -
uart: Go back to returning '0' when we've probed the device.
Two reasons for this: we know it's a uart after we call probe and it returns successfully. Second, uart passes data between probe and attach with softc. As it is now, we call probe twice, once in the bidding process and once after bidding id done. However, the probe process for uart isn't completely idempotent (we change state of the uart sometimes). The second call can result in odd behavior (though so far only in buggy version of other code I've not committed). The bigger problem is the softc: newbus creates it, we populate it, then frees it when we don't return 0 to claim the device. It then calls us again, we repopulate it, and this time it doesn't free it before calling attach. Returning 0 avoids both of these issues. The justification for doing it in the commit that changed it was 'while I'm here', so there doesn't seem to be a use case for it. Sponsored by: Netflix
Configuration menu - View commit details
-
Copy full SHA for 92025b4 - Browse repository at this point
Copy the full SHA 92025b4View commit details -
We can get the UART clock from v3 SPCR, and a precise baudrate from v4. Some precise baudrates will currently be rejected by the kernel. Sponsored by: Netflix
Configuration menu - View commit details
-
Copy full SHA for 8910dfd - Browse repository at this point
Copy the full SHA 8910dfdView commit details -
uart: Implement SPCR rev 3 and 4 for PreciseBaudrate and UartClkFreq
If we have a new enough SPCR, then use it when it provides a PreciseBaudrate and/or a UartClkFreq. Sponsored by: Netflix
Configuration menu - View commit details
-
Copy full SHA for 5699af3 - Browse repository at this point
Copy the full SHA 5699af3View commit details -
Configuration menu - View commit details
-
Copy full SHA for ddc48de - Browse repository at this point
Copy the full SHA ddc48deView commit details