diff options
author | Ian Moffett <ian@osmora.org> | 2025-10-11 20:13:06 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-10-11 20:13:52 -0400 |
commit | 6f7902208064d7c8c1f3cd559be36a90866005be (patch) | |
tree | 471f4bb718dd5194eeb742ebda8ec29b74bc7881 /src/sys/io/usb | |
parent | 159ea725460754aee6df15733ee0da73e230e008 (diff) |
kern: pci: Initialize PCI bus mastering + MMIO
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys/io/usb')
-rw-r--r-- | src/sys/io/usb/hcd/xhci.c | 16 |
1 files changed, 16 insertions, 0 deletions
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 <os/clkdev.h> #include <io/usb/xhcivar.h> #include <io/usb/xhciregs.h> +#include <io/pci/cam.h> #include <io/pci/bar.h> #include <io/pci/pci.h> #include <os/module.h> @@ -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); } |