summary refs log tree commit diff stats
path: root/hw/piix_pci.c
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2006-09-24 17:01:44 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2006-09-24 17:01:44 +0000
commit80b3ada7dd56088613a446934d144a747e740fa1 (patch)
tree3dc8bf29b3bee0c06772b56e5add4a7d5df2de23 /hw/piix_pci.c
parentd2b5931756fdb9f839180e33898cd1e3e4fbdc90 (diff)
downloadfocaccia-qemu-80b3ada7dd56088613a446934d144a747e740fa1.tar.gz
focaccia-qemu-80b3ada7dd56088613a446934d144a747e740fa1.zip
Implement sun4u PCI IRQ routing.
Allow multiple PCI busses and PCI-PCI bridges.
Fix bugs in Versatile PCI implementation.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2166 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/piix_pci.c')
-rw-r--r--hw/piix_pci.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/hw/piix_pci.c b/hw/piix_pci.c
index 939521c7bb..d618f00623 100644
--- a/hw/piix_pci.c
+++ b/hw/piix_pci.c
@@ -59,7 +59,7 @@ PCIBus *i440fx_init(void)
     I440FXState *s;
 
     s = qemu_mallocz(sizeof(I440FXState));
-    b = pci_register_bus(piix3_set_irq, pci_slot_get_pirq, NULL, 0);
+    b = pci_register_bus(piix3_set_irq, pci_slot_get_pirq, NULL, 0, 4);
     s->bus = b;
 
     register_ioport_write(0xcf8, 4, 4, i440fx_addr_writel, s);
@@ -226,6 +226,7 @@ static uint32_t pci_bios_io_addr;
 static uint32_t pci_bios_mem_addr;
 /* host irqs corresponding to PCI irqs A-D */
 static uint8_t pci_irqs[4] = { 11, 9, 11, 9 };
+static int pci_bios_next_bus;
 
 static void pci_config_writel(PCIDevice *d, uint32_t addr, uint32_t val)
 {
@@ -320,6 +321,14 @@ static void pci_bios_init_device(PCIDevice *d)
             pci_set_io_region_addr(d, 3, 0x374);
         }
         break;
+    case 0x0604:
+        /* PCI to PCI bridge.  Assign bus ID and recurse to configure
+           devices on the secondary bus.  */
+        i = pci_bios_next_bus++;
+        pci_config_writeb(d, 0x18, pci_bus_num(d->bus));
+        pci_config_writeb(d, 0x19, i);
+        pci_for_each_device(i, pci_bios_init_device);
+        break;
     case 0x0300:
         if (vendor_id != 0x1234)
             goto default_map;
@@ -398,6 +407,7 @@ void pci_bios_init(void)
     isa_outb(elcr[0], 0x4d0);
     isa_outb(elcr[1], 0x4d1);
 
-    pci_for_each_device(pci_bios_init_device);
+    pci_bios_next_bus = 1;
+    pci_for_each_device(0, pci_bios_init_device);
 }