From: Helge Deller <deller@kernel.org>
To: qemu-devel@nongnu.org
Cc: Richard Henderson <richard.henderson@linaro.org>,
Paolo Bonzini <pbonzini@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
qemu-block@nongnu.org, John Snow <jsnow@redhat.com>,
Helge Deller <deller@gmx.de>, "Denis V. Lunev" <den@openvz.org>,
Abizer Lokhandwala <abizerlokhandwalastd10@gmail.com>
Subject: [PULL 7/7] hw/hppa: Add NS 87560 SuperIO chip to HP C3700 machine
Date: Fri, 18 Sep 2026 18:38:28 +0200 [thread overview]
Message-ID: <20260918163829.2917-8-deller@kernel.org> (raw)
In-Reply-To: <20260918163829.2917-1-deller@kernel.org>
From: Abizer Lokhandwala <abizerlokhandwalastd10@gmail.com>
Due to the lack of the emulated NS 87560 SuperIO chip, we used until now the
emulated serial ports of a Diva GSP management board as a temporary
replacement. Since the NS SuperIO chip emulation was just added in the
previous commits, switch over to use it which allows us to emulate the physical
hardware more closely.
Signed-off-by: Abizer Lokhandwala <abizerlokhandwalastd10@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
---
hw/hppa/machine.c | 41 ++++++++++++++++++++++++++++++++++-------
1 file changed, 34 insertions(+), 7 deletions(-)
diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index 98931481b2..96133f09ba 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -394,7 +394,7 @@ static TranslateFn *machine_HP_common_init_cpus(MachineState *machine)
* Last creation step: Add NICs, graphics & load firmware
*/
static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
- TranslateFn *translate)
+ TranslateFn *translate, bool create_diva)
{
const char *kernel_filename = machine->kernel_filename;
MachineClass *mc = MACHINE_GET_CLASS(machine);
@@ -426,7 +426,7 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
pci_init_nic_devices(pci_bus, mc->default_nic);
}
- if (pci_bus && hppa_is_pa20(&cpu[0]->env)) {
+ if (pci_bus && hppa_is_pa20(&cpu[0]->env) && create_diva) {
/* BMC board: HP Diva GSP PCI card */
pci_dev = pci_new_multifunction(PCI_DEVFN(2, 0), "diva-gsp");
if (!lasi_dev) {
@@ -442,8 +442,9 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
/* create USB OHCI controller for USB keyboard & mouse on Astro machines */
if (!lasi_dev && machine->enable_graphics && defaults_enabled()) {
USBBus *usb_bus;
-
- pci_create_simple(pci_bus, -1, "pci-ohci");
+ if (create_diva) {
+ pci_create_simple(pci_bus, -1, "pci-ohci");
+ }
usb_bus = USB_BUS(object_resolve_type_unambiguous(TYPE_USB_BUS,
&error_abort));
usb_create_simple(usb_bus, "usb-kbd");
@@ -647,7 +648,7 @@ static void machine_HP_715_init(MachineState *machine)
}
/* Add NICs, graphics & load firmware */
- machine_HP_common_init_tail(machine, NULL, translate);
+ machine_HP_common_init_tail(machine, NULL, translate, false);
}
/*
@@ -726,7 +727,7 @@ static void machine_HP_B160L_init(MachineState *machine)
}
/* Add NICs, graphics & load firmware */
- machine_HP_common_init_tail(machine, pci_bus, translate);
+ machine_HP_common_init_tail(machine, pci_bus, translate, false);
}
static AstroState *astro_init(void)
@@ -771,6 +772,32 @@ static void machine_HP_C3700_init(MachineState *machine)
pci_bus = PCI_BUS(qdev_get_child_bus(DEVICE(astro->elroy[0]), "pci"));
assert(pci_bus);
+ /* The C3700 has a SuperIO chip, while the A400 hasn't. */
+ MachineClass *mc = MACHINE_GET_CLASS(machine);
+ bool is_C3700 = strcmp(mc->name, "C3700") == 0;
+ if (is_C3700) {
+ PCIDevice *ide_pdev = pci_create_simple(pci_bus, PCI_DEVFN(2, 0),
+ "pc87560-ide");
+ PCIDevice *usb_pdev = pci_create_simple(pci_bus, PCI_DEVFN(2, 2),
+ "pc87560-ohci");
+ PCIDevice *sio_pdev = pci_new(PCI_DEVFN(2, 1), "pc87560-superio");
+ if (serial_hd(0)) {
+ qdev_prop_set_chr(DEVICE(sio_pdev), "serial0", serial_hd(0));
+ }
+ if (serial_hd(1)) {
+ qdev_prop_set_chr(DEVICE(sio_pdev), "serial1", serial_hd(1));
+ }
+ pci_realize_and_unref(sio_pdev, pci_bus, &error_fatal);
+
+ qdev_connect_gpio_out(DEVICE(ide_pdev), 0,
+ qdev_get_gpio_in_named(DEVICE(sio_pdev), "pic-irq", 7));
+ qdev_connect_gpio_out(DEVICE(usb_pdev), 0,
+ qdev_get_gpio_in_named(DEVICE(sio_pdev), "pic-irq", 1));
+
+ qdev_connect_gpio_out_named(DEVICE(sio_pdev), "pic-out", 0,
+ pci_allocate_irq(usb_pdev));
+ }
+
/* SCSI disk setup. */
if (drive_get_max_bus(IF_SCSI) >= 0) {
DeviceState *dev = DEVICE(pci_create_simple(pci_bus, -1, "lsi53c895a"));
@@ -778,7 +805,7 @@ static void machine_HP_C3700_init(MachineState *machine)
}
/* Add NICs, graphics & load firmware */
- machine_HP_common_init_tail(machine, pci_bus, translate);
+ machine_HP_common_init_tail(machine, pci_bus, translate, !is_C3700);
}
/*
--
2.54.0
next prev parent reply other threads:[~2026-09-18 16:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 16:38 [PULL 0/7] Superio hppa patches Helge Deller
2026-09-18 16:38 ` [PULL 1/7] hw/pci/pci_ids: Add PCI vendor ID and IDs for NS chips Helge Deller
2026-09-18 16:38 ` [PULL 2/7] hw/isa/pc87560: Add main isa code for NS 87560 SuperIO chip Helge Deller
2026-09-21 9:51 ` Philippe Mathieu-Daudé
2026-09-21 10:17 ` Daniel P. Berrangé
2026-09-18 16:38 ` [PULL 3/7] hw/ide/pc87560-ide: Add IDE emulation of " Helge Deller
2026-09-18 16:38 ` [PULL 4/7] hw/usb/hcd-ohci: Add big endian and consistency check support Helge Deller
2026-09-18 16:38 ` [PULL 5/7] hw/usb/pc87560-ohci: Add USB OHCI emulation of NS 87560 SuperIO chip Helge Deller
2026-09-18 16:38 ` [PULL 6/7] hw/pc87560: Wire up " Helge Deller
2026-09-18 16:38 ` Helge Deller [this message]
2026-09-19 0:27 ` [PULL 0/7] Superio hppa patches Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260918163829.2917-8-deller@kernel.org \
--to=deller@kernel.org \
--cc=abizerlokhandwalastd10@gmail.com \
--cc=deller@gmx.de \
--cc=den@openvz.org \
--cc=jsnow@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.