[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 4/6] fdc: Parametrize ISA base, IRQ and DMA
From: |
Hervé Poussineau |
Subject: |
[Qemu-ppc] [PATCH 4/6] fdc: Parametrize ISA base, IRQ and DMA |
Date: |
Sat, 17 Mar 2012 15:39:44 +0100 |
Keep the PC values as defaults but allow to override them for PReP.
Signed-off-by: Hervé Poussineau <address@hidden>
Cc: Markus Armbruster <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
hw/fdc.c | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/hw/fdc.c b/hw/fdc.c
index a0236b7..756d4ce 100644
--- a/hw/fdc.c
+++ b/hw/fdc.c
@@ -438,6 +438,9 @@ typedef struct FDCtrlSysBus {
typedef struct FDCtrlISABus {
ISADevice busdev;
+ uint32_t iobase;
+ uint32_t irq;
+ uint32_t dma;
struct FDCtrl state;
int32_t bootindexA;
int32_t bootindexB;
@@ -1971,17 +1974,14 @@ static int isabus_fdc_init1(ISADevice *dev)
{
FDCtrlISABus *isa = DO_UPCAST(FDCtrlISABus, busdev, dev);
FDCtrl *fdctrl = &isa->state;
- int iobase = 0x3f0;
- int isairq = 6;
- int dma_chann = 2;
int ret;
- isa_register_portio_list(dev, iobase, fdc_portio_list, fdctrl, "fdc");
+ isa_register_portio_list(dev, isa->iobase, fdc_portio_list, fdctrl, "fdc");
- isa_init_irq(&isa->busdev, &fdctrl->irq, isairq);
- fdctrl->dma_chann = dma_chann;
+ isa_init_irq(&isa->busdev, &fdctrl->irq, isa->irq);
+ fdctrl->dma_chann = isa->dma;
- qdev_set_legacy_instance_id(&dev->qdev, iobase, 2);
+ qdev_set_legacy_instance_id(&dev->qdev, isa->iobase, 2);
ret = fdctrl_init_common(fdctrl);
add_boot_device_path(isa->bootindexA, &dev->qdev, "/address@hidden");
@@ -2046,6 +2046,9 @@ static const VMStateDescription vmstate_isa_fdc ={
};
static Property isa_fdc_properties[] = {
+ DEFINE_PROP_HEX32("iobase", FDCtrlISABus, iobase, 0x3f0),
+ DEFINE_PROP_UINT32("irq", FDCtrlISABus, irq, 6),
+ DEFINE_PROP_UINT32("dma", FDCtrlISABus, dma, 2),
DEFINE_PROP_DRIVE("driveA", FDCtrlISABus, state.drives[0].bs),
DEFINE_PROP_DRIVE("driveB", FDCtrlISABus, state.drives[1].bs),
DEFINE_PROP_INT32("bootindexA", FDCtrlISABus, bootindexA, -1),
--
1.7.9.1
- [Qemu-ppc] [PATCH 1/6] i82378/i82374: do not create DMA controller twice, (continued)
[Qemu-ppc] [PATCH 3/6] isa: add isa_bus_from_device() method, Hervé Poussineau, 2012/03/17
[Qemu-ppc] [PATCH 2/6] prep: change default cpu to '7448', Hervé Poussineau, 2012/03/17
[Qemu-ppc] [PATCH 4/6] fdc: Parametrize ISA base, IRQ and DMA,
Hervé Poussineau <=
[Qemu-ppc] [PATCH 5/6] prep: add pc87312 Super I/O emulation, Hervé Poussineau, 2012/03/17
[Qemu-ppc] [PATCH 6/6] prep: use pc87312 Super I/O chip instead of collection of random ISA devices, Hervé Poussineau, 2012/03/17