From 8c106233ab179deb6faa8914b6103d3e68431b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Canet?= Date: Fri, 16 Dec 2011 23:37:46 +0100 Subject: sh_pci: remove sysbus_init_mmio_cb2 usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The isa region is not exposed as a sysbus region because the iobr register contains its address and use it to remap dynamically the region. (Peter Maydell's idea) Reviewed-by: Peter Maydell Signed-off-by: BenoƮt Canet Signed-off-by: Anthony Liguori --- hw/sh_pci.c | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) (limited to 'hw/sh_pci.c') diff --git a/hw/sh_pci.c b/hw/sh_pci.c index 86f468e500..d4d028d811 100644 --- a/hw/sh_pci.c +++ b/hw/sh_pci.c @@ -110,29 +110,6 @@ static void sh_pci_set_irq(void *opaque, int irq_num, int level) qemu_set_irq(pic[irq_num], level); } -static void sh_pci_map(SysBusDevice *dev, target_phys_addr_t base) -{ - SHPCIState *s = FROM_SYSBUS(SHPCIState, dev); - - memory_region_add_subregion(get_system_memory(), - P4ADDR(base), - &s->memconfig_p4); - memory_region_add_subregion(get_system_memory(), - A7ADDR(base), - &s->memconfig_a7); - s->iobr = 0xfe240000; - memory_region_add_subregion(get_system_memory(), s->iobr, &s->isa); -} - -static void sh_pci_unmap(SysBusDevice *dev, target_phys_addr_t base) -{ - SHPCIState *s = FROM_SYSBUS(SHPCIState, dev); - - memory_region_del_subregion(get_system_memory(), &s->memconfig_p4); - memory_region_del_subregion(get_system_memory(), &s->memconfig_a7); - memory_region_del_subregion(get_system_memory(), &s->isa); -} - static int sh_pci_init_device(SysBusDevice *dev) { SHPCIState *s; @@ -153,9 +130,11 @@ static int sh_pci_init_device(SysBusDevice *dev) memory_region_init_alias(&s->memconfig_a7, "sh_pci.2", &s->memconfig_p4, 0, 0x224); isa_mmio_setup(&s->isa, 0x40000); - sysbus_init_mmio_cb2(dev, sh_pci_map, sh_pci_unmap); + sysbus_init_mmio(dev, &s->memconfig_p4); sysbus_init_mmio(dev, &s->memconfig_a7); - sysbus_init_mmio(dev, &s->isa); + s->iobr = 0xfe240000; + memory_region_add_subregion(get_system_memory(), s->iobr, &s->isa); + s->dev = pci_create_simple(s->bus, PCI_DEVFN(0, 0), "sh_pci_host"); return 0; } -- cgit v1.2.3