diff options
author | Ian Moffett <ian@osmora.org> | 2025-06-01 21:18:15 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-06-01 21:18:15 -0400 |
commit | 068224956eff541e1c9b54cd2042cc67fac1761f (patch) | |
tree | ec9d026f8295e6dd90468e3e599e192838e5a2e9 | |
parent | c3091854eef84ba4655ada317c215c426a08045c (diff) |
kernel: xhci: Ensure of PCI bus mastering and MMIO
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r-- | sys/dev/usb/xhci.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/dev/usb/xhci.c b/sys/dev/usb/xhci.c index 9ab109a..5276eea 100644 --- a/sys/dev/usb/xhci.c +++ b/sys/dev/usb/xhci.c @@ -37,6 +37,7 @@ #include <dev/usb/xhciregs.h> #include <dev/usb/xhcivar.h> #include <dev/pci/pci.h> +#include <dev/pci/pciregs.h> #include <dev/acpi/acpi.h> #include <vm/physmem.h> #include <vm/dynalloc.h> @@ -496,6 +497,16 @@ xhci_init_hc(struct xhci_hc *hc) return 0; } +static void +xhci_init_pci(void) +{ + uint32_t tmp; + + tmp = pci_readl(hci_dev, PCIREG_CMDSTATUS); + tmp |= (PCI_BUS_MASTERING | PCI_MEM_SPACE); + pci_writel(hci_dev, PCIREG_CMDSTATUS, tmp); +} + static int xhci_init(void) { @@ -528,6 +539,7 @@ xhci_init(void) return -ENODEV; } + xhci_init_pci(); return xhci_init_hc(&xhc); } |