All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO
@ 2018-03-05 21:19 Philippe Mathieu-Daudé
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 01/22] hw/isa: Move parallel_hds_isa_init() to hw/char/parallel-isa.c Philippe Mathieu-Daudé
                   ` (23 more replies)
  0 siblings, 24 replies; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-05 21:19 UTC (permalink / raw)
  To: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao

Since v1:
- complete rewrite, split out the PIIX devices for another series

In this rewrite I extract the common SuperIO code from pc87312.c; use it in
few MIPS boards; then as example, easily add a new SuperIO chipset (SMC37C669)
to the dp264 machine.

More devices are being converted but I'm running out of time for the soft
freeze (mips_r4k, hppa_dino, and the PC ones).

This series could be the 'part 2' of my previous "remove i386/pc dependency
from non-PC world" I started around 2.9.

Philippe Mathieu-Daudé (22):
  hw/isa: Move parallel_hds_isa_init() to hw/char/parallel-isa.c
  hw/dma/i8257: Rename DMA_init() to i8257_dma_init()
  hw/input/i8042: Extract declarations from i386/pc.h into input/i8042.h
  hw/isa/pc87312: Rename the device type as TYPE_PC87312_SUPERIO
  hw/isa/pc87312: Use uint16_t for the ISA I/O base address
  hw/isa/pc87312: Use 'unsigned int' for the irq value
  hw/isa/superio: Add a Super I/O template based on the PC87312 device
  hw/isa/pc87312: Inherit from the abstract TYPE_ISA_SUPERIO
  hw/isa/superio: Factor out the parallel code from pc87312.c
  hw/isa/superio: Factor out the serial code from pc87312.c
  hw/isa/superio: Factor out the floppy disc controller code from pc87312.c
  hw/isa/superio: Add a keyboard/mouse controller (8042)
  hw/isa/superio: Factor out the IDE code from pc87312.c
  hw/mips/malta: Code movement
  hw/isa/superio: Factor out the FDC37M817 Super I/O from mips_malta.c
  hw/mips/mips_fulong2e: Factor out vt82c686b_southbridge_init()
  hw/isa/vt82c686: Rename vt82c686b_init() -> vt82c686b_isa_init()
  hw/isa/vt82c686: Add the TYPE_VT82C686B_SUPERIO
  hw/isa/superio: Add the SMC FDC37C669 Super I/O
  hw/alpha/dp264: Add the ISA DMA controller
  hw/alpha/dp264: Use the TYPE_SMC37C669_SUPERIO
  hw/i386/pc: Factor out the superio code

 default-configs/alpha-softmmu.mak |   5 +
 include/hw/char/parallel.h        |  14 +++
 include/hw/{isa => dma}/i8257.h   |   6 ++
 include/hw/i386/pc.h              |  17 ---
 include/hw/input/i8042.h          |  24 +++++
 include/hw/isa/isa.h              |   2 -
 include/hw/isa/pc87312.h          |  24 ++---
 include/hw/isa/superio.h          |  60 +++++++++++
 include/hw/isa/vt82c686.h         |   4 +-
 hw/alpha/dp264.c                  |  13 ++-
 hw/char/parallel-isa.c            |  36 +++++++
 hw/char/parallel.c                |   2 +-
 hw/dma/i82374.c                   |   3 +-
 hw/dma/i8257.c                    |   4 +-
 hw/i386/pc.c                      |  77 ++++++++------
 hw/i386/vmmouse.c                 |   1 +
 hw/i386/vmport.c                  |   1 +
 hw/input/pckbd.c                  |   2 +-
 hw/isa/isa-bus.c                  |  26 -----
 hw/isa/isa-superio.c              | 210 ++++++++++++++++++++++++++++++++++++++
 hw/isa/pc87312.c                  | 178 ++++++++++++++------------------
 hw/isa/smc37c669-superio.c        | 115 +++++++++++++++++++++
 hw/isa/vt82c686.c                 |  22 +++-
 hw/mips/mips_fulong2e.c           |  85 +++++++--------
 hw/mips/mips_jazz.c               |   5 +-
 hw/mips/mips_malta.c              |  48 ++++-----
 hw/mips/mips_r4k.c                |   3 +-
 hw/ppc/prep.c                     |   6 +-
 hw/sparc/sun4m.c                  |   4 -
 hw/sparc64/sun4u.c                |   6 +-
 hw/unicore32/puv3.c               |   1 +
 hw/char/Makefile.objs             |   1 +
 hw/isa/Makefile.objs              |   1 +
 hw/isa/trace-events               |  10 +-
 MAINTAINERS                       |   6 +-
 35 files changed, 721 insertions(+), 301 deletions(-)
 create mode 100644 include/hw/char/parallel.h
 rename include/hw/{isa => dma}/i8257.h (86%)
 create mode 100644 include/hw/input/i8042.h
 create mode 100644 include/hw/isa/superio.h
 create mode 100644 hw/char/parallel-isa.c
 create mode 100644 hw/isa/isa-superio.c
 create mode 100644 hw/isa/smc37c669-superio.c

-- 
2.16.2

^ permalink raw reply	[flat|nested] 35+ messages in thread

* [Qemu-devel] [RFC PATCH v2 01/22] hw/isa: Move parallel_hds_isa_init() to hw/char/parallel-isa.c
  2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
@ 2018-03-05 21:19 ` Philippe Mathieu-Daudé
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 02/22] hw/dma/i8257: Rename DMA_init() to i8257_dma_init() Philippe Mathieu-Daudé
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-05 21:19 UTC (permalink / raw)
  To: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao

Again... (after 07dc788054d7 and 9157eee1b1c0).

We now extract the ISA bus specific helpers.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/char/parallel.h | 14 ++++++++++++++
 include/hw/i386/pc.h       |  8 --------
 hw/char/parallel-isa.c     | 36 ++++++++++++++++++++++++++++++++++++
 hw/char/parallel.c         |  2 +-
 hw/i386/pc.c               |  1 +
 hw/isa/isa-bus.c           | 26 --------------------------
 hw/mips/mips_fulong2e.c    |  1 +
 hw/mips/mips_jazz.c        |  1 +
 hw/mips/mips_malta.c       |  1 +
 hw/sparc64/sun4u.c         |  1 +
 MAINTAINERS                |  3 ++-
 hw/char/Makefile.objs      |  1 +
 12 files changed, 59 insertions(+), 36 deletions(-)
 create mode 100644 include/hw/char/parallel.h
 create mode 100644 hw/char/parallel-isa.c

diff --git a/include/hw/char/parallel.h b/include/hw/char/parallel.h
new file mode 100644
index 0000000000..d6dd62fb9f
--- /dev/null
+++ b/include/hw/char/parallel.h
@@ -0,0 +1,14 @@
+#ifndef HW_PARALLEL_H
+#define HW_PARALLEL_H
+
+#include "exec/memory.h"
+#include "hw/isa/isa.h"
+#include "chardev/char.h"
+
+void parallel_hds_isa_init(ISABus *bus, int n);
+
+bool parallel_mm_init(MemoryRegion *address_space,
+                      hwaddr base, int it_shift, qemu_irq irq,
+                      Chardev *chr);
+
+#endif
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index bb49165fe0..f1feb18c3c 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -151,14 +151,6 @@ struct PCMachineClass {
 #define PC_MACHINE_CLASS(klass) \
     OBJECT_CLASS_CHECK(PCMachineClass, (klass), TYPE_PC_MACHINE)
 
-/* parallel.c */
-
-void parallel_hds_isa_init(ISABus *bus, int n);
-
-bool parallel_mm_init(MemoryRegion *address_space,
-                      hwaddr base, int it_shift, qemu_irq irq,
-                      Chardev *chr);
-
 /* i8259.c */
 
 extern DeviceState *isa_pic;
diff --git a/hw/char/parallel-isa.c b/hw/char/parallel-isa.c
new file mode 100644
index 0000000000..639e179585
--- /dev/null
+++ b/hw/char/parallel-isa.c
@@ -0,0 +1,36 @@
+/*
+ * QEMU Parallel PORT (ISA bus helpers)
+ *
+ * Copyright (c) 2003 Fabrice Bellard
+ *
+ * SPDX-License-Identifier: MIT
+ */
+#include "qemu/osdep.h"
+#include "sysemu/sysemu.h"
+#include "hw/isa/isa.h"
+#include "hw/char/parallel.h"
+
+static void parallel_init(ISABus *bus, int index, Chardev *chr)
+{
+    DeviceState *dev;
+    ISADevice *isadev;
+
+    isadev = isa_create(bus, "isa-parallel");
+    dev = DEVICE(isadev);
+    qdev_prop_set_uint32(dev, "index", index);
+    qdev_prop_set_chr(dev, "chardev", chr);
+    qdev_init_nofail(dev);
+}
+
+void parallel_hds_isa_init(ISABus *bus, int n)
+{
+    int i;
+
+    assert(n <= MAX_PARALLEL_PORTS);
+
+    for (i = 0; i < n; i++) {
+        if (parallel_hds[i]) {
+            parallel_init(bus, i, parallel_hds[i]);
+        }
+    }
+}
diff --git a/hw/char/parallel.c b/hw/char/parallel.c
index f79dc76543..1542d62201 100644
--- a/hw/char/parallel.c
+++ b/hw/char/parallel.c
@@ -28,7 +28,7 @@
 #include "chardev/char-parallel.h"
 #include "chardev/char-fe.h"
 #include "hw/isa/isa.h"
-#include "hw/i386/pc.h"
+#include "hw/char/parallel.h"
 #include "sysemu/sysemu.h"
 
 //#define DEBUG_PARALLEL
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 94cfd40ef2..404bb39ffd 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -26,6 +26,7 @@
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
 #include "hw/char/serial.h"
+#include "hw/char/parallel.h"
 #include "hw/i386/apic.h"
 #include "hw/i386/topology.h"
 #include "sysemu/cpus.h"
diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c
index 0f2e426d02..63fa77effc 100644
--- a/hw/isa/isa-bus.c
+++ b/hw/isa/isa-bus.c
@@ -24,7 +24,6 @@
 #include "hw/sysbus.h"
 #include "sysemu/sysemu.h"
 #include "hw/isa/isa.h"
-#include "hw/i386/pc.h"
 
 static ISABus *isabus;
 
@@ -288,28 +287,3 @@ MemoryRegion *isa_address_space_io(ISADevice *dev)
 }
 
 type_init(isabus_register_types)
-
-static void parallel_init(ISABus *bus, int index, Chardev *chr)
-{
-    DeviceState *dev;
-    ISADevice *isadev;
-
-    isadev = isa_create(bus, "isa-parallel");
-    dev = DEVICE(isadev);
-    qdev_prop_set_uint32(dev, "index", index);
-    qdev_prop_set_chr(dev, "chardev", chr);
-    qdev_init_nofail(dev);
-}
-
-void parallel_hds_isa_init(ISABus *bus, int n)
-{
-    int i;
-
-    assert(n <= MAX_PARALLEL_PORTS);
-
-    for (i = 0; i < n; i++) {
-        if (parallel_hds[i]) {
-            parallel_init(bus, i, parallel_hds[i]);
-        }
-    }
-}
diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index f68c625666..dc77b55755 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -23,6 +23,7 @@
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
 #include "hw/char/serial.h"
+#include "hw/char/parallel.h"
 #include "hw/block/fdc.h"
 #include "net/net.h"
 #include "hw/boards.h"
diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
index b09871a814..b24305b7b4 100644
--- a/hw/mips/mips_jazz.c
+++ b/hw/mips/mips_jazz.c
@@ -28,6 +28,7 @@
 #include "hw/mips/cpudevs.h"
 #include "hw/i386/pc.h"
 #include "hw/char/serial.h"
+#include "hw/char/parallel.h"
 #include "hw/isa/isa.h"
 #include "hw/block/fdc.h"
 #include "sysemu/sysemu.h"
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index 6f0deb99e7..c74882c7e9 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -28,6 +28,7 @@
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
 #include "hw/char/serial.h"
+#include "hw/char/parallel.h"
 #include "hw/block/fdc.h"
 #include "net/net.h"
 #include "hw/boards.h"
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index da28ab9413..ceb1ba7eaf 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -34,6 +34,7 @@
 #include "hw/pci-host/sabre.h"
 #include "hw/i386/pc.h"
 #include "hw/char/serial.h"
+#include "hw/char/parallel.h"
 #include "hw/timer/m48t59.h"
 #include "hw/block/fdc.h"
 #include "net/net.h"
diff --git a/MAINTAINERS b/MAINTAINERS
index b7c4130388..c0f1620f3a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -913,7 +913,7 @@ M: Michael S. Tsirkin <mst@redhat.com>
 M: Paolo Bonzini <pbonzini@redhat.com>
 S: Supported
 F: hw/char/debugcon.c
-F: hw/char/parallel.c
+F: hw/char/parallel*
 F: hw/char/serial*
 F: hw/dma/i8257*
 F: hw/i2c/pm_smbus.c
@@ -928,6 +928,7 @@ F: hw/timer/i8254*
 F: hw/timer/mc146818rtc*
 F: hw/watchdog/wdt_ib700.c
 F: include/hw/display/vga.h
+F: include/hw/char/parallel.h
 F: include/hw/i2c/pm_smbus.h
 F: include/hw/isa/i8257.h
 F: include/hw/timer/hpet.h
diff --git a/hw/char/Makefile.objs b/hw/char/Makefile.objs
index 1bcd37e98d..1b979100b7 100644
--- a/hw/char/Makefile.objs
+++ b/hw/char/Makefile.objs
@@ -1,6 +1,7 @@
 common-obj-$(CONFIG_IPACK) += ipoctal232.o
 common-obj-$(CONFIG_ESCC) += escc.o
 common-obj-$(CONFIG_PARALLEL) += parallel.o
+common-obj-$(CONFIG_PARALLEL) += parallel-isa.o
 common-obj-$(CONFIG_PL011) += pl011.o
 common-obj-$(CONFIG_SERIAL) += serial.o
 common-obj-$(CONFIG_SERIAL_ISA) += serial-isa.o
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [Qemu-devel] [RFC PATCH v2 02/22] hw/dma/i8257: Rename DMA_init() to i8257_dma_init()
  2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 01/22] hw/isa: Move parallel_hds_isa_init() to hw/char/parallel-isa.c Philippe Mathieu-Daudé
@ 2018-03-05 21:19 ` Philippe Mathieu-Daudé
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 03/22] hw/input/i8042: Extract declarations from i386/pc.h into input/i8042.h Philippe Mathieu-Daudé
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-05 21:19 UTC (permalink / raw)
  To: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao, open list:PReP

- Move the header from hw/isa/ to hw/dma/
- Remove the old i386/pc dependency
- use a bool type for the high_page_enable argument

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/{isa => dma}/i8257.h | 6 ++++++
 include/hw/isa/isa.h            | 2 --
 hw/dma/i82374.c                 | 3 ++-
 hw/dma/i8257.c                  | 4 ++--
 hw/i386/pc.c                    | 3 ++-
 hw/mips/mips_fulong2e.c         | 3 ++-
 hw/mips/mips_jazz.c             | 3 ++-
 hw/mips/mips_malta.c            | 3 ++-
 hw/sparc/sun4m.c                | 4 ----
 hw/sparc64/sun4u.c              | 4 ----
 MAINTAINERS                     | 2 +-
 11 files changed, 19 insertions(+), 18 deletions(-)
 rename include/hw/{isa => dma}/i8257.h (86%)

diff --git a/include/hw/isa/i8257.h b/include/hw/dma/i8257.h
similarity index 86%
rename from include/hw/isa/i8257.h
rename to include/hw/dma/i8257.h
index 88a2766a3f..2cab50bb6c 100644
--- a/include/hw/isa/i8257.h
+++ b/include/hw/dma/i8257.h
@@ -1,6 +1,10 @@
 #ifndef HW_I8257_H
 #define HW_I8257_H
 
+#include "hw/hw.h"
+#include "hw/isa/isa.h"
+#include "exec/ioport.h"
+
 #define TYPE_I8257 "i8257"
 
 typedef struct I8257Regs {
@@ -40,4 +44,6 @@ typedef struct I8257State {
     PortioList portio_pageh;
 } I8257State;
 
+void i8257_dma_init(ISABus *bus, bool high_page_enable);
+
 #endif
diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
index 95593408ef..b9dbab24b4 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -151,6 +151,4 @@ static inline ISABus *isa_bus_from_device(ISADevice *d)
     return ISA_BUS(qdev_get_parent_bus(DEVICE(d)));
 }
 
-/* i8257.c */
-void DMA_init(ISABus *bus, int high_page_enable);
 #endif
diff --git a/hw/dma/i82374.c b/hw/dma/i82374.c
index 6c0f975df0..83c87d92e0 100644
--- a/hw/dma/i82374.c
+++ b/hw/dma/i82374.c
@@ -24,6 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/isa/isa.h"
+#include "hw/dma/i8257.h"
 
 #define TYPE_I82374 "i82374"
 #define I82374(obj) OBJECT_CHECK(I82374State, (obj), TYPE_I82374)
@@ -123,7 +124,7 @@ static void i82374_realize(DeviceState *dev, Error **errp)
     portio_list_add(&s->port_list, isa_address_space_io(&s->parent_obj),
                     s->iobase);
 
-    DMA_init(isa_bus_from_device(ISA_DEVICE(dev)), 1);
+    i8257_dma_init(isa_bus_from_device(ISA_DEVICE(dev)), true);
     memset(s->commands, 0, sizeof(s->commands));
 }
 
diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c
index bd23e893bf..52675e97c9 100644
--- a/hw/dma/i8257.c
+++ b/hw/dma/i8257.c
@@ -24,7 +24,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/isa/isa.h"
-#include "hw/isa/i8257.h"
+#include "hw/dma/i8257.h"
 #include "qemu/main-loop.h"
 #include "trace.h"
 
@@ -622,7 +622,7 @@ static void i8257_register_types(void)
 
 type_init(i8257_register_types)
 
-void DMA_init(ISABus *bus, int high_page_enable)
+void i8257_dma_init(ISABus *bus, bool high_page_enable)
 {
     ISADevice *isa1, *isa2;
     DeviceState *d;
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 404bb39ffd..95b3fb3523 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -41,6 +41,7 @@
 #include "elf.h"
 #include "multiboot.h"
 #include "hw/timer/mc146818rtc.h"
+#include "hw/dma/i8257.h"
 #include "hw/timer/i8254.h"
 #include "hw/audio/pcspk.h"
 #include "hw/pci/msi.h"
@@ -1609,7 +1610,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
     port92_init(port92, a20_line[1]);
     g_free(a20_line);
 
-    DMA_init(isa_bus, 0);
+    i8257_dma_init(isa_bus, 0);
 
     for(i = 0; i < MAX_FD; i++) {
         fd[i] = drive_get(IF_FLOPPY, 0, i);
diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index dc77b55755..0545fcd899 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -22,6 +22,7 @@
 #include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
+#include "hw/dma/i8257.h"
 #include "hw/char/serial.h"
 #include "hw/char/parallel.h"
 #include "hw/block/fdc.h"
@@ -360,7 +361,7 @@ static void mips_fulong2e_init(MachineState *machine)
 
     /* init other devices */
     pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
-    DMA_init(isa_bus, 0);
+    i8257_dma_init(isa_bus, 0);
 
     /* Super I/O */
     isa_create_simple(isa_bus, "i8042");
diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
index b24305b7b4..827ffdcd4a 100644
--- a/hw/mips/mips_jazz.c
+++ b/hw/mips/mips_jazz.c
@@ -27,6 +27,7 @@
 #include "hw/mips/mips.h"
 #include "hw/mips/cpudevs.h"
 #include "hw/i386/pc.h"
+#include "hw/dma/i8257.h"
 #include "hw/char/serial.h"
 #include "hw/char/parallel.h"
 #include "hw/isa/isa.h"
@@ -220,7 +221,7 @@ static void mips_jazz_init(MachineState *machine,
     /* ISA devices */
     i8259 = i8259_init(isa_bus, env->irq[4]);
     isa_bus_irqs(isa_bus, i8259);
-    DMA_init(isa_bus, 0);
+    i8257_dma_init(isa_bus, 0);
     pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
     pcspk_init(isa_bus, pit);
 
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index c74882c7e9..9cb86c432e 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -27,6 +27,7 @@
 #include "cpu.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
+#include "hw/dma/i8257.h"
 #include "hw/char/serial.h"
 #include "hw/char/parallel.h"
 #include "hw/block/fdc.h"
@@ -1209,7 +1210,7 @@ void mips_malta_init(MachineState *machine)
     smbus_eeprom_init(smbus, 8, smbus_eeprom_buf, smbus_eeprom_size);
     g_free(smbus_eeprom_buf);
     pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
-    DMA_init(isa_bus, 0);
+    i8257_dma_init(isa_bus, 0);
 
     /* Super I/O */
     isa_create_simple(isa_bus, "i8042");
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index 61eb424bbc..b6138760e6 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -99,10 +99,6 @@ struct sun4m_hwdef {
     uint8_t nvram_machine_id;
 };
 
-void DMA_init(ISABus *bus, int high_page_enable)
-{
-}
-
 static void fw_cfg_boot_set(void *opaque, const char *boot_device,
                             Error **errp)
 {
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index ceb1ba7eaf..0ca0243821 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -90,10 +90,6 @@ typedef struct EbusState {
 #define TYPE_EBUS "ebus"
 #define EBUS(obj) OBJECT_CHECK(EbusState, (obj), TYPE_EBUS)
 
-void DMA_init(ISABus *bus, int high_page_enable)
-{
-}
-
 static void fw_cfg_boot_set(void *opaque, const char *boot_device,
                             Error **errp)
 {
diff --git a/MAINTAINERS b/MAINTAINERS
index c0f1620f3a..335c6c9f65 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -929,8 +929,8 @@ F: hw/timer/mc146818rtc*
 F: hw/watchdog/wdt_ib700.c
 F: include/hw/display/vga.h
 F: include/hw/char/parallel.h
+F: include/hw/dma/i8257.h
 F: include/hw/i2c/pm_smbus.h
-F: include/hw/isa/i8257.h
 F: include/hw/timer/hpet.h
 F: include/hw/timer/i8254*
 F: include/hw/timer/mc146818rtc*
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [Qemu-devel] [RFC PATCH v2 03/22] hw/input/i8042: Extract declarations from i386/pc.h into input/i8042.h
  2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 01/22] hw/isa: Move parallel_hds_isa_init() to hw/char/parallel-isa.c Philippe Mathieu-Daudé
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 02/22] hw/dma/i8257: Rename DMA_init() to i8257_dma_init() Philippe Mathieu-Daudé
@ 2018-03-05 21:19 ` Philippe Mathieu-Daudé
  2018-03-06  0:05   ` David Gibson
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 04/22] hw/isa/pc87312: Rename the device type as TYPE_PC87312_SUPERIO Philippe Mathieu-Daudé
                   ` (20 subsequent siblings)
  23 siblings, 1 reply; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-05 21:19 UTC (permalink / raw)
  To: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao, David Gibson, Alexander Graf,
	open list:PReP

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/i386/pc.h     |  9 ---------
 include/hw/input/i8042.h | 24 ++++++++++++++++++++++++
 hw/alpha/dp264.c         |  3 ++-
 hw/i386/pc.c             |  1 +
 hw/i386/vmmouse.c        |  1 +
 hw/i386/vmport.c         |  1 +
 hw/input/pckbd.c         |  2 +-
 hw/mips/mips_fulong2e.c  |  3 ++-
 hw/mips/mips_jazz.c      |  1 +
 hw/mips/mips_malta.c     |  3 ++-
 hw/mips/mips_r4k.c       |  3 ++-
 hw/ppc/prep.c            |  5 +++--
 hw/sparc64/sun4u.c       |  1 +
 hw/unicore32/puv3.c      |  1 +
 MAINTAINERS              |  1 +
 15 files changed, 43 insertions(+), 16 deletions(-)
 create mode 100644 include/hw/input/i8042.h

diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index f1feb18c3c..1638618dfc 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -188,15 +188,6 @@ void vmport_register(unsigned char command, VMPortReadFunc *func, void *opaque);
 void vmmouse_get_data(uint32_t *data);
 void vmmouse_set_data(const uint32_t *data);
 
-/* pckbd.c */
-#define I8042_A20_LINE "a20"
-
-void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
-                   MemoryRegion *region, ram_addr_t size,
-                   hwaddr mask);
-void i8042_isa_mouse_fake_event(void *opaque);
-void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out);
-
 /* pc.c */
 extern int fd_bootchk;
 
diff --git a/include/hw/input/i8042.h b/include/hw/input/i8042.h
new file mode 100644
index 0000000000..f6ff146364
--- /dev/null
+++ b/include/hw/input/i8042.h
@@ -0,0 +1,24 @@
+/*
+ * QEMU PS/2 Controller
+ *
+ * Copyright (c) 2003 Fabrice Bellard
+ *
+ * SPDX-License-Identifier: MIT
+ */
+#ifndef HW_INPUT_I8042_H
+#define HW_INPUT_I8042_H
+
+#include "hw/hw.h"
+#include "hw/isa/isa.h"
+
+#define TYPE_I8042 "i8042"
+
+#define I8042_A20_LINE "a20"
+
+void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
+                   MemoryRegion *region, ram_addr_t size,
+                   hwaddr mask);
+void i8042_isa_mouse_fake_event(void *opaque);
+void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out);
+
+#endif /* HW_INPUT_I8042_H */
diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
index 766373eec7..e13cb576fd 100644
--- a/hw/alpha/dp264.c
+++ b/hw/alpha/dp264.c
@@ -19,6 +19,7 @@
 #include "hw/timer/mc146818rtc.h"
 #include "hw/ide.h"
 #include "hw/timer/i8254.h"
+#include "hw/input/i8042.h"
 #include "hw/char/serial.h"
 #include "qemu/cutils.h"
 
@@ -81,7 +82,7 @@ static void clipper_init(MachineState *machine)
     mc146818_rtc_init(isa_bus, 1900, rtc_irq);
 
     i8254_pit_init(isa_bus, 0x40, 0, NULL);
-    isa_create_simple(isa_bus, "i8042");
+    isa_create_simple(isa_bus, TYPE_I8042);
 
     /* VGA setup.  Don't bother loading the bios.  */
     pci_vga_init(pci_bus);
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 95b3fb3523..efb1b3bccf 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -43,6 +43,7 @@
 #include "hw/timer/mc146818rtc.h"
 #include "hw/dma/i8257.h"
 #include "hw/timer/i8254.h"
+#include "hw/input/i8042.h"
 #include "hw/audio/pcspk.h"
 #include "hw/pci/msi.h"
 #include "hw/sysbus.h"
diff --git a/hw/i386/vmmouse.c b/hw/i386/vmmouse.c
index 65ef55329e..5d2d278be4 100644
--- a/hw/i386/vmmouse.c
+++ b/hw/i386/vmmouse.c
@@ -25,6 +25,7 @@
 #include "hw/hw.h"
 #include "ui/console.h"
 #include "hw/i386/pc.h"
+#include "hw/input/i8042.h"
 #include "hw/qdev.h"
 
 /* debug only vmmouse */
diff --git a/hw/i386/vmport.c b/hw/i386/vmport.c
index 116aa09819..3bf8cfe041 100644
--- a/hw/i386/vmport.c
+++ b/hw/i386/vmport.c
@@ -25,6 +25,7 @@
 #include "hw/hw.h"
 #include "hw/isa/isa.h"
 #include "hw/i386/pc.h"
+#include "hw/input/i8042.h"
 #include "sysemu/hw_accel.h"
 #include "hw/qdev.h"
 #include "qemu/log.h"
diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
index c479f827b6..f17f18e51b 100644
--- a/hw/input/pckbd.c
+++ b/hw/input/pckbd.c
@@ -26,6 +26,7 @@
 #include "hw/isa/isa.h"
 #include "hw/i386/pc.h"
 #include "hw/input/ps2.h"
+#include "hw/input/i8042.h"
 #include "sysemu/sysemu.h"
 
 /* debug PC keyboard */
@@ -480,7 +481,6 @@ void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
     qemu_register_reset(kbd_reset, s);
 }
 
-#define TYPE_I8042 "i8042"
 #define I8042(obj) OBJECT_CHECK(ISAKBDState, (obj), TYPE_I8042)
 
 typedef struct ISAKBDState {
diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index 0545fcd899..9339e02120 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -44,6 +44,7 @@
 #include "hw/isa/vt82c686.h"
 #include "hw/timer/mc146818rtc.h"
 #include "hw/timer/i8254.h"
+#include "hw/input/i8042.h"
 #include "sysemu/blockdev.h"
 #include "exec/address-spaces.h"
 #include "sysemu/qtest.h"
@@ -364,7 +365,7 @@ static void mips_fulong2e_init(MachineState *machine)
     i8257_dma_init(isa_bus, 0);
 
     /* Super I/O */
-    isa_create_simple(isa_bus, "i8042");
+    isa_create_simple(isa_bus, TYPE_I8042);
 
     mc146818_rtc_init(isa_bus, 2000, NULL);
 
diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
index 827ffdcd4a..5abbe30c21 100644
--- a/hw/mips/mips_jazz.c
+++ b/hw/mips/mips_jazz.c
@@ -43,6 +43,7 @@
 #include "hw/timer/i8254.h"
 #include "hw/display/vga.h"
 #include "hw/audio/pcspk.h"
+#include "hw/input/i8042.h"
 #include "sysemu/block-backend.h"
 #include "hw/sysbus.h"
 #include "exec/address-spaces.h"
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index 9cb86c432e..cd7bd0eef6 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -47,6 +47,7 @@
 #include "hw/loader.h"
 #include "elf.h"
 #include "hw/timer/mc146818rtc.h"
+#include "hw/input/i8042.h"
 #include "hw/timer/i8254.h"
 #include "sysemu/blockdev.h"
 #include "exec/address-spaces.h"
@@ -1213,7 +1214,7 @@ void mips_malta_init(MachineState *machine)
     i8257_dma_init(isa_bus, 0);
 
     /* Super I/O */
-    isa_create_simple(isa_bus, "i8042");
+    isa_create_simple(isa_bus, TYPE_I8042);
 
     mc146818_rtc_init(isa_bus, 2000, NULL);
     serial_hds_isa_init(isa_bus, 0, 2);
diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c
index 830ee7732c..aeadc4a340 100644
--- a/hw/mips/mips_r4k.c
+++ b/hw/mips/mips_r4k.c
@@ -28,6 +28,7 @@
 #include "hw/loader.h"
 #include "elf.h"
 #include "hw/timer/mc146818rtc.h"
+#include "hw/input/i8042.h"
 #include "hw/timer/i8254.h"
 #include "sysemu/block-backend.h"
 #include "exec/address-spaces.h"
@@ -286,7 +287,7 @@ void mips_r4k_init(MachineState *machine)
                      hd[MAX_IDE_DEVS * i],
 		     hd[MAX_IDE_DEVS * i + 1]);
 
-    isa_create_simple(isa_bus, "i8042");
+    isa_create_simple(isa_bus, TYPE_I8042);
 }
 
 static void mips_machine_init(MachineClass *mc)
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index 096d4d4cfb..ae724b0613 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -41,6 +41,7 @@
 #include "hw/ide.h"
 #include "hw/loader.h"
 #include "hw/timer/mc146818rtc.h"
+#include "hw/input/i8042.h"
 #include "hw/isa/pc87312.h"
 #include "hw/net/ne2000-isa.h"
 #include "sysemu/block-backend.h"
@@ -641,7 +642,7 @@ static void ppc_prep_init(MachineState *machine)
                      hd[2 * i],
 		     hd[2 * i + 1]);
     }
-    isa_create_simple(isa_bus, "i8042");
+    isa_create_simple(isa_bus, TYPE_I8042);
 
     cpu = POWERPC_CPU(first_cpu);
     sysctrl->reset_irq = cpu->env.irq_inputs[PPC6xx_INPUT_HRESET];
@@ -771,7 +772,7 @@ static void ibm_40p_init(MachineState *machine)
 
     /* add some more devices */
     if (defaults_enabled()) {
-        isa_create_simple(isa_bus, "i8042");
+        isa_create_simple(isa_bus, TYPE_I8042);
         m48t59 = NVRAM(isa_create_simple(isa_bus, "isa-m48t59"));
 
         dev = DEVICE(isa_create(isa_bus, "cs4231a"));
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index 0ca0243821..2044a52ded 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -36,6 +36,7 @@
 #include "hw/char/serial.h"
 #include "hw/char/parallel.h"
 #include "hw/timer/m48t59.h"
+#include "hw/input/i8042.h"
 #include "hw/block/fdc.h"
 #include "net/net.h"
 #include "qemu/timer.h"
diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c
index db26959a1d..830fe3face 100644
--- a/hw/unicore32/puv3.c
+++ b/hw/unicore32/puv3.c
@@ -20,6 +20,7 @@
 
 #undef DEBUG_PUV3
 #include "hw/unicore32/puv3.h"
+#include "hw/input/i8042.h"
 
 #define KERNEL_LOAD_ADDR        0x03000000
 #define KERNEL_MAX_SIZE         0x00800000 /* Just a guess */
diff --git a/MAINTAINERS b/MAINTAINERS
index 335c6c9f65..6622efc1da 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -931,6 +931,7 @@ F: include/hw/display/vga.h
 F: include/hw/char/parallel.h
 F: include/hw/dma/i8257.h
 F: include/hw/i2c/pm_smbus.h
+F: include/hw/input/i8042.h
 F: include/hw/timer/hpet.h
 F: include/hw/timer/i8254*
 F: include/hw/timer/mc146818rtc*
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [Qemu-devel] [RFC PATCH v2 04/22] hw/isa/pc87312: Rename the device type as TYPE_PC87312_SUPERIO
  2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 03/22] hw/input/i8042: Extract declarations from i386/pc.h into input/i8042.h Philippe Mathieu-Daudé
@ 2018-03-05 21:19 ` Philippe Mathieu-Daudé
  2018-03-06  0:05   ` David Gibson
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 05/22] hw/isa/pc87312: Use uint16_t for the ISA I/O base address Philippe Mathieu-Daudé
                   ` (19 subsequent siblings)
  23 siblings, 1 reply; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-05 21:19 UTC (permalink / raw)
  To: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao, David Gibson, Alexander Graf,
	open list:PReP

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/isa/pc87312.h | 4 ++--
 hw/isa/pc87312.c         | 2 +-
 hw/ppc/prep.c            | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/hw/isa/pc87312.h b/include/hw/isa/pc87312.h
index bf74470d40..710eb1c807 100644
--- a/include/hw/isa/pc87312.h
+++ b/include/hw/isa/pc87312.h
@@ -28,8 +28,8 @@
 #include "hw/isa/isa.h"
 
 
-#define TYPE_PC87312 "pc87312"
-#define PC87312(obj) OBJECT_CHECK(PC87312State, (obj), TYPE_PC87312)
+#define TYPE_PC87312_SUPERIO "pc87312"
+#define PC87312(obj) OBJECT_CHECK(PC87312State, (obj), TYPE_PC87312_SUPERIO)
 
 typedef struct PC87312State {
     ISADevice dev;
diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c
index 48b29e3c3c..e9edbc6c50 100644
--- a/hw/isa/pc87312.c
+++ b/hw/isa/pc87312.c
@@ -391,7 +391,7 @@ static void pc87312_class_init(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo pc87312_type_info = {
-    .name          = TYPE_PC87312,
+    .name          = TYPE_PC87312_SUPERIO,
     .parent        = TYPE_ISA_DEVICE,
     .instance_size = sizeof(PC87312State),
     .instance_init = pc87312_initfn,
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index ae724b0613..610ec7ec32 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -613,7 +613,7 @@ static void ppc_prep_init(MachineState *machine)
     isa_bus = ISA_BUS(qdev_get_child_bus(DEVICE(pci), "isa.0"));
 
     /* Super I/O (parallel + serial ports) */
-    isa = isa_create(isa_bus, TYPE_PC87312);
+    isa = isa_create(isa_bus, TYPE_PC87312_SUPERIO);
     dev = DEVICE(isa);
     qdev_prop_set_uint8(dev, "config", 13); /* fdc, ser0, ser1, par0 */
     qdev_init_nofail(dev);
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [Qemu-devel] [RFC PATCH v2 05/22] hw/isa/pc87312: Use uint16_t for the ISA I/O base address
  2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
                   ` (3 preceding siblings ...)
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 04/22] hw/isa/pc87312: Rename the device type as TYPE_PC87312_SUPERIO Philippe Mathieu-Daudé
@ 2018-03-05 21:19 ` Philippe Mathieu-Daudé
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 06/22] hw/isa/pc87312: Use 'unsigned int' for the irq value Philippe Mathieu-Daudé
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-05 21:19 UTC (permalink / raw)
  To: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao, open list:PReP

This matches the isa_register_ioport() prototype.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/isa/pc87312.h |  2 +-
 hw/isa/pc87312.c         | 14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/hw/isa/pc87312.h b/include/hw/isa/pc87312.h
index 710eb1c807..b65b219a8a 100644
--- a/include/hw/isa/pc87312.h
+++ b/include/hw/isa/pc87312.h
@@ -34,7 +34,7 @@
 typedef struct PC87312State {
     ISADevice dev;
 
-    uint32_t iobase;
+    uint16_t iobase;
     uint8_t config; /* initial configuration */
 
     struct {
diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c
index e9edbc6c50..105c23e680 100644
--- a/hw/isa/pc87312.c
+++ b/hw/isa/pc87312.c
@@ -69,9 +69,9 @@ static inline bool is_parallel_enabled(PC87312State *s)
     return s->regs[REG_FER] & FER_PARALLEL_EN;
 }
 
-static const uint32_t parallel_base[] = { 0x378, 0x3bc, 0x278, 0x00 };
+static const uint16_t parallel_base[] = { 0x378, 0x3bc, 0x278, 0x00 };
 
-static inline uint32_t get_parallel_iobase(PC87312State *s)
+static inline uint16_t get_parallel_iobase(PC87312State *s)
 {
     return parallel_base[s->regs[REG_FAR] & FAR_PARALLEL_ADDR];
 }
@@ -92,12 +92,12 @@ static inline uint32_t get_parallel_irq(PC87312State *s)
 
 /* UARTs */
 
-static const uint32_t uart_base[2][4] = {
+static const uint16_t uart_base[2][4] = {
     { 0x3e8, 0x338, 0x2e8, 0x220 },
     { 0x2e8, 0x238, 0x2e0, 0x228 }
 };
 
-static inline uint32_t get_uart_iobase(PC87312State *s, int i)
+static inline uint16_t get_uart_iobase(PC87312State *s, int i)
 {
     int idx;
     idx = (s->regs[REG_FAR] >> (2 * i + 2)) & 0x3;
@@ -130,7 +130,7 @@ static inline bool is_fdc_enabled(PC87312State *s)
     return s->regs[REG_FER] & FER_FDC_EN;
 }
 
-static inline uint32_t get_fdc_iobase(PC87312State *s)
+static inline uint16_t get_fdc_iobase(PC87312State *s)
 {
     return (s->regs[REG_FER] & FER_FDC_ADDR) ? 0x370 : 0x3f0;
 }
@@ -143,7 +143,7 @@ static inline bool is_ide_enabled(PC87312State *s)
     return s->regs[REG_FER] & FER_IDE_EN;
 }
 
-static inline uint32_t get_ide_iobase(PC87312State *s)
+static inline uint16_t get_ide_iobase(PC87312State *s)
 {
     return (s->regs[REG_FER] & FER_IDE_ADDR) ? 0x170 : 0x1f0;
 }
@@ -373,7 +373,7 @@ static const VMStateDescription vmstate_pc87312 = {
 };
 
 static Property pc87312_properties[] = {
-    DEFINE_PROP_UINT32("iobase", PC87312State, iobase, 0x398),
+    DEFINE_PROP_UINT16("iobase", PC87312State, iobase, 0x398),
     DEFINE_PROP_UINT8("config", PC87312State, config, 1),
     DEFINE_PROP_END_OF_LIST()
 };
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [Qemu-devel] [RFC PATCH v2 06/22] hw/isa/pc87312: Use 'unsigned int' for the irq value
  2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
                   ` (4 preceding siblings ...)
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 05/22] hw/isa/pc87312: Use uint16_t for the ISA I/O base address Philippe Mathieu-Daudé
@ 2018-03-05 21:19 ` Philippe Mathieu-Daudé
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 07/22] hw/isa/superio: Add a Super I/O template based on the PC87312 device Philippe Mathieu-Daudé
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-05 21:19 UTC (permalink / raw)
  To: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao, open list:PReP

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/isa/pc87312.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c
index 105c23e680..fda91fed21 100644
--- a/hw/isa/pc87312.c
+++ b/hw/isa/pc87312.c
@@ -76,9 +76,9 @@ static inline uint16_t get_parallel_iobase(PC87312State *s)
     return parallel_base[s->regs[REG_FAR] & FAR_PARALLEL_ADDR];
 }
 
-static const uint32_t parallel_irq[] = { 5, 7, 5, 0 };
+static const unsigned int parallel_irq[] = { 5, 7, 5, 0 };
 
-static inline uint32_t get_parallel_irq(PC87312State *s)
+static inline unsigned int get_parallel_irq(PC87312State *s)
 {
     int idx;
     idx = (s->regs[REG_FAR] & FAR_PARALLEL_ADDR);
@@ -110,7 +110,7 @@ static inline uint16_t get_uart_iobase(PC87312State *s, int i)
     }
 }
 
-static inline uint32_t get_uart_irq(PC87312State *s, int i)
+static inline unsigned int get_uart_irq(PC87312State *s, int i)
 {
     int idx;
     idx = (s->regs[REG_FAR] >> (2 * i + 2)) & 0x3;
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [Qemu-devel] [RFC PATCH v2 07/22] hw/isa/superio: Add a Super I/O template based on the PC87312 device
  2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
                   ` (5 preceding siblings ...)
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 06/22] hw/isa/pc87312: Use 'unsigned int' for the irq value Philippe Mathieu-Daudé
@ 2018-03-05 21:19 ` Philippe Mathieu-Daudé
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 08/22] hw/isa/pc87312: Inherit from the abstract TYPE_ISA_SUPERIO Philippe Mathieu-Daudé
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-05 21:19 UTC (permalink / raw)
  To: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/isa/superio.h | 44 ++++++++++++++++++++++++++++++++++++++++++++
 hw/isa/isa-superio.c     | 27 +++++++++++++++++++++++++++
 hw/isa/Makefile.objs     |  1 +
 3 files changed, 72 insertions(+)
 create mode 100644 include/hw/isa/superio.h
 create mode 100644 hw/isa/isa-superio.c

diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h
new file mode 100644
index 0000000000..cff6ad6c08
--- /dev/null
+++ b/include/hw/isa/superio.h
@@ -0,0 +1,44 @@
+/*
+ * Generic ISA Super I/O
+ *
+ * Copyright (c) 2018 Philippe Mathieu-Daudé
+ *
+ * This code is licensed under the GNU GPLv2 and later.
+ * See the COPYING file in the top-level directory.
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+#ifndef HW_ISA_SUPERIO_H
+#define HW_ISA_SUPERIO_H
+
+#include "qemu-common.h"
+#include "sysemu/sysemu.h"
+#include "hw/isa/isa.h"
+
+#define TYPE_ISA_SUPERIO "isa-superio"
+#define ISA_SUPERIO(obj) \
+    OBJECT_CHECK(ISASuperIODevice, (obj), TYPE_ISA_SUPERIO)
+#define ISA_SUPERIO_GET_CLASS(obj) \
+    OBJECT_GET_CLASS(ISASuperIOClass, (obj), TYPE_ISA_SUPERIO)
+#define ISA_SUPERIO_CLASS(klass) \
+    OBJECT_CLASS_CHECK(ISASuperIOClass, (klass), TYPE_ISA_SUPERIO)
+
+typedef struct ISASuperIODevice {
+    ISADevice parent_obj;
+} ISASuperIODevice;
+
+typedef struct ISASuperIOFuncs {
+    size_t count;
+    bool (*is_enabled)(ISASuperIODevice *sio, uint8_t index);
+    uint16_t (*get_iobase)(ISASuperIODevice *sio, uint8_t index);
+    unsigned int (*get_irq)(ISASuperIODevice *sio, uint8_t index);
+    unsigned int (*get_dma)(ISASuperIODevice *sio, uint8_t index);
+} ISASuperIOFuncs;
+
+typedef struct ISASuperIOClass {
+    /*< private >*/
+    ISADeviceClass parent_class;
+    /*< public >*/
+    DeviceRealize parent_realize;
+} ISASuperIOClass;
+
+#endif /* HW_ISA_SUPERIO_H */
diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c
new file mode 100644
index 0000000000..7777f8b9f0
--- /dev/null
+++ b/hw/isa/isa-superio.c
@@ -0,0 +1,27 @@
+/*
+ * Generic ISA Super I/O
+ *
+ * Copyright (c) 2010-2012 Herve Poussineau
+ * Copyright (c) 2011-2012 Andreas Färber
+ * Copyright (c) 2018 Philippe Mathieu-Daudé
+ *
+ * This code is licensed under the GNU GPLv2 and 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"
+#include "trace.h"
+
+static const TypeInfo isa_superio_type_info = {
+    .name = TYPE_ISA_SUPERIO,
+    .parent = TYPE_ISA_DEVICE,
+    .abstract = true,
+};
+
+static void isa_superio_register_types(void)
+{
+    type_register_static(&isa_superio_type_info);
+}
+
+type_init(isa_superio_register_types)
diff --git a/hw/isa/Makefile.objs b/hw/isa/Makefile.objs
index fb37c55cf2..cac655ba58 100644
--- a/hw/isa/Makefile.objs
+++ b/hw/isa/Makefile.objs
@@ -1,4 +1,5 @@
 common-obj-$(CONFIG_ISA_BUS) += isa-bus.o
+common-obj-$(CONFIG_ISA_BUS) += isa-superio.o
 common-obj-$(CONFIG_APM) += apm.o
 common-obj-$(CONFIG_I82378) += i82378.o
 common-obj-$(CONFIG_PC87312) += pc87312.o
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [Qemu-devel] [RFC PATCH v2 08/22] hw/isa/pc87312: Inherit from the abstract TYPE_ISA_SUPERIO
  2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
                   ` (6 preceding siblings ...)
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 07/22] hw/isa/superio: Add a Super I/O template based on the PC87312 device Philippe Mathieu-Daudé
@ 2018-03-05 21:19 ` Philippe Mathieu-Daudé
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 09/22] hw/isa/superio: Factor out the parallel code from pc87312.c Philippe Mathieu-Daudé
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-05 21:19 UTC (permalink / raw)
  To: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao, open list:PReP

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/isa/pc87312.h |  6 ++++--
 hw/isa/pc87312.c         | 11 ++++++++++-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/include/hw/isa/pc87312.h b/include/hw/isa/pc87312.h
index b65b219a8a..f3761d6fe1 100644
--- a/include/hw/isa/pc87312.h
+++ b/include/hw/isa/pc87312.h
@@ -25,14 +25,16 @@
 #ifndef QEMU_PC87312_H
 #define QEMU_PC87312_H
 
-#include "hw/isa/isa.h"
+#include "hw/isa/superio.h"
 
 
 #define TYPE_PC87312_SUPERIO "pc87312"
 #define PC87312(obj) OBJECT_CHECK(PC87312State, (obj), TYPE_PC87312_SUPERIO)
 
 typedef struct PC87312State {
-    ISADevice dev;
+    /*< private >*/
+    ISASuperIODevice parent_dev;
+    /*< public >*/
 
     uint16_t iobase;
     uint8_t config; /* initial configuration */
diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c
index fda91fed21..6b8100ff56 100644
--- a/hw/isa/pc87312.c
+++ b/hw/isa/pc87312.c
@@ -270,6 +270,7 @@ static void pc87312_realize(DeviceState *dev, Error **errp)
     ISABus *bus;
     Chardev *chr;
     DriveInfo *drive;
+    Error *local_err = NULL;
     char name[5];
     int i;
 
@@ -279,6 +280,12 @@ static void pc87312_realize(DeviceState *dev, Error **errp)
     isa_register_ioport(isa, &s->io, s->iobase);
     pc87312_hard_reset(s);
 
+    ISA_SUPERIO_GET_CLASS(dev)->parent_realize(dev, &local_err);
+    if (local_err) {
+        error_propagate(errp, local_err);
+        return;
+    }
+
     if (is_parallel_enabled(s)) {
         /* FIXME use a qdev chardev prop instead of parallel_hds[] */
         chr = parallel_hds[0];
@@ -381,7 +388,9 @@ static Property pc87312_properties[] = {
 static void pc87312_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
+    ISASuperIOClass *sc = ISA_SUPERIO_CLASS(klass);
 
+    sc->parent_realize = dc->realize;
     dc->realize = pc87312_realize;
     dc->reset = pc87312_reset;
     dc->vmsd = &vmstate_pc87312;
@@ -392,7 +401,7 @@ static void pc87312_class_init(ObjectClass *klass, void *data)
 
 static const TypeInfo pc87312_type_info = {
     .name          = TYPE_PC87312_SUPERIO,
-    .parent        = TYPE_ISA_DEVICE,
+    .parent        = TYPE_ISA_SUPERIO,
     .instance_size = sizeof(PC87312State),
     .instance_init = pc87312_initfn,
     .class_init    = pc87312_class_init,
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [Qemu-devel] [RFC PATCH v2 09/22] hw/isa/superio: Factor out the parallel code from pc87312.c
  2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
                   ` (7 preceding siblings ...)
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 08/22] hw/isa/pc87312: Inherit from the abstract TYPE_ISA_SUPERIO Philippe Mathieu-Daudé
@ 2018-03-05 21:19 ` Philippe Mathieu-Daudé
  2018-03-08 20:31   ` Philippe Mathieu-Daudé
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 10/22] hw/isa/superio: Factor out the serial " Philippe Mathieu-Daudé
                   ` (14 subsequent siblings)
  23 siblings, 1 reply; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-05 21:19 UTC (permalink / raw)
  To: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao, open list:PReP

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/isa/pc87312.h |  4 ---
 include/hw/isa/superio.h |  6 +++++
 hw/isa/isa-superio.c     | 63 ++++++++++++++++++++++++++++++++++++++++++++++++
 hw/isa/pc87312.c         | 38 ++++++++++++-----------------
 hw/isa/trace-events      |  4 ++-
 5 files changed, 87 insertions(+), 28 deletions(-)

diff --git a/include/hw/isa/pc87312.h b/include/hw/isa/pc87312.h
index f3761d6fe1..bcc4578479 100644
--- a/include/hw/isa/pc87312.h
+++ b/include/hw/isa/pc87312.h
@@ -39,10 +39,6 @@ typedef struct PC87312State {
     uint16_t iobase;
     uint8_t config; /* initial configuration */
 
-    struct {
-        ISADevice *dev;
-    } parallel;
-
     struct {
         ISADevice *dev;
     } uart[2];
diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h
index cff6ad6c08..e9879cfde1 100644
--- a/include/hw/isa/superio.h
+++ b/include/hw/isa/superio.h
@@ -23,7 +23,11 @@
     OBJECT_CLASS_CHECK(ISASuperIOClass, (klass), TYPE_ISA_SUPERIO)
 
 typedef struct ISASuperIODevice {
+    /*< private >*/
     ISADevice parent_obj;
+    /*< public >*/
+
+    ISADevice *parallel[MAX_PARALLEL_PORTS];
 } ISASuperIODevice;
 
 typedef struct ISASuperIOFuncs {
@@ -39,6 +43,8 @@ typedef struct ISASuperIOClass {
     ISADeviceClass parent_class;
     /*< public >*/
     DeviceRealize parent_realize;
+
+    ISASuperIOFuncs parallel;
 } ISASuperIOClass;
 
 #endif /* HW_ISA_SUPERIO_H */
diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c
index 7777f8b9f0..4e0b1af633 100644
--- a/hw/isa/isa-superio.c
+++ b/hw/isa/isa-superio.c
@@ -10,13 +10,76 @@
  * SPDX-License-Identifier: GPL-2.0-or-later
  */
 #include "qemu/osdep.h"
+#include "qemu/error-report.h"
+#include "sysemu/sysemu.h"
+#include "chardev/char.h"
 #include "hw/isa/superio.h"
 #include "trace.h"
 
+static void isa_superio_realize(DeviceState *dev, Error **errp)
+{
+    ISASuperIODevice *sio = ISA_SUPERIO(dev);
+    ISASuperIOClass *k = ISA_SUPERIO_GET_CLASS(sio);
+    ISABus *bus = isa_bus_from_device(ISA_DEVICE(dev));
+    ISADevice *isa;
+    DeviceState *d;
+    Chardev *chr;
+    char *name;
+    int i;
+
+    /* Parallel port */
+    for (i = 0; i < k->parallel.count; i++) {
+        if (i >= ARRAY_SIZE(sio->parallel)) {
+            warn_report("superio: ignoring %ld parallel controllers",
+                        k->parallel.count - ARRAY_SIZE(sio->parallel));
+            break;
+        }
+        if (!k->parallel.is_enabled || k->parallel.is_enabled(sio, i)) {
+            name = g_strdup_printf("discarding-parallel%d", i);
+            /* FIXME use a qdev chardev prop instead of parallel_hds[] */
+            chr = parallel_hds[i];
+            if (chr == NULL || chr->be) {
+                chr = qemu_chr_new(name, "null");
+            }
+            isa = isa_create(bus, "isa-parallel");
+            d = DEVICE(isa);
+            qdev_prop_set_uint32(d, "index", i);
+            if (k->parallel.get_iobase) {
+                qdev_prop_set_uint32(d, "iobase",
+                                     k->parallel.get_iobase(sio, i));
+            }
+            if (k->parallel.get_irq) {
+                qdev_prop_set_uint32(d, "irq", k->parallel.get_irq(sio, i));
+            }
+            qdev_prop_set_chr(d, "chardev", chr);
+            qdev_init_nofail(d);
+            sio->parallel[i] = isa;
+            trace_superio_create_parallel(i,
+                                          k->parallel.get_iobase ?
+                                          k->parallel.get_iobase(sio, i) : -1,
+                                          k->parallel.get_irq ?
+                                          k->parallel.get_irq(sio, i) : -1);
+            object_property_add_child(OBJECT(dev), name,
+                                      OBJECT(sio->parallel[i]), NULL);
+            g_free(name);
+        }
+    }
+}
+
+static void isa_superio_class_init(ObjectClass *oc, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(oc);
+
+    dc->realize = isa_superio_realize;
+    /* Reason: Uses parallel_hds[0] in realize(), so it can't be used twice */
+    dc->user_creatable = false;
+}
+
 static const TypeInfo isa_superio_type_info = {
     .name = TYPE_ISA_SUPERIO,
     .parent = TYPE_ISA_DEVICE,
     .abstract = true,
+    .class_init = isa_superio_class_init,
 };
 
 static void isa_superio_register_types(void)
diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c
index 6b8100ff56..1c15715c69 100644
--- a/hw/isa/pc87312.c
+++ b/hw/isa/pc87312.c
@@ -64,22 +64,25 @@
 
 /* Parallel port */
 
-static inline bool is_parallel_enabled(PC87312State *s)
+static bool is_parallel_enabled(ISASuperIODevice *sio, uint8_t index)
 {
-    return s->regs[REG_FER] & FER_PARALLEL_EN;
+    PC87312State *s = PC87312(sio);
+    return index ? false : s->regs[REG_FER] & FER_PARALLEL_EN;
 }
 
 static const uint16_t parallel_base[] = { 0x378, 0x3bc, 0x278, 0x00 };
 
-static inline uint16_t get_parallel_iobase(PC87312State *s)
+static uint16_t get_parallel_iobase(ISASuperIODevice *sio, uint8_t index)
 {
+    PC87312State *s = PC87312(sio);
     return parallel_base[s->regs[REG_FAR] & FAR_PARALLEL_ADDR];
 }
 
 static const unsigned int parallel_irq[] = { 5, 7, 5, 0 };
 
-static inline unsigned int get_parallel_irq(PC87312State *s)
+static unsigned int get_parallel_irq(ISASuperIODevice *sio, uint8_t index)
 {
+    PC87312State *s = PC87312(sio);
     int idx;
     idx = (s->regs[REG_FAR] & FAR_PARALLEL_ADDR);
     if (idx == 0) {
@@ -286,24 +289,6 @@ static void pc87312_realize(DeviceState *dev, Error **errp)
         return;
     }
 
-    if (is_parallel_enabled(s)) {
-        /* FIXME use a qdev chardev prop instead of parallel_hds[] */
-        chr = parallel_hds[0];
-        if (chr == NULL) {
-            chr = qemu_chr_new("par0", "null");
-        }
-        isa = isa_create(bus, "isa-parallel");
-        d = DEVICE(isa);
-        qdev_prop_set_uint32(d, "index", 0);
-        qdev_prop_set_uint32(d, "iobase", get_parallel_iobase(s));
-        qdev_prop_set_uint32(d, "irq", get_parallel_irq(s));
-        qdev_prop_set_chr(d, "chardev", chr);
-        qdev_init_nofail(d);
-        s->parallel.dev = isa;
-        trace_pc87312_info_parallel(get_parallel_iobase(s),
-                                    get_parallel_irq(s));
-    }
-
     for (i = 0; i < 2; i++) {
         if (is_uart_enabled(s, i)) {
             /* FIXME use a qdev chardev prop instead of serial_hds[] */
@@ -395,8 +380,15 @@ static void pc87312_class_init(ObjectClass *klass, void *data)
     dc->reset = pc87312_reset;
     dc->vmsd = &vmstate_pc87312;
     dc->props = pc87312_properties;
-    /* Reason: Uses parallel_hds[0] in realize(), so it can't be used twice */
+    /* Reason: Uses serial_hds[0] in realize(), so it can't be used twice */
     dc->user_creatable = false;
+
+    sc->parallel = (ISASuperIOFuncs){
+        .count = 1,
+        .is_enabled = is_parallel_enabled,
+        .get_iobase = get_parallel_iobase,
+        .get_irq    = get_parallel_irq,
+    };
 }
 
 static const TypeInfo pc87312_type_info = {
diff --git a/hw/isa/trace-events b/hw/isa/trace-events
index a4ab4e3634..97b1949981 100644
--- a/hw/isa/trace-events
+++ b/hw/isa/trace-events
@@ -1,9 +1,11 @@
 # See docs/devel/tracing.txt for syntax documentation.
 
+# hw/isa/isa-superio.c
+superio_create_parallel(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, irq %u"
+
 # hw/isa/pc87312.c
 pc87312_io_read(uint32_t addr, uint32_t val) "read addr=0x%x val=0x%x"
 pc87312_io_write(uint32_t addr, uint32_t val) "write addr=0x%x val=0x%x"
 pc87312_info_floppy(uint32_t base) "base 0x%x"
 pc87312_info_ide(uint32_t base) "base 0x%x"
-pc87312_info_parallel(uint32_t base, uint32_t irq) "base 0x%x, irq %u"
 pc87312_info_serial(int n, uint32_t base, uint32_t irq) "id=%d, base 0x%x, irq %u"
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [Qemu-devel] [RFC PATCH v2 10/22] hw/isa/superio: Factor out the serial code from pc87312.c
  2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
                   ` (8 preceding siblings ...)
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 09/22] hw/isa/superio: Factor out the parallel code from pc87312.c Philippe Mathieu-Daudé
@ 2018-03-05 21:19 ` Philippe Mathieu-Daudé
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 11/22] hw/isa/superio: Factor out the floppy disc controller " Philippe Mathieu-Daudé
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-05 21:19 UTC (permalink / raw)
  To: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao, open list:PReP

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/isa/pc87312.h |  4 ----
 include/hw/isa/superio.h |  2 ++
 hw/isa/isa-superio.c     | 39 +++++++++++++++++++++++++++++++++++++++
 hw/isa/pc87312.c         | 43 ++++++++++++-------------------------------
 hw/isa/trace-events      |  2 +-
 5 files changed, 54 insertions(+), 36 deletions(-)

diff --git a/include/hw/isa/pc87312.h b/include/hw/isa/pc87312.h
index bcc4578479..1480615a2c 100644
--- a/include/hw/isa/pc87312.h
+++ b/include/hw/isa/pc87312.h
@@ -39,10 +39,6 @@ typedef struct PC87312State {
     uint16_t iobase;
     uint8_t config; /* initial configuration */
 
-    struct {
-        ISADevice *dev;
-    } uart[2];
-
     struct {
         ISADevice *dev;
     } fdc;
diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h
index e9879cfde1..0b516721c3 100644
--- a/include/hw/isa/superio.h
+++ b/include/hw/isa/superio.h
@@ -28,6 +28,7 @@ typedef struct ISASuperIODevice {
     /*< public >*/
 
     ISADevice *parallel[MAX_PARALLEL_PORTS];
+    ISADevice *serial[MAX_SERIAL_PORTS];
 } ISASuperIODevice;
 
 typedef struct ISASuperIOFuncs {
@@ -45,6 +46,7 @@ typedef struct ISASuperIOClass {
     DeviceRealize parent_realize;
 
     ISASuperIOFuncs parallel;
+    ISASuperIOFuncs serial;
 } ISASuperIOClass;
 
 #endif /* HW_ISA_SUPERIO_H */
diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c
index 4e0b1af633..bd4671655e 100644
--- a/hw/isa/isa-superio.c
+++ b/hw/isa/isa-superio.c
@@ -14,6 +14,7 @@
 #include "sysemu/sysemu.h"
 #include "chardev/char.h"
 #include "hw/isa/superio.h"
+#include "hw/char/serial.h"
 #include "trace.h"
 
 static void isa_superio_realize(DeviceState *dev, Error **errp)
@@ -64,6 +65,44 @@ static void isa_superio_realize(DeviceState *dev, Error **errp)
             g_free(name);
         }
     }
+
+    /* Serial */
+    for (i = 0; i < k->serial.count; i++) {
+        if (i >= ARRAY_SIZE(sio->serial)) {
+            warn_report("superio: ignoring %ld serial controllers",
+                        k->serial.count - ARRAY_SIZE(sio->serial));
+            break;
+        }
+        if (!k->serial.is_enabled || k->serial.is_enabled(sio, i)) {
+            name = g_strdup_printf("discarding-serial%d", i);
+            /* FIXME use a qdev chardev prop instead of serial_hds[] */
+            chr = serial_hds[i];
+            if (chr == NULL || chr->be) {
+                chr = qemu_chr_new(name, "null");
+            }
+            isa = isa_create(bus, TYPE_ISA_SERIAL);
+            d = DEVICE(isa);
+            qdev_prop_set_uint32(d, "index", i);
+            if (k->serial.get_iobase) {
+                qdev_prop_set_uint32(d, "iobase",
+                                     k->serial.get_iobase(sio, i));
+            }
+            if (k->serial.get_irq) {
+                qdev_prop_set_uint32(d, "irq", k->serial.get_irq(sio, i));
+            }
+            qdev_prop_set_chr(d, "chardev", chr);
+            qdev_init_nofail(d);
+            sio->serial[i] = isa;
+            trace_superio_create_serial(i,
+                                        k->serial.get_iobase ?
+                                        k->serial.get_iobase(sio, i) : -1,
+                                        k->serial.get_irq ?
+                                        k->serial.get_irq(sio, i) : -1);
+            object_property_add_child(OBJECT(dev), name,
+                                      OBJECT(sio->serial[0]), NULL);
+            g_free(name);
+        }
+    }
 }
 
 static void isa_superio_class_init(ObjectClass *oc, void *data)
diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c
index 1c15715c69..c2837bca43 100644
--- a/hw/isa/pc87312.c
+++ b/hw/isa/pc87312.c
@@ -29,8 +29,6 @@
 #include "qemu/error-report.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
-#include "sysemu/sysemu.h"
-#include "chardev/char.h"
 #include "trace.h"
 
 
@@ -100,8 +98,9 @@ static const uint16_t uart_base[2][4] = {
     { 0x2e8, 0x238, 0x2e0, 0x228 }
 };
 
-static inline uint16_t get_uart_iobase(PC87312State *s, int i)
+static uint16_t get_uart_iobase(ISASuperIODevice *sio, uint8_t i)
 {
+    PC87312State *s = PC87312(sio);
     int idx;
     idx = (s->regs[REG_FAR] >> (2 * i + 2)) & 0x3;
     if (idx == 0) {
@@ -113,15 +112,17 @@ static inline uint16_t get_uart_iobase(PC87312State *s, int i)
     }
 }
 
-static inline unsigned int get_uart_irq(PC87312State *s, int i)
+static unsigned int get_uart_irq(ISASuperIODevice *sio, uint8_t i)
 {
+    PC87312State *s = PC87312(sio);
     int idx;
     idx = (s->regs[REG_FAR] >> (2 * i + 2)) & 0x3;
     return (idx & 1) ? 3 : 4;
 }
 
-static inline bool is_uart_enabled(PC87312State *s, int i)
+static bool is_uart_enabled(ISASuperIODevice *sio, uint8_t i)
 {
+    PC87312State *s = PC87312(sio);
     return s->regs[REG_FER] & (FER_UART1_EN << i);
 }
 
@@ -271,11 +272,8 @@ static void pc87312_realize(DeviceState *dev, Error **errp)
     DeviceState *d;
     ISADevice *isa;
     ISABus *bus;
-    Chardev *chr;
     DriveInfo *drive;
     Error *local_err = NULL;
-    char name[5];
-    int i;
 
     s = PC87312(dev);
     isa = ISA_DEVICE(dev);
@@ -289,27 +287,6 @@ static void pc87312_realize(DeviceState *dev, Error **errp)
         return;
     }
 
-    for (i = 0; i < 2; i++) {
-        if (is_uart_enabled(s, i)) {
-            /* FIXME use a qdev chardev prop instead of serial_hds[] */
-            chr = serial_hds[i];
-            if (chr == NULL) {
-                snprintf(name, sizeof(name), "ser%d", i);
-                chr = qemu_chr_new(name, "null");
-            }
-            isa = isa_create(bus, "isa-serial");
-            d = DEVICE(isa);
-            qdev_prop_set_uint32(d, "index", i);
-            qdev_prop_set_uint32(d, "iobase", get_uart_iobase(s, i));
-            qdev_prop_set_uint32(d, "irq", get_uart_irq(s, i));
-            qdev_prop_set_chr(d, "chardev", chr);
-            qdev_init_nofail(d);
-            s->uart[i].dev = isa;
-            trace_pc87312_info_serial(i, get_uart_iobase(s, i),
-                                      get_uart_irq(s, i));
-        }
-    }
-
     if (is_fdc_enabled(s)) {
         isa = isa_create(bus, "isa-fdc");
         d = DEVICE(isa);
@@ -380,8 +357,6 @@ static void pc87312_class_init(ObjectClass *klass, void *data)
     dc->reset = pc87312_reset;
     dc->vmsd = &vmstate_pc87312;
     dc->props = pc87312_properties;
-    /* Reason: Uses serial_hds[0] in realize(), so it can't be used twice */
-    dc->user_creatable = false;
 
     sc->parallel = (ISASuperIOFuncs){
         .count = 1,
@@ -389,6 +364,12 @@ static void pc87312_class_init(ObjectClass *klass, void *data)
         .get_iobase = get_parallel_iobase,
         .get_irq    = get_parallel_irq,
     };
+    sc->serial = (ISASuperIOFuncs){
+        .count = 2,
+        .is_enabled = is_uart_enabled,
+        .get_iobase = get_uart_iobase,
+        .get_irq    = get_uart_irq,
+    };
 }
 
 static const TypeInfo pc87312_type_info = {
diff --git a/hw/isa/trace-events b/hw/isa/trace-events
index 97b1949981..c78dd6c353 100644
--- a/hw/isa/trace-events
+++ b/hw/isa/trace-events
@@ -2,10 +2,10 @@
 
 # hw/isa/isa-superio.c
 superio_create_parallel(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, irq %u"
+superio_create_serial(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, irq %u"
 
 # hw/isa/pc87312.c
 pc87312_io_read(uint32_t addr, uint32_t val) "read addr=0x%x val=0x%x"
 pc87312_io_write(uint32_t addr, uint32_t val) "write addr=0x%x val=0x%x"
 pc87312_info_floppy(uint32_t base) "base 0x%x"
 pc87312_info_ide(uint32_t base) "base 0x%x"
-pc87312_info_serial(int n, uint32_t base, uint32_t irq) "id=%d, base 0x%x, irq %u"
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [Qemu-devel] [RFC PATCH v2 11/22] hw/isa/superio: Factor out the floppy disc controller code from pc87312.c
  2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
                   ` (9 preceding siblings ...)
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 10/22] hw/isa/superio: Factor out the serial " Philippe Mathieu-Daudé
@ 2018-03-05 21:19 ` Philippe Mathieu-Daudé
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 12/22] hw/isa/superio: Add a keyboard/mouse controller (8042) Philippe Mathieu-Daudé
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-05 21:19 UTC (permalink / raw)
  To: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao, open list:PReP

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/isa/pc87312.h |  4 ----
 include/hw/isa/superio.h |  2 ++
 hw/isa/isa-superio.c     | 36 ++++++++++++++++++++++++++++++++++++
 hw/isa/pc87312.c         | 46 +++++++++++++++++++---------------------------
 hw/isa/trace-events      |  2 +-
 5 files changed, 58 insertions(+), 32 deletions(-)

diff --git a/include/hw/isa/pc87312.h b/include/hw/isa/pc87312.h
index 1480615a2c..e16263d4b1 100644
--- a/include/hw/isa/pc87312.h
+++ b/include/hw/isa/pc87312.h
@@ -39,10 +39,6 @@ typedef struct PC87312State {
     uint16_t iobase;
     uint8_t config; /* initial configuration */
 
-    struct {
-        ISADevice *dev;
-    } fdc;
-
     struct {
         ISADevice *dev;
     } ide;
diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h
index 0b516721c3..e8007b9eee 100644
--- a/include/hw/isa/superio.h
+++ b/include/hw/isa/superio.h
@@ -29,6 +29,7 @@ typedef struct ISASuperIODevice {
 
     ISADevice *parallel[MAX_PARALLEL_PORTS];
     ISADevice *serial[MAX_SERIAL_PORTS];
+    ISADevice *floppy;
 } ISASuperIODevice;
 
 typedef struct ISASuperIOFuncs {
@@ -47,6 +48,7 @@ typedef struct ISASuperIOClass {
 
     ISASuperIOFuncs parallel;
     ISASuperIOFuncs serial;
+    ISASuperIOFuncs floppy;
 } ISASuperIOClass;
 
 #endif /* HW_ISA_SUPERIO_H */
diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c
index bd4671655e..22bf79d3c3 100644
--- a/hw/isa/isa-superio.c
+++ b/hw/isa/isa-superio.c
@@ -11,7 +11,10 @@
  */
 #include "qemu/osdep.h"
 #include "qemu/error-report.h"
+#include "qapi/error.h"
 #include "sysemu/sysemu.h"
+#include "sysemu/block-backend.h"
+#include "sysemu/blockdev.h"
 #include "chardev/char.h"
 #include "hw/isa/superio.h"
 #include "hw/char/serial.h"
@@ -25,6 +28,7 @@ static void isa_superio_realize(DeviceState *dev, Error **errp)
     ISADevice *isa;
     DeviceState *d;
     Chardev *chr;
+    DriveInfo *drive;
     char *name;
     int i;
 
@@ -103,6 +107,38 @@ static void isa_superio_realize(DeviceState *dev, Error **errp)
             g_free(name);
         }
     }
+
+    /* Floppy disc */
+    if (!k->floppy.is_enabled || k->floppy.is_enabled(sio, 0)) {
+        isa = isa_create(bus, "isa-fdc");
+        d = DEVICE(isa);
+        if (k->floppy.get_iobase) {
+            qdev_prop_set_uint32(d, "iobase", k->floppy.get_iobase(sio, 0));
+        }
+        if (k->floppy.get_irq) {
+            qdev_prop_set_uint32(d, "irq", k->floppy.get_irq(sio, 0));
+        }
+        /* FIXME use a qdev drive property instead of drive_get() */
+        drive = drive_get(IF_FLOPPY, 0, 0);
+        if (drive != NULL) {
+            qdev_prop_set_drive(d, "driveA", blk_by_legacy_dinfo(drive),
+                                &error_fatal);
+        }
+        /* FIXME use a qdev drive property instead of drive_get() */
+        drive = drive_get(IF_FLOPPY, 0, 1);
+        if (drive != NULL) {
+            qdev_prop_set_drive(d, "driveB", blk_by_legacy_dinfo(drive),
+                                &error_fatal);
+        }
+        qdev_init_nofail(d);
+        sio->floppy = isa;
+        trace_superio_create_floppy(0,
+                                    k->floppy.get_iobase ?
+                                    k->floppy.get_iobase(sio, 0) : -1,
+                                    k->floppy.get_irq ?
+                                    k->floppy.get_irq(sio, 0) : -1);
+    }
+
 }
 
 static void isa_superio_class_init(ObjectClass *oc, void *data)
diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c
index c2837bca43..a1845a91c3 100644
--- a/hw/isa/pc87312.c
+++ b/hw/isa/pc87312.c
@@ -27,8 +27,6 @@
 #include "hw/isa/pc87312.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
-#include "sysemu/block-backend.h"
-#include "sysemu/blockdev.h"
 #include "trace.h"
 
 
@@ -129,16 +127,26 @@ static bool is_uart_enabled(ISASuperIODevice *sio, uint8_t i)
 
 /* Floppy controller */
 
-static inline bool is_fdc_enabled(PC87312State *s)
+static bool is_fdc_enabled(ISASuperIODevice *sio, uint8_t index)
 {
+    PC87312State *s = PC87312(sio);
+    assert(!index);
     return s->regs[REG_FER] & FER_FDC_EN;
 }
 
-static inline uint16_t get_fdc_iobase(PC87312State *s)
+static uint16_t get_fdc_iobase(ISASuperIODevice *sio, uint8_t index)
 {
+    PC87312State *s = PC87312(sio);
+    assert(!index);
     return (s->regs[REG_FER] & FER_FDC_ADDR) ? 0x370 : 0x3f0;
 }
 
+static unsigned int get_fdc_irq(ISASuperIODevice *sio, uint8_t index)
+{
+    assert(!index);
+    return 6;
+}
+
 
 /* IDE controller */
 
@@ -272,7 +280,6 @@ static void pc87312_realize(DeviceState *dev, Error **errp)
     DeviceState *d;
     ISADevice *isa;
     ISABus *bus;
-    DriveInfo *drive;
     Error *local_err = NULL;
 
     s = PC87312(dev);
@@ -287,28 +294,6 @@ static void pc87312_realize(DeviceState *dev, Error **errp)
         return;
     }
 
-    if (is_fdc_enabled(s)) {
-        isa = isa_create(bus, "isa-fdc");
-        d = DEVICE(isa);
-        qdev_prop_set_uint32(d, "iobase", get_fdc_iobase(s));
-        qdev_prop_set_uint32(d, "irq", 6);
-        /* FIXME use a qdev drive property instead of drive_get() */
-        drive = drive_get(IF_FLOPPY, 0, 0);
-        if (drive != NULL) {
-            qdev_prop_set_drive(d, "driveA", blk_by_legacy_dinfo(drive),
-                                &error_fatal);
-        }
-        /* FIXME use a qdev drive property instead of drive_get() */
-        drive = drive_get(IF_FLOPPY, 0, 1);
-        if (drive != NULL) {
-            qdev_prop_set_drive(d, "driveB", blk_by_legacy_dinfo(drive),
-                                &error_fatal);
-        }
-        qdev_init_nofail(d);
-        s->fdc.dev = isa;
-        trace_pc87312_info_floppy(get_fdc_iobase(s));
-    }
-
     if (is_ide_enabled(s)) {
         isa = isa_create(bus, "isa-ide");
         d = DEVICE(isa);
@@ -370,6 +355,12 @@ static void pc87312_class_init(ObjectClass *klass, void *data)
         .get_iobase = get_uart_iobase,
         .get_irq    = get_uart_irq,
     };
+    sc->floppy = (ISASuperIOFuncs){
+        .count = 1,
+        .is_enabled = is_fdc_enabled,
+        .get_iobase = get_fdc_iobase,
+        .get_irq    = get_fdc_irq,
+    };
 }
 
 static const TypeInfo pc87312_type_info = {
@@ -378,6 +369,7 @@ static const TypeInfo pc87312_type_info = {
     .instance_size = sizeof(PC87312State),
     .instance_init = pc87312_initfn,
     .class_init    = pc87312_class_init,
+    /* FIXME use a qdev drive property instead of drive_get() */
 };
 
 static void pc87312_register_types(void)
diff --git a/hw/isa/trace-events b/hw/isa/trace-events
index c78dd6c353..8d9900882f 100644
--- a/hw/isa/trace-events
+++ b/hw/isa/trace-events
@@ -3,9 +3,9 @@
 # hw/isa/isa-superio.c
 superio_create_parallel(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, irq %u"
 superio_create_serial(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, irq %u"
+superio_create_floppy(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, irq %u"
 
 # hw/isa/pc87312.c
 pc87312_io_read(uint32_t addr, uint32_t val) "read addr=0x%x val=0x%x"
 pc87312_io_write(uint32_t addr, uint32_t val) "write addr=0x%x val=0x%x"
-pc87312_info_floppy(uint32_t base) "base 0x%x"
 pc87312_info_ide(uint32_t base) "base 0x%x"
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [Qemu-devel] [RFC PATCH v2 12/22] hw/isa/superio: Add a keyboard/mouse controller (8042)
  2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
                   ` (10 preceding siblings ...)
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 11/22] hw/isa/superio: Factor out the floppy disc controller " Philippe Mathieu-Daudé
@ 2018-03-05 21:19 ` Philippe Mathieu-Daudé
  2018-03-06  4:06   ` David Gibson
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 13/22] hw/isa/superio: Factor out the IDE code from pc87312.c Philippe Mathieu-Daudé
                   ` (11 subsequent siblings)
  23 siblings, 1 reply; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-05 21:19 UTC (permalink / raw)
  To: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao, David Gibson, Alexander Graf,
	open list:PReP

Since the PC87312 inherits this abstract model, we remove the I8042
instance in the PREP machine.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/isa/superio.h | 1 +
 hw/isa/isa-superio.c     | 3 +++
 hw/ppc/prep.c            | 1 -
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h
index e8007b9eee..2fc33bf3d3 100644
--- a/include/hw/isa/superio.h
+++ b/include/hw/isa/superio.h
@@ -30,6 +30,7 @@ typedef struct ISASuperIODevice {
     ISADevice *parallel[MAX_PARALLEL_PORTS];
     ISADevice *serial[MAX_SERIAL_PORTS];
     ISADevice *floppy;
+    ISADevice *kbc;
 } ISASuperIODevice;
 
 typedef struct ISASuperIOFuncs {
diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c
index 22bf79d3c3..6a24ac0259 100644
--- a/hw/isa/isa-superio.c
+++ b/hw/isa/isa-superio.c
@@ -17,6 +17,7 @@
 #include "sysemu/blockdev.h"
 #include "chardev/char.h"
 #include "hw/isa/superio.h"
+#include "hw/input/i8042.h"
 #include "hw/char/serial.h"
 #include "trace.h"
 
@@ -139,6 +140,8 @@ static void isa_superio_realize(DeviceState *dev, Error **errp)
                                     k->floppy.get_irq(sio, 0) : -1);
     }
 
+    /* Keyboard, mouse */
+    sio->kbc = isa_create_simple(bus, TYPE_I8042);
 }
 
 static void isa_superio_class_init(ObjectClass *oc, void *data)
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index 610ec7ec32..96d319b87c 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -642,7 +642,6 @@ static void ppc_prep_init(MachineState *machine)
                      hd[2 * i],
 		     hd[2 * i + 1]);
     }
-    isa_create_simple(isa_bus, TYPE_I8042);
 
     cpu = POWERPC_CPU(first_cpu);
     sysctrl->reset_irq = cpu->env.irq_inputs[PPC6xx_INPUT_HRESET];
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [Qemu-devel] [RFC PATCH v2 13/22] hw/isa/superio: Factor out the IDE code from pc87312.c
  2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
                   ` (11 preceding siblings ...)
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 12/22] hw/isa/superio: Add a keyboard/mouse controller (8042) Philippe Mathieu-Daudé
@ 2018-03-05 21:19 ` Philippe Mathieu-Daudé
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 14/22] hw/mips/malta: Code movement Philippe Mathieu-Daudé
                   ` (10 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-05 21:19 UTC (permalink / raw)
  To: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao, open list:PReP

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/isa/superio.h |  2 ++
 hw/isa/isa-superio.c     | 22 ++++++++++++++++++++++
 hw/isa/pc87312.c         | 36 ++++++++++++++++++++----------------
 hw/isa/trace-events      |  2 +-
 4 files changed, 45 insertions(+), 17 deletions(-)

diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h
index 2fc33bf3d3..3dd5448f8c 100644
--- a/include/hw/isa/superio.h
+++ b/include/hw/isa/superio.h
@@ -31,6 +31,7 @@ typedef struct ISASuperIODevice {
     ISADevice *serial[MAX_SERIAL_PORTS];
     ISADevice *floppy;
     ISADevice *kbc;
+    ISADevice *ide;
 } ISASuperIODevice;
 
 typedef struct ISASuperIOFuncs {
@@ -50,6 +51,7 @@ typedef struct ISASuperIOClass {
     ISASuperIOFuncs parallel;
     ISASuperIOFuncs serial;
     ISASuperIOFuncs floppy;
+    ISASuperIOFuncs ide;
 } ISASuperIOClass;
 
 #endif /* HW_ISA_SUPERIO_H */
diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c
index 6a24ac0259..88d254a602 100644
--- a/hw/isa/isa-superio.c
+++ b/hw/isa/isa-superio.c
@@ -142,6 +142,28 @@ static void isa_superio_realize(DeviceState *dev, Error **errp)
 
     /* Keyboard, mouse */
     sio->kbc = isa_create_simple(bus, TYPE_I8042);
+
+    /* IDE */
+    if (k->ide.count && (!k->ide.is_enabled || k->ide.is_enabled(sio, 0))) {
+        isa = isa_create(bus, "isa-ide");
+        d = DEVICE(isa);
+        if (k->ide.get_iobase) {
+            qdev_prop_set_uint32(d, "iobase", k->ide.get_iobase(sio, 0));
+        }
+        if (k->ide.get_iobase) {
+            qdev_prop_set_uint32(d, "iobase2", k->ide.get_iobase(sio, 1));
+        }
+        if (k->ide.get_irq) {
+            qdev_prop_set_uint32(d, "irq", k->ide.get_irq(sio, 0));
+        }
+        qdev_init_nofail(d);
+        sio->ide = isa;
+        trace_superio_create_ide(0,
+                                 k->ide.get_iobase ?
+                                 k->ide.get_iobase(sio, 0) : -1,
+                                 k->ide.get_irq ?
+                                 k->ide.get_irq(sio, 0) : -1);
+    }
 }
 
 static void isa_superio_class_init(ObjectClass *oc, void *data)
diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c
index a1845a91c3..5cf64505fe 100644
--- a/hw/isa/pc87312.c
+++ b/hw/isa/pc87312.c
@@ -150,16 +150,28 @@ static unsigned int get_fdc_irq(ISASuperIODevice *sio, uint8_t index)
 
 /* IDE controller */
 
-static inline bool is_ide_enabled(PC87312State *s)
+static bool is_ide_enabled(ISASuperIODevice *sio, uint8_t index)
 {
+    PC87312State *s = PC87312(sio);
+
     return s->regs[REG_FER] & FER_IDE_EN;
 }
 
-static inline uint16_t get_ide_iobase(PC87312State *s)
+static uint16_t get_ide_iobase(ISASuperIODevice *sio, uint8_t index)
 {
+    PC87312State *s = PC87312(sio);
+
+    if (index == 1) {
+        return get_ide_iobase(sio, 0) + 0x206;
+    }
     return (s->regs[REG_FER] & FER_IDE_ADDR) ? 0x170 : 0x1f0;
 }
 
+static unsigned int get_ide_irq(ISASuperIODevice *sio, uint8_t index)
+{
+    assert(index == 0);
+    return 14;
+}
 
 static void reconfigure_devices(PC87312State *s)
 {
@@ -277,14 +289,11 @@ static void pc87312_reset(DeviceState *d)
 static void pc87312_realize(DeviceState *dev, Error **errp)
 {
     PC87312State *s;
-    DeviceState *d;
     ISADevice *isa;
-    ISABus *bus;
     Error *local_err = NULL;
 
     s = PC87312(dev);
     isa = ISA_DEVICE(dev);
-    bus = isa_bus_from_device(isa);
     isa_register_ioport(isa, &s->io, s->iobase);
     pc87312_hard_reset(s);
 
@@ -293,17 +302,6 @@ static void pc87312_realize(DeviceState *dev, Error **errp)
         error_propagate(errp, local_err);
         return;
     }
-
-    if (is_ide_enabled(s)) {
-        isa = isa_create(bus, "isa-ide");
-        d = DEVICE(isa);
-        qdev_prop_set_uint32(d, "iobase", get_ide_iobase(s));
-        qdev_prop_set_uint32(d, "iobase2", get_ide_iobase(s) + 0x206);
-        qdev_prop_set_uint32(d, "irq", 14);
-        qdev_init_nofail(d);
-        s->ide.dev = isa;
-        trace_pc87312_info_ide(get_ide_iobase(s));
-    }
 }
 
 static void pc87312_initfn(Object *obj)
@@ -361,6 +359,12 @@ static void pc87312_class_init(ObjectClass *klass, void *data)
         .get_iobase = get_fdc_iobase,
         .get_irq    = get_fdc_irq,
     };
+    sc->ide = (ISASuperIOFuncs){
+        .count = 1,
+        .is_enabled = is_ide_enabled,
+        .get_iobase = get_ide_iobase,
+        .get_irq    = get_ide_irq,
+    };
 }
 
 static const TypeInfo pc87312_type_info = {
diff --git a/hw/isa/trace-events b/hw/isa/trace-events
index 8d9900882f..80ac6175d6 100644
--- a/hw/isa/trace-events
+++ b/hw/isa/trace-events
@@ -4,8 +4,8 @@
 superio_create_parallel(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, irq %u"
 superio_create_serial(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, irq %u"
 superio_create_floppy(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, irq %u"
+superio_create_ide(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, irq %u"
 
 # hw/isa/pc87312.c
 pc87312_io_read(uint32_t addr, uint32_t val) "read addr=0x%x val=0x%x"
 pc87312_io_write(uint32_t addr, uint32_t val) "write addr=0x%x val=0x%x"
-pc87312_info_ide(uint32_t base) "base 0x%x"
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [Qemu-devel] [RFC PATCH v2 14/22] hw/mips/malta: Code movement
  2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
                   ` (12 preceding siblings ...)
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 13/22] hw/isa/superio: Factor out the IDE code from pc87312.c Philippe Mathieu-Daudé
@ 2018-03-05 21:19 ` Philippe Mathieu-Daudé
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 15/22] hw/isa/superio: Factor out the FDC37M817 Super I/O from mips_malta.c Philippe Mathieu-Daudé
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-05 21:19 UTC (permalink / raw)
  To: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao

Move the SouthBridge peripherals first, and keep the Super I/O
peripherals last.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/mips/mips_malta.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index cd7bd0eef6..9e0724ca5a 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -1062,10 +1062,6 @@ void mips_malta_init(MachineState *machine)
         memory_region_add_subregion(system_memory, 512 << 20, ram_low_postio);
     }
 
-    /* generate SPD EEPROM data */
-    generate_eeprom_spd(&smbus_eeprom_buf[0 * 256], ram_size);
-    generate_eeprom_serial(&smbus_eeprom_buf[6 * 256]);
-
 #ifdef TARGET_WORDS_BIGENDIAN
     be = 1;
 #else
@@ -1208,15 +1204,19 @@ void mips_malta_init(MachineState *machine)
     pci_create_simple(pci_bus, piix4_devfn + 2, "piix4-usb-uhci");
     smbus = piix4_pm_init(pci_bus, piix4_devfn + 3, 0x1100,
                           isa_get_irq(NULL, 9), NULL, 0, NULL);
-    smbus_eeprom_init(smbus, 8, smbus_eeprom_buf, smbus_eeprom_size);
-    g_free(smbus_eeprom_buf);
     pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
     i8257_dma_init(isa_bus, 0);
+    mc146818_rtc_init(isa_bus, 2000, NULL);
+
+    /* generate SPD EEPROM data */
+    generate_eeprom_spd(&smbus_eeprom_buf[0 * 256], ram_size);
+    generate_eeprom_serial(&smbus_eeprom_buf[6 * 256]);
+    smbus_eeprom_init(smbus, 8, smbus_eeprom_buf, smbus_eeprom_size);
+    g_free(smbus_eeprom_buf);
 
     /* Super I/O */
     isa_create_simple(isa_bus, TYPE_I8042);
 
-    mc146818_rtc_init(isa_bus, 2000, NULL);
     serial_hds_isa_init(isa_bus, 0, 2);
     parallel_hds_isa_init(isa_bus, 1);
 
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [Qemu-devel] [RFC PATCH v2 15/22] hw/isa/superio: Factor out the FDC37M817 Super I/O from mips_malta.c
  2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
                   ` (13 preceding siblings ...)
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 14/22] hw/mips/malta: Code movement Philippe Mathieu-Daudé
@ 2018-03-05 21:19 ` Philippe Mathieu-Daudé
  2018-03-08 20:43   ` Philippe Mathieu-Daudé
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 16/22] hw/mips/mips_fulong2e: Factor out vt82c686b_southbridge_init() Philippe Mathieu-Daudé
                   ` (8 subsequent siblings)
  23 siblings, 1 reply; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-05 21:19 UTC (permalink / raw)
  To: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/isa/superio.h |  2 ++
 hw/isa/isa-superio.c     | 20 ++++++++++++++++++++
 hw/mips/mips_malta.c     | 35 ++++++++++-------------------------
 3 files changed, 32 insertions(+), 25 deletions(-)

diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h
index 3dd5448f8c..b47aac3cf8 100644
--- a/include/hw/isa/superio.h
+++ b/include/hw/isa/superio.h
@@ -54,4 +54,6 @@ typedef struct ISASuperIOClass {
     ISASuperIOFuncs ide;
 } ISASuperIOClass;
 
+#define TYPE_FDC37M81X_SUPERIO  "fdc37m81x-superio"
+
 #endif /* HW_ISA_SUPERIO_H */
diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c
index 88d254a602..f1f699fc2f 100644
--- a/hw/isa/isa-superio.c
+++ b/hw/isa/isa-superio.c
@@ -182,9 +182,29 @@ static const TypeInfo isa_superio_type_info = {
     .class_init = isa_superio_class_init,
 };
 
+/* 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,
+    .instance_size = sizeof(ISASuperIODevice),
+    .class_size    = sizeof(ISASuperIOClass),
+    .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/mips/mips_malta.c b/hw/mips/mips_malta.c
index 9e0724ca5a..f6513a4fd5 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -27,14 +27,12 @@
 #include "cpu.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
+#include "hw/isa/superio.h"
 #include "hw/dma/i8257.h"
 #include "hw/char/serial.h"
-#include "hw/char/parallel.h"
-#include "hw/block/fdc.h"
 #include "net/net.h"
 #include "hw/boards.h"
 #include "hw/i2c/smbus.h"
-#include "sysemu/block-backend.h"
 #include "hw/block/flash.h"
 #include "hw/mips/mips.h"
 #include "hw/mips/cpudevs.h"
@@ -47,7 +45,6 @@
 #include "hw/loader.h"
 #include "elf.h"
 #include "hw/timer/mc146818rtc.h"
-#include "hw/input/i8042.h"
 #include "hw/timer/i8254.h"
 #include "sysemu/blockdev.h"
 #include "exec/address-spaces.h"
@@ -1005,10 +1002,8 @@ void mips_malta_init(MachineState *machine)
     qemu_irq cbus_irq, i8259_irq;
     int piix4_devfn;
     I2CBus *smbus;
-    int i;
     DriveInfo *dinfo;
     DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
-    DriveInfo *fd[MAX_FD];
     int fl_idx = 0;
     int fl_sectors = bios_size >> 16;
     int be;
@@ -1023,15 +1018,6 @@ void mips_malta_init(MachineState *machine)
 
     qdev_init_nofail(dev);
 
-    /* Make sure the first 3 serial ports are associated with a device. */
-    for(i = 0; i < 3; i++) {
-        if (!serial_hds[i]) {
-            char label[32];
-            snprintf(label, sizeof(label), "serial%d", i);
-            serial_hds[i] = qemu_chr_new(label, "null");
-        }
-    }
-
     /* create CPU */
     mips_create_cpu(s, machine->cpu_type, &cbus_irq, &i8259_irq);
 
@@ -1067,7 +1053,14 @@ void mips_malta_init(MachineState *machine)
 #else
     be = 0;
 #endif
+
     /* FPGA */
+
+    /* Make sure the second serial port is associated with a device. */
+    if (!serial_hds[2]) {
+        serial_hds[2] = qemu_chr_new("fpga-uart", "null");
+    }
+
     /* The CBUS UART is attached to the MIPS CPU INT2 pin, ie interrupt 4 */
     malta_fpga_init(system_memory, FPGA_ADDRESS, cbus_irq, serial_hds[2]);
 
@@ -1214,16 +1207,8 @@ void mips_malta_init(MachineState *machine)
     smbus_eeprom_init(smbus, 8, smbus_eeprom_buf, smbus_eeprom_size);
     g_free(smbus_eeprom_buf);
 
-    /* Super I/O */
-    isa_create_simple(isa_bus, TYPE_I8042);
-
-    serial_hds_isa_init(isa_bus, 0, 2);
-    parallel_hds_isa_init(isa_bus, 1);
-
-    for(i = 0; i < MAX_FD; i++) {
-        fd[i] = drive_get(IF_FLOPPY, 0, i);
-    }
-    fdctrl_init_isa(isa_bus, fd);
+    /* Super I/O: SMS FDC37M817 */
+    isa_create_simple(isa_bus, TYPE_FDC37M81X_SUPERIO);
 
     /* Network card */
     network_init(pci_bus);
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [Qemu-devel] [RFC PATCH v2 16/22] hw/mips/mips_fulong2e: Factor out vt82c686b_southbridge_init()
  2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
                   ` (14 preceding siblings ...)
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 15/22] hw/isa/superio: Factor out the FDC37M817 Super I/O from mips_malta.c Philippe Mathieu-Daudé
@ 2018-03-05 21:19 ` Philippe Mathieu-Daudé
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 17/22] hw/isa/vt82c686: Rename vt82c686b_init() -> vt82c686b_isa_init() Philippe Mathieu-Daudé
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-05 21:19 UTC (permalink / raw)
  To: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/mips/mips_fulong2e.c | 83 ++++++++++++++++++++++++-------------------------
 1 file changed, 41 insertions(+), 42 deletions(-)

diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index 9339e02120..ca1f76a724 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -78,8 +78,6 @@
 #define FULONG2E_ATI_SLOT        6
 #define FULONG2E_RTL8139_SLOT    7
 
-static ISADevice *pit;
-
 static struct _loaderparams {
     int ram_size;
     const char *kernel_filename;
@@ -232,11 +230,44 @@ static const uint8_t eeprom_spd[0x80] = {
     0x20,0x30,0x20
 };
 
-/* Audio support */
-static void audio_init (PCIBus *pci_bus)
+static void vt82c686b_southbridge_init(PCIBus *pci_bus, int slot, qemu_irq intc,
+                                       I2CBus **i2c_bus, ISABus **p_isa_bus)
 {
-    vt82c686b_ac97_init(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 5));
-    vt82c686b_mc97_init(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 6));
+    qemu_irq *i8259;
+    ISABus *isa_bus;
+    DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
+
+    isa_bus = vt82c686b_init(pci_bus, PCI_DEVFN(slot, 0));
+    if (!isa_bus) {
+        fprintf(stderr, "vt82c686b_init error\n");
+        exit(1);
+    }
+    *p_isa_bus = isa_bus;
+    /* Interrupt controller */
+    /* The 8259 -> IP5  */
+    i8259 = i8259_init(isa_bus, intc);
+    isa_bus_irqs(isa_bus, i8259);
+    /* init other devices */
+    i8254_pit_init(isa_bus, 0x40, 0, NULL);
+    i8257_dma_init(isa_bus, 0);
+
+    ide_drive_get(hd, ARRAY_SIZE(hd));
+    vt82c686b_ide_init(pci_bus, hd, PCI_DEVFN(slot, 1));
+
+    pci_create_simple(pci_bus, PCI_DEVFN(slot, 2), "vt82c686b-usb-uhci");
+    pci_create_simple(pci_bus, PCI_DEVFN(slot, 3), "vt82c686b-usb-uhci");
+
+    *i2c_bus = vt82c686b_pm_init(pci_bus, PCI_DEVFN(slot, 4), 0xeee1, NULL);
+
+    /* Audio support */
+    vt82c686b_ac97_init(pci_bus, PCI_DEVFN(slot, 5));
+    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 */
@@ -269,11 +300,9 @@ static void mips_fulong2e_init(MachineState *machine)
     MemoryRegion *bios = g_new(MemoryRegion, 1);
     long bios_size;
     int64_t kernel_entry;
-    qemu_irq *i8259;
     PCIBus *pci_bus;
     ISABus *isa_bus;
     I2CBus *smbus;
-    DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
     MIPSCPU *cpu;
     CPUMIPSState *env;
 
@@ -335,46 +364,16 @@ static void mips_fulong2e_init(MachineState *machine)
     /* North bridge, Bonito --> IP2 */
     pci_bus = bonito_init((qemu_irq *)&(env->irq[2]));
 
-    /* South bridge */
-    ide_drive_get(hd, ARRAY_SIZE(hd));
-
-    isa_bus = vt82c686b_init(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 0));
-    if (!isa_bus) {
-        error_report("vt82c686b_init error");
-        exit(1);
-    }
-
-    /* Interrupt controller */
-    /* The 8259 -> IP5  */
-    i8259 = i8259_init(isa_bus, env->irq[5]);
-    isa_bus_irqs(isa_bus, i8259);
-
-    vt82c686b_ide_init(pci_bus, hd, PCI_DEVFN(FULONG2E_VIA_SLOT, 1));
-    pci_create_simple(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 2),
-                      "vt82c686b-usb-uhci");
-    pci_create_simple(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 3),
-                      "vt82c686b-usb-uhci");
+    /* South bridge -> IP5 */
+    vt82c686b_southbridge_init(pci_bus, FULONG2E_VIA_SLOT, env->irq[5],
+                               &smbus, &isa_bus);
 
-    smbus = vt82c686b_pm_init(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 4),
-                              0xeee1, NULL);
     /* TODO: Populate SPD eeprom data.  */
     smbus_eeprom_init(smbus, 1, eeprom_spd, sizeof(eeprom_spd));
 
-    /* init other devices */
-    pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
-    i8257_dma_init(isa_bus, 0);
-
-    /* Super I/O */
-    isa_create_simple(isa_bus, TYPE_I8042);
-
     mc146818_rtc_init(isa_bus, 2000, NULL);
 
-    serial_hds_isa_init(isa_bus, 0, MAX_SERIAL_PORTS);
-    parallel_hds_isa_init(isa_bus, 1);
-
-    /* Sound card */
-    audio_init(pci_bus);
-    /* Network card */
+    /* Network card: RTL8139D */
     network_init(pci_bus);
 }
 
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [Qemu-devel] [RFC PATCH v2 17/22] hw/isa/vt82c686: Rename vt82c686b_init() -> vt82c686b_isa_init()
  2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
                   ` (15 preceding siblings ...)
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 16/22] hw/mips/mips_fulong2e: Factor out vt82c686b_southbridge_init() Philippe Mathieu-Daudé
@ 2018-03-05 21:19 ` Philippe Mathieu-Daudé
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 18/22] hw/isa/vt82c686: Add the TYPE_VT82C686B_SUPERIO Philippe Mathieu-Daudé
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-05 21:19 UTC (permalink / raw)
  To: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao

This function only initialize the ISA bus.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/isa/vt82c686.h | 2 +-
 hw/isa/vt82c686.c         | 2 +-
 hw/mips/mips_fulong2e.c   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/hw/isa/vt82c686.h b/include/hw/isa/vt82c686.h
index 471b5e9e53..db97c8ed7a 100644
--- a/include/hw/isa/vt82c686.h
+++ b/include/hw/isa/vt82c686.h
@@ -2,7 +2,7 @@
 #define HW_VT82C686_H
 
 /* vt82c686.c */
-ISABus *vt82c686b_init(PCIBus * bus, int devfn);
+ISABus *vt82c686b_isa_init(PCIBus * bus, int devfn);
 void vt82c686b_ac97_init(PCIBus *bus, int devfn);
 void vt82c686b_mc97_init(PCIBus *bus, int devfn);
 I2CBus *vt82c686b_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base,
diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
index 070cc1889f..7eaf3c7e8f 100644
--- a/hw/isa/vt82c686.c
+++ b/hw/isa/vt82c686.c
@@ -478,7 +478,7 @@ static void vt82c686b_realize(PCIDevice *d, Error **errp)
     qemu_register_reset(vt82c686b_reset, d);
 }
 
-ISABus *vt82c686b_init(PCIBus *bus, int devfn)
+ISABus *vt82c686b_isa_init(PCIBus *bus, int devfn)
 {
     PCIDevice *d;
 
diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index ca1f76a724..9ebc225d3b 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -237,7 +237,7 @@ static void vt82c686b_southbridge_init(PCIBus *pci_bus, int slot, qemu_irq intc,
     ISABus *isa_bus;
     DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
 
-    isa_bus = vt82c686b_init(pci_bus, PCI_DEVFN(slot, 0));
+    isa_bus = vt82c686b_isa_init(pci_bus, PCI_DEVFN(slot, 0));
     if (!isa_bus) {
         fprintf(stderr, "vt82c686b_init error\n");
         exit(1);
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [Qemu-devel] [RFC PATCH v2 18/22] hw/isa/vt82c686: Add the TYPE_VT82C686B_SUPERIO
  2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
                   ` (16 preceding siblings ...)
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 17/22] hw/isa/vt82c686: Rename vt82c686b_init() -> vt82c686b_isa_init() Philippe Mathieu-Daudé
@ 2018-03-05 21:19 ` Philippe Mathieu-Daudé
  2018-03-08 21:49   ` Philippe Mathieu-Daudé
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 19/22] hw/isa/superio: Add the SMC FDC37C669 Super I/O Philippe Mathieu-Daudé
                   ` (5 subsequent siblings)
  23 siblings, 1 reply; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-05 21:19 UTC (permalink / raw)
  To: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/isa/vt82c686.h |  2 ++
 hw/isa/vt82c686.c         | 20 ++++++++++++++++++++
 hw/mips/mips_fulong2e.c   | 15 +++------------
 3 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/include/hw/isa/vt82c686.h b/include/hw/isa/vt82c686.h
index db97c8ed7a..c3c2b6e786 100644
--- a/include/hw/isa/vt82c686.h
+++ b/include/hw/isa/vt82c686.h
@@ -1,6 +1,8 @@
 #ifndef HW_VT82C686_H
 #define HW_VT82C686_H
 
+#define TYPE_VT82C686B_SUPERIO "vt82c686b-superio"
+
 /* vt82c686.c */
 ISABus *vt82c686b_isa_init(PCIBus * bus, int devfn);
 void vt82c686b_ac97_init(PCIBus *bus, int devfn);
diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
index 7eaf3c7e8f..cff1946232 100644
--- a/hw/isa/vt82c686.c
+++ b/hw/isa/vt82c686.c
@@ -17,6 +17,7 @@
 #include "hw/i2c/smbus.h"
 #include "hw/pci/pci.h"
 #include "hw/isa/isa.h"
+#include "hw/isa/superio.h"
 #include "hw/sysbus.h"
 #include "hw/mips/mips.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)
 {
     type_register_static(&via_ac97_info);
     type_register_static(&via_mc97_info);
     type_register_static(&via_pm_info);
+    type_register_static(&via_superio_info);
     type_register_static(&via_info);
 }
 
diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index 9ebc225d3b..d608f17e1e 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -23,9 +23,7 @@
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
 #include "hw/dma/i8257.h"
-#include "hw/char/serial.h"
-#include "hw/char/parallel.h"
-#include "hw/block/fdc.h"
+#include "hw/isa/superio.h"
 #include "net/net.h"
 #include "hw/boards.h"
 #include "hw/i2c/smbus.h"
@@ -34,7 +32,6 @@
 #include "hw/mips/mips.h"
 #include "hw/mips/cpudevs.h"
 #include "hw/pci/pci.h"
-#include "sysemu/sysemu.h"
 #include "audio/audio.h"
 #include "qemu/log.h"
 #include "hw/loader.h"
@@ -44,8 +41,6 @@
 #include "hw/isa/vt82c686.h"
 #include "hw/timer/mc146818rtc.h"
 #include "hw/timer/i8254.h"
-#include "hw/input/i8042.h"
-#include "sysemu/blockdev.h"
 #include "exec/address-spaces.h"
 #include "sysemu/qtest.h"
 #include "qemu/error-report.h"
@@ -250,6 +245,8 @@ static void vt82c686b_southbridge_init(PCIBus *pci_bus, int slot, qemu_irq intc,
     /* init other devices */
     i8254_pit_init(isa_bus, 0x40, 0, NULL);
     i8257_dma_init(isa_bus, 0);
+    /* Super I/O */
+    isa_create_simple(isa_bus, TYPE_VT82C686B_SUPERIO);
 
     ide_drive_get(hd, ARRAY_SIZE(hd));
     vt82c686b_ide_init(pci_bus, hd, PCI_DEVFN(slot, 1));
@@ -262,12 +259,6 @@ static void vt82c686b_southbridge_init(PCIBus *pci_bus, int slot, qemu_irq intc,
     /* Audio support */
     vt82c686b_ac97_init(pci_bus, PCI_DEVFN(slot, 5));
     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 */
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [Qemu-devel] [RFC PATCH v2 19/22] hw/isa/superio: Add the SMC FDC37C669 Super I/O
  2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
                   ` (17 preceding siblings ...)
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 18/22] hw/isa/vt82c686: Add the TYPE_VT82C686B_SUPERIO Philippe Mathieu-Daudé
@ 2018-03-05 21:19 ` Philippe Mathieu-Daudé
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 20/22] hw/alpha/dp264: Add the ISA DMA controller Philippe Mathieu-Daudé
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-05 21:19 UTC (permalink / raw)
  To: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/isa/superio.h   |   1 +
 hw/isa/smc37c669-superio.c | 115 +++++++++++++++++++++++++++++++++++++++++++++
 hw/isa/Makefile.objs       |   2 +-
 3 files changed, 117 insertions(+), 1 deletion(-)
 create mode 100644 hw/isa/smc37c669-superio.c

diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h
index b47aac3cf8..f9ba29aa30 100644
--- a/include/hw/isa/superio.h
+++ b/include/hw/isa/superio.h
@@ -55,5 +55,6 @@ typedef struct ISASuperIOClass {
 } ISASuperIOClass;
 
 #define TYPE_FDC37M81X_SUPERIO  "fdc37m81x-superio"
+#define TYPE_SMC37C669_SUPERIO  "smc37c669-superio"
 
 #endif /* HW_ISA_SUPERIO_H */
diff --git a/hw/isa/smc37c669-superio.c b/hw/isa/smc37c669-superio.c
new file mode 100644
index 0000000000..aa233c6967
--- /dev/null
+++ b/hw/isa/smc37c669-superio.c
@@ -0,0 +1,115 @@
+/*
+ * SMC FDC37C669 Super I/O controller
+ *
+ * Copyright (c) 2018 Philippe Mathieu-Daudé
+ *
+ * This code is licensed under the GNU GPLv2 and 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"
+
+/* UARTs (compatible with NS16450 or PC16550) */
+
+static bool is_serial_enabled(ISASuperIODevice *sio, uint8_t index)
+{
+    return index < 2;
+}
+
+static uint16_t get_serial_iobase(ISASuperIODevice *sio, uint8_t index)
+{
+    return index ? 0x2f8 : 0x3f8;
+}
+
+static unsigned int get_serial_irq(ISASuperIODevice *sio, uint8_t index)
+{
+    return index ? 3 : 4;
+}
+
+/* Parallel port */
+
+static bool is_parallel_enabled(ISASuperIODevice *sio, uint8_t index)
+{
+    return index < 1;
+}
+
+static uint16_t get_parallel_iobase(ISASuperIODevice *sio, uint8_t index)
+{
+    return 0x3bc;
+}
+
+static unsigned int get_parallel_irq(ISASuperIODevice *sio, uint8_t index)
+{
+    return 7;
+}
+
+static unsigned int get_parallel_dma(ISASuperIODevice *sio, uint8_t index)
+{
+    return 3;
+}
+
+/* Diskette controller (Software compatible with the Intel PC8477) */
+
+static bool is_fdc_enabled(ISASuperIODevice *sio, uint8_t index)
+{
+    return index < 1;
+}
+
+static uint16_t get_fdc_iobase(ISASuperIODevice *sio, uint8_t index)
+{
+    return 0x3f0;
+}
+
+static unsigned int get_fdc_irq(ISASuperIODevice *sio, uint8_t index)
+{
+    return 6;
+}
+
+static unsigned int get_fdc_dma(ISASuperIODevice *sio, uint8_t index)
+{
+    return 2;
+}
+
+static void smc37c669_class_init(ObjectClass *klass, void *data)
+{
+    ISASuperIOClass *sc = ISA_SUPERIO_CLASS(klass);
+
+    sc->parallel = (ISASuperIOFuncs){
+        .count = 1,
+        .is_enabled = is_parallel_enabled,
+        .get_iobase = get_parallel_iobase,
+        .get_irq    = get_parallel_irq,
+        .get_dma    = get_parallel_dma,
+    };
+    sc->serial = (ISASuperIOFuncs){
+        .count = 2,
+        .is_enabled = is_serial_enabled,
+        .get_iobase = get_serial_iobase,
+        .get_irq    = get_serial_irq,
+    };
+    sc->floppy = (ISASuperIOFuncs){
+        .count = 1,
+        .is_enabled = is_fdc_enabled,
+        .get_iobase = get_fdc_iobase,
+        .get_irq    = get_fdc_irq,
+        .get_dma    = get_fdc_dma,
+    };
+    sc->ide.count = 0;
+}
+
+static const TypeInfo smc37c669_type_info = {
+    .name          = TYPE_SMC37C669_SUPERIO,
+    .parent        = TYPE_ISA_SUPERIO,
+    .instance_size = sizeof(ISASuperIODevice),
+    .class_size    = sizeof(ISASuperIOClass),
+    .class_init    = smc37c669_class_init,
+};
+
+static void smc37c669_register_types(void)
+{
+    type_register_static(&smc37c669_type_info);
+}
+
+type_init(smc37c669_register_types)
diff --git a/hw/isa/Makefile.objs b/hw/isa/Makefile.objs
index cac655ba58..83e06f6c04 100644
--- a/hw/isa/Makefile.objs
+++ b/hw/isa/Makefile.objs
@@ -1,5 +1,5 @@
 common-obj-$(CONFIG_ISA_BUS) += isa-bus.o
-common-obj-$(CONFIG_ISA_BUS) += isa-superio.o
+common-obj-$(CONFIG_ISA_BUS) += isa-superio.o smc37c669-superio.o
 common-obj-$(CONFIG_APM) += apm.o
 common-obj-$(CONFIG_I82378) += i82378.o
 common-obj-$(CONFIG_PC87312) += pc87312.o
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [Qemu-devel] [RFC PATCH v2 20/22] hw/alpha/dp264: Add the ISA DMA controller
  2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
                   ` (18 preceding siblings ...)
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 19/22] hw/isa/superio: Add the SMC FDC37C669 Super I/O Philippe Mathieu-Daudé
@ 2018-03-05 21:19 ` Philippe Mathieu-Daudé
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 21/22] hw/alpha/dp264: Use the TYPE_SMC37C669_SUPERIO Philippe Mathieu-Daudé
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-05 21:19 UTC (permalink / raw)
  To: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 default-configs/alpha-softmmu.mak | 2 ++
 hw/alpha/dp264.c                  | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/default-configs/alpha-softmmu.mak b/default-configs/alpha-softmmu.mak
index e0d75e3058..3740adc5e9 100644
--- a/default-configs/alpha-softmmu.mak
+++ b/default-configs/alpha-softmmu.mak
@@ -4,7 +4,9 @@ include pci.mak
 include usb.mak
 CONFIG_SERIAL=y
 CONFIG_SERIAL_ISA=y
+CONFIG_I82374=y
 CONFIG_I8254=y
+CONFIG_I8257=y
 CONFIG_PCKBD=y
 CONFIG_VGA_CIRRUS=y
 CONFIG_IDE_CORE=y
diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
index e13cb576fd..ffad678ea7 100644
--- a/hw/alpha/dp264.c
+++ b/hw/alpha/dp264.c
@@ -21,6 +21,7 @@
 #include "hw/timer/i8254.h"
 #include "hw/input/i8042.h"
 #include "hw/char/serial.h"
+#include "hw/dma/i8257.h"
 #include "qemu/cutils.h"
 
 #define MAX_IDE_BUS 2
@@ -95,6 +96,9 @@ static void clipper_init(MachineState *machine)
         pci_nic_init_nofail(&nd_table[i], pci_bus, "e1000", NULL);
     }
 
+    /* 2 82C37 (dma) */
+    isa_create_simple(isa_bus, "i82374");
+
     /* IDE disk setup.  */
     {
         DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [Qemu-devel] [RFC PATCH v2 21/22] hw/alpha/dp264: Use the TYPE_SMC37C669_SUPERIO
  2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
                   ` (19 preceding siblings ...)
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 20/22] hw/alpha/dp264: Add the ISA DMA controller Philippe Mathieu-Daudé
@ 2018-03-05 21:19 ` Philippe Mathieu-Daudé
  2018-03-08 20:39   ` Philippe Mathieu-Daudé
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 22/22] hw/i386/pc: Factor out the superio code Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  23 siblings, 1 reply; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-05 21:19 UTC (permalink / raw)
  To: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 default-configs/alpha-softmmu.mak |  3 +++
 hw/alpha/dp264.c                  | 10 ++++------
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/default-configs/alpha-softmmu.mak b/default-configs/alpha-softmmu.mak
index 3740adc5e9..bbe361f01a 100644
--- a/default-configs/alpha-softmmu.mak
+++ b/default-configs/alpha-softmmu.mak
@@ -7,6 +7,9 @@ CONFIG_SERIAL_ISA=y
 CONFIG_I82374=y
 CONFIG_I8254=y
 CONFIG_I8257=y
+CONFIG_PARALLEL=y
+CONFIG_PARALLEL_ISA=y
+CONFIG_FDC=y
 CONFIG_PCKBD=y
 CONFIG_VGA_CIRRUS=y
 CONFIG_IDE_CORE=y
diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
index ffad678ea7..80b987f7fb 100644
--- a/hw/alpha/dp264.c
+++ b/hw/alpha/dp264.c
@@ -19,8 +19,7 @@
 #include "hw/timer/mc146818rtc.h"
 #include "hw/ide.h"
 #include "hw/timer/i8254.h"
-#include "hw/input/i8042.h"
-#include "hw/char/serial.h"
+#include "hw/isa/superio.h"
 #include "hw/dma/i8257.h"
 #include "qemu/cutils.h"
 
@@ -83,14 +82,10 @@ static void clipper_init(MachineState *machine)
     mc146818_rtc_init(isa_bus, 1900, rtc_irq);
 
     i8254_pit_init(isa_bus, 0x40, 0, NULL);
-    isa_create_simple(isa_bus, TYPE_I8042);
 
     /* VGA setup.  Don't bother loading the bios.  */
     pci_vga_init(pci_bus);
 
-    /* Serial code setup.  */
-    serial_hds_isa_init(isa_bus, 0, MAX_SERIAL_PORTS);
-
     /* Network setup.  e1000 is good enough, failing Tulip support.  */
     for (i = 0; i < nb_nics; i++) {
         pci_nic_init_nofail(&nd_table[i], pci_bus, "e1000", NULL);
@@ -99,6 +94,9 @@ static void clipper_init(MachineState *machine)
     /* 2 82C37 (dma) */
     isa_create_simple(isa_bus, "i82374");
 
+    /* Super I/O */
+    isa_create_simple(isa_bus, TYPE_SMC37C669_SUPERIO);
+
     /* IDE disk setup.  */
     {
         DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [Qemu-devel] [RFC PATCH v2 22/22] hw/i386/pc: Factor out the superio code
  2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
                   ` (20 preceding siblings ...)
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 21/22] hw/alpha/dp264: Use the TYPE_SMC37C669_SUPERIO Philippe Mathieu-Daudé
@ 2018-03-05 21:19 ` Philippe Mathieu-Daudé
  2018-03-05 21:50 ` [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO no-reply
  2018-03-07 16:52 ` Paolo Bonzini
  23 siblings, 0 replies; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-05 21:19 UTC (permalink / raw)
  To: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/i386/pc.c | 72 ++++++++++++++++++++++++++++++++++--------------------------
 1 file changed, 41 insertions(+), 31 deletions(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index efb1b3bccf..cb3b480e65 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1519,6 +1519,44 @@ static const MemoryRegionOps ioportF0_io_ops = {
     },
 };
 
+static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl, bool no_vmport)
+{
+    int i;
+    DriveInfo *fd[MAX_FD];
+    qemu_irq *a20_line;
+    ISADevice *i8042, *port92, *vmmouse;
+
+    serial_hds_isa_init(isa_bus, 0, MAX_SERIAL_PORTS);
+    parallel_hds_isa_init(isa_bus, MAX_PARALLEL_PORTS);
+
+    for (i = 0; i < MAX_FD; i++) {
+        fd[i] = drive_get(IF_FLOPPY, 0, i);
+        create_fdctrl |= !!fd[i];
+    }
+    if (create_fdctrl) {
+        fdctrl_init_isa(isa_bus, fd);
+    }
+
+    i8042 = isa_create_simple(isa_bus, "i8042");
+    if (!no_vmport) {
+        vmport_init(isa_bus);
+        vmmouse = isa_try_create(isa_bus, "vmmouse");
+    } else {
+        vmmouse = NULL;
+    }
+    if (vmmouse) {
+        DeviceState *dev = DEVICE(vmmouse);
+        qdev_prop_set_ptr(dev, "ps2_mouse", i8042);
+        qdev_init_nofail(dev);
+    }
+    port92 = isa_create_simple(isa_bus, "port92");
+
+    a20_line = qemu_allocate_irqs(handle_a20_line_change, first_cpu, 2);
+    i8042_setup_a20_line(i8042, a20_line[0]);
+    port92_init(port92, a20_line[1]);
+    g_free(a20_line);
+}
+
 void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
                           ISADevice **rtc_state,
                           bool create_fdctrl,
@@ -1527,13 +1565,11 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
                           uint32_t hpet_irqs)
 {
     int i;
-    DriveInfo *fd[MAX_FD];
     DeviceState *hpet = NULL;
     int pit_isa_irq = 0;
     qemu_irq pit_alt_irq = NULL;
     qemu_irq rtc_irq = NULL;
-    qemu_irq *a20_line;
-    ISADevice *i8042, *port92, *vmmouse, *pit = NULL;
+    ISADevice *pit = NULL;
     MemoryRegion *ioport80_io = g_new(MemoryRegion, 1);
     MemoryRegion *ioportF0_io = g_new(MemoryRegion, 1);
 
@@ -1590,36 +1626,10 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
         pcspk_init(isa_bus, pit);
     }
 
-    serial_hds_isa_init(isa_bus, 0, MAX_SERIAL_PORTS);
-    parallel_hds_isa_init(isa_bus, MAX_PARALLEL_PORTS);
-
-    a20_line = qemu_allocate_irqs(handle_a20_line_change, first_cpu, 2);
-    i8042 = isa_create_simple(isa_bus, "i8042");
-    i8042_setup_a20_line(i8042, a20_line[0]);
-    if (!no_vmport) {
-        vmport_init(isa_bus);
-        vmmouse = isa_try_create(isa_bus, "vmmouse");
-    } else {
-        vmmouse = NULL;
-    }
-    if (vmmouse) {
-        DeviceState *dev = DEVICE(vmmouse);
-        qdev_prop_set_ptr(dev, "ps2_mouse", i8042);
-        qdev_init_nofail(dev);
-    }
-    port92 = isa_create_simple(isa_bus, "port92");
-    port92_init(port92, a20_line[1]);
-    g_free(a20_line);
-
     i8257_dma_init(isa_bus, 0);
 
-    for(i = 0; i < MAX_FD; i++) {
-        fd[i] = drive_get(IF_FLOPPY, 0, i);
-        create_fdctrl |= !!fd[i];
-    }
-    if (create_fdctrl) {
-        fdctrl_init_isa(isa_bus, fd);
-    }
+    /* Super I/O */
+    pc_superio_init(isa_bus, create_fdctrl, no_vmport);
 }
 
 void pc_nic_init(ISABus *isa_bus, PCIBus *pci_bus)
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO
  2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
                   ` (21 preceding siblings ...)
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 22/22] hw/i386/pc: Factor out the superio code Philippe Mathieu-Daudé
@ 2018-03-05 21:50 ` no-reply
  2018-03-07 15:26   ` Paolo Bonzini
  2018-03-07 16:52 ` Paolo Bonzini
  23 siblings, 1 reply; 35+ messages in thread
From: no-reply @ 2018-03-05 21:50 UTC (permalink / raw)
  To: f4bug
  Cc: famz, mst, pbonzini, hpoussin, marcel, aurelien,
	mark.cave-ayland, aik, thuth, ehabkost, qemu-devel, gxt,
	yongbok.kim, atar4qemu, rth

Hi,

This series failed docker-mingw@fedora build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

Type: series
Message-id: 20180305211928.466-1-f4bug@amsat.org
Subject: [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO

=== TEST SCRIPT BEGIN ===
#!/bin/bash
set -e
git submodule update --init dtc
# Let docker tests dump environment info
export SHOW_ENV=1
export J=8
time make docker-test-mingw@fedora
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
d9c63caae7 hw/i386/pc: Factor out the superio code
9e67a390dd hw/alpha/dp264: Use the TYPE_SMC37C669_SUPERIO
25db7f9953 hw/alpha/dp264: Add the ISA DMA controller
76d6e67a57 hw/isa/superio: Add the SMC FDC37C669 Super I/O
ffc800b0ca hw/isa/vt82c686: Add the TYPE_VT82C686B_SUPERIO
85a19b0256 hw/isa/vt82c686: Rename vt82c686b_init() -> vt82c686b_isa_init()
d89bbbfee2 hw/mips/mips_fulong2e: Factor out vt82c686b_southbridge_init()
e420c875ee hw/isa/superio: Factor out the FDC37M817 Super I/O from mips_malta.c
d7de9887bb hw/mips/malta: Code movement
791635483e hw/isa/superio: Factor out the IDE code from pc87312.c
394b1f0e62 hw/isa/superio: Add a keyboard/mouse controller (8042)
16497b117a hw/isa/superio: Factor out the floppy disc controller code from pc87312.c
6d4c1541cc hw/isa/superio: Factor out the serial code from pc87312.c
c00ea6aea2 hw/isa/superio: Factor out the parallel code from pc87312.c
86481897b6 hw/isa/pc87312: Inherit from the abstract TYPE_ISA_SUPERIO
3fc152c1e1 hw/isa/superio: Add a Super I/O template based on the PC87312 device
20890e64ed hw/isa/pc87312: Use 'unsigned int' for the irq value
58fe8c70e3 hw/isa/pc87312: Use uint16_t for the ISA I/O base address
22258437c7 hw/isa/pc87312: Rename the device type as TYPE_PC87312_SUPERIO
435f762b70 hw/input/i8042: Extract declarations from i386/pc.h into input/i8042.h
9782517c54 hw/dma/i8257: Rename DMA_init() to i8257_dma_init()
23bb3a93ed hw/isa: Move parallel_hds_isa_init() to hw/char/parallel-isa.c

=== OUTPUT BEGIN ===
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
Cloning into '/var/tmp/patchew-tester-tmp-o8ld5l4n/src/dtc'...
Submodule path 'dtc': checked out 'e54388015af1fb4bf04d0bca99caba1074d9cc42'
  BUILD   fedora
make[1]: Entering directory '/var/tmp/patchew-tester-tmp-o8ld5l4n/src'
  GEN     /var/tmp/patchew-tester-tmp-o8ld5l4n/src/docker-src.2018-03-05-16.48.52.7877/qemu.tar
Cloning into '/var/tmp/patchew-tester-tmp-o8ld5l4n/src/docker-src.2018-03-05-16.48.52.7877/qemu.tar.vroot'...
done.
Your branch is up-to-date with 'origin/test'.
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
Cloning into '/var/tmp/patchew-tester-tmp-o8ld5l4n/src/docker-src.2018-03-05-16.48.52.7877/qemu.tar.vroot/dtc'...
Submodule path 'dtc': checked out 'e54388015af1fb4bf04d0bca99caba1074d9cc42'
Submodule 'ui/keycodemapdb' (git://git.qemu.org/keycodemapdb.git) registered for path 'ui/keycodemapdb'
Cloning into '/var/tmp/patchew-tester-tmp-o8ld5l4n/src/docker-src.2018-03-05-16.48.52.7877/qemu.tar.vroot/ui/keycodemapdb'...
Submodule path 'ui/keycodemapdb': checked out '6b3d716e2b6472eb7189d3220552280ef3d832ce'
  COPY    RUNNER
    RUN test-mingw in qemu:fedora 
Packages installed:
PyYAML-3.12-5.fc27.x86_64
SDL-devel-1.2.15-29.fc27.x86_64
bc-1.07.1-3.fc27.x86_64
bison-3.0.4-8.fc27.x86_64
bzip2-1.0.6-24.fc27.x86_64
ccache-3.3.5-1.fc27.x86_64
clang-5.0.1-1.fc27.x86_64
findutils-4.6.0-14.fc27.x86_64
flex-2.6.1-5.fc27.x86_64
gcc-7.3.1-2.fc27.x86_64
gcc-c++-7.3.1-2.fc27.x86_64
gettext-0.19.8.1-12.fc27.x86_64
git-2.14.3-2.fc27.x86_64
glib2-devel-2.54.3-2.fc27.x86_64
hostname-3.18-4.fc27.x86_64
libaio-devel-0.3.110-9.fc27.x86_64
libasan-7.3.1-2.fc27.x86_64
libfdt-devel-1.4.6-1.fc27.x86_64
libubsan-7.3.1-2.fc27.x86_64
make-4.2.1-4.fc27.x86_64
mingw32-SDL-1.2.15-9.fc27.noarch
mingw32-bzip2-1.0.6-9.fc27.noarch
mingw32-curl-7.54.1-2.fc27.noarch
mingw32-glib2-2.54.1-1.fc27.noarch
mingw32-gmp-6.1.2-2.fc27.noarch
mingw32-gnutls-3.5.13-2.fc27.noarch
mingw32-gtk2-2.24.31-4.fc27.noarch
mingw32-gtk3-3.22.16-1.fc27.noarch
mingw32-libjpeg-turbo-1.5.1-3.fc27.noarch
mingw32-libpng-1.6.29-2.fc27.noarch
mingw32-libssh2-1.8.0-3.fc27.noarch
mingw32-libtasn1-4.13-1.fc27.noarch
mingw32-nettle-3.3-3.fc27.noarch
mingw32-pixman-0.34.0-3.fc27.noarch
mingw32-pkg-config-0.28-9.fc27.x86_64
mingw64-SDL-1.2.15-9.fc27.noarch
mingw64-bzip2-1.0.6-9.fc27.noarch
mingw64-curl-7.54.1-2.fc27.noarch
mingw64-glib2-2.54.1-1.fc27.noarch
mingw64-gmp-6.1.2-2.fc27.noarch
mingw64-gnutls-3.5.13-2.fc27.noarch
mingw64-gtk2-2.24.31-4.fc27.noarch
mingw64-gtk3-3.22.16-1.fc27.noarch
mingw64-libjpeg-turbo-1.5.1-3.fc27.noarch
mingw64-libpng-1.6.29-2.fc27.noarch
mingw64-libssh2-1.8.0-3.fc27.noarch
mingw64-libtasn1-4.13-1.fc27.noarch
mingw64-nettle-3.3-3.fc27.noarch
mingw64-pixman-0.34.0-3.fc27.noarch
mingw64-pkg-config-0.28-9.fc27.x86_64
nettle-devel-3.4-1.fc27.x86_64
perl-5.26.1-402.fc27.x86_64
pixman-devel-0.34.0-4.fc27.x86_64
python3-3.6.2-13.fc27.x86_64
sparse-0.5.1-2.fc27.x86_64
tar-1.29-7.fc27.x86_64
which-2.21-4.fc27.x86_64
zlib-devel-1.2.11-4.fc27.x86_64

Environment variables:
TARGET_LIST=
PACKAGES=ccache gettext git tar PyYAML sparse flex bison python3 bzip2 hostname     glib2-devel pixman-devel zlib-devel SDL-devel libfdt-devel     gcc gcc-c++ clang make perl which bc findutils libaio-devel     nettle-devel libasan libubsan     mingw32-pixman mingw32-glib2 mingw32-gmp mingw32-SDL mingw32-pkg-config     mingw32-gtk2 mingw32-gtk3 mingw32-gnutls mingw32-nettle mingw32-libtasn1     mingw32-libjpeg-turbo mingw32-libpng mingw32-curl mingw32-libssh2     mingw32-bzip2     mingw64-pixman mingw64-glib2 mingw64-gmp mingw64-SDL mingw64-pkg-config     mingw64-gtk2 mingw64-gtk3 mingw64-gnutls mingw64-nettle mingw64-libtasn1     mingw64-libjpeg-turbo mingw64-libpng mingw64-curl mingw64-libssh2     mingw64-bzip2
J=8
V=
HOSTNAME=b9600253438d
DEBUG=
SHOW_ENV=1
PWD=/
HOME=/root
CCACHE_DIR=/var/tmp/ccache
DISTTAG=f27container
QEMU_CONFIGURE_OPTS=--python=/usr/bin/python3
FGC=f27
TEST_DIR=/tmp/qemu-test
SHLVL=1
FEATURES=mingw clang pyyaml asan dtc
PATH=/usr/lib/ccache:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
MAKEFLAGS= -j8
EXTRA_CONFIGURE_OPTS=
_=/usr/bin/env

Configure options:
--enable-werror --target-list=x86_64-softmmu,aarch64-softmmu --prefix=/tmp/qemu-test/install --python=/usr/bin/python3 --cross-prefix=x86_64-w64-mingw32- --enable-trace-backends=simple --enable-gnutls --enable-nettle --enable-curl --enable-vnc --enable-bzip2 --enable-guest-agent --with-sdlabi=1.2 --with-gtkabi=2.0
Install prefix    /tmp/qemu-test/install
BIOS directory    /tmp/qemu-test/install
firmware path     /tmp/qemu-test/install/share/qemu-firmware
binary directory  /tmp/qemu-test/install
library directory /tmp/qemu-test/install/lib
module directory  /tmp/qemu-test/install/lib
libexec directory /tmp/qemu-test/install/libexec
include directory /tmp/qemu-test/install/include
config directory  /tmp/qemu-test/install
local state directory   queried at runtime
Windows SDK       no
Source path       /tmp/qemu-test/src
GIT binary        git
GIT submodules    
C compiler        x86_64-w64-mingw32-gcc
Host C compiler   cc
C++ compiler      x86_64-w64-mingw32-g++
Objective-C compiler clang
ARFLAGS           rv
CFLAGS            -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -g 
QEMU_CFLAGS       -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/pixman-1  -I$(SRC_PATH)/dtc/libfdt -Werror -DHAS_LIBSSH2_SFTP_FSYNC -mms-bitfields -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/glib-2.0 -I/usr/x86_64-w64-mingw32/sys-root/mingw/lib/glib-2.0/include -I/usr/x86_64-w64-mingw32/sys-root/mingw/include  -m64 -mcx16 -mthreads -D__USE_MINGW_ANSI_STDIO=1 -DWIN32_LEAN_AND_MEAN -DWINVER=0x501 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv  -Wexpansion-to-defined -Wendif-labels -Wno-shift-negative-value -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-strong -I/usr/x86_64-w64-mingw32/sys-root/mingw/include -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/p11-kit-1 -I/usr/x86_64-w64-mingw32/sys-root/mingw/include  -I/usr/x86_64-w64-mingw32/sys-root/mingw/include   -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/libpng16 
LDFLAGS           -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase -Wl,--warn-common -m64 -g 
make              make
install           install
python            /usr/bin/python3 -B
smbd              /usr/sbin/smbd
module support    no
host CPU          x86_64
host big endian   no
target list       x86_64-softmmu aarch64-softmmu
gprof enabled     no
sparse enabled    no
strip binaries    yes
profiler          no
static build      no
SDL support       yes (1.2.15)
GTK support       yes (2.24.31)
GTK GL support    no
VTE support       no 
TLS priority      NORMAL
GNUTLS support    yes
GNUTLS rnd        yes
libgcrypt         no
libgcrypt kdf     no
nettle            yes (3.3)
nettle kdf        yes
libtasn1          yes
curses support    no
virgl support     no
curl support      yes
mingw32 support   yes
Audio drivers     dsound
Block whitelist (rw) 
Block whitelist (ro) 
VirtFS support    no
Multipath support no
VNC support       yes
VNC SASL support  no
VNC JPEG support  yes
VNC PNG support   yes
xen support       no
brlapi support    no
bluez  support    no
Documentation     no
PIE               no
vde support       no
netmap support    no
Linux AIO support no
ATTR/XATTR support no
Install blobs     yes
KVM support       no
HAX support       yes
HVF support       no
WHPX support      no
TCG support       yes
TCG debug enabled no
TCG interpreter   no
malloc trim support no
RDMA support      no
fdt support       yes
preadv support    no
fdatasync         no
madvise           no
posix_madvise     no
posix_memalign    no
libcap-ng support no
vhost-net support no
vhost-crypto support no
vhost-scsi support no
vhost-vsock support no
vhost-user support no
Trace backends    simple
Trace output file trace-<pid>
spice support     no 
rbd support       no
xfsctl support    no
smartcard support no
libusb            no
usb net redir     no
OpenGL support    no
OpenGL dmabufs    no
libiscsi support  no
libnfs support    no
build guest agent yes
QGA VSS support   no
QGA w32 disk info yes
QGA MSI support   no
seccomp support   no
coroutine backend win32
coroutine pool    yes
debug stack usage no
crypto afalg      no
GlusterFS support no
gcov              gcov
gcov enabled      no
TPM support       yes
libssh2 support   yes
TPM passthrough   no
TPM emulator      no
QOM debugging     yes
Live block migration yes
lzo support       no
snappy support    no
bzip2 support     yes
NUMA host support no
libxml2           no
tcmalloc support  no
jemalloc support  no
avx2 optimization yes
replication support yes
VxHS block device no
capstone          no

WARNING: Use of GTK 2.0 is deprecated and will be removed in
WARNING: future releases. Please switch to using GTK 3.0

WARNING: Use of SDL 1.2 is deprecated and will be removed in
WARNING: future releases. Please switch to using SDL 2.0
mkdir -p dtc/libfdt
mkdir -p dtc/tests
  GEN     config-host.h
  GEN     qemu-options.def
  GEN     x86_64-softmmu/config-devices.mak.tmp
  GEN     qapi-gen
  GEN     aarch64-softmmu/config-devices.mak.tmp
  GEN     trace/generated-helpers-wrappers.h
  GEN     trace/generated-tcg-tracers.h
  GEN     trace/generated-helpers.h
  GEN     x86_64-softmmu/config-devices.mak
  GEN     trace/generated-helpers.c
  GEN     module_block.h
  GEN     aarch64-softmmu/config-devices.mak
  GEN     ui/input-keymap-atset1-to-qcode.c
  GEN     ui/input-keymap-qcode-to-atset1.c
  GEN     ui/input-keymap-linux-to-qcode.c
  GEN     ui/input-keymap-qcode-to-atset2.c
  GEN     ui/input-keymap-qcode-to-atset3.c
  GEN     ui/input-keymap-qcode-to-linux.c
  GEN     ui/input-keymap-qcode-to-qnum.c
  GEN     ui/input-keymap-qcode-to-sun.c
  GEN     ui/input-keymap-qnum-to-qcode.c
  GEN     ui/input-keymap-usb-to-qcode.c
  GEN     ui/input-keymap-win32-to-qcode.c
  GEN     ui/input-keymap-x11-to-qcode.c
  GEN     ui/input-keymap-xorgevdev-to-qcode.c
  GEN     ui/input-keymap-xorgkbd-to-qcode.c
  GEN     ui/input-keymap-xorgxquartz-to-qcode.c
  GEN     ui/input-keymap-xorgxwin-to-qcode.c
  GEN     tests/test-qapi-gen
  GEN     trace-root.h
  GEN     util/trace.h
  GEN     crypto/trace.h
  GEN     io/trace.h
  GEN     migration/trace.h
  GEN     block/trace.h
  GEN     chardev/trace.h
  GEN     hw/block/trace.h
  GEN     hw/block/dataplane/trace.h
  GEN     hw/char/trace.h
  GEN     hw/intc/trace.h
  GEN     hw/net/trace.h
  GEN     hw/rdma/trace.h
  GEN     hw/rdma/vmw/trace.h
  GEN     hw/virtio/trace.h
  GEN     hw/audio/trace.h
  GEN     hw/misc/trace.h
  GEN     hw/misc/macio/trace.h
  GEN     hw/usb/trace.h
  GEN     hw/scsi/trace.h
  GEN     hw/nvram/trace.h
  GEN     hw/display/trace.h
  GEN     hw/input/trace.h
  GEN     hw/timer/trace.h
  GEN     hw/dma/trace.h
  GEN     hw/sparc/trace.h
  GEN     hw/sparc64/trace.h
  GEN     hw/sd/trace.h
  GEN     hw/isa/trace.h
  GEN     hw/mem/trace.h
  GEN     hw/i386/trace.h
  GEN     hw/i386/xen/trace.h
  GEN     hw/9pfs/trace.h
  GEN     hw/ppc/trace.h
  GEN     hw/pci/trace.h
  GEN     hw/pci-host/trace.h
  GEN     hw/s390x/trace.h
  GEN     hw/vfio/trace.h
  GEN     hw/acpi/trace.h
  GEN     hw/arm/trace.h
  GEN     hw/alpha/trace.h
  GEN     hw/hppa/trace.h
  GEN     hw/xen/trace.h
  GEN     hw/ide/trace.h
  GEN     ui/trace.h
  GEN     audio/trace.h
  GEN     net/trace.h
  GEN     target/arm/trace.h
  GEN     target/i386/trace.h
  GEN     target/mips/trace.h
  GEN     target/sparc/trace.h
  GEN     target/s390x/trace.h
  GEN     target/ppc/trace.h
  GEN     qom/trace.h
  GEN     linux-user/trace.h
  GEN     qapi/trace.h
  GEN     accel/tcg/trace.h
  GEN     accel/kvm/trace.h
  GEN     nbd/trace.h
  GEN     scsi/trace.h
  GEN     trace-root.c
  GEN     util/trace.c
  GEN     crypto/trace.c
  GEN     io/trace.c
  GEN     migration/trace.c
  GEN     block/trace.c
  GEN     chardev/trace.c
  GEN     hw/block/trace.c
  GEN     hw/block/dataplane/trace.c
  GEN     hw/char/trace.c
  GEN     hw/intc/trace.c
  GEN     hw/net/trace.c
  GEN     hw/rdma/trace.c
  GEN     hw/rdma/vmw/trace.c
  GEN     hw/virtio/trace.c
  GEN     hw/audio/trace.c
  GEN     hw/misc/trace.c
  GEN     hw/misc/macio/trace.c
  GEN     hw/usb/trace.c
  GEN     hw/scsi/trace.c
  GEN     hw/nvram/trace.c
  GEN     hw/display/trace.c
  GEN     hw/input/trace.c
  GEN     hw/timer/trace.c
  GEN     hw/dma/trace.c
  GEN     hw/sparc/trace.c
  GEN     hw/sparc64/trace.c
  GEN     hw/sd/trace.c
  GEN     hw/isa/trace.c
  GEN     hw/mem/trace.c
  GEN     hw/i386/trace.c
  GEN     hw/i386/xen/trace.c
  GEN     hw/9pfs/trace.c
  GEN     hw/ppc/trace.c
  GEN     hw/pci/trace.c
  GEN     hw/pci-host/trace.c
  GEN     hw/s390x/trace.c
  GEN     hw/vfio/trace.c
  GEN     hw/acpi/trace.c
  GEN     hw/arm/trace.c
  GEN     hw/alpha/trace.c
  GEN     hw/hppa/trace.c
  GEN     hw/xen/trace.c
  GEN     hw/ide/trace.c
  GEN     ui/trace.c
  GEN     audio/trace.c
  GEN     net/trace.c
  GEN     target/arm/trace.c
  GEN     target/i386/trace.c
  GEN     target/mips/trace.c
  GEN     target/sparc/trace.c
  GEN     target/s390x/trace.c
  GEN     target/ppc/trace.c
  GEN     qom/trace.c
  GEN     linux-user/trace.c
  GEN     qapi/trace.c
  GEN     accel/tcg/trace.c
  GEN     accel/kvm/trace.c
  GEN     nbd/trace.c
  GEN     scsi/trace.c
  GEN     config-all-devices.mak
	 DEP /tmp/qemu-test/src/dtc/tests/dumptrees.c
	 DEP /tmp/qemu-test/src/dtc/tests/trees.S
	 DEP /tmp/qemu-test/src/dtc/tests/testutils.c
	 DEP /tmp/qemu-test/src/dtc/tests/value-labels.c
	 DEP /tmp/qemu-test/src/dtc/tests/asm_tree_dump.c
	 DEP /tmp/qemu-test/src/dtc/tests/truncated_property.c
	 DEP /tmp/qemu-test/src/dtc/tests/check_path.c
	 DEP /tmp/qemu-test/src/dtc/tests/overlay_bad_fixup.c
	 DEP /tmp/qemu-test/src/dtc/tests/overlay.c
	 DEP /tmp/qemu-test/src/dtc/tests/subnode_iterate.c
	 DEP /tmp/qemu-test/src/dtc/tests/property_iterate.c
	 DEP /tmp/qemu-test/src/dtc/tests/integer-expressions.c
	 DEP /tmp/qemu-test/src/dtc/tests/utilfdt_test.c
	 DEP /tmp/qemu-test/src/dtc/tests/path_offset_aliases.c
	 DEP /tmp/qemu-test/src/dtc/tests/add_subnode_with_nops.c
	 DEP /tmp/qemu-test/src/dtc/tests/dtbs_equal_unordered.c
	 DEP /tmp/qemu-test/src/dtc/tests/dtb_reverse.c
	 DEP /tmp/qemu-test/src/dtc/tests/dtbs_equal_ordered.c
	 DEP /tmp/qemu-test/src/dtc/tests/extra-terminating-null.c
	 DEP /tmp/qemu-test/src/dtc/tests/boot-cpuid.c
	 DEP /tmp/qemu-test/src/dtc/tests/incbin.c
	 DEP /tmp/qemu-test/src/dtc/tests/phandle_format.c
	 DEP /tmp/qemu-test/src/dtc/tests/path-references.c
	 DEP /tmp/qemu-test/src/dtc/tests/references.c
	 DEP /tmp/qemu-test/src/dtc/tests/string_escapes.c
	 DEP /tmp/qemu-test/src/dtc/tests/propname_escapes.c
	 DEP /tmp/qemu-test/src/dtc/tests/appendprop1.c
	 DEP /tmp/qemu-test/src/dtc/tests/appendprop2.c
	 DEP /tmp/qemu-test/src/dtc/tests/del_node.c
	 DEP /tmp/qemu-test/src/dtc/tests/del_property.c
	 DEP /tmp/qemu-test/src/dtc/tests/setprop.c
	 DEP /tmp/qemu-test/src/dtc/tests/rw_tree1.c
	 DEP /tmp/qemu-test/src/dtc/tests/set_name.c
	 DEP /tmp/qemu-test/src/dtc/tests/open_pack.c
	 DEP /tmp/qemu-test/src/dtc/tests/nopulate.c
	 DEP /tmp/qemu-test/src/dtc/tests/mangle-layout.c
	 DEP /tmp/qemu-test/src/dtc/tests/move_and_save.c
	 DEP /tmp/qemu-test/src/dtc/tests/sw_tree1.c
	 DEP /tmp/qemu-test/src/dtc/tests/nop_node.c
	 DEP /tmp/qemu-test/src/dtc/tests/nop_property.c
	 DEP /tmp/qemu-test/src/dtc/tests/setprop_inplace.c
	 DEP /tmp/qemu-test/src/dtc/tests/stringlist.c
	 DEP /tmp/qemu-test/src/dtc/tests/addr_size_cells.c
	 DEP /tmp/qemu-test/src/dtc/tests/notfound.c
	 DEP /tmp/qemu-test/src/dtc/tests/sized_cells.c
	 DEP /tmp/qemu-test/src/dtc/tests/char_literal.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_alias.c
	 DEP /tmp/qemu-test/src/dtc/tests/node_offset_by_compatible.c
	 DEP /tmp/qemu-test/src/dtc/tests/node_check_compatible.c
	 DEP /tmp/qemu-test/src/dtc/tests/node_offset_by_phandle.c
	 DEP /tmp/qemu-test/src/dtc/tests/node_offset_by_prop_value.c
	 DEP /tmp/qemu-test/src/dtc/tests/parent_offset.c
	 DEP /tmp/qemu-test/src/dtc/tests/supernode_atdepth_offset.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_phandle.c
	 DEP /tmp/qemu-test/src/dtc/tests/getprop.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_path.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_name.c
	 DEP /tmp/qemu-test/src/dtc/tests/path_offset.c
	 DEP /tmp/qemu-test/src/dtc/tests/subnode_offset.c
	 DEP /tmp/qemu-test/src/dtc/tests/find_property.c
	 DEP /tmp/qemu-test/src/dtc/tests/root_node.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_mem_rsv.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_overlay.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_addresses.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_empty_tree.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_rw.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_strerror.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_sw.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_wip.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_ro.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt.c
	 DEP /tmp/qemu-test/src/dtc/util.c
	 DEP /tmp/qemu-test/src/dtc/fdtoverlay.c
	 DEP /tmp/qemu-test/src/dtc/fdtput.c
	 DEP /tmp/qemu-test/src/dtc/fdtget.c
	 DEP /tmp/qemu-test/src/dtc/fdtdump.c
	 LEX convert-dtsv0-lexer.lex.c
	 DEP /tmp/qemu-test/src/dtc/srcpos.c
	 BISON dtc-parser.tab.c
	 DEP /tmp/qemu-test/src/dtc/treesource.c
	 DEP /tmp/qemu-test/src/dtc/livetree.c
	 LEX dtc-lexer.lex.c
	 DEP /tmp/qemu-test/src/dtc/fstree.c
	 DEP /tmp/qemu-test/src/dtc/flattree.c
	 DEP /tmp/qemu-test/src/dtc/dtc.c
	 DEP /tmp/qemu-test/src/dtc/data.c
	 DEP /tmp/qemu-test/src/dtc/checks.c
	 DEP convert-dtsv0-lexer.lex.c
	 DEP dtc-parser.tab.c
	 DEP dtc-lexer.lex.c
	CHK version_gen.h
	UPD version_gen.h
	 DEP /tmp/qemu-test/src/dtc/util.c
	 CC libfdt/fdt.o
	 CC libfdt/fdt_ro.o
	 CC libfdt/fdt_wip.o
	 CC libfdt/fdt_sw.o
	 CC libfdt/fdt_rw.o
	 CC libfdt/fdt_strerror.o
	 CC libfdt/fdt_empty_tree.o
	 CC libfdt/fdt_addresses.o
	 CC libfdt/fdt_overlay.o
	 AR libfdt/libfdt.a
x86_64-w64-mingw32-ar: creating libfdt/libfdt.a
a - libfdt/fdt.o
a - libfdt/fdt_ro.o
a - libfdt/fdt_wip.o
a - libfdt/fdt_sw.o
a - libfdt/fdt_rw.o
a - libfdt/fdt_strerror.o
a - libfdt/fdt_empty_tree.o
a - libfdt/fdt_addresses.o
a - libfdt/fdt_overlay.o
  RC      version.o
mkdir -p dtc/libfdt
mkdir -p dtc/tests
  GEN     qga/qapi-generated/qapi-gen
  CC      qapi/qapi-builtin-types.o
  CC      qapi/qapi-types.o
  CC      qapi/qapi-types-block-core.o
  CC      qapi/qapi-types-block.o
  CC      qapi/qapi-types-common.o
  CC      qapi/qapi-types-crypto.o
  CC      qapi/qapi-types-char.o
  CC      qapi/qapi-types-introspect.o
  CC      qapi/qapi-types-misc.o
  CC      qapi/qapi-types-migration.o
  CC      qapi/qapi-types-net.o
  CC      qapi/qapi-types-rocker.o
  CC      qapi/qapi-types-run-state.o
  CC      qapi/qapi-types-sockets.o
  CC      qapi/qapi-types-tpm.o
  CC      qapi/qapi-types-trace.o
  CC      qapi/qapi-types-transaction.o
  CC      qapi/qapi-types-ui.o
  CC      qapi/qapi-builtin-visit.o
  CC      qapi/qapi-visit.o
  CC      qapi/qapi-visit-block-core.o
  CC      qapi/qapi-visit-block.o
  CC      qapi/qapi-visit-char.o
  CC      qapi/qapi-visit-common.o
  CC      qapi/qapi-visit-crypto.o
  CC      qapi/qapi-visit-introspect.o
  CC      qapi/qapi-visit-migration.o
  CC      qapi/qapi-visit-misc.o
  CC      qapi/qapi-visit-net.o
  CC      qapi/qapi-visit-rocker.o
  CC      qapi/qapi-visit-run-state.o
  CC      qapi/qapi-visit-sockets.o
  CC      qapi/qapi-visit-tpm.o
  CC      qapi/qapi-visit-trace.o
  CC      qapi/qapi-visit-transaction.o
  CC      qapi/qapi-visit-ui.o
  CC      qapi/qapi-events.o
  CC      qapi/qapi-events-block-core.o
  CC      qapi/qapi-events-block.o
  CC      qapi/qapi-events-char.o
  CC      qapi/qapi-events-common.o
  CC      qapi/qapi-events-introspect.o
  CC      qapi/qapi-events-crypto.o
  CC      qapi/qapi-events-migration.o
  CC      qapi/qapi-events-misc.o
  CC      qapi/qapi-events-net.o
  CC      qapi/qapi-events-rocker.o
  CC      qapi/qapi-events-run-state.o
  CC      qapi/qapi-events-sockets.o
  CC      qapi/qapi-events-tpm.o
  CC      qapi/qapi-events-trace.o
  CC      qapi/qapi-events-transaction.o
  CC      qapi/qapi-events-ui.o
  CC      qapi/qapi-introspect.o
  CC      qapi/qapi-visit-core.o
  CC      qapi/qapi-dealloc-visitor.o
  CC      qapi/qobject-input-visitor.o
  CC      qapi/qobject-output-visitor.o
  CC      qapi/qmp-registry.o
  CC      qapi/qmp-dispatch.o
  CC      qapi/string-input-visitor.o
  CC      qapi/string-output-visitor.o
  CC      qapi/opts-visitor.o
  CC      qapi/qapi-clone-visitor.o
  CC      qapi/qmp-event.o
  CC      qapi/qapi-util.o
  CC      qobject/qnull.o
  CC      qobject/qnum.o
  CC      qobject/qstring.o
  CC      qobject/qdict.o
  CC      qobject/qlist.o
  CC      qobject/qbool.o
  CC      qobject/qlit.o
  CC      qobject/qjson.o
  CC      qobject/qobject.o
  CC      qobject/json-lexer.o
  CC      qobject/json-streamer.o
  CC      qobject/json-parser.o
  CC      trace/simple.o
  CC      trace/control.o
  CC      trace/qmp.o
  CC      util/osdep.o
  CC      util/cutils.o
  CC      util/unicode.o
  CC      util/qemu-timer-common.o
  CC      util/bufferiszero.o
  CC      util/lockcnt.o
  CC      util/aiocb.o
  CC      util/async.o
  CC      util/thread-pool.o
  CC      util/qemu-timer.o
  CC      util/main-loop.o
  CC      util/iohandler.o
  CC      util/aio-win32.o
  CC      util/event_notifier-win32.o
  CC      util/oslib-win32.o
  CC      util/qemu-thread-win32.o
  CC      util/envlist.o
  CC      util/path.o
  CC      util/module.o
  CC      util/host-utils.o
  CC      util/bitops.o
  CC      util/bitmap.o
  CC      util/hbitmap.o
  CC      util/fifo8.o
  CC      util/acl.o
  CC      util/cacheinfo.o
  CC      util/error.o
  CC      util/qemu-error.o
  CC      util/id.o
  CC      util/iov.o
  CC      util/qemu-config.o
  CC      util/qemu-sockets.o
  CC      util/uri.o
  CC      util/notify.o
  CC      util/qemu-option.o
  CC      util/qemu-progress.o
  CC      util/keyval.o
  CC      util/crc32c.o
  CC      util/hexdump.o
  CC      util/uuid.o
  CC      util/throttle.o
  CC      util/getauxval.o
  CC      util/readline.o
  CC      util/rcu.o
  CC      util/qemu-coroutine.o
  CC      util/qemu-coroutine-lock.o
  CC      util/qemu-coroutine-io.o
  CC      util/qemu-coroutine-sleep.o
  CC      util/coroutine-win32.o
  CC      util/buffer.o
  CC      util/timed-average.o
  CC      util/base64.o
  CC      util/log.o
  CC      util/pagesize.o
  CC      util/qdist.o
  CC      util/qht.o
  CC      util/range.o
  CC      util/stats64.o
  CC      util/systemd.o
  CC      trace-root.o
  CC      util/trace.o
  CC      crypto/trace.o
  CC      io/trace.o
  CC      migration/trace.o
  CC      block/trace.o
  CC      chardev/trace.o
  CC      hw/block/trace.o
  CC      hw/block/dataplane/trace.o
  CC      hw/char/trace.o
  CC      hw/intc/trace.o
  CC      hw/net/trace.o
  CC      hw/rdma/trace.o
  CC      hw/rdma/vmw/trace.o
  CC      hw/audio/trace.o
  CC      hw/virtio/trace.o
  CC      hw/misc/trace.o
  CC      hw/misc/macio/trace.o
  CC      hw/usb/trace.o
  CC      hw/scsi/trace.o
  CC      hw/nvram/trace.o
  CC      hw/display/trace.o
  CC      hw/input/trace.o
  CC      hw/timer/trace.o
  CC      hw/dma/trace.o
  CC      hw/sparc/trace.o
  CC      hw/sparc64/trace.o
  CC      hw/sd/trace.o
  CC      hw/isa/trace.o
  CC      hw/mem/trace.o
  CC      hw/i386/trace.o
  CC      hw/i386/xen/trace.o
  CC      hw/9pfs/trace.o
  CC      hw/ppc/trace.o
  CC      hw/pci/trace.o
  CC      hw/pci-host/trace.o
  CC      hw/s390x/trace.o
  CC      hw/vfio/trace.o
  CC      hw/acpi/trace.o
  CC      hw/arm/trace.o
  CC      hw/alpha/trace.o
  CC      hw/hppa/trace.o
  CC      hw/xen/trace.o
  CC      hw/ide/trace.o
  CC      ui/trace.o
  CC      audio/trace.o
  CC      net/trace.o
  CC      target/arm/trace.o
  CC      target/i386/trace.o
  CC      target/mips/trace.o
  CC      target/sparc/trace.o
  CC      target/s390x/trace.o
  CC      target/ppc/trace.o
  CC      qom/trace.o
  CC      linux-user/trace.o
  CC      qapi/trace.o
  CC      accel/tcg/trace.o
  CC      accel/kvm/trace.o
  CC      nbd/trace.o
  CC      scsi/trace.o
  CC      crypto/pbkdf-stub.o
  CC      stubs/arch-query-cpu-def.o
  CC      stubs/arch-query-cpu-model-expansion.o
  CC      stubs/arch-query-cpu-model-comparison.o
  CC      stubs/arch-query-cpu-model-baseline.o
  CC      stubs/bdrv-next-monitor-owned.o
  CC      stubs/blk-commit-all.o
  CC      stubs/blockdev-close-all-bdrv-states.o
  CC      stubs/clock-warp.o
  CC      stubs/cpu-get-clock.o
  CC      stubs/cpu-get-icount.o
  CC      stubs/dump.o
  CC      stubs/error-printf.o
  CC      stubs/fdset.o
  CC      stubs/get-vm-name.o
  CC      stubs/gdbstub.o
  CC      stubs/iothread.o
  CC      stubs/iothread-lock.o
  CC      stubs/is-daemonized.o
  CC      stubs/machine-init-done.o
  CC      stubs/migr-blocker.o
  CC      stubs/change-state-handler.o
  CC      stubs/monitor.o
  CC      stubs/notify-event.o
  CC      stubs/qtest.o
  CC      stubs/replay.o
  CC      stubs/runstate-check.o
  CC      stubs/set-fd-handler.o
  CC      stubs/slirp.o
  CC      stubs/sysbus.o
  CC      stubs/tpm.o
  CC      stubs/trace-control.o
  CC      stubs/uuid.o
  CC      stubs/vm-stop.o
  CC      stubs/vmstate.o
  CC      stubs/fd-register.o
  CC      stubs/qmp_pc_dimm.o
  CC      stubs/target-monitor-defs.o
  CC      stubs/target-get-monitor-def.o
  CC      stubs/pc_madt_cpu_entry.o
  CC      stubs/vmgenid.o
  CC      stubs/xen-common.o
  CC      stubs/xen-hvm.o
  CC      stubs/pci-host-piix.o
  CC      stubs/ram-block.o
  GEN     qemu-img-cmds.h
  CC      block.o
  CC      blockjob.o
  CC      qemu-io-cmds.o
  CC      replication.o
  CC      block/raw-format.o
  CC      block/qcow.o
  CC      block/vdi.o
  CC      block/vmdk.o
  CC      block/cloop.o
  CC      block/bochs.o
  CC      block/vpc.o
  CC      block/vvfat.o
  CC      block/dmg.o
  CC      block/qcow2.o
  CC      block/qcow2-refcount.o
  CC      block/qcow2-cluster.o
  CC      block/qcow2-snapshot.o
  CC      block/qcow2-cache.o
  CC      block/qed.o
  CC      block/qcow2-bitmap.o
  CC      block/qed-l2-cache.o
  CC      block/qed-table.o
  CC      block/qed-cluster.o
  CC      block/qed-check.o
  CC      block/vhdx.o
  CC      block/vhdx-endian.o
  CC      block/vhdx-log.o
  CC      block/quorum.o
  CC      block/parallels.o
  CC      block/blkdebug.o
  CC      block/blkverify.o
  CC      block/blkreplay.o
  CC      block/block-backend.o
  CC      block/snapshot.o
  CC      block/qapi.o
  CC      block/file-win32.o
  CC      block/win32-aio.o
  CC      block/null.o
  CC      block/mirror.o
  CC      block/commit.o
  CC      block/io.o
  CC      block/throttle-groups.o
  CC      block/nbd.o
  CC      block/nbd-client.o
  CC      block/sheepdog.o
  CC      block/accounting.o
  CC      block/dirty-bitmap.o
  CC      block/write-threshold.o
  CC      block/backup.o
  CC      block/replication.o
  CC      block/throttle.o
  CC      block/crypto.o
  CC      nbd/server.o
  CC      nbd/client.o
  CC      nbd/common.o
  CC      scsi/utils.o
  CC      block/curl.o
  CC      block/ssh.o
  CC      block/dmg-bz2.o
  CC      crypto/init.o
  CC      crypto/hash.o
  CC      crypto/hash-nettle.o
  CC      crypto/hmac.o
  CC      crypto/hmac-nettle.o
  CC      crypto/aes.o
  CC      crypto/desrfb.o
  CC      crypto/cipher.o
  CC      crypto/tlscreds.o
  CC      crypto/tlscredsanon.o
  CC      crypto/tlscredsx509.o
  CC      crypto/tlssession.o
  CC      crypto/secret.o
  CC      crypto/pbkdf.o
  CC      crypto/random-gnutls.o
  CC      crypto/pbkdf-nettle.o
  CC      crypto/ivgen.o
  CC      crypto/ivgen-essiv.o
  CC      crypto/ivgen-plain.o
  CC      crypto/ivgen-plain64.o
  CC      crypto/afsplit.o
  CC      crypto/xts.o
  CC      crypto/block.o
  CC      crypto/block-qcow.o
  CC      crypto/block-luks.o
  CC      io/channel.o
  CC      io/channel-buffer.o
  CC      io/channel-command.o
  CC      io/channel-file.o
  CC      io/channel-socket.o
  CC      io/channel-tls.o
  CC      io/channel-watch.o
  CC      io/channel-websock.o
  CC      io/channel-util.o
  CC      io/dns-resolver.o
  CC      io/net-listener.o
  CC      io/task.o
  CC      qom/object.o
  CC      qom/container.o
  CC      qom/qom-qobject.o
  CC      qom/object_interfaces.o
  CC      qemu-io.o
  CC      blockdev.o
  CC      blockdev-nbd.o
  CC      iothread.o
  CC      bootdevice.o
  CC      qdev-monitor.o
  CC      device-hotplug.o
  CC      os-win32.o
  CC      bt-host.o
  CC      bt-vhci.o
  CC      dma-helpers.o
  CC      vl.o
  CC      tpm.o
  CC      qapi/qapi-commands.o
  CC      device_tree.o
  CC      qapi/qapi-commands-block-core.o
  CC      qapi/qapi-commands-block.o
  CC      qapi/qapi-commands-char.o
  CC      qapi/qapi-commands-common.o
  CC      qapi/qapi-commands-crypto.o
  CC      qapi/qapi-commands-introspect.o
  CC      qapi/qapi-commands-migration.o
  CC      qapi/qapi-commands-misc.o
  CC      qapi/qapi-commands-net.o
  CC      qapi/qapi-commands-rocker.o
  CC      qapi/qapi-commands-run-state.o
  CC      qapi/qapi-commands-sockets.o
  CC      qapi/qapi-commands-tpm.o
  CC      qapi/qapi-commands-trace.o
  CC      qapi/qapi-commands-transaction.o
  CC      qapi/qapi-commands-ui.o
  CC      qmp.o
  CC      hmp.o
  CC      cpus-common.o
  CC      audio/audio.o
  CC      audio/noaudio.o
  CC      audio/wavaudio.o
  CC      audio/mixeng.o
  CC      audio/dsoundaudio.o
  CC      audio/wavcapture.o
  CC      audio/audio_win_int.o
  CC      backends/rng.o
  CC      backends/rng-egd.o
  CC      backends/tpm.o
  CC      backends/hostmem.o
  CC      backends/hostmem-ram.o
  CC      backends/cryptodev.o
  CC      backends/cryptodev-builtin.o
  CC      backends/cryptodev-vhost.o
  CC      block/stream.o
  CC      chardev/msmouse.o
  CC      chardev/wctablet.o
  CC      chardev/testdev.o
  CC      disas/arm.o
  CXX     disas/arm-a64.o
  CC      disas/i386.o
  CXX     disas/libvixl/vixl/utils.o
  CXX     disas/libvixl/vixl/compiler-intrinsics.o
  CXX     disas/libvixl/vixl/a64/instructions-a64.o
  CXX     disas/libvixl/vixl/a64/decoder-a64.o
  CXX     disas/libvixl/vixl/a64/disasm-a64.o
  CC      hw/acpi/core.o
  CC      hw/acpi/piix4.o
  CC      hw/acpi/pcihp.o
  CC      hw/acpi/ich9.o
  CC      hw/acpi/tco.o
  CC      hw/acpi/cpu_hotplug.o
  CC      hw/acpi/memory_hotplug.o
  CC      hw/acpi/cpu.o
  CC      hw/acpi/nvdimm.o
  CC      hw/acpi/vmgenid.o
  CC      hw/acpi/acpi_interface.o
  CC      hw/acpi/bios-linker-loader.o
  CC      hw/acpi/aml-build.o
  CC      hw/acpi/ipmi.o
  CC      hw/acpi/acpi-stub.o
  CC      hw/acpi/ipmi-stub.o
  CC      hw/audio/sb16.o
  CC      hw/audio/es1370.o
  CC      hw/audio/ac97.o
  CC      hw/audio/fmopl.o
  CC      hw/audio/adlib.o
  CC      hw/audio/gus.o
  CC      hw/audio/gusemu_hal.o
  CC      hw/audio/gusemu_mixer.o
  CC      hw/audio/cs4231a.o
  CC      hw/audio/intel-hda.o
  CC      hw/audio/hda-codec.o
  CC      hw/audio/pcspk.o
  CC      hw/audio/wm8750.o
  CC      hw/audio/pl041.o
  CC      hw/audio/lm4549.o
  CC      hw/audio/marvell_88w8618.o
  CC      hw/audio/soundhw.o
  CC      hw/block/block.o
  CC      hw/block/cdrom.o
  CC      hw/block/hd-geometry.o
  CC      hw/block/fdc.o
  CC      hw/block/m25p80.o
  CC      hw/block/nand.o
  CC      hw/block/pflash_cfi01.o
  CC      hw/block/pflash_cfi02.o
  CC      hw/block/ecc.o
  CC      hw/block/onenand.o
  CC      hw/block/nvme.o
  CC      hw/bt/core.o
  CC      hw/bt/l2cap.o
  CC      hw/bt/sdp.o
  CC      hw/bt/hci.o
  CC      hw/bt/hid.o
  CC      hw/bt/hci-csr.o
  CC      hw/char/parallel.o
  CC      hw/char/ipoctal232.o
  CC      hw/char/parallel-isa.o
  CC      hw/char/pl011.o
  CC      hw/char/serial.o
  CC      hw/char/serial-isa.o
  CC      hw/char/serial-pci.o
  CC      hw/char/virtio-console.o
  CC      hw/char/cadence_uart.o
  CC      hw/char/cmsdk-apb-uart.o
  CC      hw/char/debugcon.o
  CC      hw/char/imx_serial.o
  CC      hw/core/qdev.o
  CC      hw/core/qdev-properties.o
  CC      hw/core/bus.o
  CC      hw/core/reset.o
  CC      hw/core/qdev-fw.o
  CC      hw/core/fw-path-provider.o
  CC      hw/core/irq.o
  CC      hw/core/hotplug.o
  CC      hw/core/nmi.o
  CC      hw/core/stream.o
  CC      hw/core/ptimer.o
  CC      hw/core/sysbus.o
  CC      hw/core/machine.o
  CC      hw/core/loader.o
  CC      hw/core/qdev-properties-system.o
  CC      hw/core/register.o
  CC      hw/core/or-irq.o
  CC      hw/core/split-irq.o
  CC      hw/core/platform-bus.o
  CC      hw/cpu/core.o
  CC      hw/display/ads7846.o
  CC      hw/display/cirrus_vga.o
  CC      hw/display/pl110.o
  CC      hw/display/sii9022.o
  CC      hw/display/ssd0303.o
  CC      hw/display/ssd0323.o
  CC      hw/display/vga-pci.o
  CC      hw/display/vga-isa.o
  CC      hw/display/vmware_vga.o
  CC      hw/display/blizzard.o
  CC      hw/display/exynos4210_fimd.o
  CC      hw/display/framebuffer.o
  CC      hw/display/tc6393xb.o
  CC      hw/dma/pl080.o
  CC      hw/dma/pl330.o
  CC      hw/dma/i8257.o
  CC      hw/dma/xilinx_axidma.o
  CC      hw/dma/xlnx-zynq-devcfg.o
  CC      hw/gpio/max7310.o
  CC      hw/gpio/pl061.o
  CC      hw/gpio/zaurus.o
  CC      hw/gpio/gpio_key.o
  CC      hw/i2c/core.o
  CC      hw/i2c/smbus.o
  CC      hw/i2c/smbus_eeprom.o
  CC      hw/i2c/i2c-ddc.o
  CC      hw/i2c/versatile_i2c.o
  CC      hw/i2c/pm_smbus.o
  CC      hw/i2c/smbus_ich9.o
  CC      hw/i2c/bitbang_i2c.o
  CC      hw/i2c/exynos4210_i2c.o
  CC      hw/i2c/imx_i2c.o
  CC      hw/i2c/aspeed_i2c.o
  CC      hw/ide/core.o
  CC      hw/ide/atapi.o
  CC      hw/ide/qdev.o
  CC      hw/ide/pci.o
  CC      hw/ide/isa.o
  CC      hw/ide/piix.o
  CC      hw/ide/microdrive.o
  CC      hw/ide/ahci.o
  CC      hw/ide/ich.o
  CC      hw/ide/ahci-allwinner.o
  CC      hw/input/hid.o
  CC      hw/input/lm832x.o
  CC      hw/input/pckbd.o
  CC      hw/input/pl050.o
  CC      hw/input/ps2.o
  CC      hw/input/stellaris_input.o
  CC      hw/input/tsc2005.o
  CC      hw/input/virtio-input.o
  CC      hw/input/virtio-input-hid.o
  CC      hw/intc/i8259_common.o
  CC      hw/intc/i8259.o
  CC      hw/intc/pl190.o
  CC      hw/intc/xlnx-pmu-iomod-intc.o
  CC      hw/intc/xlnx-zynqmp-ipi.o
  CC      hw/intc/imx_avic.o
  CC      hw/intc/imx_gpcv2.o
  CC      hw/intc/realview_gic.o
  CC      hw/intc/ioapic_common.o
  CC      hw/intc/arm_gic_common.o
  CC      hw/intc/arm_gic.o
  CC      hw/intc/arm_gicv2m.o
  CC      hw/intc/arm_gicv3_common.o
  CC      hw/intc/arm_gicv3.o
  CC      hw/intc/arm_gicv3_dist.o
  CC      hw/intc/arm_gicv3_redist.o
  CC      hw/intc/arm_gicv3_its_common.o
  CC      hw/intc/intc.o
  CC      hw/ipack/ipack.o
  CC      hw/ipack/tpci200.o
  CC      hw/ipmi/ipmi.o
  CC      hw/ipmi/ipmi_bmc_sim.o
  CC      hw/ipmi/ipmi_bmc_extern.o
  CC      hw/ipmi/isa_ipmi_kcs.o
  CC      hw/ipmi/isa_ipmi_bt.o
  CC      hw/isa/isa-bus.o
  CC      hw/isa/isa-superio.o
  CC      hw/isa/smc37c669-superio.o
  CC      hw/isa/apm.o
  CC      hw/mem/pc-dimm.o
  CC      hw/mem/nvdimm.o
  CC      hw/misc/applesmc.o
  CC      hw/misc/max111x.o
/tmp/qemu-test/src/hw/isa/isa-superio.c: In function 'isa_superio_realize':
/tmp/qemu-test/src/hw/isa/isa-superio.c:39:46: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'long long unsigned int' [-Werror=format=]
             warn_report("superio: ignoring %ld parallel controllers",
                                            ~~^
                                            %lld
/tmp/qemu-test/src/hw/isa/isa-superio.c:77:46: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'long long unsigned int' [-Werror=format=]
             warn_report("superio: ignoring %ld serial controllers",
                                            ~~^
                                            %lld
cc1: all warnings being treated as errors
make: *** [/tmp/qemu-test/src/rules.mak:66: hw/isa/isa-superio.o] Error 1
make: *** Waiting for unfinished jobs....
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 407, in <module>
    sys.exit(main())
  File "./tests/docker/docker.py", line 404, in main
    return args.cmdobj.run(args, argv)
  File "./tests/docker/docker.py", line 261, in run
    return Docker().run(argv, args.keep, quiet=args.quiet)
  File "./tests/docker/docker.py", line 229, in run
    quiet=quiet)
  File "./tests/docker/docker.py", line 147, in _do_check
    return subprocess.check_call(self._command + cmd, **kwargs)
  File "/usr/lib64/python2.7/subprocess.py", line 186, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['docker', 'run', '--label', 'com.qemu.instance.uuid=060f9bee20bf11e8974d52540069c830', '-u', '0', '--security-opt', 'seccomp=unconfined', '--rm', '--net=none', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=8', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/root/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-o8ld5l4n/src/docker-src.2018-03-05-16.48.52.7877:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-mingw']' returned non-zero exit status 2
make[1]: *** [tests/docker/Makefile.include:129: docker-run] Error 1
make[1]: Leaving directory '/var/tmp/patchew-tester-tmp-o8ld5l4n/src'
make: *** [tests/docker/Makefile.include:163: docker-run-test-mingw@fedora] Error 2

real	1m39.403s
user	0m3.888s
sys	0m3.682s
=== OUTPUT END ===

Test command exited with code: 2


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 03/22] hw/input/i8042: Extract declarations from i386/pc.h into input/i8042.h
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 03/22] hw/input/i8042: Extract declarations from i386/pc.h into input/i8042.h Philippe Mathieu-Daudé
@ 2018-03-06  0:05   ` David Gibson
  0 siblings, 0 replies; 35+ messages in thread
From: David Gibson @ 2018-03-06  0:05 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth, qemu-devel, Richard Henderson,
	Eduardo Habkost, Yongbok Kim, Artyom Tarasenko, Guan Xuetao,
	Alexander Graf, open list:PReP

[-- Attachment #1: Type: text/plain, Size: 9922 bytes --]

On Mon, Mar 05, 2018 at 06:19:09PM -0300, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

hw/ppc part
Acked-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  include/hw/i386/pc.h     |  9 ---------
>  include/hw/input/i8042.h | 24 ++++++++++++++++++++++++
>  hw/alpha/dp264.c         |  3 ++-
>  hw/i386/pc.c             |  1 +
>  hw/i386/vmmouse.c        |  1 +
>  hw/i386/vmport.c         |  1 +
>  hw/input/pckbd.c         |  2 +-
>  hw/mips/mips_fulong2e.c  |  3 ++-
>  hw/mips/mips_jazz.c      |  1 +
>  hw/mips/mips_malta.c     |  3 ++-
>  hw/mips/mips_r4k.c       |  3 ++-
>  hw/ppc/prep.c            |  5 +++--
>  hw/sparc64/sun4u.c       |  1 +
>  hw/unicore32/puv3.c      |  1 +
>  MAINTAINERS              |  1 +
>  15 files changed, 43 insertions(+), 16 deletions(-)
>  create mode 100644 include/hw/input/i8042.h
> 
> diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
> index f1feb18c3c..1638618dfc 100644
> --- a/include/hw/i386/pc.h
> +++ b/include/hw/i386/pc.h
> @@ -188,15 +188,6 @@ void vmport_register(unsigned char command, VMPortReadFunc *func, void *opaque);
>  void vmmouse_get_data(uint32_t *data);
>  void vmmouse_set_data(const uint32_t *data);
>  
> -/* pckbd.c */
> -#define I8042_A20_LINE "a20"
> -
> -void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
> -                   MemoryRegion *region, ram_addr_t size,
> -                   hwaddr mask);
> -void i8042_isa_mouse_fake_event(void *opaque);
> -void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out);
> -
>  /* pc.c */
>  extern int fd_bootchk;
>  
> diff --git a/include/hw/input/i8042.h b/include/hw/input/i8042.h
> new file mode 100644
> index 0000000000..f6ff146364
> --- /dev/null
> +++ b/include/hw/input/i8042.h
> @@ -0,0 +1,24 @@
> +/*
> + * QEMU PS/2 Controller
> + *
> + * Copyright (c) 2003 Fabrice Bellard
> + *
> + * SPDX-License-Identifier: MIT
> + */
> +#ifndef HW_INPUT_I8042_H
> +#define HW_INPUT_I8042_H
> +
> +#include "hw/hw.h"
> +#include "hw/isa/isa.h"
> +
> +#define TYPE_I8042 "i8042"
> +
> +#define I8042_A20_LINE "a20"
> +
> +void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
> +                   MemoryRegion *region, ram_addr_t size,
> +                   hwaddr mask);
> +void i8042_isa_mouse_fake_event(void *opaque);
> +void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out);
> +
> +#endif /* HW_INPUT_I8042_H */
> diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
> index 766373eec7..e13cb576fd 100644
> --- a/hw/alpha/dp264.c
> +++ b/hw/alpha/dp264.c
> @@ -19,6 +19,7 @@
>  #include "hw/timer/mc146818rtc.h"
>  #include "hw/ide.h"
>  #include "hw/timer/i8254.h"
> +#include "hw/input/i8042.h"
>  #include "hw/char/serial.h"
>  #include "qemu/cutils.h"
>  
> @@ -81,7 +82,7 @@ static void clipper_init(MachineState *machine)
>      mc146818_rtc_init(isa_bus, 1900, rtc_irq);
>  
>      i8254_pit_init(isa_bus, 0x40, 0, NULL);
> -    isa_create_simple(isa_bus, "i8042");
> +    isa_create_simple(isa_bus, TYPE_I8042);
>  
>      /* VGA setup.  Don't bother loading the bios.  */
>      pci_vga_init(pci_bus);
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 95b3fb3523..efb1b3bccf 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -43,6 +43,7 @@
>  #include "hw/timer/mc146818rtc.h"
>  #include "hw/dma/i8257.h"
>  #include "hw/timer/i8254.h"
> +#include "hw/input/i8042.h"
>  #include "hw/audio/pcspk.h"
>  #include "hw/pci/msi.h"
>  #include "hw/sysbus.h"
> diff --git a/hw/i386/vmmouse.c b/hw/i386/vmmouse.c
> index 65ef55329e..5d2d278be4 100644
> --- a/hw/i386/vmmouse.c
> +++ b/hw/i386/vmmouse.c
> @@ -25,6 +25,7 @@
>  #include "hw/hw.h"
>  #include "ui/console.h"
>  #include "hw/i386/pc.h"
> +#include "hw/input/i8042.h"
>  #include "hw/qdev.h"
>  
>  /* debug only vmmouse */
> diff --git a/hw/i386/vmport.c b/hw/i386/vmport.c
> index 116aa09819..3bf8cfe041 100644
> --- a/hw/i386/vmport.c
> +++ b/hw/i386/vmport.c
> @@ -25,6 +25,7 @@
>  #include "hw/hw.h"
>  #include "hw/isa/isa.h"
>  #include "hw/i386/pc.h"
> +#include "hw/input/i8042.h"
>  #include "sysemu/hw_accel.h"
>  #include "hw/qdev.h"
>  #include "qemu/log.h"
> diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
> index c479f827b6..f17f18e51b 100644
> --- a/hw/input/pckbd.c
> +++ b/hw/input/pckbd.c
> @@ -26,6 +26,7 @@
>  #include "hw/isa/isa.h"
>  #include "hw/i386/pc.h"
>  #include "hw/input/ps2.h"
> +#include "hw/input/i8042.h"
>  #include "sysemu/sysemu.h"
>  
>  /* debug PC keyboard */
> @@ -480,7 +481,6 @@ void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
>      qemu_register_reset(kbd_reset, s);
>  }
>  
> -#define TYPE_I8042 "i8042"
>  #define I8042(obj) OBJECT_CHECK(ISAKBDState, (obj), TYPE_I8042)
>  
>  typedef struct ISAKBDState {
> diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
> index 0545fcd899..9339e02120 100644
> --- a/hw/mips/mips_fulong2e.c
> +++ b/hw/mips/mips_fulong2e.c
> @@ -44,6 +44,7 @@
>  #include "hw/isa/vt82c686.h"
>  #include "hw/timer/mc146818rtc.h"
>  #include "hw/timer/i8254.h"
> +#include "hw/input/i8042.h"
>  #include "sysemu/blockdev.h"
>  #include "exec/address-spaces.h"
>  #include "sysemu/qtest.h"
> @@ -364,7 +365,7 @@ static void mips_fulong2e_init(MachineState *machine)
>      i8257_dma_init(isa_bus, 0);
>  
>      /* Super I/O */
> -    isa_create_simple(isa_bus, "i8042");
> +    isa_create_simple(isa_bus, TYPE_I8042);
>  
>      mc146818_rtc_init(isa_bus, 2000, NULL);
>  
> diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
> index 827ffdcd4a..5abbe30c21 100644
> --- a/hw/mips/mips_jazz.c
> +++ b/hw/mips/mips_jazz.c
> @@ -43,6 +43,7 @@
>  #include "hw/timer/i8254.h"
>  #include "hw/display/vga.h"
>  #include "hw/audio/pcspk.h"
> +#include "hw/input/i8042.h"
>  #include "sysemu/block-backend.h"
>  #include "hw/sysbus.h"
>  #include "exec/address-spaces.h"
> diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
> index 9cb86c432e..cd7bd0eef6 100644
> --- a/hw/mips/mips_malta.c
> +++ b/hw/mips/mips_malta.c
> @@ -47,6 +47,7 @@
>  #include "hw/loader.h"
>  #include "elf.h"
>  #include "hw/timer/mc146818rtc.h"
> +#include "hw/input/i8042.h"
>  #include "hw/timer/i8254.h"
>  #include "sysemu/blockdev.h"
>  #include "exec/address-spaces.h"
> @@ -1213,7 +1214,7 @@ void mips_malta_init(MachineState *machine)
>      i8257_dma_init(isa_bus, 0);
>  
>      /* Super I/O */
> -    isa_create_simple(isa_bus, "i8042");
> +    isa_create_simple(isa_bus, TYPE_I8042);
>  
>      mc146818_rtc_init(isa_bus, 2000, NULL);
>      serial_hds_isa_init(isa_bus, 0, 2);
> diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c
> index 830ee7732c..aeadc4a340 100644
> --- a/hw/mips/mips_r4k.c
> +++ b/hw/mips/mips_r4k.c
> @@ -28,6 +28,7 @@
>  #include "hw/loader.h"
>  #include "elf.h"
>  #include "hw/timer/mc146818rtc.h"
> +#include "hw/input/i8042.h"
>  #include "hw/timer/i8254.h"
>  #include "sysemu/block-backend.h"
>  #include "exec/address-spaces.h"
> @@ -286,7 +287,7 @@ void mips_r4k_init(MachineState *machine)
>                       hd[MAX_IDE_DEVS * i],
>  		     hd[MAX_IDE_DEVS * i + 1]);
>  
> -    isa_create_simple(isa_bus, "i8042");
> +    isa_create_simple(isa_bus, TYPE_I8042);
>  }
>  
>  static void mips_machine_init(MachineClass *mc)
> diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
> index 096d4d4cfb..ae724b0613 100644
> --- a/hw/ppc/prep.c
> +++ b/hw/ppc/prep.c
> @@ -41,6 +41,7 @@
>  #include "hw/ide.h"
>  #include "hw/loader.h"
>  #include "hw/timer/mc146818rtc.h"
> +#include "hw/input/i8042.h"
>  #include "hw/isa/pc87312.h"
>  #include "hw/net/ne2000-isa.h"
>  #include "sysemu/block-backend.h"
> @@ -641,7 +642,7 @@ static void ppc_prep_init(MachineState *machine)
>                       hd[2 * i],
>  		     hd[2 * i + 1]);
>      }
> -    isa_create_simple(isa_bus, "i8042");
> +    isa_create_simple(isa_bus, TYPE_I8042);
>  
>      cpu = POWERPC_CPU(first_cpu);
>      sysctrl->reset_irq = cpu->env.irq_inputs[PPC6xx_INPUT_HRESET];
> @@ -771,7 +772,7 @@ static void ibm_40p_init(MachineState *machine)
>  
>      /* add some more devices */
>      if (defaults_enabled()) {
> -        isa_create_simple(isa_bus, "i8042");
> +        isa_create_simple(isa_bus, TYPE_I8042);
>          m48t59 = NVRAM(isa_create_simple(isa_bus, "isa-m48t59"));
>  
>          dev = DEVICE(isa_create(isa_bus, "cs4231a"));
> diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
> index 0ca0243821..2044a52ded 100644
> --- a/hw/sparc64/sun4u.c
> +++ b/hw/sparc64/sun4u.c
> @@ -36,6 +36,7 @@
>  #include "hw/char/serial.h"
>  #include "hw/char/parallel.h"
>  #include "hw/timer/m48t59.h"
> +#include "hw/input/i8042.h"
>  #include "hw/block/fdc.h"
>  #include "net/net.h"
>  #include "qemu/timer.h"
> diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c
> index db26959a1d..830fe3face 100644
> --- a/hw/unicore32/puv3.c
> +++ b/hw/unicore32/puv3.c
> @@ -20,6 +20,7 @@
>  
>  #undef DEBUG_PUV3
>  #include "hw/unicore32/puv3.h"
> +#include "hw/input/i8042.h"
>  
>  #define KERNEL_LOAD_ADDR        0x03000000
>  #define KERNEL_MAX_SIZE         0x00800000 /* Just a guess */
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 335c6c9f65..6622efc1da 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -931,6 +931,7 @@ F: include/hw/display/vga.h
>  F: include/hw/char/parallel.h
>  F: include/hw/dma/i8257.h
>  F: include/hw/i2c/pm_smbus.h
> +F: include/hw/input/i8042.h
>  F: include/hw/timer/hpet.h
>  F: include/hw/timer/i8254*
>  F: include/hw/timer/mc146818rtc*

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 04/22] hw/isa/pc87312: Rename the device type as TYPE_PC87312_SUPERIO
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 04/22] hw/isa/pc87312: Rename the device type as TYPE_PC87312_SUPERIO Philippe Mathieu-Daudé
@ 2018-03-06  0:05   ` David Gibson
  0 siblings, 0 replies; 35+ messages in thread
From: David Gibson @ 2018-03-06  0:05 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth, qemu-devel, Richard Henderson,
	Eduardo Habkost, Yongbok Kim, Artyom Tarasenko, Guan Xuetao,
	Alexander Graf, open list:PReP

[-- Attachment #1: Type: text/plain, Size: 2172 bytes --]

On Mon, Mar 05, 2018 at 06:19:10PM -0300, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

hw/ppc part
Acked-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  include/hw/isa/pc87312.h | 4 ++--
>  hw/isa/pc87312.c         | 2 +-
>  hw/ppc/prep.c            | 2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/include/hw/isa/pc87312.h b/include/hw/isa/pc87312.h
> index bf74470d40..710eb1c807 100644
> --- a/include/hw/isa/pc87312.h
> +++ b/include/hw/isa/pc87312.h
> @@ -28,8 +28,8 @@
>  #include "hw/isa/isa.h"
>  
>  
> -#define TYPE_PC87312 "pc87312"
> -#define PC87312(obj) OBJECT_CHECK(PC87312State, (obj), TYPE_PC87312)
> +#define TYPE_PC87312_SUPERIO "pc87312"
> +#define PC87312(obj) OBJECT_CHECK(PC87312State, (obj), TYPE_PC87312_SUPERIO)
>  
>  typedef struct PC87312State {
>      ISADevice dev;
> diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c
> index 48b29e3c3c..e9edbc6c50 100644
> --- a/hw/isa/pc87312.c
> +++ b/hw/isa/pc87312.c
> @@ -391,7 +391,7 @@ static void pc87312_class_init(ObjectClass *klass, void *data)
>  }
>  
>  static const TypeInfo pc87312_type_info = {
> -    .name          = TYPE_PC87312,
> +    .name          = TYPE_PC87312_SUPERIO,
>      .parent        = TYPE_ISA_DEVICE,
>      .instance_size = sizeof(PC87312State),
>      .instance_init = pc87312_initfn,
> diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
> index ae724b0613..610ec7ec32 100644
> --- a/hw/ppc/prep.c
> +++ b/hw/ppc/prep.c
> @@ -613,7 +613,7 @@ static void ppc_prep_init(MachineState *machine)
>      isa_bus = ISA_BUS(qdev_get_child_bus(DEVICE(pci), "isa.0"));
>  
>      /* Super I/O (parallel + serial ports) */
> -    isa = isa_create(isa_bus, TYPE_PC87312);
> +    isa = isa_create(isa_bus, TYPE_PC87312_SUPERIO);
>      dev = DEVICE(isa);
>      qdev_prop_set_uint8(dev, "config", 13); /* fdc, ser0, ser1, par0 */
>      qdev_init_nofail(dev);

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 12/22] hw/isa/superio: Add a keyboard/mouse controller (8042)
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 12/22] hw/isa/superio: Add a keyboard/mouse controller (8042) Philippe Mathieu-Daudé
@ 2018-03-06  4:06   ` David Gibson
  0 siblings, 0 replies; 35+ messages in thread
From: David Gibson @ 2018-03-06  4:06 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth, qemu-devel, Richard Henderson,
	Eduardo Habkost, Yongbok Kim, Artyom Tarasenko, Guan Xuetao,
	Alexander Graf, open list:PReP

[-- Attachment #1: Type: text/plain, Size: 2249 bytes --]

On Mon, Mar 05, 2018 at 06:19:18PM -0300, Philippe Mathieu-Daudé wrote:
> Since the PC87312 inherits this abstract model, we remove the I8042
> instance in the PREP machine.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Acked-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  include/hw/isa/superio.h | 1 +
>  hw/isa/isa-superio.c     | 3 +++
>  hw/ppc/prep.c            | 1 -
>  3 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h
> index e8007b9eee..2fc33bf3d3 100644
> --- a/include/hw/isa/superio.h
> +++ b/include/hw/isa/superio.h
> @@ -30,6 +30,7 @@ typedef struct ISASuperIODevice {
>      ISADevice *parallel[MAX_PARALLEL_PORTS];
>      ISADevice *serial[MAX_SERIAL_PORTS];
>      ISADevice *floppy;
> +    ISADevice *kbc;
>  } ISASuperIODevice;
>  
>  typedef struct ISASuperIOFuncs {
> diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c
> index 22bf79d3c3..6a24ac0259 100644
> --- a/hw/isa/isa-superio.c
> +++ b/hw/isa/isa-superio.c
> @@ -17,6 +17,7 @@
>  #include "sysemu/blockdev.h"
>  #include "chardev/char.h"
>  #include "hw/isa/superio.h"
> +#include "hw/input/i8042.h"
>  #include "hw/char/serial.h"
>  #include "trace.h"
>  
> @@ -139,6 +140,8 @@ static void isa_superio_realize(DeviceState *dev, Error **errp)
>                                      k->floppy.get_irq(sio, 0) : -1);
>      }
>  
> +    /* Keyboard, mouse */
> +    sio->kbc = isa_create_simple(bus, TYPE_I8042);
>  }
>  
>  static void isa_superio_class_init(ObjectClass *oc, void *data)
> diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
> index 610ec7ec32..96d319b87c 100644
> --- a/hw/ppc/prep.c
> +++ b/hw/ppc/prep.c
> @@ -642,7 +642,6 @@ static void ppc_prep_init(MachineState *machine)
>                       hd[2 * i],
>  		     hd[2 * i + 1]);
>      }
> -    isa_create_simple(isa_bus, TYPE_I8042);
>  
>      cpu = POWERPC_CPU(first_cpu);
>      sysctrl->reset_irq = cpu->env.irq_inputs[PPC6xx_INPUT_HRESET];

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO
  2018-03-05 21:50 ` [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO no-reply
@ 2018-03-07 15:26   ` Paolo Bonzini
  0 siblings, 0 replies; 35+ messages in thread
From: Paolo Bonzini @ 2018-03-07 15:26 UTC (permalink / raw)
  To: qemu-devel, f4bug
  Cc: famz, mst, hpoussin, marcel, aurelien, mark.cave-ayland, aik,
	thuth, ehabkost, gxt, yongbok.kim, atar4qemu, rth

On 05/03/2018 22:50, no-reply@patchew.org wrote:
>   CC      hw/misc/applesmc.o
>   CC      hw/misc/max111x.o
> /tmp/qemu-test/src/hw/isa/isa-superio.c: In function 'isa_superio_realize':
> /tmp/qemu-test/src/hw/isa/isa-superio.c:39:46: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'long long unsigned int' [-Werror=format=]
>              warn_report("superio: ignoring %ld parallel controllers",
>                                             ~~^
>                                             %lld
> /tmp/qemu-test/src/hw/isa/isa-superio.c:77:46: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'long long unsigned int' [-Werror=format=]
>              warn_report("superio: ignoring %ld serial controllers",
>                                             ~~^
>                                             %lld

Easily fixed. :)

Paolo

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO
  2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
                   ` (22 preceding siblings ...)
  2018-03-05 21:50 ` [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO no-reply
@ 2018-03-07 16:52 ` Paolo Bonzini
  2018-03-07 23:46   ` Philippe Mathieu-Daudé
  23 siblings, 1 reply; 35+ messages in thread
From: Paolo Bonzini @ 2018-03-07 16:52 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé,
	Michael S . Tsirkin, Hervé Poussineau, Marcel Apfelbaum,
	Aurelien Jarno, Mark Cave-Ayland, Alexey Kardashevskiy,
	Thomas Huth
  Cc: Eduardo Habkost, qemu-devel, Guan Xuetao, Yongbok Kim,
	Artyom Tarasenko, Richard Henderson

On 05/03/2018 22:19, Philippe Mathieu-Daudé wrote:
> Since v1:
> - complete rewrite, split out the PIIX devices for another series
> 
> In this rewrite I extract the common SuperIO code from pc87312.c; use it in
> few MIPS boards; then as example, easily add a new SuperIO chipset (SMC37C669)
> to the dp264 machine.
> 
> More devices are being converted but I'm running out of time for the soft
> freeze (mips_r4k, hppa_dino, and the PC ones).
> 
> This series could be the 'part 2' of my previous "remove i386/pc dependency
> from non-PC world" I started around 2.9.
> 
> Philippe Mathieu-Daudé (22):
>   hw/isa: Move parallel_hds_isa_init() to hw/char/parallel-isa.c
>   hw/dma/i8257: Rename DMA_init() to i8257_dma_init()
>   hw/input/i8042: Extract declarations from i386/pc.h into input/i8042.h
>   hw/isa/pc87312: Rename the device type as TYPE_PC87312_SUPERIO
>   hw/isa/pc87312: Use uint16_t for the ISA I/O base address
>   hw/isa/pc87312: Use 'unsigned int' for the irq value
>   hw/isa/superio: Add a Super I/O template based on the PC87312 device
>   hw/isa/pc87312: Inherit from the abstract TYPE_ISA_SUPERIO
>   hw/isa/superio: Factor out the parallel code from pc87312.c
>   hw/isa/superio: Factor out the serial code from pc87312.c
>   hw/isa/superio: Factor out the floppy disc controller code from pc87312.c
>   hw/isa/superio: Add a keyboard/mouse controller (8042)
>   hw/isa/superio: Factor out the IDE code from pc87312.c
>   hw/mips/malta: Code movement
>   hw/isa/superio: Factor out the FDC37M817 Super I/O from mips_malta.c
>   hw/mips/mips_fulong2e: Factor out vt82c686b_southbridge_init()
>   hw/isa/vt82c686: Rename vt82c686b_init() -> vt82c686b_isa_init()
>   hw/isa/vt82c686: Add the TYPE_VT82C686B_SUPERIO
>   hw/isa/superio: Add the SMC FDC37C669 Super I/O
>   hw/alpha/dp264: Add the ISA DMA controller
>   hw/alpha/dp264: Use the TYPE_SMC37C669_SUPERIO
>   hw/i386/pc: Factor out the superio code
> 
>  default-configs/alpha-softmmu.mak |   5 +
>  include/hw/char/parallel.h        |  14 +++
>  include/hw/{isa => dma}/i8257.h   |   6 ++
>  include/hw/i386/pc.h              |  17 ---
>  include/hw/input/i8042.h          |  24 +++++
>  include/hw/isa/isa.h              |   2 -
>  include/hw/isa/pc87312.h          |  24 ++---
>  include/hw/isa/superio.h          |  60 +++++++++++
>  include/hw/isa/vt82c686.h         |   4 +-
>  hw/alpha/dp264.c                  |  13 ++-
>  hw/char/parallel-isa.c            |  36 +++++++
>  hw/char/parallel.c                |   2 +-
>  hw/dma/i82374.c                   |   3 +-
>  hw/dma/i8257.c                    |   4 +-
>  hw/i386/pc.c                      |  77 ++++++++------
>  hw/i386/vmmouse.c                 |   1 +
>  hw/i386/vmport.c                  |   1 +
>  hw/input/pckbd.c                  |   2 +-
>  hw/isa/isa-bus.c                  |  26 -----
>  hw/isa/isa-superio.c              | 210 ++++++++++++++++++++++++++++++++++++++
>  hw/isa/pc87312.c                  | 178 ++++++++++++++------------------
>  hw/isa/smc37c669-superio.c        | 115 +++++++++++++++++++++
>  hw/isa/vt82c686.c                 |  22 +++-
>  hw/mips/mips_fulong2e.c           |  85 +++++++--------
>  hw/mips/mips_jazz.c               |   5 +-
>  hw/mips/mips_malta.c              |  48 ++++-----
>  hw/mips/mips_r4k.c                |   3 +-
>  hw/ppc/prep.c                     |   6 +-
>  hw/sparc/sun4m.c                  |   4 -
>  hw/sparc64/sun4u.c                |   6 +-
>  hw/unicore32/puv3.c               |   1 +
>  hw/char/Makefile.objs             |   1 +
>  hw/isa/Makefile.objs              |   1 +
>  hw/isa/trace-events               |  10 +-
>  MAINTAINERS                       |   6 +-
>  35 files changed, 721 insertions(+), 301 deletions(-)
>  create mode 100644 include/hw/char/parallel.h
>  rename include/hw/{isa => dma}/i8257.h (86%)
>  create mode 100644 include/hw/input/i8042.h
>  create mode 100644 include/hw/isa/superio.h
>  create mode 100644 hw/char/parallel-isa.c
>  create mode 100644 hw/isa/isa-superio.c
>  create mode 100644 hw/isa/smc37c669-superio.c
> 

Queued, thanks.

Paolo

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO
  2018-03-07 16:52 ` Paolo Bonzini
@ 2018-03-07 23:46   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-07 23:46 UTC (permalink / raw)
  To: Paolo Bonzini, Michael S . Tsirkin, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: Eduardo Habkost, qemu-devel, Guan Xuetao, Yongbok Kim,
	Artyom Tarasenko, Richard Henderson

Hi Paolo,

On 03/07/2018 01:52 PM, Paolo Bonzini wrote:
> On 05/03/2018 22:19, Philippe Mathieu-Daudé wrote:
>> Since v1:
>> - complete rewrite, split out the PIIX devices for another series
>>
>> In this rewrite I extract the common SuperIO code from pc87312.c; use it in
>> few MIPS boards; then as example, easily add a new SuperIO chipset (SMC37C669)
>> to the dp264 machine.
>>
>> More devices are being converted but I'm running out of time for the soft
>> freeze (mips_r4k, hppa_dino, and the PC ones).
>>
>> This series could be the 'part 2' of my previous "remove i386/pc dependency
>> from non-PC world" I started around 2.9.
>>
>> Philippe Mathieu-Daudé (22):
>>   hw/isa: Move parallel_hds_isa_init() to hw/char/parallel-isa.c
>>   hw/dma/i8257: Rename DMA_init() to i8257_dma_init()
>>   hw/input/i8042: Extract declarations from i386/pc.h into input/i8042.h
>>   hw/isa/pc87312: Rename the device type as TYPE_PC87312_SUPERIO
>>   hw/isa/pc87312: Use uint16_t for the ISA I/O base address
>>   hw/isa/pc87312: Use 'unsigned int' for the irq value
>>   hw/isa/superio: Add a Super I/O template based on the PC87312 device
>>   hw/isa/pc87312: Inherit from the abstract TYPE_ISA_SUPERIO
>>   hw/isa/superio: Factor out the parallel code from pc87312.c
>>   hw/isa/superio: Factor out the serial code from pc87312.c
>>   hw/isa/superio: Factor out the floppy disc controller code from pc87312.c
>>   hw/isa/superio: Add a keyboard/mouse controller (8042)
>>   hw/isa/superio: Factor out the IDE code from pc87312.c
>>   hw/mips/malta: Code movement
>>   hw/isa/superio: Factor out the FDC37M817 Super I/O from mips_malta.c
>>   hw/mips/mips_fulong2e: Factor out vt82c686b_southbridge_init()
>>   hw/isa/vt82c686: Rename vt82c686b_init() -> vt82c686b_isa_init()
>>   hw/isa/vt82c686: Add the TYPE_VT82C686B_SUPERIO
>>   hw/isa/superio: Add the SMC FDC37C669 Super I/O
>>   hw/alpha/dp264: Add the ISA DMA controller
>>   hw/alpha/dp264: Use the TYPE_SMC37C669_SUPERIO
>>   hw/i386/pc: Factor out the superio code
>>
>>  default-configs/alpha-softmmu.mak |   5 +
>>  include/hw/char/parallel.h        |  14 +++
>>  include/hw/{isa => dma}/i8257.h   |   6 ++
>>  include/hw/i386/pc.h              |  17 ---
>>  include/hw/input/i8042.h          |  24 +++++
>>  include/hw/isa/isa.h              |   2 -
>>  include/hw/isa/pc87312.h          |  24 ++---
>>  include/hw/isa/superio.h          |  60 +++++++++++
>>  include/hw/isa/vt82c686.h         |   4 +-
>>  hw/alpha/dp264.c                  |  13 ++-
>>  hw/char/parallel-isa.c            |  36 +++++++
>>  hw/char/parallel.c                |   2 +-
>>  hw/dma/i82374.c                   |   3 +-
>>  hw/dma/i8257.c                    |   4 +-
>>  hw/i386/pc.c                      |  77 ++++++++------
>>  hw/i386/vmmouse.c                 |   1 +
>>  hw/i386/vmport.c                  |   1 +
>>  hw/input/pckbd.c                  |   2 +-
>>  hw/isa/isa-bus.c                  |  26 -----
>>  hw/isa/isa-superio.c              | 210 ++++++++++++++++++++++++++++++++++++++
>>  hw/isa/pc87312.c                  | 178 ++++++++++++++------------------
>>  hw/isa/smc37c669-superio.c        | 115 +++++++++++++++++++++
>>  hw/isa/vt82c686.c                 |  22 +++-
>>  hw/mips/mips_fulong2e.c           |  85 +++++++--------
>>  hw/mips/mips_jazz.c               |   5 +-
>>  hw/mips/mips_malta.c              |  48 ++++-----
>>  hw/mips/mips_r4k.c                |   3 +-
>>  hw/ppc/prep.c                     |   6 +-
>>  hw/sparc/sun4m.c                  |   4 -
>>  hw/sparc64/sun4u.c                |   6 +-
>>  hw/unicore32/puv3.c               |   1 +
>>  hw/char/Makefile.objs             |   1 +
>>  hw/isa/Makefile.objs              |   1 +
>>  hw/isa/trace-events               |  10 +-
>>  MAINTAINERS                       |   6 +-
>>  35 files changed, 721 insertions(+), 301 deletions(-)
>>  create mode 100644 include/hw/char/parallel.h
>>  rename include/hw/{isa => dma}/i8257.h (86%)
>>  create mode 100644 include/hw/input/i8042.h
>>  create mode 100644 include/hw/isa/superio.h
>>  create mode 100644 hw/char/parallel-isa.c
>>  create mode 100644 hw/isa/isa-superio.c
>>  create mode 100644 hw/isa/smc37c669-superio.c
>>
> 
> Queued, thanks.

Thanks for your trust, but this series is not ready yet :|

It touches various archs/machines and I couldn't test all images yet.

I posted it to get feedback and see if this superio refactor is useful
or not, makes sens. I understand you queuing it means somehow "yes" so
I'll continue to work on it, for now not adding more code but testing it
deeper and fixing few bugs :)

Thanks!

Phil.

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 09/22] hw/isa/superio: Factor out the parallel code from pc87312.c
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 09/22] hw/isa/superio: Factor out the parallel code from pc87312.c Philippe Mathieu-Daudé
@ 2018-03-08 20:31   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-08 20:31 UTC (permalink / raw)
  To: Michael S . Tsirkin, Paolo Bonzini, Hervé Poussineau,
	Marcel Apfelbaum, Aurelien Jarno, Mark Cave-Ayland,
	Alexey Kardashevskiy, Thomas Huth
  Cc: qemu-devel, Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao, open list:PReP

On 03/05/2018 10:19 PM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  include/hw/isa/pc87312.h |  4 ---
>  include/hw/isa/superio.h |  6 +++++
>  hw/isa/isa-superio.c     | 63 ++++++++++++++++++++++++++++++++++++++++++++++++
>  hw/isa/pc87312.c         | 38 ++++++++++++-----------------
>  hw/isa/trace-events      |  4 ++-
>  5 files changed, 87 insertions(+), 28 deletions(-)
> 
> diff --git a/include/hw/isa/pc87312.h b/include/hw/isa/pc87312.h
> index f3761d6fe1..bcc4578479 100644
> --- a/include/hw/isa/pc87312.h
> +++ b/include/hw/isa/pc87312.h
> @@ -39,10 +39,6 @@ typedef struct PC87312State {
>      uint16_t iobase;
>      uint8_t config; /* initial configuration */
>  
> -    struct {
> -        ISADevice *dev;
> -    } parallel;
> -
>      struct {
>          ISADevice *dev;
>      } uart[2];
> diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h
> index cff6ad6c08..e9879cfde1 100644
> --- a/include/hw/isa/superio.h
> +++ b/include/hw/isa/superio.h
> @@ -23,7 +23,11 @@
>      OBJECT_CLASS_CHECK(ISASuperIOClass, (klass), TYPE_ISA_SUPERIO)
>  
>  typedef struct ISASuperIODevice {
> +    /*< private >*/
>      ISADevice parent_obj;
> +    /*< public >*/
> +
> +    ISADevice *parallel[MAX_PARALLEL_PORTS];
>  } ISASuperIODevice;
>  
>  typedef struct ISASuperIOFuncs {
> @@ -39,6 +43,8 @@ typedef struct ISASuperIOClass {
>      ISADeviceClass parent_class;
>      /*< public >*/
>      DeviceRealize parent_realize;
> +
> +    ISASuperIOFuncs parallel;
>  } ISASuperIOClass;
>  
>  #endif /* HW_ISA_SUPERIO_H */
> diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c
> index 7777f8b9f0..4e0b1af633 100644
> --- a/hw/isa/isa-superio.c
> +++ b/hw/isa/isa-superio.c
> @@ -10,13 +10,76 @@
>   * SPDX-License-Identifier: GPL-2.0-or-later
>   */
>  #include "qemu/osdep.h"
> +#include "qemu/error-report.h"
> +#include "sysemu/sysemu.h"
> +#include "chardev/char.h"
>  #include "hw/isa/superio.h"
>  #include "trace.h"
>  
> +static void isa_superio_realize(DeviceState *dev, Error **errp)
> +{
> +    ISASuperIODevice *sio = ISA_SUPERIO(dev);
> +    ISASuperIOClass *k = ISA_SUPERIO_GET_CLASS(sio);
> +    ISABus *bus = isa_bus_from_device(ISA_DEVICE(dev));
> +    ISADevice *isa;
> +    DeviceState *d;
> +    Chardev *chr;
> +    char *name;
> +    int i;
> +
> +    /* Parallel port */
> +    for (i = 0; i < k->parallel.count; i++) {
> +        if (i >= ARRAY_SIZE(sio->parallel)) {
> +            warn_report("superio: ignoring %ld parallel controllers",
> +                        k->parallel.count - ARRAY_SIZE(sio->parallel));
> +            break;
> +        }
> +        if (!k->parallel.is_enabled || k->parallel.is_enabled(sio, i)) {
> +            name = g_strdup_printf("discarding-parallel%d", i);
> +            /* FIXME use a qdev chardev prop instead of parallel_hds[] */
> +            chr = parallel_hds[i];
> +            if (chr == NULL || chr->be) {
> +                chr = qemu_chr_new(name, "null");
> +            }
> +            isa = isa_create(bus, "isa-parallel");
> +            d = DEVICE(isa);
> +            qdev_prop_set_uint32(d, "index", i);
> +            if (k->parallel.get_iobase) {
> +                qdev_prop_set_uint32(d, "iobase",
> +                                     k->parallel.get_iobase(sio, i));
> +            }
> +            if (k->parallel.get_irq) {
> +                qdev_prop_set_uint32(d, "irq", k->parallel.get_irq(sio, i));
> +            }
> +            qdev_prop_set_chr(d, "chardev", chr);
> +            qdev_init_nofail(d);
> +            sio->parallel[i] = isa;
> +            trace_superio_create_parallel(i,
> +                                          k->parallel.get_iobase ?
> +                                          k->parallel.get_iobase(sio, i) : -1,
> +                                          k->parallel.get_irq ?
> +                                          k->parallel.get_irq(sio, i) : -1);
> +            object_property_add_child(OBJECT(dev), name,
> +                                      OBJECT(sio->parallel[i]), NULL);
> +            g_free(name);
> +        }
> +    }
> +}
> +
> +static void isa_superio_class_init(ObjectClass *oc, void *data)
> +{
> +    DeviceClass *dc = DEVICE_CLASS(oc);
> +
> +    dc->realize = isa_superio_realize;
> +    /* Reason: Uses parallel_hds[0] in realize(), so it can't be used twice */
> +    dc->user_creatable = false;
> +}
> +
>  static const TypeInfo isa_superio_type_info = {
>      .name = TYPE_ISA_SUPERIO,
>      .parent = TYPE_ISA_DEVICE,
>      .abstract = true,

I missed here:

       .class_size = sizeof(ISASuperIOClass),

> +    .class_init = isa_superio_class_init,
>  };
>  
>  static void isa_superio_register_types(void)
> diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c
> index 6b8100ff56..1c15715c69 100644
> --- a/hw/isa/pc87312.c
> +++ b/hw/isa/pc87312.c
> @@ -64,22 +64,25 @@
>  
>  /* Parallel port */
>  
> -static inline bool is_parallel_enabled(PC87312State *s)
> +static bool is_parallel_enabled(ISASuperIODevice *sio, uint8_t index)
>  {
> -    return s->regs[REG_FER] & FER_PARALLEL_EN;
> +    PC87312State *s = PC87312(sio);
> +    return index ? false : s->regs[REG_FER] & FER_PARALLEL_EN;
>  }
>  
>  static const uint16_t parallel_base[] = { 0x378, 0x3bc, 0x278, 0x00 };
>  
> -static inline uint16_t get_parallel_iobase(PC87312State *s)
> +static uint16_t get_parallel_iobase(ISASuperIODevice *sio, uint8_t index)
>  {
> +    PC87312State *s = PC87312(sio);
>      return parallel_base[s->regs[REG_FAR] & FAR_PARALLEL_ADDR];
>  }
>  
>  static const unsigned int parallel_irq[] = { 5, 7, 5, 0 };
>  
> -static inline unsigned int get_parallel_irq(PC87312State *s)
> +static unsigned int get_parallel_irq(ISASuperIODevice *sio, uint8_t index)
>  {
> +    PC87312State *s = PC87312(sio);
>      int idx;
>      idx = (s->regs[REG_FAR] & FAR_PARALLEL_ADDR);
>      if (idx == 0) {
> @@ -286,24 +289,6 @@ static void pc87312_realize(DeviceState *dev, Error **errp)
>          return;
>      }
>  
> -    if (is_parallel_enabled(s)) {
> -        /* FIXME use a qdev chardev prop instead of parallel_hds[] */
> -        chr = parallel_hds[0];
> -        if (chr == NULL) {
> -            chr = qemu_chr_new("par0", "null");
> -        }
> -        isa = isa_create(bus, "isa-parallel");
> -        d = DEVICE(isa);
> -        qdev_prop_set_uint32(d, "index", 0);
> -        qdev_prop_set_uint32(d, "iobase", get_parallel_iobase(s));
> -        qdev_prop_set_uint32(d, "irq", get_parallel_irq(s));
> -        qdev_prop_set_chr(d, "chardev", chr);
> -        qdev_init_nofail(d);
> -        s->parallel.dev = isa;
> -        trace_pc87312_info_parallel(get_parallel_iobase(s),
> -                                    get_parallel_irq(s));
> -    }
> -
>      for (i = 0; i < 2; i++) {
>          if (is_uart_enabled(s, i)) {
>              /* FIXME use a qdev chardev prop instead of serial_hds[] */
> @@ -395,8 +380,15 @@ static void pc87312_class_init(ObjectClass *klass, void *data)
>      dc->reset = pc87312_reset;
>      dc->vmsd = &vmstate_pc87312;
>      dc->props = pc87312_properties;
> -    /* Reason: Uses parallel_hds[0] in realize(), so it can't be used twice */
> +    /* Reason: Uses serial_hds[0] in realize(), so it can't be used twice */
>      dc->user_creatable = false;
> +
> +    sc->parallel = (ISASuperIOFuncs){
> +        .count = 1,
> +        .is_enabled = is_parallel_enabled,
> +        .get_iobase = get_parallel_iobase,
> +        .get_irq    = get_parallel_irq,
> +    };
>  }
>  
>  static const TypeInfo pc87312_type_info = {
> diff --git a/hw/isa/trace-events b/hw/isa/trace-events
> index a4ab4e3634..97b1949981 100644
> --- a/hw/isa/trace-events
> +++ b/hw/isa/trace-events
> @@ -1,9 +1,11 @@
>  # See docs/devel/tracing.txt for syntax documentation.
>  
> +# hw/isa/isa-superio.c
> +superio_create_parallel(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, irq %u"
> +
>  # hw/isa/pc87312.c
>  pc87312_io_read(uint32_t addr, uint32_t val) "read addr=0x%x val=0x%x"
>  pc87312_io_write(uint32_t addr, uint32_t val) "write addr=0x%x val=0x%x"
>  pc87312_info_floppy(uint32_t base) "base 0x%x"
>  pc87312_info_ide(uint32_t base) "base 0x%x"
> -pc87312_info_parallel(uint32_t base, uint32_t irq) "base 0x%x, irq %u"
>  pc87312_info_serial(int n, uint32_t base, uint32_t irq) "id=%d, base 0x%x, irq %u"
> 

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 21/22] hw/alpha/dp264: Use the TYPE_SMC37C669_SUPERIO
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 21/22] hw/alpha/dp264: Use the TYPE_SMC37C669_SUPERIO Philippe Mathieu-Daudé
@ 2018-03-08 20:39   ` Philippe Mathieu-Daudé
  2018-03-08 22:14     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-08 20:39 UTC (permalink / raw)
  To: Paolo Bonzini, Aurelien Jarno, Richard Henderson
  Cc: Michael S . Tsirkin, Hervé Poussineau, Marcel Apfelbaum,
	Mark Cave-Ayland, Alexey Kardashevskiy, Thomas Huth, qemu-devel,
	Eduardo Habkost, Yongbok Kim, Artyom Tarasenko, Guan Xuetao

On 03/05/2018 10:19 PM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  default-configs/alpha-softmmu.mak |  3 +++
>  hw/alpha/dp264.c                  | 10 ++++------
>  2 files changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/default-configs/alpha-softmmu.mak b/default-configs/alpha-softmmu.mak
> index 3740adc5e9..bbe361f01a 100644
> --- a/default-configs/alpha-softmmu.mak
> +++ b/default-configs/alpha-softmmu.mak
> @@ -7,6 +7,9 @@ CONFIG_SERIAL_ISA=y
>  CONFIG_I82374=y
>  CONFIG_I8254=y
>  CONFIG_I8257=y
> +CONFIG_PARALLEL=y
> +CONFIG_PARALLEL_ISA=y
> +CONFIG_FDC=y
>  CONFIG_PCKBD=y
>  CONFIG_VGA_CIRRUS=y
>  CONFIG_IDE_CORE=y
> diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
> index ffad678ea7..80b987f7fb 100644
> --- a/hw/alpha/dp264.c
> +++ b/hw/alpha/dp264.c
> @@ -19,8 +19,7 @@
>  #include "hw/timer/mc146818rtc.h"
>  #include "hw/ide.h"
>  #include "hw/timer/i8254.h"
> -#include "hw/input/i8042.h"
> -#include "hw/char/serial.h"
> +#include "hw/isa/superio.h"
>  #include "hw/dma/i8257.h"
>  #include "qemu/cutils.h"
>  
> @@ -83,14 +82,10 @@ static void clipper_init(MachineState *machine)
>      mc146818_rtc_init(isa_bus, 1900, rtc_irq);
>  
>      i8254_pit_init(isa_bus, 0x40, 0, NULL);
> -    isa_create_simple(isa_bus, TYPE_I8042);
>  
>      /* VGA setup.  Don't bother loading the bios.  */
>      pci_vga_init(pci_bus);
>  
> -    /* Serial code setup.  */
> -    serial_hds_isa_init(isa_bus, 0, MAX_SERIAL_PORTS);
> -
>      /* Network setup.  e1000 is good enough, failing Tulip support.  */
>      for (i = 0; i < nb_nics; i++) {
>          pci_nic_init_nofail(&nd_table[i], pci_bus, "e1000", NULL);
> @@ -99,6 +94,9 @@ static void clipper_init(MachineState *machine)
>      /* 2 82C37 (dma) */
>      isa_create_simple(isa_bus, "i82374");
>  
> +    /* Super I/O */
> +    isa_create_simple(isa_bus, TYPE_SMC37C669_SUPERIO);
> +
>      /* IDE disk setup.  */
>      {
>          DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
> 

Booting linux with:

qemu-system-alpha -kernel vmlinux-smp -nographic -append 'console=srm
printk.time=0'

diffing the console before/after (master/series):

  platform rtc-alpha: rtc core: registered rtc-alpha as rtc0
  Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
  serial8250: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
+ serial8250: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A
  serio: i8042 KBD port at 0x60,0x64 irq 1
  serio: i8042 AUX port at 0x60,0x64 irq 12
  mousedev: PS/2 mouse device common for all mice
  input: AT Translated Set 2 keyboard as
/devices/platform/i8042/serio0/input/input0

The only diff is the 2nd uart discovered (ttyS1), since the SMC37C669
provides 2 (everything else is exactly the same - except the RTC time).

So alpha-softmmu behaves correctly.

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 15/22] hw/isa/superio: Factor out the FDC37M817 Super I/O from mips_malta.c
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 15/22] hw/isa/superio: Factor out the FDC37M817 Super I/O from mips_malta.c Philippe Mathieu-Daudé
@ 2018-03-08 20:43   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-08 20:43 UTC (permalink / raw)
  To: Paolo Bonzini, Aurelien Jarno
  Cc: Michael S . Tsirkin, Hervé Poussineau, Marcel Apfelbaum,
	Mark Cave-Ayland, Alexey Kardashevskiy, Thomas Huth, qemu-devel,
	Richard Henderson, Eduardo Habkost, Yongbok Kim,
	Artyom Tarasenko, Guan Xuetao

On 03/05/2018 10:19 PM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  include/hw/isa/superio.h |  2 ++
>  hw/isa/isa-superio.c     | 20 ++++++++++++++++++++
>  hw/mips/mips_malta.c     | 35 ++++++++++-------------------------
>  3 files changed, 32 insertions(+), 25 deletions(-)
> 
> diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h
> index 3dd5448f8c..b47aac3cf8 100644
> --- a/include/hw/isa/superio.h
> +++ b/include/hw/isa/superio.h
> @@ -54,4 +54,6 @@ typedef struct ISASuperIOClass {
>      ISASuperIOFuncs ide;
>  } ISASuperIOClass;
>  
> +#define TYPE_FDC37M81X_SUPERIO  "fdc37m81x-superio"
> +
>  #endif /* HW_ISA_SUPERIO_H */
> diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c
> index 88d254a602..f1f699fc2f 100644
> --- a/hw/isa/isa-superio.c
> +++ b/hw/isa/isa-superio.c
> @@ -182,9 +182,29 @@ static const TypeInfo isa_superio_type_info = {
>      .class_init = isa_superio_class_init,
>  };
>  
> +/* 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,
> +    .instance_size = sizeof(ISASuperIODevice),
> +    .class_size    = sizeof(ISASuperIOClass),
> +    .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/mips/mips_malta.c b/hw/mips/mips_malta.c
> index 9e0724ca5a..f6513a4fd5 100644
> --- a/hw/mips/mips_malta.c
> +++ b/hw/mips/mips_malta.c
> @@ -27,14 +27,12 @@
>  #include "cpu.h"
>  #include "hw/hw.h"
>  #include "hw/i386/pc.h"
> +#include "hw/isa/superio.h"
>  #include "hw/dma/i8257.h"
>  #include "hw/char/serial.h"
> -#include "hw/char/parallel.h"
> -#include "hw/block/fdc.h"
>  #include "net/net.h"
>  #include "hw/boards.h"
>  #include "hw/i2c/smbus.h"
> -#include "sysemu/block-backend.h"
>  #include "hw/block/flash.h"
>  #include "hw/mips/mips.h"
>  #include "hw/mips/cpudevs.h"
> @@ -47,7 +45,6 @@
>  #include "hw/loader.h"
>  #include "elf.h"
>  #include "hw/timer/mc146818rtc.h"
> -#include "hw/input/i8042.h"
>  #include "hw/timer/i8254.h"
>  #include "sysemu/blockdev.h"
>  #include "exec/address-spaces.h"
> @@ -1005,10 +1002,8 @@ void mips_malta_init(MachineState *machine)
>      qemu_irq cbus_irq, i8259_irq;
>      int piix4_devfn;
>      I2CBus *smbus;
> -    int i;
>      DriveInfo *dinfo;
>      DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
> -    DriveInfo *fd[MAX_FD];
>      int fl_idx = 0;
>      int fl_sectors = bios_size >> 16;
>      int be;
> @@ -1023,15 +1018,6 @@ void mips_malta_init(MachineState *machine)
>  
>      qdev_init_nofail(dev);
>  
> -    /* Make sure the first 3 serial ports are associated with a device. */
> -    for(i = 0; i < 3; i++) {
> -        if (!serial_hds[i]) {
> -            char label[32];
> -            snprintf(label, sizeof(label), "serial%d", i);
> -            serial_hds[i] = qemu_chr_new(label, "null");
> -        }
> -    }
> -
>      /* create CPU */
>      mips_create_cpu(s, machine->cpu_type, &cbus_irq, &i8259_irq);
>  
> @@ -1067,7 +1053,14 @@ void mips_malta_init(MachineState *machine)
>  #else
>      be = 0;
>  #endif
> +
>      /* FPGA */
> +
> +    /* Make sure the second serial port is associated with a device. */
> +    if (!serial_hds[2]) {
> +        serial_hds[2] = qemu_chr_new("fpga-uart", "null");
> +    }
> +
>      /* The CBUS UART is attached to the MIPS CPU INT2 pin, ie interrupt 4 */
>      malta_fpga_init(system_memory, FPGA_ADDRESS, cbus_irq, serial_hds[2]);
>  
> @@ -1214,16 +1207,8 @@ void mips_malta_init(MachineState *machine)
>      smbus_eeprom_init(smbus, 8, smbus_eeprom_buf, smbus_eeprom_size);
>      g_free(smbus_eeprom_buf);
>  
> -    /* Super I/O */
> -    isa_create_simple(isa_bus, TYPE_I8042);
> -
> -    serial_hds_isa_init(isa_bus, 0, 2);
> -    parallel_hds_isa_init(isa_bus, 1);
> -
> -    for(i = 0; i < MAX_FD; i++) {
> -        fd[i] = drive_get(IF_FLOPPY, 0, i);
> -    }
> -    fdctrl_init_isa(isa_bus, fd);
> +    /* Super I/O: SMS FDC37M817 */
> +    isa_create_simple(isa_bus, TYPE_FDC37M81X_SUPERIO);
>  
>      /* Network card */
>      network_init(pci_bus);
> 

Booting Aurelien Malta Linux image with this series applied, the console
is identical (also 'info mtree' in monitor).

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 18/22] hw/isa/vt82c686: Add the TYPE_VT82C686B_SUPERIO
  2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 18/22] hw/isa/vt82c686: Add the TYPE_VT82C686B_SUPERIO Philippe Mathieu-Daudé
@ 2018-03-08 21:49   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-08 21:49 UTC (permalink / raw)
  To: Paolo Bonzini, Hervé Poussineau, Marcel Apfelbaum,
	Aurelien Jarno, Yongbok Kim
  Cc: Michael S . Tsirkin, Mark Cave-Ayland, Alexey Kardashevskiy,
	Thomas Huth, qemu-devel, Richard Henderson, Eduardo Habkost,
	Artyom Tarasenko, Guan Xuetao

On 03/05/2018 10:19 PM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  include/hw/isa/vt82c686.h |  2 ++
>  hw/isa/vt82c686.c         | 20 ++++++++++++++++++++
>  hw/mips/mips_fulong2e.c   | 15 +++------------
>  3 files changed, 25 insertions(+), 12 deletions(-)
> 
> diff --git a/include/hw/isa/vt82c686.h b/include/hw/isa/vt82c686.h
> index db97c8ed7a..c3c2b6e786 100644
> --- a/include/hw/isa/vt82c686.h
> +++ b/include/hw/isa/vt82c686.h
> @@ -1,6 +1,8 @@
>  #ifndef HW_VT82C686_H
>  #define HW_VT82C686_H
>  
> +#define TYPE_VT82C686B_SUPERIO "vt82c686b-superio"
> +
>  /* vt82c686.c */
>  ISABus *vt82c686b_isa_init(PCIBus * bus, int devfn);
>  void vt82c686b_ac97_init(PCIBus *bus, int devfn);
> diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
> index 7eaf3c7e8f..cff1946232 100644
> --- a/hw/isa/vt82c686.c
> +++ b/hw/isa/vt82c686.c
> @@ -17,6 +17,7 @@
>  #include "hw/i2c/smbus.h"
>  #include "hw/pci/pci.h"
>  #include "hw/isa/isa.h"
> +#include "hw/isa/superio.h"
>  #include "hw/sysbus.h"
>  #include "hw/mips/mips.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)
>  {
>      type_register_static(&via_ac97_info);
>      type_register_static(&via_mc97_info);
>      type_register_static(&via_pm_info);
> +    type_register_static(&via_superio_info);
>      type_register_static(&via_info);
>  }
>  
> diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
> index 9ebc225d3b..d608f17e1e 100644
> --- a/hw/mips/mips_fulong2e.c
> +++ b/hw/mips/mips_fulong2e.c
> @@ -23,9 +23,7 @@
>  #include "hw/hw.h"
>  #include "hw/i386/pc.h"
>  #include "hw/dma/i8257.h"
> -#include "hw/char/serial.h"
> -#include "hw/char/parallel.h"
> -#include "hw/block/fdc.h"
> +#include "hw/isa/superio.h"
>  #include "net/net.h"
>  #include "hw/boards.h"
>  #include "hw/i2c/smbus.h"
> @@ -34,7 +32,6 @@
>  #include "hw/mips/mips.h"
>  #include "hw/mips/cpudevs.h"
>  #include "hw/pci/pci.h"
> -#include "sysemu/sysemu.h"
>  #include "audio/audio.h"
>  #include "qemu/log.h"
>  #include "hw/loader.h"
> @@ -44,8 +41,6 @@
>  #include "hw/isa/vt82c686.h"
>  #include "hw/timer/mc146818rtc.h"
>  #include "hw/timer/i8254.h"
> -#include "hw/input/i8042.h"
> -#include "sysemu/blockdev.h"
>  #include "exec/address-spaces.h"
>  #include "sysemu/qtest.h"
>  #include "qemu/error-report.h"
> @@ -250,6 +245,8 @@ static void vt82c686b_southbridge_init(PCIBus *pci_bus, int slot, qemu_irq intc,
>      /* init other devices */
>      i8254_pit_init(isa_bus, 0x40, 0, NULL);
>      i8257_dma_init(isa_bus, 0);
> +    /* Super I/O */
> +    isa_create_simple(isa_bus, TYPE_VT82C686B_SUPERIO);
>  
>      ide_drive_get(hd, ARRAY_SIZE(hd));
>      vt82c686b_ide_init(pci_bus, hd, PCI_DEVFN(slot, 1));
> @@ -262,12 +259,6 @@ static void vt82c686b_southbridge_init(PCIBus *pci_bus, int slot, qemu_irq intc,
>      /* Audio support */
>      vt82c686b_ac97_init(pci_bus, PCI_DEVFN(slot, 5));
>      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 */

I don't have Fuloong 2e image at hand, but the monitor "info qtree" diff
without/with TYPE_VT82C686B_SUPERIO is:

         bus: isa.0
           type ISA
+          dev: isa-fdc, id ""
+            iobase = 1008 (0x3f0)
+            irq = 6 (0x6)
+            dma = 2 (0x2)
+            driveA = ""
+            driveB = ""
+            check_media_rate = true
+            fdtypeA = "auto"
+            fdtypeB = "auto"
+            fallback = "288"
+            isa irq 6
+            bus: floppy-bus.0
+              type floppy-bus
+              dev: floppy, id ""
+                unit = 0 (0x0)
+                drive = "floppy0"
+                logical_block_size = 512 (0x200)
+                physical_block_size = 512 (0x200)
+                min_io_size = 0 (0x0)
+                opt_io_size = 0 (0x0)
+                discard_granularity = 4294967295 (0xffffffff)
+                write-cache = "auto"
+                share-rw = false
+                drive-type = "288"
+          dev: isa-serial, id ""
+            index = 1 (0x1)
+            iobase = 760 (0x2f8)
+            irq = 3 (0x3)
+            chardev = "discarding-serial1"
+            wakeup = 0 (0x0)
+            isa irq 3
           dev: isa-serial, id ""
             index = 0 (0x0)
             iobase = 1016 (0x3f8)
             irq = 4 (0x4)
             chardev = "serial0"
             wakeup = 0 (0x0)
             isa irq 4
           dev: isa-parallel, id ""
             index = 0 (0x0)
             iobase = 888 (0x378)
             irq = 7 (0x7)
             chardev = "parallel0"
             isa irq 7
+          dev: vt82c686b-superio, id ""

and "info mtree":

     0000000000000170-0000000000000177 (prio 0, i/o): ide
     00000000000001f0-00000000000001f7 (prio 0, i/o): ide
+    00000000000002f8-00000000000002ff (prio 0, i/o): serial
     0000000000000376-0000000000000376 (prio 0, i/o): ide
     0000000000000378-000000000000037f (prio 0, i/o): parallel
     00000000000003f0-00000000000003f1 (prio 0, i/o): superio [disabled]
+    00000000000003f1-00000000000003f5 (prio 0, i/o): fdc
     00000000000003f6-00000000000003f6 (prio 0, i/o): ide
+    00000000000003f7-00000000000003f7 (prio 0, i/o): fdc
     00000000000003f8-00000000000003ff (prio 0, i/o): serial
     00000000000004d0-00000000000004d0 (prio 0, i/o): elcr
     00000000000004d1-00000000000004d1 (prio 0, i/o): elcr

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 21/22] hw/alpha/dp264: Use the TYPE_SMC37C669_SUPERIO
  2018-03-08 20:39   ` Philippe Mathieu-Daudé
@ 2018-03-08 22:14     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 35+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-03-08 22:14 UTC (permalink / raw)
  To: Paolo Bonzini, Aurelien Jarno, Richard Henderson
  Cc: Michael S . Tsirkin, Hervé Poussineau, Marcel Apfelbaum,
	Mark Cave-Ayland, Alexey Kardashevskiy, Thomas Huth, qemu-devel,
	Eduardo Habkost, Yongbok Kim, Artyom Tarasenko, Guan Xuetao

On 03/08/2018 09:39 PM, Philippe Mathieu-Daudé wrote:
> On 03/05/2018 10:19 PM, Philippe Mathieu-Daudé wrote:
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>>  default-configs/alpha-softmmu.mak |  3 +++
>>  hw/alpha/dp264.c                  | 10 ++++------
>>  2 files changed, 7 insertions(+), 6 deletions(-)
>>
>> diff --git a/default-configs/alpha-softmmu.mak b/default-configs/alpha-softmmu.mak
>> index 3740adc5e9..bbe361f01a 100644
>> --- a/default-configs/alpha-softmmu.mak
>> +++ b/default-configs/alpha-softmmu.mak
>> @@ -7,6 +7,9 @@ CONFIG_SERIAL_ISA=y
>>  CONFIG_I82374=y
>>  CONFIG_I8254=y
>>  CONFIG_I8257=y
>> +CONFIG_PARALLEL=y
>> +CONFIG_PARALLEL_ISA=y
>> +CONFIG_FDC=y
>>  CONFIG_PCKBD=y
>>  CONFIG_VGA_CIRRUS=y
>>  CONFIG_IDE_CORE=y
>> diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
>> index ffad678ea7..80b987f7fb 100644
>> --- a/hw/alpha/dp264.c
>> +++ b/hw/alpha/dp264.c
>> @@ -19,8 +19,7 @@
>>  #include "hw/timer/mc146818rtc.h"
>>  #include "hw/ide.h"
>>  #include "hw/timer/i8254.h"
>> -#include "hw/input/i8042.h"
>> -#include "hw/char/serial.h"
>> +#include "hw/isa/superio.h"
>>  #include "hw/dma/i8257.h"
>>  #include "qemu/cutils.h"
>>  
>> @@ -83,14 +82,10 @@ static void clipper_init(MachineState *machine)
>>      mc146818_rtc_init(isa_bus, 1900, rtc_irq);
>>  
>>      i8254_pit_init(isa_bus, 0x40, 0, NULL);
>> -    isa_create_simple(isa_bus, TYPE_I8042);
>>  
>>      /* VGA setup.  Don't bother loading the bios.  */
>>      pci_vga_init(pci_bus);
>>  
>> -    /* Serial code setup.  */
>> -    serial_hds_isa_init(isa_bus, 0, MAX_SERIAL_PORTS);
>> -
>>      /* Network setup.  e1000 is good enough, failing Tulip support.  */
>>      for (i = 0; i < nb_nics; i++) {
>>          pci_nic_init_nofail(&nd_table[i], pci_bus, "e1000", NULL);
>> @@ -99,6 +94,9 @@ static void clipper_init(MachineState *machine)
>>      /* 2 82C37 (dma) */
>>      isa_create_simple(isa_bus, "i82374");
>>  
>> +    /* Super I/O */
>> +    isa_create_simple(isa_bus, TYPE_SMC37C669_SUPERIO);
>> +
>>      /* IDE disk setup.  */
>>      {
>>          DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
>>
> 
> Booting linux with:
> 
> qemu-system-alpha -kernel vmlinux-smp -nographic -append 'console=srm
> printk.time=0'
> 
> diffing the console before/after (master/series):
> 
>   platform rtc-alpha: rtc core: registered rtc-alpha as rtc0
>   Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
>   serial8250: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
> + serial8250: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A
>   serio: i8042 KBD port at 0x60,0x64 irq 1
>   serio: i8042 AUX port at 0x60,0x64 irq 12
>   mousedev: PS/2 mouse device common for all mice
>   input: AT Translated Set 2 keyboard as
> /devices/platform/i8042/serio0/input/input0
> 
> The only diff is the 2nd uart discovered (ttyS1), since the SMC37C669
> provides 2 (everything else is exactly the same - except the RTC time).
> 
> So alpha-softmmu behaves correctly.

And the "info qtree" diff:

   dev: isabus-bridge, id ""
     bus: isa.0
       type ISA
+      dev: i8042, id ""
+        gpio-out "a20" 1
+        isa irqs 1,12
+      dev: isa-fdc, id ""
+        iobase = 1008 (0x3f0)
+        irq = 6 (0x6)
+        dma = 2 (0x2)
+        driveA = ""
+        driveB = ""
+        check_media_rate = true
+        fdtypeA = "auto"
+        fdtypeB = "auto"
+        fallback = "288"
+        isa irq 6
+        bus: floppy-bus.0
+          type floppy-bus
+          dev: floppy, id ""
+            unit = 0 (0x0)
+            drive = "floppy0"
+            logical_block_size = 512 (0x200)
+            physical_block_size = 512 (0x200)
+            min_io_size = 0 (0x0)
+            opt_io_size = 0 (0x0)
+            discard_granularity = 4294967295 (0xffffffff)
+            write-cache = "auto"
+            share-rw = false
+            drive-type = "288"
+      dev: isa-serial, id ""
+        index = 1 (0x1)
+        iobase = 760 (0x2f8)
+        irq = 3 (0x3)
+        chardev = "discarding-serial1"
+        wakeup = 0 (0x0)
+        isa irq 3
       dev: isa-serial, id ""
         index = 0 (0x0)
         iobase = 1016 (0x3f8)
@@ -13,9 +47,25 @@
         chardev = "serial0"
         wakeup = 0 (0x0)
         isa irq 4
-      dev: i8042, id ""
-        gpio-out "a20" 1
-        isa irqs 1,12
+      dev: isa-parallel, id ""
+        index = 0 (0x0)
+        iobase = 956 (0x3bc)
+        irq = 7 (0x7)
+        chardev = "parallel0"
+        isa irq 7
+      dev: smc37c669-superio, id ""
+      dev: i8257, id ""
+        base = 192 (0xc0)
+        page-base = 136 (0x88)
+        pageh-base = 1160 (0x488)
+        dshift = 1 (0x1)
+      dev: i8257, id ""
+        base = 0 (0x0)
+        page-base = 128 (0x80)
+        pageh-base = 1152 (0x480)
+        dshift = 0 (0x0)
+      dev: i82374, id ""
+        iobase = 1024 (0x400)
       dev: isa-pit, id ""
         gpio-in "" 1
         gpio-out "" 1
         ...


and "info mtree":

     00000801b0000000-00000801bfffffff (prio 0, i/o): dchip0
     00000801f8000000-00000801fbffffff (prio 0, i/o): pci0-iack
     00000801fc000000-00000801fdffffff (prio 0, i/o): pci0-io
+      00000801fc000000-00000801fc000007 (prio 0, i/o): dma-chan
+      00000801fc000008-00000801fc00000f (prio 0, i/o): dma-cont
       00000801fc000020-00000801fc000021 (prio 0, i/o): pic
       00000801fc000040-00000801fc000043 (prio 0, i/o): pit
       00000801fc000060-00000801fc000060 (prio 0, i/o): i8042-data
       00000801fc000064-00000801fc000064 (prio 0, i/o): i8042-cmd
       00000801fc000070-00000801fc000071 (prio 0, i/o): rtc
+      00000801fc000081-00000801fc000083 (prio 0, i/o): dma-page
+      00000801fc000087-00000801fc000087 (prio 0, i/o): dma-page
+      00000801fc000089-00000801fc00008b (prio 0, i/o): dma-page
+      00000801fc00008f-00000801fc00008f (prio 0, i/o): dma-page
       00000801fc0000a0-00000801fc0000a1 (prio 0, i/o): pic
+      00000801fc0000c0-00000801fc0000cf (prio 0, i/o): dma-chan
+      00000801fc0000d0-00000801fc0000df (prio 0, i/o): dma-cont
+      00000801fc0002f8-00000801fc0002ff (prio 0, i/o): serial
       00000801fc0003b0-00000801fc0003df (prio 0, i/o): cirrus-io
+      00000801fc0003bc-00000801fc0003c3 (prio 0, i/o): parallel
+      00000801fc0003f1-00000801fc0003f5 (prio 0, i/o): fdc
+      00000801fc0003f7-00000801fc0003f7 (prio 0, i/o): fdc
       00000801fc0003f8-00000801fc0003ff (prio 0, i/o): serial
+      00000801fc00040a-00000801fc00040a (prio 0, i/o): i82374
+      00000801fc000410-00000801fc00043f (prio 0, i/o): i82374
+      00000801fc000481-00000801fc000483 (prio 0, i/o): dma-pageh
+      00000801fc000487-00000801fc000489 (prio 0, i/o): dma-pageh
+      00000801fc000489-00000801fc00048b (prio 0, i/o): dma-pageh
+      00000801fc00048f-00000801fc000491 (prio 0, i/o): dma-pageh
       00000801fc0004d0-00000801fc0004d0 (prio 0, i/o): elcr
       00000801fc0004d1-00000801fc0004d1 (prio 0, i/o): elcr
     00000801fe000000-00000801feffffff (prio 0, i/o): pci0-conf
     ...

^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2018-03-08 22:15 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-05 21:19 [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO Philippe Mathieu-Daudé
2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 01/22] hw/isa: Move parallel_hds_isa_init() to hw/char/parallel-isa.c Philippe Mathieu-Daudé
2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 02/22] hw/dma/i8257: Rename DMA_init() to i8257_dma_init() Philippe Mathieu-Daudé
2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 03/22] hw/input/i8042: Extract declarations from i386/pc.h into input/i8042.h Philippe Mathieu-Daudé
2018-03-06  0:05   ` David Gibson
2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 04/22] hw/isa/pc87312: Rename the device type as TYPE_PC87312_SUPERIO Philippe Mathieu-Daudé
2018-03-06  0:05   ` David Gibson
2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 05/22] hw/isa/pc87312: Use uint16_t for the ISA I/O base address Philippe Mathieu-Daudé
2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 06/22] hw/isa/pc87312: Use 'unsigned int' for the irq value Philippe Mathieu-Daudé
2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 07/22] hw/isa/superio: Add a Super I/O template based on the PC87312 device Philippe Mathieu-Daudé
2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 08/22] hw/isa/pc87312: Inherit from the abstract TYPE_ISA_SUPERIO Philippe Mathieu-Daudé
2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 09/22] hw/isa/superio: Factor out the parallel code from pc87312.c Philippe Mathieu-Daudé
2018-03-08 20:31   ` Philippe Mathieu-Daudé
2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 10/22] hw/isa/superio: Factor out the serial " Philippe Mathieu-Daudé
2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 11/22] hw/isa/superio: Factor out the floppy disc controller " Philippe Mathieu-Daudé
2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 12/22] hw/isa/superio: Add a keyboard/mouse controller (8042) Philippe Mathieu-Daudé
2018-03-06  4:06   ` David Gibson
2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 13/22] hw/isa/superio: Factor out the IDE code from pc87312.c Philippe Mathieu-Daudé
2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 14/22] hw/mips/malta: Code movement Philippe Mathieu-Daudé
2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 15/22] hw/isa/superio: Factor out the FDC37M817 Super I/O from mips_malta.c Philippe Mathieu-Daudé
2018-03-08 20:43   ` Philippe Mathieu-Daudé
2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 16/22] hw/mips/mips_fulong2e: Factor out vt82c686b_southbridge_init() Philippe Mathieu-Daudé
2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 17/22] hw/isa/vt82c686: Rename vt82c686b_init() -> vt82c686b_isa_init() Philippe Mathieu-Daudé
2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 18/22] hw/isa/vt82c686: Add the TYPE_VT82C686B_SUPERIO Philippe Mathieu-Daudé
2018-03-08 21:49   ` Philippe Mathieu-Daudé
2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 19/22] hw/isa/superio: Add the SMC FDC37C669 Super I/O Philippe Mathieu-Daudé
2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 20/22] hw/alpha/dp264: Add the ISA DMA controller Philippe Mathieu-Daudé
2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 21/22] hw/alpha/dp264: Use the TYPE_SMC37C669_SUPERIO Philippe Mathieu-Daudé
2018-03-08 20:39   ` Philippe Mathieu-Daudé
2018-03-08 22:14     ` Philippe Mathieu-Daudé
2018-03-05 21:19 ` [Qemu-devel] [RFC PATCH v2 22/22] hw/i386/pc: Factor out the superio code Philippe Mathieu-Daudé
2018-03-05 21:50 ` [Qemu-devel] [RFC PATCH v2 00/22] remove i386/pc dependency: generic SuperIO no-reply
2018-03-07 15:26   ` Paolo Bonzini
2018-03-07 16:52 ` Paolo Bonzini
2018-03-07 23:46   ` Philippe Mathieu-Daudé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.