qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 11/11] hw/hppa: Add 715 machine type including NCR710 SCSI
@ 2025-10-26 17:40 Helge Deller
  0 siblings, 0 replies; 2+ messages in thread
From: Helge Deller @ 2025-10-26 17:40 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel, Philippe Mathieu-Daudé

This patch is still missing a Review...
Richard or Philippe, can you take a look ?

Thanks!
Helge
-----------

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

v3: based on feedback from Philippe Mathieu-Daudé <philmd@linaro.org>
- create SCSI device at caller site, not inside machine_HP_common_init_tail()

Signed-off-by: Helge Deller <deller@gmx.de>

diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index 81ed050b5e..110fe6bb0c 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"
@@ -346,7 +348,7 @@ static TranslateFn *machine_HP_common_init_cpus(MachineState *machine)
 }
 
 /*
- * Last creation step: Add SCSI discs, NICs, graphics & load firmware
+ * Last creation step: Add NICs, graphics & load firmware
  */
 static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
                                         TranslateFn *translate)
@@ -361,12 +363,6 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
     MemoryRegion *rom_region;
     SysBusDevice *s;
 
-    /* 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);
-    }
-
     /* Graphics setup. */
     if (machine->enable_graphics && vga_interface_type != VGA_NONE) {
         dev = qdev_new("artist");
@@ -537,6 +533,71 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
     cpu[0]->env.kernel_entry = kernel_entry;
 }
 
+/*
+ * Create HP 715/64 workstation
+ */
+static void machine_HP_715_init(MachineState *machine)
+{
+    DeviceState *dev;
+    MemoryRegion *addr_space = get_system_memory();
+    TranslateFn *translate;
+    ISABus *isa_bus;
+
+    /* Create CPUs and RAM.  */
+    translate = machine_HP_common_init_cpus(machine);
+
+    if (hppa_is_pa20(&cpu[0]->env)) {
+        error_report("The HP 715/64 workstation requires a 32-bit "
+                     "CPU. Use '-machine 715' instead.");
+        exit(1);
+    }
+
+    /* Create ISA bus, needed for PS/2 kbd/mouse port emulation */
+    isa_bus = hppa_isa_bus(translate(NULL, IDE_HPA));
+    assert(isa_bus);
+
+    /* Init Lasi chip */
+    lasi_dev = DEVICE(lasi_init());
+    memory_region_add_subregion(addr_space, translate(NULL, LASI_HPA_715),
+                                sysbus_mmio_get_region(
+                                    SYS_BUS_DEVICE(lasi_dev), 0));
+
+    /* Serial ports: Lasi use a 7.272727 MHz clock. */
+    serial_mm_init(addr_space, translate(NULL, LASI_HPA_715 + LASI_UART + 0x800), 0,
+        qdev_get_gpio_in(lasi_dev, LASI_IRQ_UART_HPA), 7272727 / 16,
+        serial_hd(0), DEVICE_BIG_ENDIAN);
+
+    /* Parallel port */
+    parallel_mm_init(addr_space, translate(NULL, LASI_HPA_715 + LASI_LPT + 0x800), 0,
+                     qdev_get_gpio_in(lasi_dev, LASI_IRQ_LPT_HPA),
+                     parallel_hds[0]);
+
+    /* PS/2 Keyboard/Mouse */
+    dev = qdev_new(TYPE_LASIPS2);
+    sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
+    sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0,
+                       qdev_get_gpio_in(lasi_dev, LASI_IRQ_PS2KBD_HPA));
+    memory_region_add_subregion(addr_space,
+                                translate(NULL, LASI_HPA_715 + LASI_PS2),
+                                sysbus_mmio_get_region(SYS_BUS_DEVICE(dev),
+                                                       0));
+    memory_region_add_subregion(addr_space,
+                                translate(NULL, LASI_HPA_715 + LASI_PS2 + 0x100),
+                                sysbus_mmio_get_region(SYS_BUS_DEVICE(dev),
+                                                       1));
+    /* SCSI disk setup. */
+    if (drive_get_max_bus(IF_SCSI) >= 0) {
+        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);
+    }
+
+    /* Add NICs, graphics & load firmware */
+    machine_HP_common_init_tail(machine, NULL, translate);
+}
+
 /*
  * Create HP B160L workstation
  */
@@ -603,7 +664,13 @@ static void machine_HP_B160L_init(MachineState *machine)
                                 sysbus_mmio_get_region(SYS_BUS_DEVICE(dev),
                                                        1));
 
-    /* Add SCSI discs, NICs, graphics & load firmware */
+    /* 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);
+    }
+
+    /* Add NICs, graphics & load firmware */
     machine_HP_common_init_tail(machine, pci_bus, translate);
 }
 
@@ -646,7 +713,13 @@ static void machine_HP_C3700_init(MachineState *machine)
     pci_bus = PCI_BUS(qdev_get_child_bus(DEVICE(astro->elroy[0]), "pci"));
     assert(pci_bus);
 
-    /* Add SCSI discs, NICs, graphics & load firmware */
+    /* SCSI disk setup. */
+    if (drive_get_max_bus(IF_SCSI) >= 0) {
+        DeviceState *dev = DEVICE(pci_create_simple(pci_bus, -1, "lsi53c895a"));
+        lsi53c8xx_handle_legacy_cmdline(dev);
+    }
+
+    /* Add NICs, graphics & load firmware */
     machine_HP_common_init_tail(machine, pci_bus, translate);
 }
 
@@ -743,6 +816,25 @@ static void HP_C3700_machine_init_class_init(ObjectClass *oc, const void *data)
     mc->default_ram_size = 1024 * MiB;
 }
 
+static void HP_715_machine_init_class_init(ObjectClass *oc, const void *data)
+{
+    static const char * const valid_cpu_types[] = {
+        TYPE_HPPA_CPU,
+        NULL
+    };
+    MachineClass *mc = MACHINE_CLASS(oc);
+
+    mc->desc = "HP 715/64 workstation";
+    mc->default_cpu_type = TYPE_HPPA_CPU;
+    mc->valid_cpu_types = valid_cpu_types;
+    mc->init = machine_HP_715_init;
+    /* can only support up to max. 8 CPUs due inventory major numbers */
+    mc->max_cpus = MIN_CONST(HPPA_MAX_CPUS, 8);
+    mc->default_ram_size = 256 * MiB;
+    mc->default_nic = NULL;
+}
+
+
 static const TypeInfo hppa_machine_types[] = {
     {
         .name           = TYPE_HPPA_COMMON_MACHINE,
@@ -762,6 +854,10 @@ static const TypeInfo hppa_machine_types[] = {
         .name = MACHINE_TYPE_NAME("C3700"),
         .parent = TYPE_HPPA_COMMON_MACHINE,
         .class_init = HP_C3700_machine_init_class_init,
+    }, {
+        .name = MACHINE_TYPE_NAME("715"),
+        .parent = TYPE_HPPA_COMMON_MACHINE,
+        .class_init = HP_715_machine_init_class_init,
     },
 };
 


^ permalink raw reply related	[flat|nested] 2+ messages in thread
* [PATCH v2 00/11] HP-PARISC 715 machine with NCR710 SCSI chip
@ 2025-10-25 16:18 deller
  2025-10-25 16:19 ` [PATCH v2 11/11] hw/hppa: Add 715 machine type including NCR710 SCSI deller
  0 siblings, 1 reply; 2+ messages in thread
From: deller @ 2025-10-25 16:18 UTC (permalink / raw)
  To: qemu-devel, Richard Henderson
  Cc: Fam Zheng, Philippe Mathieu-Daudé, Soumyajyotii Ssarkar,
	Helge Deller, Paolo Bonzini

From: Helge Deller <deller@gmx.de>

Second round for review:
- previous big SCSI patch has been splitted up -> now patches #2 and #3
- Soumyajyotii has heavily cleaned up the SCSI driver (patches #2 & #3)
- I have reviewed the SCSI patches (#2 and #3), of course additional review
  is welcome.
- added R-b tags to patches #4 - #7
- new review needed for patches #8 & patch #9, both changed according to Richard's feedback.

---------

Additional generic info:

This patch series adds a new emulation for a HP PA-RISC 715/64 model,
as descrived here:
https://www.openpa.net/systems/hp-9000_715.html.

That machine has no PCI bus and instead uses a "LASI" chip which has built-in
NCR 53c710 SCSI and i82596 network chips. Compared to the other already
emulated machines B160L and C3700, this machine should be able to support older
operating systems like HP-UX 9 as well.

The QEMU project participated in the Google Summer of Code 2025 program by
"Implementing LASI Network Card and NCR 710 SCSI Controller Device Models", and
Soumyajyotii Ssarkar stepped up to develop those drivers.

This patch series includes the code for the NCR710 SCSI controller,
the network code will follow in later patch series.

Helge & Soumyajyotii

Helge Deller (7):
  target/hppa: Update SeaBIOS-hppa to version 19
  hw/hppa: Fix firmware end address for LASI chip
  hw/hppa: Fix interrupt of LASI parallel port
  hw/hppa: Add NCR 710 SCSI driver to LASI chip Kconfig entry
  hw/hppa: PCI devices depend on availability of PCI bus
  hw/hppa: Require SeaBIOS version 19 for 715 machine
  hw/hppa: Add 715 machine type including NCR710 SCSI

Soumyajyotii Ssarkar (4):
  lasi_ncr710: Add LASI wrapper for NCR 53c710 SCSI chip
  ncr710: Add driver for the NCR 53c710 SCSI chip
  lasi: Forward LASI SCSI ports to NCR 53c710 driver
  hw/scsi: Add config option for new ncr710 driver

 MAINTAINERS                 |    2 +
 hw/hppa/Kconfig             |    2 -
 hw/hppa/hppa_hardware.h     |    3 +-
 hw/hppa/machine.c           |  127 +-
 hw/misc/Kconfig             |    5 +
 hw/misc/lasi.c              |    6 +-
 hw/scsi/Kconfig             |    5 +
 hw/scsi/lasi_ncr710.c       |  282 ++++
 hw/scsi/lasi_ncr710.h       |   57 +
 hw/scsi/meson.build         |    1 +
 hw/scsi/ncr53c710.c         | 2432 +++++++++++++++++++++++++++++++++++
 hw/scsi/ncr53c710.h         |  246 ++++
 hw/scsi/trace-events        |   29 +
 include/hw/misc/lasi.h      |    2 +
 pc-bios/hppa-firmware.img   |  Bin 167644 -> 630056 bytes
 pc-bios/hppa-firmware64.img |  Bin 206104 -> 699872 bytes
 roms/seabios-hppa           |    2 +-
 17 files changed, 3179 insertions(+), 22 deletions(-)
 create mode 100644 hw/scsi/lasi_ncr710.c
 create mode 100644 hw/scsi/lasi_ncr710.h
 create mode 100644 hw/scsi/ncr53c710.c
 create mode 100644 hw/scsi/ncr53c710.h

-- 
2.51.0



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

end of thread, other threads:[~2025-10-26 17:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-26 17:40 [PATCH v3 11/11] hw/hppa: Add 715 machine type including NCR710 SCSI Helge Deller
  -- strict thread matches above, loose matches on Subject: below --
2025-10-25 16:18 [PATCH v2 00/11] HP-PARISC 715 machine with NCR710 SCSI chip deller
2025-10-25 16:19 ` [PATCH v2 11/11] hw/hppa: Add 715 machine type including NCR710 SCSI deller
2025-10-25 16:25   ` Philippe Mathieu-Daudé
2025-10-25 16:32     ` Helge Deller
2025-10-25 16:48       ` [PATCH v3 " Helge Deller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).