parisc: SEABIOS_HPPA_VERSION 6

Fixes the serial port emulation

Qemu versions which request a SEABIOS_HPPA_VERSION < 6 have the bug that
they use the DINO UART instead of the LASI UART as serial port #0.

Staring with SEABIOS_HPPA_VERSION 6 the serial ports are now emulated as
on physical hardware, with LASI UART being serial port #0.

This patch adds a compat patch, which will use the DINO UART port
for console I/O if it detects that qemu requests a SEABIOS_HPPA_VERSION
< 6.

Signed-off-by: Helge Deller <deller@gmx.de>
diff --git a/src/parisc/parisc.c b/src/parisc/parisc.c
index 0a60fa1..d2eca58 100644
--- a/src/parisc/parisc.c
+++ b/src/parisc/parisc.c
@@ -31,7 +31,7 @@
 
 #include "vgabios.h"
 
-#define SEABIOS_HPPA_VERSION 5
+#define SEABIOS_HPPA_VERSION 6
 
 /*
  * Various variables which are needed by x86 code.
@@ -2002,13 +2002,13 @@
     .cl_class = CL_KEYBD,
 };
 
-static const struct pz_device mem_cons_boot = {
+static struct pz_device mem_cons_boot = {
     .hpa = PARISC_SERIAL_CONSOLE - 0x800,
     .iodc_io = (unsigned long)&iodc_entry,
     .cl_class = CL_DUPLEX,
 };
 
-static const struct pz_device mem_kbd_boot = {
+static struct pz_device mem_kbd_boot = {
     .hpa = PARISC_SERIAL_CONSOLE - 0x800,
     .iodc_io = (unsigned long)&iodc_entry,
     .cl_class = CL_KEYBD,
@@ -2122,6 +2122,15 @@
             "Please update.\n", (int)SEABIOS_HPPA_VERSION, i);
         hlt();
     }
+    /* Qemu versions which request a SEABIOS_HPPA_VERSION < 6 have the bug that
+     * they use the DINO UART instead of the LASI UART as serial port #0.
+     * Fix it up here and switch the serial console code to use PORT_SERIAL2
+     * for such Qemu versions, so that we can still use this higher SeaBIOS
+     * version with older Qemus. */
+    if (i < 6) {
+        mem_cons_boot.hpa = PORT_SERIAL2 - 0x800;
+        mem_kbd_boot.hpa = PORT_SERIAL2 - 0x800;
+    }
 
     tlb_entries = romfile_loadint("/etc/cpu/tlb_entries", 256);
     dprintf(0, "fw_cfg: TLB entries %d\n", tlb_entries);