From owner-svn-src-all@freebsd.org Thu Apr 25 02:16:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B10261588BDF; Thu, 25 Apr 2019 02:16:49 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4866B8B4A3; Thu, 25 Apr 2019 02:16:49 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2AD6B1D147; Thu, 25 Apr 2019 02:16:49 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3P2GnJc058771; Thu, 25 Apr 2019 02:16:49 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3P2GnUE058770; Thu, 25 Apr 2019 02:16:49 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201904250216.x3P2GnUE058770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Thu, 25 Apr 2019 02:16:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346657 - head/sys/dev/uart X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/sys/dev/uart X-SVN-Commit-Revision: 346657 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4866B8B4A3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 02:16:49 -0000 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 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;