Skip to contentSkip to conversation

HPPA: i82596, PS/2 and graphics emulation

PATCH Superseded Sven Schnelle 3 participants 11 messages Oct 20, 2019 – Oct 21, 2019 1 message not in the archive

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#4 lore raw

PATCH 3/7 hppa: remove ISA region

In reply to Sven Schnelle

B160L doesn't have an ISA bus, and we no longer need it to workaround missing hardware, so remove it.

---
 hw/hppa/hppa_hardware.h |  1 -
 hw/hppa/machine.c       | 32 --------------------------------
 2 files changed, 33 deletions(-)
hw/hppa/hppa_hardware.h +0 -1
index 507f91e05d..ce59cbbf94 100644
@@ -26,7 +26,6 @@
 #define MEMORY_HPA      0xfffbf000
 
 #define PCI_HPA         DINO_HPA        /* PCI bus */
-#define IDE_HPA         0xf9000000      /* Boot disc controller */
 
 /* offsets to DINO HPA: */
 #define DINO_PCI_ADDR           0x064
hw/hppa/machine.c +0 -32
index 65fc20ebed..542faae9be 100644
@@ -22,30 +22,6 @@
 #include "qapi/error.h"
 #include "qemu/log.h"
 
-#define MAX_IDE_BUS 2
-
-static ISABus *hppa_isa_bus(void)
-{
-    ISABus *isa_bus;
-    qemu_irq *isa_irqs;
-    MemoryRegion *isa_region;
-
-    isa_region = g_new(MemoryRegion, 1);
-    memory_region_init_io(isa_region, NULL, &hppa_pci_ignore_ops,
-                          NULL, "isa-io", 0x800);
-    memory_region_add_subregion(get_system_memory(), IDE_HPA,
-                                isa_region);
-
-    isa_bus = isa_bus_new(NULL, get_system_memory(), isa_region,
-                          &error_abort);
-    isa_irqs = i8259_init(isa_bus,
-                          /* qemu_allocate_irq(dino_set_isa_irq, s, 0)); */
-                          NULL);
-    isa_bus_irqs(isa_bus, isa_irqs);
-
-    return isa_bus;
-}
-
 static uint64_t cpu_hppa_to_phys(void *opaque, uint64_t addr)
 {
     addr &= (0x10000000 - 1);
@@ -62,7 +38,6 @@ static void machine_hppa_init(MachineState *machine)
     const char *initrd_filename = machine->initrd_filename;
     DeviceState *dev;
     PCIBus *pci_bus;
-    ISABus *isa_bus;
     qemu_irq rtc_irq, serial_irq;
     char *firmware_filename;
     uint64_t firmware_low, firmware_high;
@@ -108,13 +83,6 @@ static void machine_hppa_init(MachineState *machine)
     pci_bus = dino_init(addr_space, &rtc_irq, &serial_irq);
     assert(pci_bus);
 
-    /* Create ISA bus. */
-    isa_bus = hppa_isa_bus();
-    assert(isa_bus);
-
-    /* Realtime clock, used by firmware for PDC_TOD call. */
-    mc146818_rtc_init(isa_bus, 2000, rtc_irq);
-
     /* Serial code setup.  */
     if (serial_hd(0)) {
         uint32_t addr = DINO_UART_HPA + 0x800;
Signature · 1 line
2.23.0
#1 lore raw

PATCH 1/7 hw/hppa/dino.c: Improve emulation of Dino PCI chip

In reply to Sven Schnelle

From: Helge Deller <[email protected]>

The tests of the dino chip with the Online-diagnostics CD ("ODE DINOTEST") now succeeds.
Additionally add some qemu trace events.

---
 MAINTAINERS          |  2 +-
 hw/hppa/dino.c       | 82 +++++++++++++++++++++++++++++++++++++-------
 hw/hppa/trace-events |  5 +++
 3 files changed, 76 insertions(+), 13 deletions(-)
MAINTAINERS +1 -1
index 250ce8e7a1..f9541c3305 100644
@@ -874,7 +874,7 @@ F: hw/*/etraxfs_*.c
 
 HP-PARISC Machines
 ------------------
-Dino
+HP B160L
 M: Richard Henderson <[email protected]>
 R: Helge Deller <[email protected]>
 S: Odd Fixes
hw/hppa/dino.c +70 -12

211 lines not on this page · raw message

hw/hppa/trace-events +5 -0
index 4e2acb6176..f943b16c4e 100644
@@ -2,3 +2,8 @@
 
 # pci.c
 hppa_pci_iack_write(void) ""
+
+# dino.c
+dino_chip_mem_valid(uint64_t addr, uint32_t val) "access to addr 0x%"PRIx64" is %d"
+dino_chip_read(uint64_t addr, uint32_t val) "addr 0x%"PRIx64" val 0x%08x"
+dino_chip_write(uint64_t addr, uint32_t val) "addr 0x%"PRIx64" val 0x%08x"
Signature · 1 line
2.23.0
#0 lore raw

cover HPPA: i82596, PS/2 and graphics emulation

Hi,

these series adds quite a lot to the HPPA emulation in QEMU:
i82596 emulation from Helge, PS/2 and Artist graphics emulation.

See https://parisc.wiki.kernel.org/index.php/Qemu for a few screenshots of QEMU running a X11/CDE session in HP-UX.

Regards,
Sven

Helge Deller (2):
hw/hppa/dino.c: Improve emulation of Dino PCI chip
hppa: Add support for LASI chip with i82596 NIC

Sven Schnelle (5):
hppa: remove ISA region
ps2: accept 'Set Key Make and Break' commands
hppa: add emulation of LASI PS2 controllers
hppa: Add emulation of Artist graphics
seabios-hppa: update to latest version

 MAINTAINERS                 |    4 +-
 hw/display/Kconfig          |    3 +
 hw/display/Makefile.objs    |    1 +
 hw/display/artist.c         | 1336 +++++++++++++++++++++++++++++++++++
 hw/display/trace-events     |    9 +
 hw/hppa/Kconfig             |    3 +
 hw/hppa/Makefile.objs       |    2 +-
 hw/hppa/dino.c              |   82 ++-
 hw/hppa/hppa_hardware.h     |    2 +-
 hw/hppa/hppa_sys.h          |    2 +
 hw/hppa/lasi.c              |  368 ++++++++++
 hw/hppa/machine.c           |   50 +-
 hw/hppa/trace-events        |   10 +
 hw/input/Kconfig            |    3 +
 hw/input/Makefile.objs      |    1 +
 hw/input/lasips2.c          |  289 ++++++++
 hw/input/ps2.c              |   11 +
 hw/input/trace-events       |    5 +
 hw/net/Kconfig              |    7 +
 hw/net/Makefile.objs        |    2 +
 hw/net/i82596.c             |  734 +++++++++++++++++++
 hw/net/i82596.h             |   55 ++
 hw/net/lasi_i82596.c        |  188 +++++
 hw/net/trace-events         |   13 +
 include/hw/input/lasips2.h  |   16 +
 include/hw/input/ps2.h      |    1 +
 include/hw/net/lasi_82596.h |   29 +
 pc-bios/hppa-firmware.img   |  Bin 783724 -> 772876 bytes
 roms/seabios-hppa           |    2 +-
 29 files changed, 3179 insertions(+), 49 deletions(-)
 create mode 100644 hw/display/artist.c
 create mode 100644 hw/hppa/lasi.c
 create mode 100644 hw/input/lasips2.c
 create mode 100644 hw/net/i82596.c
 create mode 100644 hw/net/i82596.h
 create mode 100644 hw/net/lasi_i82596.c
 create mode 100644 include/hw/input/lasips2.h
 create mode 100644 include/hw/net/lasi_82596.h
Signature · 1 line
2.23.0
#7 lore raw

PATCH 4/7 ps2: accept 'Set Key Make and Break' commands

HP-UX sends both the 'Set key make and break (0xfc) and 'Set all key typematic make and break' (0xfa). QEMU response with 'Resend' as it doesn't handle these commands. HP-UX than reports an PS/2 max retransmission exceeded error. Add these commands and just reply with ACK.

---
 hw/input/ps2.c | 6 ++++++
 1 file changed, 6 insertions(+)
hw/input/ps2.c +6 -0
index 67f92f6112..6c2c7066a6 100644
@@ -49,6 +49,8 @@
 #define KBD_CMD_RESET_DISABLE	0xF5	/* reset and disable scanning */
 #define KBD_CMD_RESET_ENABLE   	0xF6    /* reset and enable scanning */
 #define KBD_CMD_RESET		0xFF	/* Reset */
+#define KBD_CMD_SET_MAKE_BREAK  0xFC    /* Set Make and Break mode */
+#define KBD_CMD_SET_TYPEMATIC   0xFA    /* Set Typematic Make and Break mode */
 
 /* Keyboard Replies */
 #define KBD_REPLY_POR		0xAA	/* Power on reset */
@@ -592,6 +594,10 @@ void ps2_write_keyboard(void *opaque, int val)
                 KBD_REPLY_ACK,
                 KBD_REPLY_POR);
             break;
+        case KBD_CMD_SET_TYPEMATIC:
+        case KBD_CMD_SET_MAKE_BREAK:
+            ps2_queue(&s->common, KBD_REPLY_ACK);
+            break;
         default:
             ps2_queue(&s->common, KBD_REPLY_RESEND);
             break;
Signature · 1 line
2.23.0
#8 lore raw

PATCH 5/7 hppa: add emulation of LASI PS2 controllers

In reply to Sven Schnelle
---
 hw/hppa/Kconfig            |   1 +
 hw/hppa/lasi.c             |  10 +-
 hw/input/Kconfig           |   3 +
 hw/input/Makefile.objs     |   1 +
 hw/input/lasips2.c         | 289 +++++++++++++++++++++++++++++++++++++
 hw/input/ps2.c             |   5 +
 hw/input/trace-events      |   5 +
 include/hw/input/lasips2.h |  16 ++
 include/hw/input/ps2.h     |   1 +
 9 files changed, 330 insertions(+), 1 deletion(-)
 create mode 100644 hw/input/lasips2.c
 create mode 100644 include/hw/input/lasips2.h
hw/hppa/Kconfig +1 -0
index 2a7b38d6d6..7f9be7f25c 100644
@@ -11,3 +11,4 @@ config DINO
     select MC146818RTC
     select LSI_SCSI_PCI
     select LASI_82596
+    select LASIPS2
hw/hppa/lasi.c +9 -1
index 51752589f3..d8d03f95c0 100644
@@ -22,6 +22,7 @@
 #include "hw/net/lasi_82596.h"
 #include "hw/char/parallel.h"
 #include "hw/char/serial.h"
+#include "hw/input/lasips2.h"
 #include "exec/address-spaces.h"
 #include "migration/vmstate.h"
 
@@ -324,6 +325,7 @@ DeviceState *lasi_init(MemoryRegion *address_space)
                      lpt_irq, parallel_hds[0]);
 
     /* Real time clock (RTC), it's only one 32-bit counter @9000 */
+
     s->rtc = time(NULL);
     s->rtc_ref = 0;
 
@@ -333,8 +335,14 @@ DeviceState *lasi_init(MemoryRegion *address_space)
                 lasi_get_irq(LASI_UART_HPA));
         serial_mm_init(address_space, LASI_UART_HPA + 0x800, 0,
                 serial_irq, 8000000 / 16,
-                serial_hd(1), DEVICE_NATIVE_ENDIAN);
+                serial_hd(0), DEVICE_NATIVE_ENDIAN);
     }
+
+    /* PS/2 Keyboard/Mouse */
+    qemu_irq ps2kbd_irq = qemu_allocate_irq(lasi_set_irq, s,
+            lasi_get_irq(LASI_PS2KBD_HPA));
+    lasips2_init(address_space, LASI_PS2KBD_HPA,  ps2kbd_irq);
+
     return dev;
 }
 
hw/input/Kconfig +3 -0
index 287f08887b..25c77a1b87 100644
@@ -41,3 +41,6 @@ config VHOST_USER_INPUT
 
 config TSC210X
     bool
+
+config LASIPS2
+    select PS2
hw/input/Makefile.objs +1 -0
index a1bc502ed0..f98f635685 100644
@@ -15,3 +15,4 @@ common-obj-$(CONFIG_VHOST_USER_INPUT) += vhost-user-input.o
 obj-$(CONFIG_MILKYMIST) += milkymist-softusb.o
 obj-$(CONFIG_PXA2XX) += pxa2xx_keypad.o
 obj-$(CONFIG_TSC210X) += tsc210x.o
+obj-$(CONFIG_LASIPS2) += lasips2.o
hw/input/lasips2.c new file +289 -0

289 lines not on this page · raw message

hw/input/ps2.c +5 -0
index 6c2c7066a6..7b0739aa7f 100644
@@ -192,6 +192,11 @@ static void ps2_reset_queue(PS2State *s)
     q->count = 0;
 }
 
+int ps2_queue_empty(PS2State *s)
+{
+    return s->queue.count == 0;
+}
+
 void ps2_queue_noirq(PS2State *s, int b)
 {
     PS2Queue *q = &s->queue;
hw/input/trace-events +5 -0
index cf072fa2f8..a2888fd10c 100644
@@ -53,3 +53,8 @@ tsc2005_sense(const char *state) "touchscreen sense %s"
 
 # virtio-input.c
 virtio_input_queue_full(void) "queue full"
+
+# lasips2.c
+lasips2_reg_read(unsigned int size, int id, uint64_t addr, const char *name, uint64_t val) "%u %d addr 0x%"PRIx64 "%s -> 0x%"PRIx64
+lasips2_reg_write(unsigned int size, int id, uint64_t addr, const char *name, uint64_t val) "%u %d addr 0x%"PRIx64 "%s <- 0x%"PRIx64
+lasips2_intr(unsigned int val) "%d"
include/hw/input/lasips2.h new file +16 -0
new file mode 100644
index 0000000000..0cd7b59064
@@ -0,0 +1,16 @@
+/*
+ * QEMU LASI PS/2 emulation
+ *
+ * Copyright (c) 2019 Sven Schnelle
+ *
+ */
+#ifndef HW_INPUT_LASIPS2_H
+#define HW_INPUT_LASIPS2_H
+
+#include "exec/hwaddr.h"
+
+#define TYPE_LASIPS2 "lasips2"
+
+void lasips2_init(MemoryRegion *address_space, hwaddr base, qemu_irq irq);
+
+#endif /* HW_INPUT_LASIPS2_H */
include/hw/input/ps2.h +1 -0
index b60455d4f6..35d983897a 100644
@@ -47,5 +47,6 @@ void ps2_queue_3(PS2State *s, int b1, int b2, int b3);
 void ps2_queue_4(PS2State *s, int b1, int b2, int b3, int b4);
 void ps2_keyboard_set_translation(void *opaque, int mode);
 void ps2_mouse_fake_event(void *opaque);
+int ps2_queue_empty(PS2State *s);
 
 #endif /* HW_PS2_H */
Signature · 1 line
2.23.0
#9 lore raw

PATCH 6/7 hppa: Add emulation of Artist graphics

In reply to Sven Schnelle

This adds emulation of Artist graphics good enough to get a Text console on both Linux and HP-UX. The X11 server from HP-UX also works.

---
 hw/display/Kconfig       |    3 +
 hw/display/Makefile.objs |    1 +
 hw/display/artist.c      | 1336 ++++++++++++++++++++++++++++++++++++++
 hw/display/trace-events  |    9 +
 hw/hppa/Kconfig          |    1 +
 hw/hppa/hppa_hardware.h  |    1 +
 hw/hppa/machine.c        |   10 +
 7 files changed, 1361 insertions(+)
 create mode 100644 hw/display/artist.c
hw/display/Kconfig +3 -0
index cbdf7b1a67..953631afb6 100644
@@ -91,6 +91,9 @@ config TCX
 config CG3
     bool
 
+config ARTIST
+    bool
+
 config VGA
     bool
 
hw/display/Makefile.objs +1 -0
index 5a4066383b..5f63294149 100644
@@ -39,6 +39,7 @@ common-obj-$(CONFIG_SM501) += sm501.o
 common-obj-$(CONFIG_TCX) += tcx.o
 common-obj-$(CONFIG_CG3) += cg3.o
 common-obj-$(CONFIG_NEXTCUBE) += next-fb.o
+common-obj-$(CONFIG_ARTIST) += artist.o
 
 obj-$(CONFIG_VGA) += vga.o
 
hw/display/artist.c new file +1336 -0

1,336 lines not on this page · raw message

hw/display/trace-events +9 -0
index ba7787b180..e6e22bef88 100644
@@ -142,3 +142,12 @@ sii9022_switch_mode(const char *mode) "mode: %s"
 # ati.c
 ati_mm_read(unsigned int size, uint64_t addr, const char *name, uint64_t val) "%u 0x%"PRIx64 " %s -> 0x%"PRIx64
 ati_mm_write(unsigned int size, uint64_t addr, const char *name, uint64_t val) "%u 0x%"PRIx64 " %s <- 0x%"PRIx64
+
+# artist.c
+artist_reg_read(unsigned int size, uint64_t addr, const char *name, uint64_t val) "%u 0x%"PRIx64 "%s -> 0x%"PRIx64
+artist_reg_write(unsigned int size, uint64_t addr, const char *name, uint64_t val) "%u 0x%"PRIx64 "%s <- 0x%"PRIx64
+artist_vram_read(unsigned int size, uint64_t addr, int posx, int posy, uint64_t val) "%u 0x%"PRIx64 " %ux%u-> 0x%"PRIx64
+artist_vram_write(unsigned int size, uint64_t addr, uint64_t val) "%u 0x%"PRIx64 " <- 0x%"PRIx64
+artist_fill_window(unsigned int start_x, unsigned int start_y, unsigned int width, unsigned int height, uint32_t op, uint32_t ctlpln) "start=%ux%u length=%ux%u op=0x%08x ctlpln=0x%08x"
+artist_block_move(unsigned int start_x, unsigned int start_y, unsigned int dest_x, unsigned int dest_y, unsigned int width, unsigned int height) "source %ux%u -> dest %ux%u size %ux%u"
+artist_draw_line(unsigned int start_x, unsigned int start_y, unsigned int end_x, unsigned int end_y) "%ux%u %ux%u"
hw/hppa/Kconfig +1 -0
index 7f9be7f25c..82178c7dcb 100644
@@ -12,3 +12,4 @@ config DINO
     select LSI_SCSI_PCI
     select LASI_82596
     select LASIPS2
+    select ARTIST
hw/hppa/hppa_hardware.h +1 -0
index ce59cbbf94..5716c80da9 100644
@@ -22,6 +22,7 @@
 #define LASI_PS2KBD_HPA 0xffd08000
 #define LASI_PS2MOU_HPA 0xffd08100
 #define LASI_GFX_HPA    0xf8000000
+#define ARTIST_FB_ADDR  0xf9000000
 #define CPU_HPA         0xfffb0000
 #define MEMORY_HPA      0xfffbf000
 
hw/hppa/machine.c +10 -0
index 542faae9be..ec519c1a44 100644
@@ -21,6 +21,7 @@
 #include "qemu/units.h"
 #include "qapi/error.h"
 #include "qemu/log.h"
+#include "hw/usb.h"
 
 static uint64_t cpu_hppa_to_phys(void *opaque, uint64_t addr)
 {
@@ -49,6 +50,7 @@ static void machine_hppa_init(MachineState *machine)
     MemoryRegion *cpu_region;
     long i;
     unsigned int smp_cpus = machine->smp.cpus;
+    SysBusDevice *s;
 
     ram_size = machine->ram_size;
 
@@ -94,6 +96,14 @@ static void machine_hppa_init(MachineState *machine)
     dev = DEVICE(pci_create_simple(pci_bus, -1, "lsi53c895a"));
     lsi53c8xx_handle_legacy_cmdline(dev);
 
+    if (vga_interface_type != VGA_NONE) {
+        dev = qdev_create(NULL, "artist");
+        qdev_init_nofail(dev);
+        s = SYS_BUS_DEVICE(dev);
+        sysbus_mmio_map(s, 0, LASI_GFX_HPA);
+        sysbus_mmio_map(s, 1, ARTIST_FB_ADDR);
+    }
+
     /* Network setup.  e1000 is good enough, failing Tulip support.  */
     for (i = 0; i < nb_nics; i++) {
         if (!enable_lasi_lan()) {
Signature · 1 line
2.23.0
#3 lore raw

PATCH 2/7 hppa: Add support for LASI chip with i82596 NIC

In reply to Sven Schnelle

From: Helge Deller <[email protected]>

LASI is a built-in multi-I/O chip which supports serial, parallel, network (Intel i82596 Apricot), sound and other functionalities. LASI has been used in many HP PARISC machines.
This patch adds the necessary parts to allow Linux and HP-UX to detect LASI and the network card.

---
 MAINTAINERS                 |   2 +
 hw/hppa/Kconfig             |   1 +
 hw/hppa/Makefile.objs       |   2 +-
 hw/hppa/hppa_sys.h          |   2 +
 hw/hppa/lasi.c              | 360 ++++++++++++++++++
 hw/hppa/machine.c           |   8 +-
 hw/hppa/trace-events        |   5 +
 hw/net/Kconfig              |   7 +
 hw/net/Makefile.objs        |   2 +
 hw/net/i82596.c             | 734 ++++++++++++++++++++++++++++++++++++
 hw/net/i82596.h             |  55 +++
 hw/net/lasi_i82596.c        | 188 +++++++++
 hw/net/trace-events         |  13 +
 include/hw/net/lasi_82596.h |  29 ++
 14 files changed, 1406 insertions(+), 2 deletions(-)
 create mode 100644 hw/hppa/lasi.c
 create mode 100644 hw/net/i82596.c
 create mode 100644 hw/net/i82596.h
 create mode 100644 hw/net/lasi_i82596.c
 create mode 100644 include/hw/net/lasi_82596.h
MAINTAINERS +2 -0
index f9541c3305..91e9e8ceac 100644
@@ -178,6 +178,8 @@ S: Maintained
 F: target/hppa/
 F: hw/hppa/
 F: disas/hppa.c
+F: hw/net/*i82596*
+F: include/hw/net/lasi_82596.h
 
 LM32 TCG CPUs
 M: Michael Walle <[email protected]>
hw/hppa/Kconfig +1 -0
index 6e5d74a825..2a7b38d6d6 100644
@@ -10,3 +10,4 @@ config DINO
     select IDE_CMD646
     select MC146818RTC
     select LSI_SCSI_PCI
+    select LASI_82596
hw/hppa/Makefile.objs +1 -1
index 67838f50a3..eac3467d8a 100644
@@ -1 +1 @@
-obj-$(CONFIG_DINO) += pci.o machine.o dino.o
+obj-$(CONFIG_DINO) += pci.o machine.o dino.o lasi.o
hw/hppa/hppa_sys.h +2 -0
index 43d25d21fc..d99b5dd87b 100644
@@ -11,6 +11,8 @@
 #include "hppa_hardware.h"
 
 PCIBus *dino_init(MemoryRegion *, qemu_irq *, qemu_irq *);
+DeviceState *lasi_init(MemoryRegion *);
+#define enable_lasi_lan()       0
 
 #define TYPE_DINO_PCI_HOST_BRIDGE "dino-pcihost"
 
hw/hppa/lasi.c new file +360 -0

360 lines not on this page · raw message

hw/hppa/machine.c +7 -1
index 7e23675429..65fc20ebed 100644
@@ -16,6 +16,7 @@
 #include "hw/ide.h"
 #include "hw/timer/i8254.h"
 #include "hw/char/serial.h"
+#include "hw/net/lasi_82596.h"
 #include "hppa_sys.h"
 #include "qemu/units.h"
 #include "qapi/error.h"
@@ -100,6 +101,9 @@ static void machine_hppa_init(MachineState *machine)
                                          "ram", ram_size);
     memory_region_add_subregion(addr_space, 0, ram_region);
 
+    /* Init Lasi chip */
+    lasi_init(addr_space);
+
     /* Init Dino (PCI host bus chip).  */
     pci_bus = dino_init(addr_space, &rtc_irq, &serial_irq);
     assert(pci_bus);
@@ -124,7 +128,9 @@ static void machine_hppa_init(MachineState *machine)
 
     /* Network setup.  e1000 is good enough, failing Tulip support.  */
     for (i = 0; i < nb_nics; i++) {
-        pci_nic_init_nofail(&nd_table[i], pci_bus, "e1000", NULL);
+        if (!enable_lasi_lan()) {
+            pci_nic_init_nofail(&nd_table[i], pci_bus, "e1000", NULL);
+        }
     }
 
     /* Load firmware.  Given that this is not "real" firmware,
hw/hppa/trace-events +5 -0
index f943b16c4e..3ff620319a 100644
@@ -7,3 +7,8 @@ hppa_pci_iack_write(void) ""
 dino_chip_mem_valid(uint64_t addr, uint32_t val) "access to addr 0x%"PRIx64" is %d"
 dino_chip_read(uint64_t addr, uint32_t val) "addr 0x%"PRIx64" val 0x%08x"
 dino_chip_write(uint64_t addr, uint32_t val) "addr 0x%"PRIx64" val 0x%08x"
+
+# lasi.c
+lasi_chip_mem_valid(uint64_t addr, uint32_t val) "access to addr 0x%"PRIx64" is %d"
+lasi_chip_read(uint64_t addr, uint32_t val) "addr 0x%"PRIx64" val 0x%08x"
+lasi_chip_write(uint64_t addr, uint32_t val) "addr 0x%"PRIx64" val 0x%08x"
hw/net/Kconfig +7 -0
index 4ef86dc3a5..a38f9adaeb 100644
@@ -24,6 +24,9 @@ config PCNET_PCI
 config PCNET_COMMON
     bool
 
+config I82596_COMMON
+    bool
+
 config E1000_PCI
     bool
     default y if PCI_DEVICES
@@ -82,6 +85,10 @@ config LANCE
     bool
     select PCNET_COMMON
 
+config LASI_82596
+    bool
+    select I82596_COMMON
+
 config SUNHME
     bool
 
hw/net/Makefile.objs +2 -0
index 9904273b06..f3ef9ffe9b 100644
@@ -27,6 +27,8 @@ common-obj-$(CONFIG_IMX_FEC) += imx_fec.o
 common-obj-$(CONFIG_CADENCE) += cadence_gem.o
 common-obj-$(CONFIG_STELLARIS_ENET) += stellaris_enet.o
 common-obj-$(CONFIG_LANCE) += lance.o
+common-obj-$(CONFIG_LASI_82596) += lasi_i82596.o
+common-obj-$(CONFIG_I82596_COMMON) += i82596.o
 common-obj-$(CONFIG_SUNHME) += sunhme.o
 common-obj-$(CONFIG_FTGMAC100) += ftgmac100.o
 common-obj-$(CONFIG_SUNGEM) += sungem.o
hw/net/i82596.c new file +734 -0

734 lines not on this page · raw message

hw/net/i82596.h new file +55 -0

55 lines not on this page · raw message

hw/net/lasi_i82596.c new file +188 -0

188 lines not on this page · raw message

hw/net/trace-events +13 -0
index 58665655cc..abb71a6a9a 100644
@@ -367,3 +367,16 @@ virtio_net_announce_notify(void) ""
 virtio_net_announce_timer(int round) "%d"
 virtio_net_handle_announce(int round) "%d"
 virtio_net_post_load_device(void)
+
+# lasi_i82596.c
+lasi_82596_mem_readw(uint64_t addr, uint32_t ret) "addr=0x%"PRIx64" val=0x%04x"
+lasi_82596_mem_writew(uint64_t addr, uint32_t val) "addr=0x%"PRIx64" val=0x%04x"
+
+# i82596.c
+i82596_s_reset(void *s) "%p Reset chip"
+i82596_transmit(uint32_t size, uint32_t addr) "size %u from addr 0x%04x"
+i82596_receive_analysis(const char *s) "%s"
+i82596_receive_packet(size_t sz) "len=%zu"
+i82596_new_mac(const char *id_with_mac) "New MAC for: %s"
+i82596_set_multicast(uint16_t count) "Added %d multicast entries"
+i82596_channel_attention(void *s) "%p: Received CHANNEL ATTENTION"
include/hw/net/lasi_82596.h new file +29 -0
new file mode 100644
index 0000000000..e76ef8308e
@@ -0,0 +1,29 @@
+/*
+ * QEMU LASI i82596 device emulation
+ *
+ * Copyright (c) 201 Helge Deller <[email protected]>
+ *
+ */
+
+#ifndef LASI_82596_H
+#define LASI_82596_H
+
+#include "net/net.h"
+#include "hw/net/i82596.h"
+
+#define TYPE_LASI_82596 "lasi_82596"
+#define SYSBUS_I82596(obj) \
+    OBJECT_CHECK(SysBusI82596State, (obj), TYPE_LASI_82596)
+
+typedef struct {
+    SysBusDevice parent_obj;
+
+    I82596State state;
+    uint16_t last_val;
+    int val_index:1;
+} SysBusI82596State;
+
+SysBusI82596State *lasi_82596_init(MemoryRegion *addr_space,
+                                    hwaddr hpa, qemu_irq irq);
+
+#endif
Signature · 1 line
2.23.0
#11 lore raw

Re: [PATCH 7/7] seabios-hppa: update to latest version

In reply to a message not in the archive

Hi Sven,

Quoted 1 line · Sven Schnelle

Required for STI support.

Please add the changelog. This might be enough:

$ git shortlog 0f4fe846..f8706d6f
Helge Deller (12):
      Add PDC_MEM_MAP and ENTRY_INIT_SRCH_FRST for OSF/MkLinux
      Return non-existant BTLB for PDC_BLOCK_TLB
      Add serial, parallel and LAN port support of  LASI chip
      Implement ENTRY_IO_BBLOCK_IN IODC function
      Do not print \r on parisc SeaBIOS
      Fix serial ports and add PDC_MODEL functions for special 
instructions enablement
      Implement SeaBIOS returning additional addresses. Fixes HP-UX boot.
      Fix mod_pgs (number of pages) for graphic cards
      Merge pull request #3 from svenschnelle/sti
      Merge pull request #4 from svenschnelle/parisc-qemu-4.1.0
      parisc: Implement PDC rendenzvous
      parisc: Improve soft power button emulation

Sven Schnelle (7):
parisc: fix PDC info for graphics adapter
parisc: add missing header guard to hppa.h
parisc: add LASI PS/2 emulation.
parisc: Add STI support
parisc: wire up graphics console
parisc: Add support for setting STI screen resolution
parisc: support LASI RTC register

Also, maybe it's clearer to use "update to parisc-qemu-4.2" in subject.

Quoted 6 lines
---
  pc-bios/hppa-firmware.img | Bin 783724 -> 772876 bytes
  roms/seabios-hppa         |   2 +-
  2 files changed, 1 insertion(+), 1 deletion(-)

[...]

You can send this patch using 'git format-patch --no-binary'
and share a link to one of your repository, such https://github.com/svenschnelle/qemu.

GIT-FORMAT-PATCH(1)

--no-binary
Do not output contents of changes in binary files, instead display a notice that those files changed. Patches generated using this option cannot be applied properly, but they are still useful for code review.

roms/seabios-hppa line 1

Quoted 7 lines
roms/seabios-hppa +1 -1
index 0f4fe84658..9312de136f 160000
@@ -1 +1 @@
-Subproject commit 0f4fe84658165e96ce35870fd19fc634e182e77b
+Subproject commit 9312de136fc31b41774239f8bed8c2a817b98344

I'm getting:

fatal: bad object 9312de136fc31b41774239f8bed8c2a817b98344

Is this the correct hash?

Regards,

Phil.

#5 lore raw

Re: [PATCH 3/7] hppa: remove ISA region

In reply to Sven Schnelle
Quoted 8 lines · Sven Schnelle

B160L doesn't have an ISA bus, and we no longer need it to workaround missing hardware, so remove it.

---
 hw/hppa/hppa_hardware.h |  1 -
 hw/hppa/machine.c       | 32 --------------------------------
 2 files changed, 33 deletions(-)

This should remove ISA_BUS from hw/hppa/Kconfig as well.

r~

#2 lore raw

Re: [PATCH 1/7] hw/hppa/dino.c: Improve emulation of Dino PCI chip

In reply to Sven Schnelle

hw/hppa/dino.c line 88

Quoted 6 lines · Sven Schnelle

#define DINO_PCI_HOST_BRIDGE(obj) \
OBJECT_CHECK(DinoState, (obj), TYPE_DINO_PCI_HOST_BRIDGE)

hw/hppa/dino.c +3 -0
+#define DINO800_REGS ((DINO_TLTIM - DINO_GMASK) / 4)
+static uint8_t reg800_keep_bits[DINO800_REGS]
+        = { 1, 7, 7, 8, 7, 9, 32, 8, 30, 25, 22, 9 };

(1) const.
(2) better as a mask:

static const uint32_t reg800_keep_mask[DINO800_REGS] = {
    MAKE_64BIT_MASK(0, 1),
    MAKE_64BIT_MASK(0, 7),
    ...
};

since that's the only way this is actually used.

r~

#6 lore raw

Re: [PATCH 3/7] hppa: remove ISA region

In reply to Richard Henderson

Hi Richard,

Quoted 11 lines · Richard Henderson
Quoted 8 lines · Sven Schnelle

B160L doesn't have an ISA bus, and we no longer need it to workaround missing hardware, so remove it.

---
 hw/hppa/hppa_hardware.h |  1 -
 hw/hppa/machine.c       | 32 --------------------------------
 2 files changed, 33 deletions(-)

This should remove ISA_BUS from hw/hppa/Kconfig as well.

Right. I thought to do so is easy, but that turned out to reveal a lot of other issues:

- hppa is using the I8259 code, which relies on ISA
- hw/hppa/pci.c seems to only contain unused stuff
- LASI use hw/char/parallel.c, which relies on ISA. parallel.c could propably be split up into a ISA dependent part and a generic part

So it is more work to remove ISA completely, therefore i'll drop that patch for now and submit it later again.

Thanks
Sven