Page MenuHomeFreeBSD

uart: Add ns8250 ACPI entry for SPCR rev 2
ClosedPublic

Authored by cperciva on Sun, Feb 8, 12:45 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Feb 11, 7:40 AM
Unknown Object (File)
Wed, Feb 11, 7:28 AM
Unknown Object (File)
Wed, Feb 11, 5:33 AM
Unknown Object (File)
Wed, Feb 11, 1:24 AM
Unknown Object (File)
Wed, Feb 11, 1:18 AM
Unknown Object (File)
Wed, Feb 11, 1:18 AM
Unknown Object (File)
Wed, Feb 11, 12:32 AM
Unknown Object (File)
Sun, Feb 8, 12:52 AM
Subscribers
None

Details

Summary

This is an MFC "in spirit" of a685a263b803; the code in this area has
been significantly restructured between 14.x and 15.x, but the general
concept of adding ACPI_DBG2_16550_WITH_GAS (aka 0x12) as a recognized
flavour of ns8250 UART which can be configured via SPCR remains.

Tested by: David Woodhouse
Sponsored by: Amazon

Diff Detail

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

Event Timeline

cperciva created this revision.
This revision is now accepted and ready to land.Sun, Feb 8, 2:02 AM

There's also a 'honor disabled ports' commit in main that you may want to merge too...

In D55173#1261492, @imp wrote:

There's also a 'honor disabled ports' commit in main that you may want to merge too...

Can you point me in its direction? My grepping is failing me.

commit d82698ac68c23d856716dc9f6524b9ef363d7eba
Author: Jarmo Jaakkola <jarmo.jaakkola@roskakori.fi>
Date: Wed Jan 7 22:14:56 2026 -0700

loader.efi: Only use SPCR if enabled.

SerialPort in the SPCR is zeroed when serial redirection is disabled,
rather than the SPCR being omitted from the ACPI tables ony many
systems. Check to see that SerialPort.Address is non-zero before using.

FreeBSD would fail to boot on systems that could have a serial port
redireciton, but don't have it enabled because the loader would create a
bogus hw.uart.console. While one could unset this value to boot, you
couldn't do that automatically very easily. Instead, don't even look
at the SPCR table if the SerialPort is zero'd.

PR: 292206
MFC After: 3 days
Sponsored by: Netflix
Co-authored-by: Warner Losh <imp@FreeBSD.org>
Closes:  https://github.com/freebsd/freebsd-src/pull/1948

Ah thanks, I was looking in the kernel uart code. It looks like the code to use SPCR in the boot loader was never MFCed so there's no need for a bug fix to it. :-)

This revision was automatically updated to reflect the committed changes.