From 6f7902208064d7c8c1f3cd559be36a90866005be Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sat, 11 Oct 2025 20:13:06 -0400 Subject: kern: pci: Initialize PCI bus mastering + MMIO Signed-off-by: Ian Moffett --- src/sys/io/usb/hcd/xhci.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/sys/io/usb/hcd/xhci.c') diff --git a/src/sys/io/usb/hcd/xhci.c b/src/sys/io/usb/hcd/xhci.c index 0125e96..0582aaa 100644 --- a/src/sys/io/usb/hcd/xhci.c +++ b/src/sys/io/usb/hcd/xhci.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -162,6 +163,20 @@ xhci_init_hc(struct xhci_hcd *hcd) return 0; } +static void +xhci_pci_init(struct pci_device *devp) +{ + uint32_t config; + + if (devp == NULL) { + return; + } + + config = pci_readl(devp, PCIREG_CMDSTATUS); + config |= PCI_BUS_MASTERING | PCI_MEM_SPACE; + pci_writel(devp, PCIREG_CMDSTATUS, config); +} + static int xhci_init(struct module *modp) { @@ -202,6 +217,7 @@ xhci_attach(struct pci_adv *ap) return error; } + xhci_pci_init(&dev); hcd.capspace = bs.va_base; return xhci_init_hc(&hcd); } -- cgit v1.2.3