SPCR rev 2 adds a series of new device types, with 0x12 being
"16550-compatible with parameters defined in the Generic Address
Structure". Since we look for the parameters already in the GAS there's
nothing extra for us to do beyond adding the entry so that it probes
successfully.
Details
- Reviewers
imp andrew - Commits
- rGa685a263b803: uart: Add ns8250 ACPI entry for SPCR rev 2
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
It's used when setting up the console via ACPI. At work we have a device which, for $REASONS probes the UART as PCI instead of ACPI. They added a SPCR table on request, which follows the latest SPCR definition, but doesn't have an ACPI node for the UART itself, it only has the SPCR entry as type 0x12. Adding this dummy entry, which would only be useful at console probe time (via uart_cpu_acpi_scan()) lets the machinery work, and the console is probed correctly. If my reading of things is correct, the device won't be matched at ACPI setup time later on, so there's no other impact.
Weird, all the other devices that attach via SPCR don't need this entry. Are you sure it's still needed? I reworked things a bit ago...
Or is 0x12 some super magical thing...
0x12 is, from what I can tell from reading https://learn.microsoft.com/en-us/windows-hardware/drivers/bringup/acpi-debug-port-table is identical to what you've written handling of 0 as, just with a different number. Microsoft just wanted to be different.
sys/dev/uart/uart_dev_ns8250.c | ||
---|---|---|
504 | This looks like it should be ACPI_DBG2_16550_WITH_GAS rather than 0x12 |
sys/dev/uart/uart_dev_ns8250.c | ||
---|---|---|
504 | I'd prefer you use the PNPID here. Otherwise, won't the device not be probed? If it's probed by some other way, then a comment about why "" that describes it. And I'd prefer "16550-compatible with parameters defined in Generic Address Structure" since it's not exactly a generic 16550... |
Address feedback. Added comment noting empty strings, and changed naked 0x12 to
the right constant.