parisc: Enable power button switch and add option to disable it

Due to a mismatch of memory mapping for PA2.0 with PSW.W=0,
the power button was broken on 64-bit machines.
The mapping bug is now fixed in qemu, so re-enable the button again.

Additionally add option to completely disable the power
switch with:
    "-fw_cfg opt/power-button-enable,string=0"

Signed-off-by: Helge Deller <deller@gmx.de>
diff --git a/src/parisc/parisc.c b/src/parisc/parisc.c
index afe248a..5f450f7 100644
--- a/src/parisc/parisc.c
+++ b/src/parisc/parisc.c
@@ -209,8 +209,7 @@
 
 static int powerswitch_supported(void)
 {
-    /* can't reach powerswitch pointer on 64-bit CPU if ptr above 0xf0000000 */
-    return cpu_bit_width == 32 || (unsigned long) powersw_ptr < 0xf0000000;
+    return powersw_ptr != NULL;
 }
 
 static void check_powersw_button(void)
@@ -3041,6 +3040,12 @@
     powersw_ptr = (int *) (unsigned long)
         romfile_loadint("/etc/hppa/power-button-addr", (unsigned long)&powersw_nop);
 
+    /* allow user to disable power button: "-fw_cfg opt/power-button-enable,string=0" */
+    i = romfile_loadstring_to_int("opt/power-button-enable", 1);
+    if (i == 0) {
+        powersw_ptr = NULL;
+    }
+
     /* real-time-clock addr */
     rtc_ptr = (int *) (unsigned long)
         romfile_loadint("/etc/hppa/rtc-addr", (unsigned long) LASI_RTC_HPA);