|
@@ -29,7 +29,6 @@
|
|
|
#include "hw/mips/mips.h"
|
|
|
#include "hw/pci/pci.h"
|
|
|
#include "hw/pci/pci_host.h"
|
|
|
-#include "hw/southbridge/piix.h"
|
|
|
#include "migration/vmstate.h"
|
|
|
#include "hw/intc/i8259.h"
|
|
|
#include "hw/irq.h"
|
|
@@ -981,53 +980,6 @@ static const MemoryRegionOps isd_mem_ops = {
|
|
|
},
|
|
|
};
|
|
|
|
|
|
-static int gt64120_pci_map_irq(PCIDevice *pci_dev, int irq_num)
|
|
|
-{
|
|
|
- int slot;
|
|
|
-
|
|
|
- slot = PCI_SLOT(pci_dev->devfn);
|
|
|
-
|
|
|
- switch (slot) {
|
|
|
- /* PIIX4 USB */
|
|
|
- case 10:
|
|
|
- return 3;
|
|
|
- /* AMD 79C973 Ethernet */
|
|
|
- case 11:
|
|
|
- return 1;
|
|
|
- /* Crystal 4281 Sound */
|
|
|
- case 12:
|
|
|
- return 2;
|
|
|
- /* PCI slot 1 to 4 */
|
|
|
- case 18 ... 21:
|
|
|
- return ((slot - 18) + irq_num) & 0x03;
|
|
|
- /* Unknown device, don't do any translation */
|
|
|
- default:
|
|
|
- return irq_num;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-static void gt64120_pci_set_irq(void *opaque, int irq_num, int level)
|
|
|
-{
|
|
|
- int i, pic_irq, pic_level;
|
|
|
- qemu_irq *pic = opaque;
|
|
|
- PCIBus *bus = pci_get_bus(piix4_dev);
|
|
|
-
|
|
|
- /* now we change the pic irq level according to the piix irq mappings */
|
|
|
- /* XXX: optimize */
|
|
|
- pic_irq = piix4_dev->config[PIIX_PIRQCA + irq_num];
|
|
|
- if (pic_irq < 16) {
|
|
|
- /* The pic level is the logical OR of all the PCI irqs mapped to it. */
|
|
|
- pic_level = 0;
|
|
|
- for (i = 0; i < 4; i++) {
|
|
|
- if (pic_irq == piix4_dev->config[PIIX_PIRQCA + i]) {
|
|
|
- pic_level |= pci_bus_get_irq_level(bus, i);
|
|
|
- }
|
|
|
- }
|
|
|
- qemu_set_irq(pic[pic_irq], pic_level);
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
static void gt64120_reset(DeviceState *dev)
|
|
|
{
|
|
|
GT64120State *s = GT64120_PCI_HOST_BRIDGE(dev);
|
|
@@ -1204,7 +1156,7 @@ static void gt64120_realize(DeviceState *dev, Error **errp)
|
|
|
"gt64120-isd", 0x1000);
|
|
|
}
|
|
|
|
|
|
-PCIBus *gt64120_register(qemu_irq *pic)
|
|
|
+PCIBus *gt64120_register(void)
|
|
|
{
|
|
|
GT64120State *d;
|
|
|
PCIHostState *phb;
|
|
@@ -1215,12 +1167,10 @@ PCIBus *gt64120_register(qemu_irq *pic)
|
|
|
phb = PCI_HOST_BRIDGE(dev);
|
|
|
memory_region_init(&d->pci0_mem, OBJECT(dev), "pci0-mem", 4 * GiB);
|
|
|
address_space_init(&d->pci0_mem_as, &d->pci0_mem, "pci0-mem");
|
|
|
- phb->bus = pci_register_root_bus(dev, "pci",
|
|
|
- gt64120_pci_set_irq, gt64120_pci_map_irq,
|
|
|
- pic,
|
|
|
- &d->pci0_mem,
|
|
|
- get_system_io(),
|
|
|
- PCI_DEVFN(18, 0), 4, TYPE_PCI_BUS);
|
|
|
+ phb->bus = pci_root_bus_new(dev, "pci",
|
|
|
+ &d->pci0_mem,
|
|
|
+ get_system_io(),
|
|
|
+ PCI_DEVFN(18, 0), TYPE_PCI_BUS);
|
|
|
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
|
|
|
|
|
|
pci_create_simple(phb->bus, PCI_DEVFN(0, 0), "gt64120_pci");
|