Support pci init of both PIIX3 and PIIX4 - patch from bochs bios.
authorKevin O'Connor <kevin@koconnor.net>
Sat, 25 Oct 2008 19:23:23 +0000 (15:23 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 25 Oct 2008 19:23:23 +0000 (15:23 -0400)
src/pci.h
src/pciinit.c

index 2b05738cf4eda166aab3c36449b4c3afbe4850fd..41f62f04994452bc33c3dddf928c37a74188158a 100644 (file)
--- a/src/pci.h
+++ b/src/pci.h
@@ -69,6 +69,8 @@ void create_pirtable();
 #define PCI_DEVICE_ID_INTEL_82441       0x1237
 #define PCI_DEVICE_ID_INTEL_82371SB_0   0x7000
 #define PCI_DEVICE_ID_INTEL_82371SB_1   0x7010
+#define PCI_DEVICE_ID_INTEL_82371AB_0   0x7110
+#define PCI_DEVICE_ID_INTEL_82371AB     0x7111
 #define PCI_DEVICE_ID_INTEL_82371AB_3   0x7113
 
 
index 6e4045b248af9a23b8cbc0904709fe364864705f..f5f6a1378b339b7169861f8e90bcddfbb3a848ce 100644 (file)
@@ -67,11 +67,12 @@ static void pci_bios_init_bridges(PCIDevice d)
     device_id = pci_config_readw(d, PCI_DEVICE_ID);
 
     if (vendor_id == PCI_VENDOR_ID_INTEL
-        && device_id == PCI_DEVICE_ID_INTEL_82371SB_0) {
+        && (device_id == PCI_DEVICE_ID_INTEL_82371SB_0
+            || device_id == PCI_DEVICE_ID_INTEL_82371AB_0)) {
         int i, irq;
         u8 elcr[2];
 
-        /* PIIX3 bridge */
+        /* PIIX3/PIIX4 PCI to ISA bridge */
 
         elcr[0] = 0x00;
         elcr[1] = 0x00;
@@ -84,7 +85,7 @@ static void pci_bios_init_bridges(PCIDevice d)
         }
         outb(elcr[0], 0x4d0);
         outb(elcr[1], 0x4d1);
-        dprintf(1, "PIIX3 init: elcr=%02x %02x\n",
+        dprintf(1, "PIIX3/PIIX4 init: elcr=%02x %02x\n",
                 elcr[0], elcr[1]);
     }
 }
@@ -103,8 +104,9 @@ static void pci_bios_init_device(PCIDevice d)
     switch(class) {
     case 0x0101:
         if (vendor_id == PCI_VENDOR_ID_INTEL
-            && device_id == PCI_DEVICE_ID_INTEL_82371SB_1) {
-            /* PIIX3 IDE */
+            && (device_id == PCI_DEVICE_ID_INTEL_82371SB_1
+                || device_id == PCI_DEVICE_ID_INTEL_82371AB)) {
+            /* PIIX3/PIIX4 IDE */
             pci_config_writew(d, 0x40, 0x8000); // enable IDE0
             pci_config_writew(d, 0x42, 0x8000); // enable IDE1
             goto default_map;