aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-02-02 22:18:54 -0500
committerKevin O'Connor <kevin@koconnor.net>2016-02-02 23:16:40 -0500
commit5f7f3419bd2c99c745bd9b75d3b1aee436705d96 (patch)
tree315691ea2b6eb7b54e79fcdaae4daeb395f2f6a5
parentf51388da734e39af1ac2ef9a18b5cd3e30eb15b1 (diff)
downloadseabios-hppa-5f7f3419bd2c99c745bd9b75d3b1aee436705d96.zip
seabios-hppa-5f7f3419bd2c99c745bd9b75d3b1aee436705d96.tar.gz
seabios-hppa-5f7f3419bd2c99c745bd9b75d3b1aee436705d96.tar.bz2
lsi-scsi: Convert to new PCI BAR helper functions
Use the pci_enable_x() functions. The lsi-scsi controller code will now explicitly set PCI_COMMAND_IO instead of assuming it has already been enabled. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--src/hw/lsi-scsi.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/hw/lsi-scsi.c b/src/hw/lsi-scsi.c
index ad33528..2629b5f 100644
--- a/src/hw/lsi-scsi.c
+++ b/src/hw/lsi-scsi.c
@@ -172,15 +172,14 @@ lsi_scsi_scan_target(struct pci_device *pci, u32 iobase, u8 target)
static void
init_lsi_scsi(struct pci_device *pci)
{
- u16 bdf = pci->bdf;
- u32 iobase = pci_config_readl(pci->bdf, PCI_BASE_ADDRESS_0)
- & PCI_BASE_ADDRESS_IO_MASK;
-
- pci_config_maskw(bdf, PCI_COMMAND, 0, PCI_COMMAND_MASTER);
+ u32 iobase = pci_enable_iobar(pci, PCI_BASE_ADDRESS_0);
+ if (!iobase)
+ return;
+ pci_enable_busmaster(pci);
dprintf(1, "found lsi53c895a at %02x:%02x.%x, io @ %x\n",
- pci_bdf_to_bus(bdf), pci_bdf_to_dev(bdf),
- pci_bdf_to_fn(bdf), iobase);
+ pci_bdf_to_bus(pci->bdf), pci_bdf_to_dev(pci->bdf),
+ pci_bdf_to_fn(pci->bdf), iobase);
// reset
outb(LSI_ISTAT0_SRST, iobase + LSI_REG_ISTAT0);