Commit 07c84741 authored by Mark Cave-Ayland's avatar Mark Cave-Ayland
Browse files

sun4u: expose fw_cfg and NVRAM on ebus PCI IO address space



To allow future changes to the sun4u PCI topology.

Signed-off-by: default avatarMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
Acked-By: default avatarArtyom Tarasenko <atar4qemu@gmail.com>
parent d6acc8a5
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -450,7 +450,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
                           &pci_bus3, &pbm_irqs);
    pci_vga_init(pci_bus);

    // XXX Should be pci_bus3
    /* XXX Should be pci_bus3 */
    ebus = pci_create_simple(pci_bus, -1, "ebus");
    isa_bus = pci_ebus_init(ebus, pbm_irqs);

@@ -492,7 +492,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
    /* Map NVRAM into I/O (ebus) space */
    nvram = m48t59_init(NULL, 0, 0, NVRAM_SIZE, 1968, 59);
    s = SYS_BUS_DEVICE(nvram);
    memory_region_add_subregion(get_system_io(), 0x2000,
    memory_region_add_subregion(pci_address_space_io(ebus), 0x2000,
                                sysbus_mmio_get_region(s, 0));
 
    initrd_size = 0;
@@ -514,10 +514,9 @@ static void sun4uv_init(MemoryRegion *address_space_mem,

    dev = qdev_create(NULL, TYPE_FW_CFG_IO);
    qdev_prop_set_bit(dev, "dma_enabled", false);
    object_property_add_child(OBJECT(qdev_get_machine()), TYPE_FW_CFG,
                              OBJECT(dev), NULL);
    object_property_add_child(OBJECT(ebus), TYPE_FW_CFG, OBJECT(dev), NULL);
    qdev_init_nofail(dev);
    memory_region_add_subregion(get_system_io(), BIOS_CFG_IOPORT,
    memory_region_add_subregion(pci_address_space_io(ebus), BIOS_CFG_IOPORT,
                                &FW_CFG_IO(dev)->comb_iomem);

    fw_cfg = FW_CFG(dev);