diff options
author | Helge Deller <deller@gmx.de> | 2024-01-03 20:54:18 +0100 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2024-01-04 18:49:41 +0100 |
commit | 541a67a1e10b4592e8ce9c7997cd478ff651ef2b (patch) | |
tree | 739ddf1867fc92e2d1831ce5d5210bad11bb48ac | |
parent | ca2a5bf30744a00a4bff39edee9d08d01350c036 (diff) | |
download | seabios-hppa-541a67a1e10b4592e8ce9c7997cd478ff651ef2b.zip seabios-hppa-541a67a1e10b4592e8ce9c7997cd478ff651ef2b.tar.gz seabios-hppa-541a67a1e10b4592e8ce9c7997cd478ff651ef2b.tar.bz2 |
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>
-rw-r--r-- | src/parisc/parisc.c | 9 |
1 files changed, 7 insertions, 2 deletions
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 @@ void __VISIBLE __noreturn hlt(void) 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 @@ void __VISIBLE start_parisc_firmware(void) 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); |