hw/isa/vt82c686: Add the TYPE_VT82C686B_SUPERIO

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20180308223946.26784-20-f4bug@amsat.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Philippe Mathieu-Daudé 2018-03-08 23:39:40 +01:00 committed by Paolo Bonzini
parent 728d891003
commit 98cf824b5f
3 changed files with 25 additions and 12 deletions

View File

@ -17,6 +17,7 @@
#include "hw/i2c/smbus.h" #include "hw/i2c/smbus.h"
#include "hw/pci/pci.h" #include "hw/pci/pci.h"
#include "hw/isa/isa.h" #include "hw/isa/isa.h"
#include "hw/isa/superio.h"
#include "hw/sysbus.h" #include "hw/sysbus.h"
#include "hw/mips/mips.h" #include "hw/mips/mips.h"
#include "hw/isa/apm.h" #include "hw/isa/apm.h"
@ -519,11 +520,30 @@ static const TypeInfo via_info = {
}, },
}; };
static void vt82c686b_superio_class_init(ObjectClass *klass, void *data)
{
ISASuperIOClass *sc = ISA_SUPERIO_CLASS(klass);
sc->serial.count = 2;
sc->parallel.count = 1;
sc->ide.count = 0;
sc->floppy.count = 1;
}
static const TypeInfo via_superio_info = {
.name = TYPE_VT82C686B_SUPERIO,
.parent = TYPE_ISA_SUPERIO,
.instance_size = sizeof(ISASuperIODevice),
.class_size = sizeof(ISASuperIOClass),
.class_init = vt82c686b_superio_class_init,
};
static void vt82c686b_register_types(void) static void vt82c686b_register_types(void)
{ {
type_register_static(&via_ac97_info); type_register_static(&via_ac97_info);
type_register_static(&via_mc97_info); type_register_static(&via_mc97_info);
type_register_static(&via_pm_info); type_register_static(&via_pm_info);
type_register_static(&via_superio_info);
type_register_static(&via_info); type_register_static(&via_info);
} }

View File

@ -23,9 +23,7 @@
#include "hw/hw.h" #include "hw/hw.h"
#include "hw/i386/pc.h" #include "hw/i386/pc.h"
#include "hw/dma/i8257.h" #include "hw/dma/i8257.h"
#include "hw/char/serial.h" #include "hw/isa/superio.h"
#include "hw/char/parallel.h"
#include "hw/block/fdc.h"
#include "net/net.h" #include "net/net.h"
#include "hw/boards.h" #include "hw/boards.h"
#include "hw/i2c/smbus.h" #include "hw/i2c/smbus.h"
@ -33,7 +31,6 @@
#include "hw/mips/mips.h" #include "hw/mips/mips.h"
#include "hw/mips/cpudevs.h" #include "hw/mips/cpudevs.h"
#include "hw/pci/pci.h" #include "hw/pci/pci.h"
#include "sysemu/sysemu.h"
#include "audio/audio.h" #include "audio/audio.h"
#include "qemu/log.h" #include "qemu/log.h"
#include "hw/loader.h" #include "hw/loader.h"
@ -43,8 +40,6 @@
#include "hw/isa/vt82c686.h" #include "hw/isa/vt82c686.h"
#include "hw/timer/mc146818rtc.h" #include "hw/timer/mc146818rtc.h"
#include "hw/timer/i8254.h" #include "hw/timer/i8254.h"
#include "hw/input/i8042.h"
#include "sysemu/blockdev.h"
#include "exec/address-spaces.h" #include "exec/address-spaces.h"
#include "sysemu/qtest.h" #include "sysemu/qtest.h"
#include "qemu/error-report.h" #include "qemu/error-report.h"
@ -249,6 +244,8 @@ static void vt82c686b_southbridge_init(PCIBus *pci_bus, int slot, qemu_irq intc,
/* init other devices */ /* init other devices */
i8254_pit_init(isa_bus, 0x40, 0, NULL); i8254_pit_init(isa_bus, 0x40, 0, NULL);
i8257_dma_init(isa_bus, 0); i8257_dma_init(isa_bus, 0);
/* Super I/O */
isa_create_simple(isa_bus, TYPE_VT82C686B_SUPERIO);
ide_drive_get(hd, ARRAY_SIZE(hd)); ide_drive_get(hd, ARRAY_SIZE(hd));
vt82c686b_ide_init(pci_bus, hd, PCI_DEVFN(slot, 1)); vt82c686b_ide_init(pci_bus, hd, PCI_DEVFN(slot, 1));
@ -261,12 +258,6 @@ static void vt82c686b_southbridge_init(PCIBus *pci_bus, int slot, qemu_irq intc,
/* Audio support */ /* Audio support */
vt82c686b_ac97_init(pci_bus, PCI_DEVFN(slot, 5)); vt82c686b_ac97_init(pci_bus, PCI_DEVFN(slot, 5));
vt82c686b_mc97_init(pci_bus, PCI_DEVFN(slot, 6)); vt82c686b_mc97_init(pci_bus, PCI_DEVFN(slot, 6));
/* Super I/O */
isa_create_simple(isa_bus, TYPE_I8042);
serial_hds_isa_init(isa_bus, 0, MAX_SERIAL_PORTS);
parallel_hds_isa_init(isa_bus, 1);
} }
/* Network support */ /* Network support */

View File

@ -1,6 +1,8 @@
#ifndef HW_VT82C686_H #ifndef HW_VT82C686_H
#define HW_VT82C686_H #define HW_VT82C686_H
#define TYPE_VT82C686B_SUPERIO "vt82c686b-superio"
/* vt82c686.c */ /* vt82c686.c */
ISABus *vt82c686b_isa_init(PCIBus * bus, int devfn); ISABus *vt82c686b_isa_init(PCIBus * bus, int devfn);
void vt82c686b_ac97_init(PCIBus *bus, int devfn); void vt82c686b_ac97_init(PCIBus *bus, int devfn);