qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC 20/23] 40p: Add the Super I/O chip (pc87312)


From: Andreas Färber
Subject: [Qemu-devel] [RFC 20/23] 40p: Add the Super I/O chip (pc87312)
Date: Tue, 14 Jun 2011 04:37:54 +0200

Signed-off-by: Hervé Poussineau <address@hidden>

Set the floppy properties with raw qdev_prop_set() for now because
qdev_prop_set_drive() also calls bdrv_attach(), which can't be called
twice for a drive. Having it attached to the isa-fdc seems nicer.

Signed-off-by: Andreas Färber <address@hidden>

prep: Manually set floppy properties
---
 hw/ppc_prep.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
index 27e1d14..935d1e9 100644
--- a/hw/ppc_prep.c
+++ b/hw/ppc_prep.c
@@ -779,6 +779,8 @@ static void ibm_40p_init(ram_addr_t ram_size,
     DeviceState *dev;
     PCIBus *pci_bus;
     PCIDevice *pci;
+    ISADevice *isa;
+    DriveInfo *drive;
 
     // IBM E15 graphic adapter (S3 Vision864)
     // PowerPC 601
@@ -831,6 +833,21 @@ static void ibm_40p_init(ram_addr_t ram_size,
     cpu_exit_irq = qemu_allocate_irqs(cpu_request_exit, NULL, 1);
     qdev_connect_gpio_out(&pci->qdev, 0, env->irq_inputs[PPC6xx_INPUT_INT]);
     qdev_connect_gpio_out(&pci->qdev, 1, *cpu_exit_irq);
+
+    /* Super I/O (parallel + serial ports) */
+    isa = isa_create("isa-pc87312");
+    qdev_prop_set_chr(&isa->qdev, "parallel", parallel_hds[0]);
+    qdev_prop_set_chr(&isa->qdev, "uart1", serial_hds[0]);
+    qdev_prop_set_chr(&isa->qdev, "uart2", serial_hds[1]);
+    drive = drive_get(IF_FLOPPY, 0, 0);
+    if (drive) {
+        qdev_prop_set(&isa->qdev, "floppyA", drive->bdrv, PROP_TYPE_DRIVE);
+    }
+    drive = drive_get(IF_FLOPPY, 0, 1);
+    if (drive) {
+        qdev_prop_set(&isa->qdev, "floppyB", drive->bdrv, PROP_TYPE_DRIVE);
+    }
+    qdev_init_nofail(&isa->qdev);
 }
 
 static QEMUMachine prep_machine = {
-- 
1.7.5.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]