HP-PARISC 715 machine with NCR710 SCSI chip
PATCH v2 5/11 hw/scsi: Add config option for new ncr710 driver
In reply to [email protected]From: Soumyajyotii Ssarkar <[email protected]>
Add config option and wire up in meson makefile.
--- hw/scsi/Kconfig | 5 +++++ hw/scsi/meson.build | 1 + 2 files changed, 6 insertions(+)
hw/scsi/Kconfig +5 -0
@@ -7,6 +7,11 @@ config LSI_SCSI_PCI depends on PCI select SCSI +config NCR710_SCSI + bool + default y if LASI + select SCSI + config MPTSAS_SCSI_PCI bool default y if PCI_DEVICES
hw/scsi/meson.build +1 -0
@@ -12,6 +12,7 @@ scsi_ss.add(files( scsi_ss.add(when: 'CONFIG_ESP', if_true: files('esp.c')) scsi_ss.add(when: 'CONFIG_ESP_PCI', if_true: files('esp-pci.c')) scsi_ss.add(when: 'CONFIG_LSI_SCSI_PCI', if_true: files('lsi53c895a.c')) +scsi_ss.add(when: 'CONFIG_NCR710_SCSI', if_true: files('ncr53c710.c', 'lasi_ncr710.c')) scsi_ss.add(when: 'CONFIG_MEGASAS_SCSI_PCI', if_true: files('megasas.c')) scsi_ss.add(when: 'CONFIG_MPTSAS_SCSI_PCI', if_true: files('mptsas.c', 'mptconfig.c', 'mptendian.c')) scsi_ss.add(when: 'CONFIG_VMW_PVSCSI_SCSI_PCI', if_true: files('vmw_pvscsi.c'))
Signature · 1 line
2.51.0
PATCH v2 7/11 hw/hppa: Fix interrupt of LASI parallel port
In reply to [email protected]From: Helge Deller <[email protected]>
Fix wrong assignment where the LASI parallel port was using the IRQ line of the LASI LAN card.
--- hw/hppa/machine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/hppa/machine.c +1 -1
@@ -584,7 +584,7 @@ static void machine_HP_B160L_init(MachineState *machine)/* Parallel port */ parallel_mm_init (addr_space,translate (NULL ,LASI_LPT_HPA +0x800 ),0 , -qdev_get_gpio_in (lasi_dev,LASI_IRQ_LAN_HPA ), +qdev_get_gpio_in (lasi_dev,LASI_IRQ_LPT_HPA ), parallel_hds[0 ]);/* PS/2 Keyboard/Mouse */
Signature · 1 line
2.51.0
PATCH v2 11/11 hw/hppa: Add 715 machine type including NCR710 SCSI
In reply to [email protected]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
--- hw/hppa/machine.c | 95 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 93 insertions(+), 2 deletions(-)
hw/hppa/machine.c +93 -2
@@ -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); + } }/* Graphics setup. */
@@ -537,6 +548,63 @@ 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 )); + +/* Add SCSI discs, NICs, graphics & load firmware */ +machine_HP_common_init_tail (machine,NULL , translate); +} +/* * Create HP B160L workstation */
@@ -743,6 +811,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 +849,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, }, };
Signature · 1 line
2.51.0
PATCH v2 1/11 target/hppa: Update SeaBIOS-hppa to version 19
In reply to [email protected]From: Helge Deller <[email protected]>
This is SeaBIOS for the hppa architecture v19.
It's required to support the new 715 machine,
which uses a LASI NCR710 SCSI controller.
New:
- Added new 715 machine (Snake machine, no PCI bus)
- Added driver for NCR710 SCSI on LASI (Soumyajyotii Ssarkar)
Fixes & cleanups:
- Fix memory size detection on NetBSD
- Snake machines do not support the PDC_SYSTEM_MAP call
- Always return the HPA in pdc_mem_map() PDC call
- Add LMMIO range for internal artist graphic card
- various coding style cleanups
--- pc-bios/hppa-firmware.img | Bin 167644 -> 630056 bytes pc-bios/hppa-firmware64.img | Bin 206104 -> 699872 bytes roms/seabios-hppa | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-)
pc-bios/hppa-firmware.img binary +0 -0
pc-bios/hppa-firmware64.img binary +0 -0
roms/seabios-hppa +1 -1
@@ -1 +1 @@ -Subproject commit 3391c580960febcb9fa8f686f9666adaa462c349 +Subproject commit d0d359929a009549f7cecac9d2a29c8bdbc07a98
Signature · 1 line
2.51.0
PATCH v2 3/11 ncr710: Add driver for the NCR 53c710 SCSI chip
In reply to [email protected]From: Soumyajyotii Ssarkar <[email protected]>
Add an emulation for the NCR 53c710 SCSI chip.
This SCSI chip was used widely in historic machines, e.g. as SCSI core in the LASI controller in HP PA-RISC machines.
This driver was developed as part of the Google Summer of Code 2025 program.
--- MAINTAINERS | 1 + hw/scsi/ncr53c710.c | 2432 ++++++++++++++++++++++++++++++++++++++++++ hw/scsi/ncr53c710.h | 246 +++++ hw/scsi/trace-events | 12 + 4 files changed, 2691 insertions(+) create mode 100644 hw/scsi/ncr53c710.c create mode 100644 hw/scsi/ncr53c710.h
MAINTAINERS +1 -0
@@ -1284,6 +1284,7 @@ F: hw/misc/lasi.c F: hw/pci-host/astro.c F: hw/pci-host/dino.c F: hw/scsi/lasi_ncr710.* +F: hw/scsi/ncr53c710.* F: include/hw/input/lasips2.h F: include/hw/misc/lasi.h F: include/hw/net/lasi_82596.h
hw/scsi/ncr53c710.c new file +2432 -0
2,432 lines not on this page · raw message
hw/scsi/ncr53c710.h new file +246 -0
246 lines not on this page · raw message
hw/scsi/trace-events +12 -0
@@ -306,6 +306,18 @@ lsi_reg_write(const char *name, int offset, uint8_t val) "Write reg %s 0x%x = 0x lsi_scripts_timer_triggered(void) "SCRIPTS timer triggered" lsi_scripts_timer_start(void) "SCRIPTS timer started" +# ncr53c710.c +ncr710_reset(void) "Reset" +ncr710_reg_read(const char *name, int offset, uint8_t ret) "Read %s [0x%02x] = 0x%02x" +ncr710_reg_write(const char *name, int offset, uint8_t val) "Write %s [0x%02x] = 0x%02x" +ncr710_script_scsi_interrupt(uint8_t stat0, uint8_t sstat0) "SCSI interrupt stat=0x%02x sstat=0x%02x" +ncr710_script_dma_interrupt(uint8_t stat, uint8_t dstat) "DMA interrupt stat=0x%02x dstat=0x%02x" +ncr710_command_complete(uint32_t tag, uint8_t status) "tag=0x%x status=0x%02x" +ncr710_disconnect(uint8_t waiting) "waiting=%d" +ncr710_bad_selection(uint32_t target) "target=%d" +ncr710_parity_sense_changed(const char *parity) "Parity sense changed to %s" +ncr710_device_realize(void) "Device realized" + # lasi_ncr710.c lasi_ncr710_device_realize(void) "Device realized" lasi_ncr710_device_reset(void) "Device reset"
Signature · 1 line
2.51.0
PATCH v2 6/11 hw/hppa: Fix firmware end address for LASI chip
In reply to [email protected]From: Helge Deller <[email protected]>
The base address of a LASI chip on a 715 machine starts at HPA 0xf0100000. Make sure that the firmware does not extend beyond that address, otherwise it's not possible to access the LASI ports.
--- hw/hppa/hppa_hardware.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
hw/hppa/hppa_hardware.h +2 -1
@@ -5,7 +5,7 @@#define HW_HPPA_HPPA_HARDWARE_H #define FIRMWARE_START 0xf0000000 -#define FIRMWARE_END 0xf0800000 +#define FIRMWARE_END 0xf0100000#define FIRMWARE_HIGH 0xfffffff0/* upper 32-bits of 64-bit firmware address */ #define RAM_MAP_HIGH 0x0100000000/* memory above 3.75 GB is mapped here */
@@ -19,6 +19,7 @@#define DINO_UART_HPA 0xfff83000#define DINO_UART_BASE 0xfff83800#define DINO_SCSI_HPA 0xfff8c000 +#define LASI_HPA_715 0xf0100000#define LASI_HPA 0xffd00000#define LASI_UART_HPA 0xffd05000#define LASI_SCSI_HPA 0xffd06000
Signature · 1 line
2.51.0
PATCH v2 9/11 hw/hppa: PCI devices depend on availability of PCI bus
In reply to [email protected]From: Helge Deller <[email protected]>
Only create the PCI serial ports (DIVA) and PCI network cards when there is actually a PCI bus. The shortly added 715 machine will not have a PCI bus, so avoid creating further PCI devices.
v2:
Clean up sequential testing of NULL pointers - as suggested by Richard
--- hw/hppa/machine.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-)
hw/hppa/machine.c +15 -13
@@ -387,20 +387,22 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus, enable_lasi_lan()); } -pci_init_nic_devices (pci_bus, mc->default_nic); - -/* BMC board: HP Diva GSP */ - dev =qdev_new ("diva-gsp" ); -if (!object_property_get_bool (OBJECT (dev),"disable" ,NULL )) { - pci_dev =pci_new_multifunction (PCI_DEVFN (2 ,0 ),"diva-gsp" ); -if (!lasi_dev) { -/* bind default keyboard/serial to Diva card */ -qdev_prop_set_chr (DEVICE (pci_dev),"chardev1" ,serial_hd (0 )); -qdev_prop_set_chr (DEVICE (pci_dev),"chardev2" ,serial_hd (1 )); -qdev_prop_set_chr (DEVICE (pci_dev),"chardev3" ,serial_hd (2 )); -qdev_prop_set_chr (DEVICE (pci_dev),"chardev4" ,serial_hd (3 )); +if (pci_bus) { +pci_init_nic_devices (pci_bus, mc->default_nic); + +/* BMC board: HP Diva GSP PCI card */ + dev =qdev_new ("diva-gsp" ); +if (dev && !object_property_get_bool (OBJECT (dev),"disable" ,NULL )) { + pci_dev =pci_new_multifunction (PCI_DEVFN (2 ,0 ),"diva-gsp" ); +if (!lasi_dev) { +/* bind default keyboard/serial to Diva card */ +qdev_prop_set_chr (DEVICE (pci_dev),"chardev1" ,serial_hd (0 )); +qdev_prop_set_chr (DEVICE (pci_dev),"chardev2" ,serial_hd (1 )); +qdev_prop_set_chr (DEVICE (pci_dev),"chardev3" ,serial_hd (2 )); +qdev_prop_set_chr (DEVICE (pci_dev),"chardev4" ,serial_hd (3 )); + } +pci_realize_and_unref (pci_dev, pci_bus, &error_fatal); } -pci_realize_and_unref (pci_dev, pci_bus, &error_fatal); }/* create USB OHCI controller for USB keyboard & mouse on Astro machines */
Signature · 1 line
2.51.0
PATCH v2 10/11 hw/hppa: Require SeaBIOS version 19 for 715 machine
In reply to [email protected]From: Helge Deller <[email protected]>
Require at least SeaBIOS version 19 before adding the 715 machine. This is required, because the machine inventory of the 715 is provided by the SeaBIOS firmware.
--- hw/hppa/machine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/hppa/machine.c +1 -1
@@ -43,7 +43,7 @@ struct HppaMachineState {MachineState parent_obj; }; -#define MIN_SEABIOS_HPPA_VERSION 12/* require at least this fw version */ +#define MIN_SEABIOS_HPPA_VERSION 19/* require at least this fw version */ #define HPA_POWER_BUTTON (FIRMWARE_END - 0x10)static hwaddr soft_power_reg;
Signature · 1 line
2.51.0
v2 cover HP-PARISC 715 machine with NCR710 SCSI chip
From: Helge Deller <[email protected]>
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
Signature · 1 line
2.51.0
PATCH v2 4/11 lasi: Forward LASI SCSI ports to NCR 53c710 driver
From: Soumyajyotii Ssarkar <[email protected]>
--- hw/misc/lasi.c | 6 +++++- include/hw/misc/lasi.h | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-)
hw/misc/lasi.c +5 -1
@@ -43,7 +43,7 @@ static bool lasi_chip_mem_valid(void *opaque, hwaddr addr,case LASI_LAN +12 :/* LASI LAN MAC */ case LASI_RTC :case LASI_FDC : - + case LASI_SCSI ... LASI_SCSI + 0xFF: case LASI_PCR ... LASI_AMR: ret = true; }
@@ -84,6 +84,7 @@ static MemTxResult lasi_chip_read_with_attrs(void *opaque, hwaddr addr,case LASI_LAN :case LASI_LAN +12 :case LASI_FDC : + case LASI_SCSI ... LASI_SCSI + 0xFF: val =0 ;break ;case LASI_RTC :
@@ -156,6 +157,9 @@ static MemTxResult lasi_chip_write_with_attrs(void *opaque, hwaddr addr,case LASI_UART :/* XXX: reset serial port */ break ; + case LASI_SCSI ... LASI_SCSI + 0xFF: +/* XXX: reset SCSI Controller */ +break ;case LASI_LAN :/* XXX: reset LAN card */ break ;
include/hw/misc/lasi.h +2 -0
@@ -28,7 +28,9 @@ OBJECT_DECLARE_SIMPLE_TYPE(LasiState, LASI_CHIP)#define LASI_LPT 0x02000#define LASI_AUDIO 0x04000#define LASI_UART 0x05000 +#define LASI_SCSI 0x06000#define LASI_LAN 0x07000 +#define LASI_PS2 0x08000#define LASI_RTC 0x09000#define LASI_FDC 0x0A000
Signature · 1 line
2.51.0
PATCH v2 2/11 lasi_ncr710: Add LASI wrapper for NCR 53c710 SCSI chip
In reply to [email protected]From: Soumyajyotii Ssarkar <[email protected]>
The LASI multi I/O chip in older PA-RISC machines includes a SCSI core based on the NCR 53c710 SCSI chip.
This driver adds the glue code to talk to the NCR710 via LASI.
This driver was developed as part of the Google Summer of Code 2025 program.
--- MAINTAINERS | 1 + hw/scsi/lasi_ncr710.c | 282 ++++++++++++++++++++++++++++++++++++++++++ hw/scsi/lasi_ncr710.h | 57 +++++++++ hw/scsi/trace-events | 17 +++ 4 files changed, 357 insertions(+) create mode 100644 hw/scsi/lasi_ncr710.c create mode 100644 hw/scsi/lasi_ncr710.h
MAINTAINERS +1 -0
@@ -1283,6 +1283,7 @@ F: hw/net/*i82596* F: hw/misc/lasi.c F: hw/pci-host/astro.c F: hw/pci-host/dino.c +F: hw/scsi/lasi_ncr710.* F: include/hw/input/lasips2.h F: include/hw/misc/lasi.h F: include/hw/net/lasi_82596.h
hw/scsi/lasi_ncr710.c new file +282 -0
282 lines not on this page · raw message
hw/scsi/lasi_ncr710.h new file +57 -0
57 lines not on this page · raw message
hw/scsi/trace-events +17 -0
@@ -306,6 +306,23 @@ lsi_reg_write(const char *name, int offset, uint8_t val) "Write reg %s 0x%x = 0x lsi_scripts_timer_triggered(void) "SCRIPTS timer triggered" lsi_scripts_timer_start(void) "SCRIPTS timer started" +# lasi_ncr710.c +lasi_ncr710_device_realize(void) "Device realized" +lasi_ncr710_device_reset(void) "Device reset" +lasi_ncr710_reg_read(uint32_t addr, uint32_t val, unsigned size) "addr=0x%03x val=0x%08x size=%u" +lasi_ncr710_reg_write(uint32_t addr, uint32_t val, unsigned size) "addr=0x%03x val=0x%08x size=%u" +lasi_ncr710_reg_read_id(uint32_t hw_type, uint32_t sversion, uint32_t val) "hw_type=%u sversion=0x%04x val=0x%08x" +lasi_ncr710_reg_read_hversion(uint32_t hversion) "LASI NCR710: HVersion read -> 0x%02x" +lasi_ncr710_reg_forward_read(uint32_t addr, uint32_t val) "LASI NCR710: Forward read to NCR710 core addr=0x%03x val=0x%08x" +lasi_ncr710_reg_forward_write(uint32_t addr, uint32_t val) "LASI NCR710: Forward write to NCR710 core addr=0x%03x val=0x%08x" +lasi_ncr710_command_complete(uint32_t status, size_t resid) "LASI NCR710: Command complete status=0x%02x resid=%zu" +lasi_ncr710_transfer_data(uint32_t len) "LASI NCR710: Transfer data len=%u" +lasi_ncr710_request_cancelled(void *req) "LASI NCR710: Request cancelled req=%p" +lasi_ncr710_timers_initialized(uint64_t reselection) "Timers: reselection=0x%" PRIx64 +lasi_ncr710_handle_legacy_cmdline(int busnr, int found_drives) "LASI NCR710: Handle legacy cmdline busnr=%d found_drives=%d" +lasi_ncr710_legacy_drive_found(int busnr, int unit) "LASI NCR710: Found legacy drive at bus=%d unit=%d" +lasi_ncr710_scsi_device_created(const char *type) "LASI NCR710: SCSI device created: %s" + # virtio-scsi.c virtio_scsi_cmd_req(int lun, uint32_t tag, uint8_t cmd) "virtio_scsi_cmd_req lun=%u tag=0x%x cmd=0x%x" virtio_scsi_cmd_resp(int lun, uint32_t tag, int response, uint8_t status) "virtio_scsi_cmd_resp lun=%u tag=0x%x response=%d status=0x%x"
Signature · 1 line
2.51.0
PATCH v2 8/11 hw/hppa: Add NCR 710 SCSI driver to LASI chip Kconfig entry
In reply to [email protected]From: Helge Deller <[email protected]>
The LASI chip is a multi I/O chip used in many older PA-RISC machines. It includes functionality for NCR710 SCSI, serial, parallel, audio, i82596 networking and PS/2 ports.
Add the functionality for NCR710_SCSI to the LASI Kconfig option and move over the relevant parts from the generic HPPA_B160L Kconfig option to get the dependeny rights.
v2: move dependency to NCR710 to LASI chip instead of base machine.
--- hw/hppa/Kconfig | 2 -- hw/misc/Kconfig | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-)
hw/hppa/Kconfig +0 -2
@@ -17,7 +17,5 @@ config HPPA_B160L select IDE_CMD646 select MC146818RTC select LSI_SCSI_PCI - select LASI_82596 - select LASIPS2 select PARALLEL select ARTIST
hw/misc/Kconfig +5 -0
@@ -212,6 +212,11 @@ config VIRT_CTRL config LASI bool + select LASI_82596 + select LASIPS2 + select NCR710_SCSI + select PARALLEL + select SERIAL_MM config ALLWINNER_SRAMC bool
Signature · 1 line
2.51.0
Re: [PATCH v2 07/11] hw/hppa: Fix interrupt of LASI parallel port
In reply to [email protected]Quoted 10 lines · On 25/10/25 18:18, [email protected] wrote:
From: Helge Deller <[email protected]>
Fix wrong assignment where the LASI parallel port was using the IRQ line of the LASI LAN card.
Signed-off-by Helge Deller <[email protected]>Reviewed-by Richard Henderson <[email protected]>--- hw/hppa/machine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Re: [PATCH v2 09/11] hw/hppa: PCI devices depend on availability of PCI bus
In reply to [email protected]Quoted 6 lines · On 25/10/25 18:18, [email protected] wrote:
From: Helge Deller <[email protected]>
Only create the PCI serial ports (DIVA) and PCI network cards when there is actually a PCI bus. The shortly added 715 machine will not have a PCI bus, so avoid creating further PCI devices.
---> v2:
Quoted 6 lines
Clean up sequential testing of NULL pointers - as suggested by Richard
Signed-off-by Helge Deller <[email protected]>--- hw/hppa/machine.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-)
Re: [PATCH v2 11/11] hw/hppa: Add 715 machine type including NCR710 SCSI
In reply to [email protected]Quoted 35 lines · 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 useassert()to check ncr710 device availabilitySigned-off-by Helge Deller <[email protected]>--- hw/hppa/machine.c | 95 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 93 insertions(+), 2 deletions(-)hw/hppa/machine.c +4
-2@@ -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" ));
hw/hppa/machine.c static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus, · line 379
Quoted 10 lines
hw/hppa/machine.c +9
-0+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?
Re: [PATCH v2 11/11] hw/hppa: Add 715 machine type including NCR710 SCSI
Quoted 39 lines · Philippe Mathieu-Daudé
Quoted 38 lines · 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 useassert()to check ncr710 device availabilitySigned-off-by Helge Deller <[email protected]>---
hw/hppa/machine.c| 95 ++++++++++++++++++++++++++++++++++++++++++++++-1 file changed, 93 insertions(+), 2 deletions(-)hw/hppa/machine.c +8
-2@@ -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),
Quoted 8 lines
hw/hppa/machine.c static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus, · line 379
Quoted 6 lines
hw/hppa/machine.c +5
-0+ 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
Re: [PATCH v3 11/11] hw/hppa: Add 715 machine type including NCR710 SCSI
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é <[email protected]>
- create SCSI device at caller site, not inside machine_HP_common_init_tail()
hw/hppa/machine.c +105 -9
@@ -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 ) { + 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, }, };
Re: [PATCH v2 09/11] hw/hppa: PCI devices depend on availability of PCI bus
In reply to [email protected]Quoted 6 lines · On 10/25/25 18:18, [email protected] wrote:
From: Helge Deller<[email protected]>
Only create the PCI serial ports (DIVA) and PCI network cards when there is actually a PCI bus. The shortly added 715 machine will not have a PCI bus, so avoid creating further PCI devices.
Quoted 7 lines
v2:
Clean up sequential testing of NULL pointers - as suggested by RichardSigned-off-by Helge Deller<[email protected]>--- hw/hppa/machine.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-)
r~
Re: [PATCH v2 03/11] ncr710: Add driver for the NCR 53c710 SCSI chip
In reply to [email protected]Quoted 5 lines · On Sat, 25 Oct 2025, [email protected] wrote:
From: Soumyajyotii Ssarkar <[email protected]>
Add an emulation for the NCR 53c710 SCSI chip.
This SCSI chip was used widely in historic machines, e.g. as SCSI core in the LASI controller in HP PA-RISC machines.
Shouldn't this patch come before the previous one as it defines functions that the LASI glue uses so I wonder if this compiles without this patch?
Regards,
BALATON Zoltan
Re: [PATCH v2 03/11] ncr710: Add driver for the NCR 53c710 SCSI chip
Quoted 10 lines · BALATON Zoltan
Quoted 5 lines · On Sat, 25 Oct 2025, [email protected] wrote:
From: Soumyajyotii Ssarkar <[email protected]>
Add an emulation for the NCR 53c710 SCSI chip.
This SCSI chip was used widely in historic machines, e.g. as SCSI core in the LASI controller in HP PA-RISC machines.Shouldn't this patch come before the previous one as it defines functions that the LASI glue uses so I wonder if this compiles without this patch?
You catched me :-)
Basically you are right.
Logically it belongs before the next patch, but since it's not wired up in the meson.build makefile yet, it will not be compiled yet.
I looked at switching both patches, but since it would not have had any effect I just kept it as is.
Helge