diff mbox

[3/8] sun4u: expose fw_cfg and NVRAM on ebus PCI IO address space

Message ID 1499810007-28613-4-git-send-email-mark.cave-ayland@ilande.co.uk
State New
Headers show

Commit Message

Mark Cave-Ayland July 11, 2017, 9:53 p.m. UTC
To allow future changes to the sun4u PCI topology.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-By: Artyom Tarasenko <atar4qemu@gmail.com>
---
 hw/sparc64/sun4u.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index 8932be9..4f96d97 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -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);