From nobody Wed Jun 15 21:10:15 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4D2DA832C58; Wed, 15 Jun 2022 21:10:16 +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 4LNdHW6yLyz4Z3K; Wed, 15 Jun 2022 21:10:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655327416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w+v3zf8B20hqTAyQaCGPhXLNLFpf0w8KjGnCGPDR3dY=; b=s6PJ6BBdc2lANvv1OQVlTTf7WDcdNuC+XgnmP/TlHjrV8pVOj1H8xZuLYTLkk6I25u7mu4 tEpKb2F7dwVykouqDgk86SlBeKyJihHs6tE7Cze3BqGbf9RNDwHWEbPq5wQkIsbg/RAYOV PdT1o3fHQLDtlMqH4OntLyrfL8dkAMJgh1E83rJylpokaxjdV7x/IHo8AVWoyy+NPnh28M mjezXl6K7euHetjpRmdRgNFwp+3risOttvPKoBx0SszjqUCWv7pPNzh1NvTUyn75WfCihm F406vNG9bUgi3BhpozZxqVMx+McbtMHCF37WDgbcnsN8JOjxAgjaHNTj7oTEGw== 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 9D23625B71; Wed, 15 Jun 2022 21:10:15 +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 25FLAFen037510; Wed, 15 Jun 2022 21:10:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25FLAF1U037503; Wed, 15 Jun 2022 21:10:15 GMT (envelope-from git) Date: Wed, 15 Jun 2022 21:10:15 GMT Message-Id: <202206152110.25FLAF1U037503@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 447c418da034 - main - USB: add quirks to XHCI List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 447c418da03454a2a00bc115a69c62055a6d5272 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655327416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w+v3zf8B20hqTAyQaCGPhXLNLFpf0w8KjGnCGPDR3dY=; b=HEMAt0Jzxl5VUX6KliQW1WJJGzXxcj/tKvo/nY57asCcsmpmxBH0z3JkhuZIJHJ97Jv+qU jhOQUxZaQnueZp7ZkJ3DgwG4vVlrAXI3VEcRYbTIBA7kQd6lwaLAEtfrly77kpfl5V0Fjd 46SIu1UoMqJcUGBm3BtlM2C96H1b0PeIZtHKZoUyNB8FA/rtqf6jbg2cNu46O3MOfFmKN+ xFquXugZsGXYLwUKz+WNhShX1qFtEOCHOTu1KkNW0y13J/eJxID/3Lo+saFOHNnLgYk3s6 N5zSKuIMU9CuxuGf9vPCu+CvRAuvkv6FlSbKYIVrGxjb9wKGQdgt4MaIt1ZR9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655327416; a=rsa-sha256; cv=none; b=xx7wT6TUYszSyqEnkbe4+E9bpaYRrCxRr/NIKX4SKI4qVcDjF0rUr/jCa1JHxLHObtXCPY NBfh5VzESRSjUITA2jafSq9xlSF9WbLVLNigu+Nhfs1Uv4XkyMmG6alPh8ldqnzc+QkdOZ fsXpKUbR5d4fd9jlxNuY1+4ncOQ2zxMYgTJxl2Vrob0wxrodoUhn2STtR2ss0ZazATJpwb q8tqtAzxrA8q/tVQ0iShblJzcWFSWxeZy1DcZ0i0chHHITDwsAQppEZ3rZ99AdRxl2npRv ZpPwVzw9qrcNyawnZTHfTIuLVzfUBJvsRNSQmi35du//Pz3T8T1R3rcGSwYKnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=447c418da03454a2a00bc115a69c62055a6d5272 commit 447c418da03454a2a00bc115a69c62055a6d5272 Author: Bjoern A. Zeeb AuthorDate: 2022-06-14 16:39:31 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-06-15 21:08:58 +0000 USB: add quirks to XHCI While XHCI is very generic some revisions of chipsets have problems. On dwc3 <= 3.00a Port Disable does not seem to work so we need to not enable it. For that introduce quirks to xhci so that controllers can steer certain features. I would hope that this is and remains the only one. Obtained from: an old patch mainly debugging other problems MFC after: 2 weeks Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D35482 --- sys/dev/usb/controller/xhci.c | 3 ++- sys/dev/usb/controller/xhci.h | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c index 15835d0a641b..039750cb0874 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -3392,7 +3392,8 @@ xhci_roothub_exec(struct usb_device *udev, XWRITE4(sc, oper, port, v | XHCI_PS_PRC); break; case UHF_PORT_ENABLE: - XWRITE4(sc, oper, port, v | XHCI_PS_PED); + if ((sc->sc_quirks & XHCI_QUIRK_DISABLE_PORT_PED) == 0) + XWRITE4(sc, oper, port, v | XHCI_PS_PED); break; case UHF_PORT_POWER: XWRITE4(sc, oper, port, v & ~XHCI_PS_PP); diff --git a/sys/dev/usb/controller/xhci.h b/sys/dev/usb/controller/xhci.h index e5c189697067..4701e62ba3e5 100644 --- a/sys/dev/usb/controller/xhci.h +++ b/sys/dev/usb/controller/xhci.h @@ -487,6 +487,10 @@ union xhci_hub_desc { typedef int (xhci_port_route_t)(device_t, uint32_t, uint32_t); +enum xhci_quirks { + XHCI_QUIRK_DISABLE_PORT_PED = 0x00000001, +}; + struct xhci_softc { struct xhci_hw_softc sc_hw; /* base device */ @@ -563,6 +567,9 @@ struct xhci_softc { /* vendor string for root HUB */ char sc_vendor[16]; + + /* XHCI quirks. */ + uint32_t sc_quirks; }; #define XHCI_CMD_LOCK(sc) sx_xlock(&(sc)->sc_cmd_sx)