[SeaBIOS] [PATCH] megasas: read addional PCI I/O bar

Paolo Bonzini pbonzini at redhat.com
Thu Nov 6 14:44:16 CET 2014


On 06/11/2014 14:31, Hannes Reinecke wrote:
> 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 at suse.de>

Thanks---Gerd, can we somehow add this patch to QEMU 2.2? O:-)

Paolo

> ---
>  src/megasas.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/megasas.c b/src/megasas.c
> index f4eeba0..167fc32 100644
> --- a/src/megasas.c
> +++ b/src/megasas.c
> @@ -353,6 +353,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);
> 



More information about the SeaBIOS mailing list