summary refs log tree commit diff stats
path: root/hw/ppc
diff options
context:
space:
mode:
authorBernhard Beschow <shentey@gmail.com>2022-06-13 19:24:55 +0200
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2022-10-31 11:32:07 +0100
commit9eb6abbf6aea3116b3a4a7a6fbbb89ec836c0551 (patch)
tree7325a82d31cfb1135f5b6b0b58ce3083948ce0b4 /hw/ppc
parent4b8fd0661a6c57f6a94b55e462626d522fa9c5cc (diff)
downloadfocaccia-qemu-9eb6abbf6aea3116b3a4a7a6fbbb89ec836c0551.tar.gz
focaccia-qemu-9eb6abbf6aea3116b3a4a7a6fbbb89ec836c0551.zip
hw/isa/vt82c686: Instantiate IDE function in host device
The IDE function is closely tied to the ISA function (e.g. the IDE
interrupt routing happens there), so it makes sense that the IDE
function is instantiated within the south bridge itself.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20220901114127.53914-7-shentey@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'hw/ppc')
-rw-r--r--hw/ppc/Kconfig1
-rw-r--r--hw/ppc/pegasos2.c9
2 files changed, 4 insertions, 6 deletions
diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig
index 791fe78a50..76a4612d96 100644
--- a/hw/ppc/Kconfig
+++ b/hw/ppc/Kconfig
@@ -74,7 +74,6 @@ config PEGASOS2
     imply ATI_VGA
     select MV64361
     select VT82C686
-    select IDE_VIA
     select SMBUS_EEPROM
     select VOF
 # This should come with VT82C686
diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c
index 506f273b93..dcb66428dc 100644
--- a/hw/ppc/pegasos2.c
+++ b/hw/ppc/pegasos2.c
@@ -102,7 +102,7 @@ static void pegasos2_init(MachineState *machine)
     CPUPPCState *env;
     MemoryRegion *rom = g_new(MemoryRegion, 1);
     PCIBus *pci_bus;
-    PCIDevice *dev;
+    PCIDevice *dev, *via;
     I2CBus *i2c_bus;
     const char *fwname = machine->firmware ?: PROM_FILENAME;
     char *filename;
@@ -160,13 +160,12 @@ static void pegasos2_init(MachineState *machine)
 
     /* VIA VT8231 South Bridge (multifunction PCI device) */
     /* VT8231 function 0: PCI-to-ISA Bridge */
-    dev = pci_create_simple_multifunction(pci_bus, PCI_DEVFN(12, 0), true,
+    via = pci_create_simple_multifunction(pci_bus, PCI_DEVFN(12, 0), true,
                                           TYPE_VT8231_ISA);
-    qdev_connect_gpio_out(DEVICE(dev), 0,
+    qdev_connect_gpio_out(DEVICE(via), 0,
                           qdev_get_gpio_in_named(pm->mv, "gpp", 31));
 
-    /* VT8231 function 1: IDE Controller */
-    dev = pci_create_simple(pci_bus, PCI_DEVFN(12, 1), TYPE_VIA_IDE);
+    dev = PCI_DEVICE(object_resolve_path_component(OBJECT(via), "ide"));
     pci_ide_create_devs(dev);
 
     /* VT8231 function 2-3: USB Ports */