This series adds some helper functions for working with PCI BARs (Base Address Registers), and it then updates all the drivers to use these helper functions. The new helper functions perform sanity checks on the BARs and make sure the appropriate pci command register flags are enabled. The existing driver code was inconsistent with these checks.
At the end of this series, the pci->have_driver flag is also consistently set on any PCI device that there is a SeaBIOS driver for. This will make sure SeaBIOS does not attempt to load an option rom for a device that SeaBIOS already has a native driver for.
This series is also available at:
https://github.com/KevinOConnor/seabios/tree/testing
-Kevin
Kevin O'Connor (14): pci: Add helper functions for internal driver BAR handling ahci: Convert to new PCI BAR helper functions ata: Convert to new PCI BAR helper functions esp-scsi: Convert to new PCI BAR helper functions lsi-scsi: Convert to new PCI BAR helper functions megasas: Convert to new PCI BAR helper functions pvscsi: Convert to new PCI BAR helper functions sdcard: Convert to new PCI BAR helper functions ehci: Convert to new PCI BAR helper functions ohci: Convert to new PCI BAR helper functions uhci: Convert to new PCI BAR helper functions xhci: Convert to new PCI BAR helper functions virtio: Convert to new PCI BAR helper functions pci: Consistently set pci->have_drivers for devices with internal drivers
src/hw/ahci.c | 35 ++++++++++++++---------------- src/hw/ahci.h | 3 +-- src/hw/ata.c | 26 +++++++++++------------ src/hw/esp-scsi.c | 13 ++++++------ src/hw/lsi-scsi.c | 13 ++++++------ src/hw/megasas.c | 18 +++++++--------- src/hw/pci.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/hw/pci.h | 3 +++ src/hw/pvscsi.c | 17 +++++++-------- src/hw/sdcard.c | 15 ++++++------- src/hw/usb-ehci.c | 12 +++++------ src/hw/usb-ohci.c | 17 +++++++-------- src/hw/usb-uhci.c | 16 ++++++++------ src/hw/usb-xhci.c | 27 ++++++++++++------------ src/hw/virtio-pci.c | 36 +++++++++++++++++-------------- src/hw/virtio-pci.h | 32 ++++++++++++++++------------ 16 files changed, 203 insertions(+), 141 deletions(-)