From owner-dev-commits-src-main@freebsd.org Thu Sep 30 20:35:27 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1D476B7BFE; Thu, 30 Sep 2021 20:35:27 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HL4kR5w5zz4pl5; Thu, 30 Sep 2021 20:35:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC3C712768; Thu, 30 Sep 2021 20:35:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18UKZRxN074617; Thu, 30 Sep 2021 20:35:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18UKZRUe074616; Thu, 30 Sep 2021 20:35:27 GMT (envelope-from git) Date: Thu, 30 Sep 2021 20:35:27 GMT Message-Id: <202109302035.18UKZRUe074616@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 9eb5fd359969 - main - uart: Match simple comm MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9eb5fd3599695acc76291777bc587e14746e960c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 20:35:28 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9eb5fd3599695acc76291777bc587e14746e960c commit 9eb5fd3599695acc76291777bc587e14746e960c Author: Warner Losh AuthorDate: 2021-09-30 20:16:19 +0000 Commit: Warner Losh CommitDate: 2021-09-30 20:16:19 +0000 uart: Match simple comm Match the PCI simple comm devices (or try to). Be conservative and use legacy interrupts rather than msi messages by default for this 'catch all' since it matches what Linux does (it has opt-in generally for MSI, but also matches more devices because it does a catch-all like implemented in this commit). Sponsored by: Netflix Reviewed by: kbowling Differential Revision: https://reviews.freebsd.org/D32228 --- sys/dev/uart/uart_bus_pci.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/dev/uart/uart_bus_pci.c b/sys/dev/uart/uart_bus_pci.c index 4090af0ea9a0..fe5ad2b6d206 100644 --- a/sys/dev/uart/uart_bus_pci.c +++ b/sys/dev/uart/uart_bus_pci.c @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -218,6 +219,12 @@ uart_pci_probe(device_t dev) { struct uart_softc *sc; const struct pci_id *id; + struct pci_id cid = { + .regshft = 0, + .rclk = 0, + .rid = 0x10 | PCI_NO_MSI, + .desc = "Generic SimpleComm PCI device", + }; int result; sc = device_get_softc(dev); @@ -227,6 +234,14 @@ uart_pci_probe(device_t dev) sc->sc_class = &uart_ns8250_class; goto match; } + if (pci_get_class(dev) == PCIC_SIMPLECOMM && + pci_get_subclass(dev) == PCIS_SIMPLECOMM_UART && + pci_get_progif(dev) < PCIP_SIMPLECOMM_UART_16550A) { + /* XXX rclk what to do */ + id = &cid; + sc->sc_class = &uart_ns8250_class; + goto match; + } /* Add checks for non-ns8250 IDs here. */ return (ENXIO);