}
}
-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;
{
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);
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);
.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)
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;
}
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);
struct ISADevice {
DeviceState qdev;
- uint32_t iobase[2];
uint32_t isairq[2];
qemu_irq *irqs[2];
int nirqs;
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;
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]);
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
}
}
- 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);
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);
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);
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);
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);