From 068224956eff541e1c9b54cd2042cc67fac1761f Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sun, 1 Jun 2025 21:18:15 -0400 Subject: kernel: xhci: Ensure of PCI bus mastering and MMIO Signed-off-by: Ian Moffett --- sys/dev/usb/xhci.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sys') 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 #include #include +#include #include #include #include @@ -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); } -- cgit v1.2.3