From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 37EB1C982D2 for ; Thu, 17 Sep 2026 21:36:06 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x7Jkc-0007zq-JC; Thu, 17 Sep 2026 17:34:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x7JkZ-0007z4-V3; Thu, 17 Sep 2026 17:34:36 -0400 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x7JkO-00060X-HW; Thu, 17 Sep 2026 17:34:35 -0400 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id B82FC41B32; Thu, 17 Sep 2026 21:34:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C23351F000FF; Thu, 17 Sep 2026 21:34:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789680862; bh=FhRw3AtyOopeiazjNZ1pbw976Fvw+qCbMTto/y6m/4k=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Fg8fqrf7J9IuW+I7dPLoqArANxWQ9Ccnezi6o7raHhtdBnTW7YnIu6EX6kPfPwPb/ 6hzJWJxqiXaa8/0EsWz5Xd2Xbz9O0Oqh2rkl87MSHVvzNHCtitqaFcr8mwjBJwPaPB Ws/mX51nwboh80ohpeMp+dMJ8Eew7RCFvHUwzsFaGE7smct+HFBjR59c261sAY+QYB f+NRfgJYq42ynLtm5isSN3rXbKsIl9OBkBBxMDE+JXYbh9LUQ2TTjP4L4xhCkAxq1O g6KdFfPJNzuOoiatJTvjfxNLQkW71v2+Pmh0gKl3uP+E7aECisRaQ7No866sSRJZTC IVRfosifvwyYw== From: Helge Deller To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , "Denis V. Lunev" , Helge Deller , John Snow , Richard Henderson , Paolo Bonzini , Abizer Lokhandwala , qemu-block@nongnu.org Subject: [PATCH 7/7] hw/hppa: Add NS 87560 SuperIO chip to HP C3700 machine Date: Thu, 17 Sep 2026 23:34:00 +0200 Message-ID: <20260917213402.3127-8-deller@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260917213402.3127-1-deller@kernel.org> References: <20260917213402.3127-1-deller@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2600:3c0a:e001:78e:0:1991:8:25; envelope-from=deller@kernel.org; helo=sea.source.kernel.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Abizer Lokhandwala 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 Signed-off-by: Helge Deller --- 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