mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 04:43:53 +00:00
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
This commit is contained in:
parent
054a472059
commit
ac83063d37
|
@ -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);
|
DRIVER_MODULE(bcm_xhci, pci, bcm_xhci_driver, 0, 0);
|
||||||
MODULE_DEPEND(bcm_xhci, usb, 1, 1, 1);
|
MODULE_DEPEND(bcm_xhci, usb, 1, 1, 1);
|
||||||
|
MODULE_DEPEND(bcm_xhci, pci, 1, 1, 1);
|
||||||
|
MODULE_DEPEND(bcm_xhci, xhci, 1, 1, 1);
|
||||||
|
|
|
@ -4406,3 +4406,5 @@ static const struct usb_bus_methods xhci_bus_methods = {
|
||||||
.set_hw_power_sleep = xhci_set_hw_power_sleep,
|
.set_hw_power_sleep = xhci_set_hw_power_sleep,
|
||||||
.set_endpoint_mode = xhci_set_endpoint_mode,
|
.set_endpoint_mode = xhci_set_endpoint_mode,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
MODULE_VERSION(xhci, 1);
|
||||||
|
|
|
@ -44,7 +44,7 @@ MAKE+=" DEBUG_FLAGS+=-DUSB_REQ_DEBUG"
|
||||||
|
|
||||||
SUBDIR = usb
|
SUBDIR = usb
|
||||||
SUBDIR += ${_dwc_otg} ehci ${_musb} ohci uhci xhci ${_uss820dci} \
|
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 += ${_rum} ${_run} ${_runfw} ${_uath} upgt usie ural ${_zyd} ${_urtw}
|
||||||
SUBDIR += atp cfumass uhid uhid_snes ukbd ums udbp uep wmt wsp ugold uled \
|
SUBDIR += atp cfumass uhid uhid_snes ukbd ums udbp uep wmt wsp ugold uled \
|
||||||
usbhid
|
usbhid
|
||||||
|
@ -98,6 +98,11 @@ _urtw= urtw
|
||||||
_avr32dci= avr32dci
|
_avr32dci= avr32dci
|
||||||
.endif
|
.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" || \
|
.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
|
||||||
${MACHINE_CPUARCH} == "i386"
|
${MACHINE_CPUARCH} == "i386"
|
||||||
_uacpi= uacpi
|
_uacpi= uacpi
|
||||||
|
|
12
sys/modules/usb/bcm2838_xhci/Makefile
Normal file
12
sys/modules/usb/bcm2838_xhci/Makefile
Normal file
|
@ -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>
|
Loading…
Reference in a new issue