sun4u: pass PCIDevice into pci_ebus_init() instead of PCIBus

In order to wire up the ebus PCI address spaces differently then we need
access to the underlying PCIDevice.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
This commit is contained in:
Mark Cave-Ayland 2017-09-04 18:41:01 +01:00
parent 2b48373979
commit e1030ca5ab

View File

@ -224,13 +224,11 @@ static void isa_irq_handler(void *opaque, int n, int level)
/* EBUS (Eight bit bus) bridge */ /* EBUS (Eight bit bus) bridge */
static ISABus * static ISABus *
pci_ebus_init(PCIBus *bus, int devfn, qemu_irq *irqs) pci_ebus_init(PCIDevice *pci_dev, qemu_irq *irqs)
{ {
qemu_irq *isa_irq; qemu_irq *isa_irq;
PCIDevice *pci_dev;
ISABus *isa_bus; ISABus *isa_bus;
pci_dev = pci_create_simple(bus, devfn, "ebus");
isa_bus = ISA_BUS(qdev_get_child_bus(DEVICE(pci_dev), "isa.0")); isa_bus = ISA_BUS(qdev_get_child_bus(DEVICE(pci_dev), "isa.0"));
isa_irq = qemu_allocate_irqs(isa_irq_handler, irqs, 16); isa_irq = qemu_allocate_irqs(isa_irq_handler, irqs, 16);
isa_bus_irqs(isa_bus, isa_irq); isa_bus_irqs(isa_bus, isa_irq);
@ -429,6 +427,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
unsigned int i; unsigned int i;
uint64_t initrd_addr, initrd_size, kernel_addr, kernel_size, kernel_entry; uint64_t initrd_addr, initrd_size, kernel_addr, kernel_size, kernel_entry;
PCIBus *pci_bus, *pci_bus2, *pci_bus3; PCIBus *pci_bus, *pci_bus2, *pci_bus3;
PCIDevice *ebus;
ISABus *isa_bus; ISABus *isa_bus;
SysBusDevice *s; SysBusDevice *s;
qemu_irq *ivec_irqs, *pbm_irqs; qemu_irq *ivec_irqs, *pbm_irqs;
@ -452,7 +451,8 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
pci_vga_init(pci_bus); pci_vga_init(pci_bus);
// XXX Should be pci_bus3 // XXX Should be pci_bus3
isa_bus = pci_ebus_init(pci_bus, -1, pbm_irqs); ebus = pci_create_simple(pci_bus, -1, "ebus");
isa_bus = pci_ebus_init(ebus, pbm_irqs);
i = 0; i = 0;
if (hwdef->console_serial_base) { if (hwdef->console_serial_base) {