[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 08/12] fdc: Parametrize ISA base, IRQ and DMA
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH v4 08/12] fdc: Parametrize ISA base, IRQ and DMA |
Date: |
Wed, 8 Jun 2011 20:55:15 +0200 |
From: Hervé Poussineau <address@hidden>
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 | 27 +++++++++++++++------------
1 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/hw/fdc.c b/hw/fdc.c
index edf0360..f4e3e0d 100644
--- a/hw/fdc.c
+++ b/hw/fdc.c
@@ -425,6 +425,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;
@@ -1895,26 +1898,23 @@ 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;
- register_ioport_read(iobase + 0x01, 5, 1,
+ register_ioport_read(isa->iobase + 0x01, 5, 1,
&fdctrl_read_port, fdctrl);
- register_ioport_read(iobase + 0x07, 1, 1,
+ register_ioport_read(isa->iobase + 0x07, 1, 1,
&fdctrl_read_port, fdctrl);
- register_ioport_write(iobase + 0x01, 5, 1,
+ register_ioport_write(isa->iobase + 0x01, 5, 1,
&fdctrl_write_port, fdctrl);
- register_ioport_write(iobase + 0x07, 1, 1,
+ register_ioport_write(isa->iobase + 0x07, 1, 1,
&fdctrl_write_port, fdctrl);
- isa_init_ioport_range(dev, iobase, 6);
- isa_init_ioport(dev, iobase + 7);
+ isa_init_ioport_range(dev, isa->iobase, 6);
+ isa_init_ioport(dev, isa->iobase + 7);
- 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");
@@ -1979,6 +1979,9 @@ static ISADeviceInfo isa_fdc_info = {
.qdev.vmsd = &vmstate_isa_fdc,
.qdev.reset = fdctrl_external_reset_isa,
.qdev.props = (Property[]) {
+ 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.5.3
- Re: [Qemu-devel] [RFC v2 00/10] ISA reconfigurability v2, (continued)
- Re: [Qemu-devel] [RFC v2 00/10] ISA reconfigurability v2, Andreas Färber, 2011/06/07
- Re: [Qemu-devel] [RFC v2 00/10] ISA reconfigurability v2, Gerd Hoffmann, 2011/06/08
- [Qemu-devel] [RFC v4 00/12] ISA reconfigurability v4, Andreas Färber, 2011/06/08
- [Qemu-devel] [PATCH v4 01/12] qdev: Add support for property type bool, Andreas Färber, 2011/06/08
- [Qemu-devel] [PATCH v4 02/12] qdev: Add helpers for reading properties, Andreas Färber, 2011/06/08
- [Qemu-devel] [RFC v4 03/12] isa: Provide set_state callback, Andreas Färber, 2011/06/08
- [Qemu-devel] [RFC v4 04/12] isa: Allow to un-assign I/O ports, Andreas Färber, 2011/06/08
- [Qemu-devel] [RFC v4 05/12] isa: Allow to un-associate an IRQ, Andreas Färber, 2011/06/08
- [Qemu-devel] [RFC v4 06/12] parallel: Implement ISA set_state callback, Andreas Färber, 2011/06/08
- [Qemu-devel] [RFC v4 07/12] serial: Implement ISA set_state() callback, Andreas Färber, 2011/06/08
- [Qemu-devel] [PATCH v4 08/12] fdc: Parametrize ISA base, IRQ and DMA,
Andreas Färber <=
- [Qemu-devel] [RFC v4 09/12] fdc: Implement ISA set_state() callback, Andreas Färber, 2011/06/08
- [Qemu-devel] [RFC v4 10/12] ide: Allow to discard I/O ports, Andreas Färber, 2011/06/08
- [Qemu-devel] [RFC v4 11/12] ide: Implement ISA set_state() callback, Andreas Färber, 2011/06/08
- [Qemu-devel] [RFC v4 12/12] prep: Add pc87312 Super I/O emulation, Andreas Färber, 2011/06/08
- Re: [Qemu-devel] [RFC v4 09/12] fdc: Implement ISA set_state() callback, Gerd Hoffmann, 2011/06/09
- Re: [Qemu-devel] [RFC v4 09/12] fdc: Implement ISA set_state() callback, Andreas Färber, 2011/06/09
- Re: [Qemu-devel] [RFC v4 07/12] serial: Implement ISA set_state() callback, Markus Armbruster, 2011/06/09
- Re: [Qemu-devel] [RFC v4 07/12] serial: Implement ISA set_state() callback, Andreas Färber, 2011/06/09
- Re: [Qemu-devel] [RFC v4 05/12] isa: Allow to un-associate an IRQ, Markus Armbruster, 2011/06/09
- Re: [Qemu-devel] [RFC v4 05/12] isa: Allow to un-associate an IRQ, Markus Armbruster, 2011/06/09