aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2022-10-24 11:55:32 +0200
committerHelge Deller <deller@gmx.de>2022-10-24 11:55:32 +0200
commit81339bebc4cbad4d260d8f030da111d486982bac (patch)
tree0f575c980a13bb9a90fe9efd1033d80f8e307b35
parent01cf225be69dafe405305c051fe634db1b2a7942 (diff)
downloadseabios-hppa-81339bebc4cbad4d260d8f030da111d486982bac.zip
seabios-hppa-81339bebc4cbad4d260d8f030da111d486982bac.tar.gz
seabios-hppa-81339bebc4cbad4d260d8f030da111d486982bac.tar.bz2
parisc: Set PSW Q-bit by default
otherwise MPE has boot issues.
-rw-r--r--src/parisc/head.S3
-rw-r--r--src/parisc/parisc.c36
2 files changed, 25 insertions, 14 deletions
diff --git a/src/parisc/head.S b/src/parisc/head.S
index e7c69f3..8c0726f 100644
--- a/src/parisc/head.S
+++ b/src/parisc/head.S
@@ -178,6 +178,9 @@ ENTRY(startup)
rsm PSW_W_SM, %r0
.level 1.1
+ /* enable PSQ Q-bit by default. HPE needs it. */
+ ssm 8, %r1 /* set Q-bit */
+
/* Save CPU HPA in cr7, hopefully HP-UX will not use that register. */
mtctl %r5, CPU_HPA_CR_REG /* store CPU HPA */
diff --git a/src/parisc/parisc.c b/src/parisc/parisc.c
index 0c6c6c6..9023795 100644
--- a/src/parisc/parisc.c
+++ b/src/parisc/parisc.c
@@ -575,18 +575,22 @@ static hppa_device_t *find_hppa_device_by_path(struct pdc_module_path *search,
return NULL;
}
+static portaddr_t ser_port_addr(unsigned long defport)
+{
+ if (opsys_id == OS_ID_MPEXL)
+ return PARISC_SERIAL_CONSOLE; /* XXX: workaround that MPE uses different serial port hpa */
+ else
+ return defport;
+}
+
#define SERIAL_TIMEOUT 20
static unsigned long parisc_serial_in(char *c, unsigned long maxchars)
{
- portaddr_t addr;
unsigned long end = timer_calc(SERIAL_TIMEOUT);
unsigned long count = 0;
+ portaddr_t addr;
- if (opsys_id == OS_ID_MPEXL)
- addr = PARISC_SERIAL_CONSOLE; /* XXX: workaround that MPE uses different serial port hpa */
- else
- addr = PAGE0->mem_kbd.hpa + 0x800;
-
+ addr = ser_port_addr(PAGE0->mem_kbd.hpa + 0x800);
while (count < maxchars) {
u8 lsr = inb(addr+SEROFF_LSR);
if (lsr & 0x01) {
@@ -602,8 +606,9 @@ static unsigned long parisc_serial_in(char *c, unsigned long maxchars)
static void parisc_serial_out(char c)
{
- portaddr_t addr = PAGE0->mem_cons.hpa + 0x800; /* PARISC_SERIAL_CONSOLE */
- addr = PARISC_SERIAL_CONSOLE;
+ portaddr_t addr;
+
+ addr = ser_port_addr(PAGE0->mem_cons.hpa + 0x800);
for (;;) {
if (c == '\n')
parisc_serial_out('\r');
@@ -666,7 +671,7 @@ int __VISIBLE parisc_iodc_ENTRY_IO(ARG_LIST)
char *c;
struct disk_op_s disk_op;
- if (0 &&
+ if (1 &&
(((HPA_is_serial_device(hpa) || HPA_is_graphics_device(hpa)) && option == ENTRY_IO_COUT) ||
((HPA_is_serial_device(hpa) || HPA_is_graphics_device(hpa)) && option == ENTRY_IO_CIN)
// || (HPA_is_storage_device(hpa) && option == ENTRY_IO_BOOTIN)
@@ -720,9 +725,9 @@ int __VISIBLE parisc_iodc_ENTRY_IO(ARG_LIST)
process_bootio:
- if (ARG6 >= ram_size) { /* ram address outside memory range? */
- result[0] = ARG7;
- return PDC_OK; // work around MEM size detection problem with "DUMPAREA found, save main memory to disc" should be: PDC_ERROR XXX
+ if (ARG6 >= ram_size || (ARG6 + ARG7) >= ram_size ||
+ (ARG6 + ARG7) < ARG6) { /* ram address outside memory range? */
+ return PDC_ERROR;
}
if (ARG6 < PAGE_SIZE &&
(option == ENTRY_IO_BOOTIN || option == ENTRY_IO_BBLOCK_IN)) {
@@ -973,8 +978,10 @@ static int pdc_chassis(ARG_LIST)
switch (option) {
case PDC_CHASSIS_DISP:
- if (ARG2 == 0x2dead)
+ if (ARG2 == 0x2dead) {
+ // dump_mem(0x3a0, 96, 0x3a0);
hlt();
+ }
ARG3 = ARG2;
result = (unsigned long *)&ARG4; // do not write to ARG2, use &ARG4 instead
// fall through
@@ -1447,7 +1454,7 @@ static int pdc_mem(ARG_LIST)
static int pdc_psw(ARG_LIST)
{
- static unsigned long psw_defaults = PDC_PSW_ENDIAN_BIT;
+ static unsigned long psw_defaults = 0;
unsigned long option = ARG1;
unsigned long *result = (unsigned long *)ARG2;
@@ -1460,6 +1467,7 @@ static int pdc_psw(ARG_LIST)
*result = psw_defaults;
if (option == PDC_PSW_SET_DEFAULTS) {
psw_defaults = ARG2;
+ /* TODO: check if endian bit changed and set. */
}
return PDC_OK;
}