aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/fdc.c17
-rw-r--r--hw/fdc.h4
-rw-r--r--hw/isa-bus.c10
-rw-r--r--hw/isa.h4
-rw-r--r--hw/mips_malta.c4
-rw-r--r--hw/pc.c4
-rw-r--r--hw/pckbd.c8
-rw-r--r--hw/ppc_prep.c2
-rw-r--r--hw/sun4u.c4
9 files changed, 23 insertions, 34 deletions
diff --git a/hw/fdc.c b/hw/fdc.c
index db57710ce7..d761e62ad7 100644
--- a/hw/fdc.c
+++ b/hw/fdc.c
@@ -1871,14 +1871,14 @@ static void fdctrl_connect_drives(fdctrl_t *fdctrl, BlockDriverState **fds)
}
}
-fdctrl_t *fdctrl_init_isa(int isairq, int dma_chann,
- uint32_t io_base,
- BlockDriverState **fds)
+fdctrl_t *fdctrl_init_isa(BlockDriverState **fds)
{
fdctrl_t *fdctrl;
ISADevice *dev;
+ int isairq = 6;
+ int dma_chann = 2;
- dev = isa_create_simple("isa-fdc", io_base, 0, isairq, -1);
+ dev = isa_create_simple("isa-fdc", isairq, -1);
fdctrl = &(DO_UPCAST(fdctrl_isabus_t, busdev, dev)->state);
fdctrl->dma_chann = dma_chann;
@@ -1968,14 +1968,15 @@ static int isabus_fdc_init1(ISADevice *dev)
{
fdctrl_isabus_t *isa = DO_UPCAST(fdctrl_isabus_t, busdev, dev);
fdctrl_t *fdctrl = &isa->state;
+ int iobase = 0x3f0;
- register_ioport_read(isa->busdev.iobase[0] + 0x01, 5, 1,
+ register_ioport_read(iobase + 0x01, 5, 1,
&fdctrl_read_port, fdctrl);
- register_ioport_read(isa->busdev.iobase[0] + 0x07, 1, 1,
+ register_ioport_read(iobase + 0x07, 1, 1,
&fdctrl_read_port, fdctrl);
- register_ioport_write(isa->busdev.iobase[0] + 0x01, 5, 1,
+ register_ioport_write(iobase + 0x01, 5, 1,
&fdctrl_write_port, fdctrl);
- register_ioport_write(isa->busdev.iobase[0] + 0x07, 1, 1,
+ register_ioport_write(iobase + 0x07, 1, 1,
&fdctrl_write_port, fdctrl);
isa_init_irq(&isa->busdev, &fdctrl->irq);
diff --git a/hw/fdc.h b/hw/fdc.h
index 04d64ea961..1b81ec1dbb 100644
--- a/hw/fdc.h
+++ b/hw/fdc.h
@@ -3,9 +3,7 @@
typedef struct fdctrl_t fdctrl_t;
-fdctrl_t *fdctrl_init_isa(int isairq, int dma_chann,
- uint32_t io_base,
- BlockDriverState **fds);
+fdctrl_t *fdctrl_init_isa(BlockDriverState **fds);
fdctrl_t *fdctrl_init_sysbus(qemu_irq irq, int dma_chann,
target_phys_addr_t mmio_base,
BlockDriverState **fds);
diff --git a/hw/isa-bus.c b/hw/isa-bus.c
index 2843b5132c..fde066acc9 100644
--- a/hw/isa-bus.c
+++ b/hw/isa-bus.c
@@ -35,11 +35,6 @@ static struct BusInfo isa_bus_info = {
.name = "ISA",
.size = sizeof(ISABus),
.print_dev = isabus_dev_print,
- .props = (Property[]) {
- DEFINE_PROP_HEX32("iobase", ISADevice, iobase[0], -1),
- DEFINE_PROP_HEX32("iobase2", ISADevice, iobase[1], -1),
- DEFINE_PROP_END_OF_LIST(),
- }
};
ISABus *isa_bus_new(DeviceState *dev)
@@ -122,8 +117,7 @@ void isa_qdev_register(ISADeviceInfo *info)
qdev_register(&info->qdev);
}
-ISADevice *isa_create_simple(const char *name, uint32_t iobase, uint32_t iobase2,
- uint32_t irq, uint32 irq2)
+ISADevice *isa_create_simple(const char *name, uint32_t irq, uint32 irq2)
{
DeviceState *dev;
ISADevice *isa;
@@ -134,8 +128,6 @@ ISADevice *isa_create_simple(const char *name, uint32_t iobase, uint32_t iobase2
}
dev = qdev_create(&isabus->qbus, name);
isa = DO_UPCAST(ISADevice, qdev, dev);
- isa->iobase[0] = iobase;
- isa->iobase[1] = iobase2;
qdev_init(dev);
if (irq != -1) {
isa_connect_irq(isa, 0, irq);
diff --git a/hw/isa.h b/hw/isa.h
index d98acd5bc4..24c5c66ca5 100644
--- a/hw/isa.h
+++ b/hw/isa.h
@@ -12,7 +12,6 @@ typedef struct ISADeviceInfo ISADeviceInfo;
struct ISADevice {
DeviceState qdev;
- uint32_t iobase[2];
uint32_t isairq[2];
qemu_irq *irqs[2];
int nirqs;
@@ -30,8 +29,7 @@ void isa_connect_irq(ISADevice *dev, int devirq, int isairq);
qemu_irq isa_reserve_irq(int isairq);
void isa_init_irq(ISADevice *dev, qemu_irq *p);
void isa_qdev_register(ISADeviceInfo *info);
-ISADevice *isa_create_simple(const char *name, uint32_t iobase, uint32_t iobase2,
- uint32_t irq, uint32_t irq2);
+ISADevice *isa_create_simple(const char *name, uint32_t irq, uint32_t irq2);
extern target_phys_addr_t isa_mem_base;
diff --git a/hw/mips_malta.c b/hw/mips_malta.c
index bb6364b08a..3222e166e6 100644
--- a/hw/mips_malta.c
+++ b/hw/mips_malta.c
@@ -921,7 +921,7 @@ void mips_malta_init (ram_addr_t ram_size,
DMA_init(0);
/* Super I/O */
- isa_dev = isa_create_simple("i8042", 0x60, 0x64, 1, 12);
+ isa_dev = isa_create_simple("i8042", 1, 12);
rtc_state = rtc_init(0x70, isa_reserve_irq(8), 2000);
serial_init(0x3f8, isa_reserve_irq(4), 115200, serial_hds[0]);
@@ -932,7 +932,7 @@ void mips_malta_init (ram_addr_t ram_size,
dinfo = drive_get(IF_FLOPPY, 0, i);
fd[i] = dinfo ? dinfo->bdrv : NULL;
}
- floppy_controller = fdctrl_init_isa(6, 2, 0x3f0, fd);
+ floppy_controller = fdctrl_init_isa(fd);
/* Sound card */
#ifdef HAS_AUDIO
diff --git a/hw/pc.c b/hw/pc.c
index 872cb3ad5b..0219961348 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -1373,7 +1373,7 @@ static void pc_init1(ram_addr_t ram_size,
}
}
- isa_dev = isa_create_simple("i8042", 0x60, 0x64, 1, 12);
+ isa_dev = isa_create_simple("i8042", 1, 12);
DMA_init(0);
#ifdef HAS_AUDIO
audio_init(pci_enabled ? pci_bus : NULL, isa_irq);
@@ -1383,7 +1383,7 @@ static void pc_init1(ram_addr_t ram_size,
dinfo = drive_get(IF_FLOPPY, 0, i);
fd[i] = dinfo ? dinfo->bdrv : NULL;
}
- floppy_controller = fdctrl_init_isa(6, 2, 0x3f0, fd);
+ floppy_controller = fdctrl_init_isa(fd);
cmos_init(below_4g_mem_size, above_4g_mem_size, boot_device, hd);
diff --git a/hw/pckbd.c b/hw/pckbd.c
index 3f833202a2..b4b65a6604 100644
--- a/hw/pckbd.c
+++ b/hw/pckbd.c
@@ -455,10 +455,10 @@ static int i8042_initfn(ISADevice *dev)
kbd_reset(s);
register_savevm("pckbd", 0, 3, kbd_save, kbd_load, s);
- register_ioport_read(dev->iobase[0], 1, 1, kbd_read_data, s);
- register_ioport_write(dev->iobase[0], 1, 1, kbd_write_data, s);
- register_ioport_read(dev->iobase[1], 1, 1, kbd_read_status, s);
- register_ioport_write(dev->iobase[1], 1, 1, kbd_write_command, s);
+ register_ioport_read(0x60, 1, 1, kbd_read_data, s);
+ register_ioport_write(0x60, 1, 1, kbd_write_data, s);
+ register_ioport_read(0x64, 1, 1, kbd_read_status, s);
+ register_ioport_write(0x64, 1, 1, kbd_write_command, s);
s->kbd = ps2_kbd_init(kbd_update_kbd_irq, s);
s->mouse = ps2_mouse_init(kbd_update_aux_irq, s);
diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
index 8ba434d06d..927d4040ab 100644
--- a/hw/ppc_prep.c
+++ b/hw/ppc_prep.c
@@ -719,7 +719,7 @@ static void ppc_prep_init (ram_addr_t ram_size,
dinfo = drive_get(IF_FLOPPY, 0, i);
fd[i] = dinfo ? dinfo->bdrv : NULL;
}
- fdctrl_init_isa(6, 2, 0x3f0, fd);
+ fdctrl_init_isa(fd);
/* Register speaker port */
register_ioport_read(0x61, 1, 1, speaker_ioport_read, NULL);
diff --git a/hw/sun4u.c b/hw/sun4u.c
index 03855d34fb..b71df1f7e5 100644
--- a/hw/sun4u.c
+++ b/hw/sun4u.c
@@ -617,12 +617,12 @@ static void sun4uv_init(ram_addr_t RAM_size,
pci_cmd646_ide_init(pci_bus, hd, 1);
- isa_create_simple("i8042", 0x60, 0x64, 1, 12);
+ isa_create_simple("i8042", 1, 12);
for(i = 0; i < MAX_FD; i++) {
dinfo = drive_get(IF_FLOPPY, 0, i);
fd[i] = dinfo ? dinfo->bdrv : NULL;
}
- fdctrl_init_isa(6, 2, 0x3f0, fd);
+ fdctrl_init_isa(fd);
/* FIXME: wire up interrupts. */
nvram = m48t59_init(NULL/*8*/, 0, 0x0074, NVRAM_SIZE, 59);