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
This commit is contained in:
committed by
Warner Losh
parent
e2bedc7d69
commit
d82698ac68
@@ -867,10 +867,10 @@ acpi_uart_parity(UINT8 p)
|
||||
}
|
||||
|
||||
/*
|
||||
* See if we can find a SPCR ACPI table in the static tables. If so, then it
|
||||
* describes the serial console that's been redirected to, so we know that at
|
||||
* least there's a serial console. this is most important for embedded systems
|
||||
* that don't have traidtional PC serial ports.
|
||||
* See if we can find an enabled SPCR ACPI table in the static tables. If so,
|
||||
* then it describes the serial console that's been redirected to, so we know
|
||||
* that at least there's a serial console. This is most important for embedded
|
||||
* systems that don't have traidtional PC serial ports.
|
||||
*
|
||||
* All the two letter variables in this function correspond to their usage in
|
||||
* the uart(4) console string. We use io == -1 to select between I/O ports and
|
||||
@@ -886,8 +886,12 @@ check_acpi_spcr(void)
|
||||
const char *dt, *pa;
|
||||
char *val = NULL;
|
||||
|
||||
/*
|
||||
* The SPCR is enabled when SerialPort is non-zero. Address being zero
|
||||
* should suffice to see if it's disabled.
|
||||
*/
|
||||
spcr = acpi_find_table(ACPI_SIG_SPCR);
|
||||
if (spcr == NULL)
|
||||
if (spcr == NULL || spcr->SerialPort.Address == 0)
|
||||
return (0);
|
||||
dt = acpi_uart_type(spcr->InterfaceType);
|
||||
if (dt == NULL) { /* Kernel can't use unknown types */
|
||||
|
||||
Reference in New Issue
Block a user