aboutsummaryrefslogtreecommitdiff
path: root/sys/modules
diff options
context:
space:
mode:
authorLexi Winter <lexi@le-Fay.ORG>2024-04-10 03:11:36 +0000
committerWarner Losh <imp@FreeBSD.org>2024-04-10 03:11:39 +0000
commitac83063d37e5e92ad048cc4ed958654c02103f74 (patch)
treefc3579b09fc497db32bfc70d5d162a4335b2fe4f /sys/modules
parent054a4720591f0c98579bccef2751fd458ee4f71f (diff)
downloadsrc-ac83063d37e5e92ad048cc4ed958654c02103f74.tar.gz
src-ac83063d37e5e92ad048cc4ed958654c02103f74.zip
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
Diffstat (limited to 'sys/modules')
-rw-r--r--sys/modules/usb/Makefile7
-rw-r--r--sys/modules/usb/bcm2838_xhci/Makefile12
2 files changed, 18 insertions, 1 deletions
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 <bsd.kmod.mk>