ACPI SPCR: handle BaudRate=0

From 7d8dc6544c

"The mcbin (and likely others) have a nonstandard uart clock. This means
that the earlycon programming will incorrectly set the baud rate if it is
specified. The way around this is to tell the kernel to continue using the
preprogrammed baud rate. This is done by setting the baud to 0."

Our drivers (uart_dev_ns8250) do respect zero, but SPCR would error. Let's
not error.

Submitted by:	Greg V <greg@unrelenting.technology>
Reviewed by:	mw, imp, bcran
Differential Revision:	https://reviews.freebsd.org/D19914
This commit is contained in:
Rebecca Cran 2019-04-25 02:16:48 +00:00
parent 0c0ffba5d6
commit 56a70105df
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=346657

View File

@ -128,6 +128,13 @@ uart_cpu_acpi_probe(struct uart_class **classp, bus_space_tag_t *bst,
goto out;
switch(spcr->BaudRate) {
case 0:
/*
* A BaudRate of 0 is a special value which means not to
* change the rate that's already programmed.
*/
*baud = 0;
break;
case 3:
*baud = 9600;
break;