]> xenbits.xensource.com Git - seabios.git/commitdiff
esp-scsi: Convert to new PCI BAR helper functions
authorKevin O'Connor <kevin@koconnor.net>
Wed, 3 Feb 2016 03:17:01 +0000 (22:17 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Wed, 3 Feb 2016 04:16:40 +0000 (23:16 -0500)
Use the pci_enable_x() functions.

The esp-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>
src/hw/esp-scsi.c

index d4e47e3c5ef8dfc12b330ce325aa8b9ffd350a05..cf2cc11e013863f38871058b949bb295d23baebd 100644 (file)
@@ -192,15 +192,14 @@ esp_scsi_scan_target(struct pci_device *pci, u32 iobase, u8 target)
 static void
 init_esp_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;
+    u32 iobase = pci_enable_iobar(pci, PCI_BASE_ADDRESS_0);
+    if (!iobase)
+        return;
+    pci_enable_busmaster(pci);
 
     dprintf(1, "found esp at %02x:%02x.%x, io @ %x\n",
-            pci_bdf_to_bus(bdf), pci_bdf_to_dev(bdf),
-            pci_bdf_to_fn(bdf), iobase);
-
-    pci_config_maskw(bdf, PCI_COMMAND, 0, PCI_COMMAND_MASTER);
+            pci_bdf_to_bus(pci->bdf), pci_bdf_to_dev(pci->bdf),
+            pci_bdf_to_fn(pci->bdf), iobase);
 
     // reset
     outb(ESP_CMD_RESET, iobase + ESP_CMD);