[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 19/56] hw/isa: extract FDC37M81X to a separate file
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 19/56] hw/isa: extract FDC37M81X to a separate file |
Date: |
Thu, 15 Feb 2024 18:57:13 +0100 |
From: Paolo Bonzini <pbonzini@redhat.com>
isa-superio.c currently defines a SuperIO chip that is not used
by any other user of the file. Extract the chip to a separate file.
Reviewed-by: Bernhard Beschow <shentey@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-ID: <20240213155005.109954-7-pbonzini@redhat.com>
[PMD: Update MAINTAINERS]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
MAINTAINERS | 1 +
hw/isa/fdc37m81x-superio.c | 32 ++++++++++++++++++++++++++++++++
hw/isa/isa-superio.c | 18 ------------------
hw/isa/Kconfig | 4 ++++
hw/isa/meson.build | 1 +
hw/mips/Kconfig | 2 +-
6 files changed, 39 insertions(+), 19 deletions(-)
create mode 100644 hw/isa/fdc37m81x-superio.c
diff --git a/MAINTAINERS b/MAINTAINERS
index a24c2b51b6..8920ba403d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1357,6 +1357,7 @@ M: Philippe Mathieu-Daudé <philmd@linaro.org>
R: Aurelien Jarno <aurelien@aurel32.net>
S: Odd Fixes
F: hw/isa/piix.c
+F: hw/isa/fdc37m81x-superio.c
F: hw/acpi/piix4.c
F: hw/mips/malta.c
F: hw/pci-host/gt64120.c
diff --git a/hw/isa/fdc37m81x-superio.c b/hw/isa/fdc37m81x-superio.c
new file mode 100644
index 0000000000..55e91fbca1
--- /dev/null
+++ b/hw/isa/fdc37m81x-superio.c
@@ -0,0 +1,32 @@
+/*
+ * SMS FDC37M817 Super I/O
+ *
+ * Copyright (c) 2018 Philippe Mathieu-Daudé
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "hw/isa/superio.h"
+
+static void fdc37m81x_class_init(ObjectClass *klass, void *data)
+{
+ ISASuperIOClass *sc = ISA_SUPERIO_CLASS(klass);
+
+ sc->serial.count = 2; /* NS16C550A */
+ sc->parallel.count = 1;
+ sc->floppy.count = 1; /* SMSC 82077AA Compatible */
+ sc->ide.count = 0;
+}
+
+static const TypeInfo types[] = {
+ {
+ .name = TYPE_FDC37M81X_SUPERIO,
+ .parent = TYPE_ISA_SUPERIO,
+ .class_init = fdc37m81x_class_init,
+ },
+};
+
+DEFINE_TYPES(types)
diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c
index d85f22db1a..ad9cd129af 100644
--- a/hw/isa/isa-superio.c
+++ b/hw/isa/isa-superio.c
@@ -188,27 +188,9 @@ static const TypeInfo isa_superio_type_info = {
.instance_size = sizeof(ISASuperIODevice),
};
-/* SMS FDC37M817 Super I/O */
-static void fdc37m81x_class_init(ObjectClass *klass, void *data)
-{
- ISASuperIOClass *sc = ISA_SUPERIO_CLASS(klass);
-
- sc->serial.count = 2; /* NS16C550A */
- sc->parallel.count = 1;
- sc->floppy.count = 1; /* SMSC 82077AA Compatible */
- sc->ide.count = 0;
-}
-
-static const TypeInfo fdc37m81x_type_info = {
- .name = TYPE_FDC37M81X_SUPERIO,
- .parent = TYPE_ISA_SUPERIO,
- .class_init = fdc37m81x_class_init,
-};
-
static void isa_superio_register_types(void)
{
type_register_static(&isa_superio_type_info);
- type_register_static(&fdc37m81x_type_info);
}
type_init(isa_superio_register_types)
diff --git a/hw/isa/Kconfig b/hw/isa/Kconfig
index 5df3c09cd5..73c6470805 100644
--- a/hw/isa/Kconfig
+++ b/hw/isa/Kconfig
@@ -23,6 +23,10 @@ config ISA_SUPERIO
# Some users of ISA_SUPERIO do not use it
#select IDE_ISA
+config FDC37M81X
+ bool
+ select ISA_SUPERIO
+
config PC87312
bool
select ISA_SUPERIO
diff --git a/hw/isa/meson.build b/hw/isa/meson.build
index 2ab99ce0c6..f650b39507 100644
--- a/hw/isa/meson.build
+++ b/hw/isa/meson.build
@@ -4,6 +4,7 @@ system_ss.add(when: 'CONFIG_ISA_BUS', if_true:
files('isa-bus.c'))
system_ss.add(when: 'CONFIG_ISA_SUPERIO', if_true: files('isa-superio.c'))
system_ss.add(when: 'CONFIG_PC87312', if_true: files('pc87312.c'))
system_ss.add(when: 'CONFIG_PIIX', if_true: files('piix.c'))
+system_ss.add(when: 'CONFIG_FDC37M81X', if_true: files('fdc37m81x-superio.c'))
system_ss.add(when: 'CONFIG_SMC37C669', if_true: files('smc37c669-superio.c'))
system_ss.add(when: 'CONFIG_VT82C686', if_true: files('vt82c686.c'))
diff --git a/hw/mips/Kconfig b/hw/mips/Kconfig
index afcfb2b8ec..e57db4f641 100644
--- a/hw/mips/Kconfig
+++ b/hw/mips/Kconfig
@@ -1,7 +1,7 @@
config MALTA
bool
+ select FDC37M81X
select GT64120
- select ISA_SUPERIO
select PIIX
config MIPSSIM
--
2.41.0
- [PULL 09/56] hw/misc/mips_itu: Remove MIPSITUState::saar field, (continued)
- [PULL 09/56] hw/misc/mips_itu: Remove MIPSITUState::saar field, Philippe Mathieu-Daudé, 2024/02/15
- [PULL 10/56] target/mips: Remove unused mips_def_t::SAARP field, Philippe Mathieu-Daudé, 2024/02/15
- [PULL 11/56] target/mips: Remove CPUMIPSState::CP0_SAAR[2] field, Philippe Mathieu-Daudé, 2024/02/15
- [PULL 12/56] target/mips: Remove helpers accessing SAARI register, Philippe Mathieu-Daudé, 2024/02/15
- [PULL 13/56] target/mips: Remove CPUMIPSState::CP0_SAARI field, Philippe Mathieu-Daudé, 2024/02/15
- [PULL 14/56] target/mips: Remove the unused DisasContext::saar field, Philippe Mathieu-Daudé, 2024/02/15
- [PULL 15/56] hw/isa: clean up Kconfig selections for ISA_SUPERIO, Philippe Mathieu-Daudé, 2024/02/15
- [PULL 17/56] hw/isa: fix ISA_SUPERIO dependencies, Philippe Mathieu-Daudé, 2024/02/15
- [PULL 16/56] hw/mips/Kconfig: Remove ISA dependencies from MIPSsim board, Philippe Mathieu-Daudé, 2024/02/15
- [PULL 18/56] hw/isa: specify instance_size in isa_superio_type_info, Philippe Mathieu-Daudé, 2024/02/15
- [PULL 19/56] hw/isa: extract FDC37M81X to a separate file,
Philippe Mathieu-Daudé <=
- [PULL 20/56] hw/rx/rx62n: Reduce inclusion of 'qemu/units.h', Philippe Mathieu-Daudé, 2024/02/15
- [PULL 21/56] hw/rx/rx62n: Only call qdev_get_gpio_in() when necessary, Philippe Mathieu-Daudé, 2024/02/15
- [PULL 22/56] hw/i386/q35: Realize LPC PCI function before accessing it, Philippe Mathieu-Daudé, 2024/02/15
- [PULL 23/56] hw/ppc/prep: Realize ISA bridge before accessing it, Philippe Mathieu-Daudé, 2024/02/15
- [PULL 24/56] hw/misc/macio: Realize IDE controller before accessing it, Philippe Mathieu-Daudé, 2024/02/15
- [PULL 25/56] hw/sh4/r2d: Realize IDE controller before accessing it, Philippe Mathieu-Daudé, 2024/02/15
- [PULL 26/56] hw/dma: Pass parent object to i8257_dma_init(), Philippe Mathieu-Daudé, 2024/02/15
- [PULL 28/56] hw/sparc64/cpu: Initialize GPIO before realizing CPU devices, Philippe Mathieu-Daudé, 2024/02/15
- [PULL 27/56] hw/sparc/sun4m: Realize DMA controller before accessing it, Philippe Mathieu-Daudé, 2024/02/15
- [PULL 29/56] target/sparc: Provide hint about CPUSPARCState::irq_manager member, Philippe Mathieu-Daudé, 2024/02/15