parisc: Prevent unneeded accesses to not-available devices

Prevent some HPMCs when trying to check for devices like LASI LAN &
graphics.

Signed-off-by: Helge Deller <deller@gmx.de>
diff --git a/src/parisc/parisc.c b/src/parisc/parisc.c
index f89be6a..d7a05c0 100644
--- a/src/parisc/parisc.c
+++ b/src/parisc/parisc.c
@@ -550,7 +550,7 @@
 
 static int artist_present(void)
 {
-    return !!(*(u32 *)0xf8380004 == 0x6dc20006);
+    return !!(*(u32 *)F_EXTEND(0xf8380004) == 0x6dc20006);
 }
 
 int HPA_is_LASI_graphics(unsigned long hpa)
@@ -808,7 +808,7 @@
     uninitialized = 0;
 
     /* check if qemu emulates LASI chip (LASI_IAR exists) */
-    if (*(unsigned long *)(LASI_HPA+16) == 0) {
+    if (has_astro || *(unsigned long *)(LASI_HPA+16) == 0) {
         remove_from_keep_list(LASI_UART_HPA);
         remove_from_keep_list(LASI_LAN_HPA);
         remove_from_keep_list(LASI_LPT_HPA);
@@ -2118,6 +2118,8 @@
 
     switch (option) {
         case PDC_LAN_STATION_ID_READ:
+            if (has_astro)
+                return PDC_INVALID_ARG;
             if (ARG3 != LASI_LAN_HPA)
                 return PDC_INVALID_ARG;
             if (!keep_this_hpa(LASI_LAN_HPA))
@@ -3007,6 +3009,8 @@
     char bootdrive = (char)cmdline; // c = hdd, d = CD/DVD
     show_boot_menu = (linux_kernel_entry == 1);
 
+    has_astro = (sizeof(long) != 4); /* 64-bit firmware does not support Dino */
+
     initialize_iodc_entry();
 
 #ifndef __LP64__
@@ -3053,7 +3057,6 @@
      * but cfg() tries to initialize the PCI bus.
      */
     PAGE0->mem_cons.hpa = 0;
-    has_astro = 0;
     pci_hpa = PCI_HPA;    /* HPA of Dino or Elroy0 */
     hppa_port_pci_cmd  = (PCI_HPA + DINO_PCI_ADDR);
     hppa_port_pci_data = (PCI_HPA + DINO_CONFIG_DATA);