]> xenbits.xensource.com Git - seabios.git/commitdiff
megasas: read addional PCI I/O bar
authorHannes Reinecke <hare@suse.de>
Thu, 6 Nov 2014 13:31:56 +0000 (14:31 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 10 Nov 2014 10:23:35 +0000 (11:23 +0100)
Some newer cards have the I/O bar at BAR 0, so we need to check
that, too, if we cannot get an address for BAR 2.
Without this patch the new 'megasas-gen2' emulation in qemu
is not detected.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
src/hw/megasas.c

index a5dc14fcff9b8ecadf8a1300fc8857022cdd6386..b2a65e48bac792e62338286f44f3b3778354e710 100644 (file)
@@ -357,6 +357,10 @@ init_megasas(struct pci_device *pci)
     u32 iobase = pci_config_readl(pci->bdf, PCI_BASE_ADDRESS_2)
         & PCI_BASE_ADDRESS_IO_MASK;
 
+    if (!iobase)
+        iobase = pci_config_readl(pci->bdf, PCI_BASE_ADDRESS_0)
+            & PCI_BASE_ADDRESS_IO_MASK;
+
     dprintf(1, "found MegaRAID SAS at %02x:%02x.%x, io @ %x\n",
             pci_bdf_to_bus(bdf), pci_bdf_to_dev(bdf),
             pci_bdf_to_fn(bdf), iobase);