On 10/25/25 18:25, Philippe Mathieu-Daudé wrote:
On 25/10/25 18:19, [email protected] wrote:
From: Helge Deller <[email protected]>

Add a new emulation for a 715/64 machine.
This machines has no PCI bus, and has the majority of the devices (SCSI,
network, serial ports, ...) provided by a LASI multi-function I/O chip.

v2: based on feedback from Richard
- Fix indenting and use assert() to check ncr710 device availability

Signed-off-by: Helge Deller <[email protected]>
---
  hw/hppa/machine.c | 95 ++++++++++++++++++++++++++++++++++++++++++++++-
  1 file changed, 93 insertions(+), 2 deletions(-)

diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index 81ed050b5e..7b130a0db0 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -30,6 +30,8 @@
  #include "hw/pci-host/astro.h"
  #include "hw/pci-host/dino.h"
  #include "hw/misc/lasi.h"
+#include "hw/scsi/ncr53c710.h"
+#include "hw/scsi/lasi_ncr710.h"
  #include "hppa_hardware.h"
  #include "qemu/units.h"
  #include "qapi/error.h"
@@ -363,8 +365,17 @@ static void machine_HP_common_init_tail(MachineState 
*machine, PCIBus *pci_bus,
      /* SCSI disk setup. */
      if (drive_get_max_bus(IF_SCSI) >= 0) {
-        dev = DEVICE(pci_create_simple(pci_bus, -1, "lsi53c895a"));
-        lsi53c8xx_handle_legacy_cmdline(dev);
+        if (pci_bus) {
+            dev = DEVICE(pci_create_simple(pci_bus, -1, "lsi53c895a"));
+            lsi53c8xx_handle_legacy_cmdline(dev);
+        } else {
+            dev = lasi_ncr710_init(addr_space,
+                                   translate(NULL, LASI_HPA_715 + 0x6000),
+                                   qdev_get_gpio_in(lasi_dev,
+                                                    LASI_IRQ_SCSI_HPA));
+            assert(dev);
+            lasi_ncr710_handle_legacy_cmdline(dev);
+        }
      }

Can we move this code in the callers to keep the rest really common?

Yes, ok.
I will respin this patch and resend soon.

Helge

Reply via email to