]> xenbits.xensource.com Git - seabios.git/commitdiff
usb: add boot prio support for mmio host adapters
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 30 Sep 2020 11:14:31 +0000 (13:14 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 13 Oct 2020 09:04:03 +0000 (11:04 +0200)
Add mmio field to usb controller struct, add support for mmio-mapped
usb host adapters to boot order handling.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20200930111433.21533-2-kraxel@redhat.com

src/boot.c
src/hw/usb.h

index a715e37356e2bbcf1dfa40b4d1b4e774662900fa..bd78fb907c5a4eb9fdab292008ff63b56739d25f 100644 (file)
@@ -425,7 +425,15 @@ int bootprio_find_usb(struct usbdevice_s *usbdev, int lun)
         return -1;
     // Find usb - for example: /pci@i0cf8/usb@1,2/storage@1/channel@0/disk@0,0
     char desc[256], *p;
-    p = build_pci_path(desc, sizeof(desc), "usb", usbdev->hub->cntl->pci);
+
+    if (usbdev->hub->cntl->pci)
+        p = build_pci_path(desc, sizeof(desc), "usb", usbdev->hub->cntl->pci);
+    else if (usbdev->hub->cntl->mmio)
+        p = desc + snprintf(desc, sizeof(desc), "/*@%016x"
+                            , (u32)usbdev->hub->cntl->mmio);
+    else
+        return -1;
+
     p = build_usb_path(p, desc+sizeof(desc)-p, usbdev->hub);
     snprintf(p, desc+sizeof(desc)-p, "/storage@%x/*@0/*@0,%x"
              , usb_portmap(usbdev), lun);
index 2cfb5721775af804f272a260725b5ddb73f82d09..887f2064cf3a5b9b1a37f5e0f84943840d73535d 100644 (file)
@@ -35,6 +35,7 @@ struct usb_s {
     struct usb_pipe *freelist;
     struct mutex_s resetlock;
     struct pci_device *pci;
+    void *mmio;
     u8 type;
     u8 maxaddr;
 };