svn commit: r346657 - head/sys/dev/uart

Rebecca Cran bcran at FreeBSD.org
Thu Apr 25 02:16:49 UTC 2019


Author: bcran
Date: Thu Apr 25 02:16:48 2019
New Revision: 346657
URL: https://svnweb.freebsd.org/changeset/base/346657

Log:
  ACPI SPCR: handle BaudRate=0
  
  From https://github.com/tianocore/edk2-platforms/commit/7d8dc6544c93a5f5a03c83316489ba8700946e9f
  
  "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 at unrelenting.technology>
  Reviewed by:	mw, imp, bcran
  Differential Revision:	https://reviews.freebsd.org/D19914

Modified:
  head/sys/dev/uart/uart_cpu_arm64.c

Modified: head/sys/dev/uart/uart_cpu_arm64.c
==============================================================================
--- head/sys/dev/uart/uart_cpu_arm64.c	Thu Apr 25 00:58:11 2019	(r346656)
+++ head/sys/dev/uart/uart_cpu_arm64.c	Thu Apr 25 02:16:48 2019	(r346657)
@@ -128,6 +128,13 @@ uart_cpu_acpi_probe(struct uart_class **classp, bus_sp
 		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;


More information about the svn-src-all mailing list