diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2020-09-30 13:14:33 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-10-13 11:04:03 +0200 |
commit | c685fe3ff2d402caefc1487d99bb486c4a510b8b (patch) | |
tree | 67173c7df6170a709b13272f2ef05ac270448a99 | |
parent | b95a199610820f161a25af59369ebc12616fddfd (diff) | |
download | seabios-c685fe3ff2d402caefc1487d99bb486c4a510b8b.tar.gz |
usb/xhci: add support for mmio host adapters (via acpi).
Add xhci_controller_setup_acpi() function to initialize usb host
adapters declared in the DSDT table. Search the acpi devices list
for xhci controllers.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20200930111433.21533-4-kraxel@redhat.com
-rw-r--r-- | src/hw/usb-xhci.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/hw/usb-xhci.c b/src/hw/usb-xhci.c index f27867e4..c35f2211 100644 --- a/src/hw/usb-xhci.c +++ b/src/hw/usb-xhci.c @@ -637,6 +637,29 @@ xhci_controller_setup_pci(struct pci_device *pci) run_thread(configure_xhci, xhci); } +static void +xhci_controller_setup_acpi(struct acpi_device *dev) +{ + struct usb_xhci_s *xhci; + u64 mem, unused; + void *baseaddr; + + if (acpi_dsdt_find_mem(dev, &mem, &unused) < 0) + return; + if (mem >= 0x100000000ll) + return; + + baseaddr = (void*)(u32)mem; + dprintf(1, "ACPI: XHCI at mmio %p\n", baseaddr); + + xhci = xhci_controller_setup(baseaddr); + if (!xhci) + return; + + xhci->usb.mmio = baseaddr; + run_thread(configure_xhci, xhci); +} + void xhci_setup(void) { @@ -648,6 +671,14 @@ xhci_setup(void) if (pci_classprog(pci) == PCI_CLASS_SERIAL_USB_XHCI) xhci_controller_setup_pci(pci); } + + u16 xhci_eisaid = 0x0d10; + struct acpi_device *dev; + for (dev = acpi_dsdt_find_eisaid(NULL, xhci_eisaid); + dev != NULL; + dev = acpi_dsdt_find_eisaid(dev, xhci_eisaid)) { + xhci_controller_setup_acpi(dev); + } } |