From nobody Wed Apr 10 03:22:29 2024 X-Original-To: dev-commits-src-main@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 4VDp6Y3d4Sz5GdnZ; Wed, 10 Apr 2024 03:22:29 +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 4VDp6Y3Bnbz4PcZ; Wed, 10 Apr 2024 03:22:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712719349; 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=oj7ErvvyY6MyasJtMsMLfkAbXbvd5vjorHpFE0ivq9A=; b=NVMyDDPVyS6SBRgZxv3xXsxQsa8hzcv8yEh5oUE/J351qKEfzIBjoVVYDZryj21+4JXh/R tldCo2bwdIPy9ulmECqAjGo3on9BgA+zdkzhqpdguhi8w0uCcRf2HsoVrcPZB3SpRVH9Dv byUjbnOyKUjPNDGFTNnyr9cEcVVpsa9Lvb34/SFmJz1XTcc5XFZFru0nQxfmcQL1VSKjBG qzOxDDT6vPX2nTTIzFnzD/gX/yaWMoU7cyBOCYJFHkHLXR5xHyF6ZpzzPqiaqVeFKYI7De JfShqYtEt+AzzO7C1QtfnkWci4ylNN4vYVuPhKw5Gu+0ZdcDqvudrVGijuLH/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712719349; a=rsa-sha256; cv=none; b=iz2/CE5qcgzUgPYSLFe77wfmgTkY4iD6HEpVz3f1GK8X8dQRUhj9in8JJb+QmD/S+lbSQX Zb6ZJ5l+zRIUtDgRN2B3gfzSWnqYkn75Z772XONmIth8EThArtuGmOXna+VzF7vtLmcwJT Xtdevt7s+FWTgTLStZGrPEGAIcTYoHcT/KSKaXggUwMG5Nlyv2haV8XlEhalgp6ZhXwCHW +UqIfbRGat7qJ8DMyAeUJOnbLSxtdpXmHBLH8fnj3IKR1Pi3StpoyeSDQnKe8LlRcs83V+ rh18jK/Ok2hGnxtfrgq2azrYDMD4OW19ADdGcmQVKCMI1MZ9Q3qVUwFCdgE8WA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712719349; 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=oj7ErvvyY6MyasJtMsMLfkAbXbvd5vjorHpFE0ivq9A=; b=ajjJhfZ6/jp8hwzjhITzb9a5Dr3xUWL5KSrEte7lOsFAo6SNCeIhU7yk/UG+S87e94vuKv 3otou/mbnk1co4cF0jPNxdCJHYoRoZClq+kGkPDxawLbqSgDcghySThYgCcQSEit1xcWCI aftNR9LlPmXUJWIVMxuL0lVJ56SCkxlBtobRk9tk4hg4L5IWLuIU+1TvqEnyAruwJBHZL8 ZOqAQsOYhfz/0RyD2gL3HjgT5S8XGJiPlxnP2sBKib+s415eN0hq8bWUbVV7FNUxOsOive f75lUniapZWcsABlrLzLKXzfsv7PIIdRHnGCcB3hm0Kc3KWA+Sp3gyhCSx3PNg== 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 4VDp6Y2pB2zM2w; Wed, 10 Apr 2024 03:22:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43A3MTaA087270; Wed, 10 Apr 2024 03:22:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43A3MTXZ087267; Wed, 10 Apr 2024 03:22:29 GMT (envelope-from git) Date: Wed, 10 Apr 2024 03:22:29 GMT Message-Id: <202404100322.43A3MTXZ087267@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: ac83063d37e5 - main - bcm2838_xhci: add module List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: dev-commits-src-main+owner@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: ac83063d37e5e92ad048cc4ed958654c02103f74 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ac83063d37e5e92ad048cc4ed958654c02103f74 commit ac83063d37e5e92ad048cc4ed958654c02103f74 Author: Lexi Winter AuthorDate: 2024-04-10 03:11:36 +0000 Commit: Warner Losh CommitDate: 2024-04-10 03:11:39 +0000 bcm2838_xhci: add module bcm2838_xhci(4) is a shim for the XHCI controller on the Raspberry Pi 4B SoC. It loads the controller's firmware before passing control to the normal xhci(4) driver. When xhci(4) is built as a module (and not in the kernel), bcm2838_xhci is not built at all and the RPi4's XHCI controller won't attach due to missing firmware. To fix this, build a new module, bcm2838_xhci.ko, which depends on xhci.ko. For the dependency to work correctly, also modify xhci to provide the 'xhci' module in addition to the 'xhci_pci' module it already provided. Since bcm2838_xhci is specific to a quirk of the RPi4 SoC, only build the module for AArch64. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1142 --- sys/arm/broadcom/bcm2835/bcm2838_xhci.c | 2 ++ sys/dev/usb/controller/xhci.c | 2 ++ sys/modules/usb/Makefile | 7 ++++++- sys/modules/usb/bcm2838_xhci/Makefile | 12 ++++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/sys/arm/broadcom/bcm2835/bcm2838_xhci.c b/sys/arm/broadcom/bcm2835/bcm2838_xhci.c index 11b3bccf68a1..25579d7227a5 100644 --- a/sys/arm/broadcom/bcm2835/bcm2838_xhci.c +++ b/sys/arm/broadcom/bcm2835/bcm2838_xhci.c @@ -212,3 +212,5 @@ DEFINE_CLASS_1(bcm_xhci, bcm_xhci_driver, bcm_xhci_methods, DRIVER_MODULE(bcm_xhci, pci, bcm_xhci_driver, 0, 0); MODULE_DEPEND(bcm_xhci, usb, 1, 1, 1); +MODULE_DEPEND(bcm_xhci, pci, 1, 1, 1); +MODULE_DEPEND(bcm_xhci, xhci, 1, 1, 1); diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c index 17800dc11d0c..5be592512196 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -4406,3 +4406,5 @@ static const struct usb_bus_methods xhci_bus_methods = { .set_hw_power_sleep = xhci_set_hw_power_sleep, .set_endpoint_mode = xhci_set_endpoint_mode, }; + +MODULE_VERSION(xhci, 1); diff --git a/sys/modules/usb/Makefile b/sys/modules/usb/Makefile index 2c593495b9a4..3a81c7fd44f3 100644 --- a/sys/modules/usb/Makefile +++ b/sys/modules/usb/Makefile @@ -44,7 +44,7 @@ MAKE+=" DEBUG_FLAGS+=-DUSB_REQ_DEBUG" SUBDIR = usb SUBDIR += ${_dwc_otg} ehci ${_musb} ohci uhci xhci ${_uss820dci} \ - ${_atmegadci} ${_avr32dci} ${_rsu} ${_rsufw} + ${_atmegadci} ${_avr32dci} ${_rsu} ${_rsufw} ${_bcm2838_xhci} SUBDIR += ${_rum} ${_run} ${_runfw} ${_uath} upgt usie ural ${_zyd} ${_urtw} SUBDIR += atp cfumass uhid uhid_snes ukbd ums udbp uep wmt wsp ugold uled \ usbhid @@ -98,6 +98,11 @@ _urtw= urtw _avr32dci= avr32dci .endif +.if ${MACHINE_CPUARCH} == "aarch64" +# The bcm2838_xhci shim is specific to the Raspberry Pi 4 SoC. +_bcm2838_xhci= bcm2838_xhci +.endif + .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ ${MACHINE_CPUARCH} == "i386" _uacpi= uacpi diff --git a/sys/modules/usb/bcm2838_xhci/Makefile b/sys/modules/usb/bcm2838_xhci/Makefile new file mode 100644 index 000000000000..3c90b4c8b32c --- /dev/null +++ b/sys/modules/usb/bcm2838_xhci/Makefile @@ -0,0 +1,12 @@ +# Copyright (c) 2024 Lexi Winter. +# +# SPDX-License-Identifier: BSD-2-Clause + +S= ${SRCTOP}/sys + +.PATH: $S/arm/broadcom/bcm2835 + +KMOD= bcm2838_xhci +SRCS= bcm2838_xhci.c + +.include