aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2022-10-20 13:19:36 +0200
committerHelge Deller <deller@gmx.de>2022-10-20 13:19:36 +0200
commit73f2ae77fac9977cdf0dca419fb7dc0fc4fc9171 (patch)
tree5055da5cb23da026f9e7913eaf13fef15969e389
parent259302f635e979ebc13ea5dcc097fb58f0dad337 (diff)
downloadseabios-hppa-73f2ae77fac9977cdf0dca419fb7dc0fc4fc9171.zip
seabios-hppa-73f2ae77fac9977cdf0dca419fb7dc0fc4fc9171.tar.gz
seabios-hppa-73f2ae77fac9977cdf0dca419fb7dc0fc4fc9171.tar.bz2
parisc: fix nvolatile and stable storage & FPU detection
-rw-r--r--src/parisc/b160l.h36
-rw-r--r--src/parisc/parisc.c74
2 files changed, 52 insertions, 58 deletions
diff --git a/src/parisc/b160l.h b/src/parisc/b160l.h
index 1819d84..40d615e 100644
--- a/src/parisc/b160l.h
+++ b/src/parisc/b160l.h
@@ -1,13 +1,11 @@
/* AUTO-GENERATED FILE FOR QEMU */
-#if 1
#define PARISC_MODEL "9000/778/B160L"
-#define PARISC_PDC_MODEL 0x5020, 0x481, 0x0,\
-0x2020202, 0x7794d7fe, 0x10000000, 0x4, 0xba, 0xba
-#else
-#define PARISC_MODEL "928LX 3kRanger Fox"
-#define PARISC_PDC_MODEL 0x4800, 0x481, 0x0,\
-0x2020202, 0x7794d7fe, 0x10000001, 0x0 /*BOOT_ID:PA1.1->4*/, 0,0 /*0xba, 0xba*/
-#endif
+#define PARISC_PDC_MODEL 0x5020, 0x481, 0x0, 0x2020202, 0x7794d7fe, 0x10000001, 0x4, 0xba, 0xba
+// #define MPE_PARISC_MODEL "928LX 3kRanger Fox"
+#define MPE_PARISC_MODEL "e3000/A400-100-11#N"
+// #define MPE_PARISC_MODEL "e3000/A500-200-20#A"
+#define MPE_PARISC_PDC_MODEL 0x4800, 0x481, 0x0, 0x44143A73, 0x10000001, 0x0, 0, 0
+
#define PARISC_PDC_VERSION 0x0008
#define PARISC_PDC_CPUID 0x01e8
#define PARISC_PDC_CAPABILITIES 0x0002
@@ -27,28 +25,6 @@ https://support.hpe.com/hpesc/public/docDisplay?docId=c01097674&docLocale=en_US
HP-UX Model String: 9000/800/A400-44
MPE/XL Model String: e3000/A400-100-11#N
-https://support.hpe.com/hpesc/public/docDisplay?docId=pdb_na-PHSS_28611
-Please note that the following configuration settings are
- maintained in Stable Storage, not NVRAM, and thus are not
- modified during the update to PDC version 43.24:
-
- - Primary boot path
- - Console/Display path
- - Alternate boot path
- - Keyboard path
- - Hversion
- - Sversion
- - SWID
- - SW Cap
- - CPU Boot IDs
- - Calib Values
- - HPUX model
- - MPE XL model
- - NT Model
- - MFG console path
- - Original product number
- - Current product number
- - System Serial Number string
#endif
#define HPA_ffc00000_DESCRIPTION "Phantom PseudoBC GSC+ Port"
diff --git a/src/parisc/parisc.c b/src/parisc/parisc.c
index 2321a00..3876300 100644
--- a/src/parisc/parisc.c
+++ b/src/parisc/parisc.c
@@ -118,6 +118,8 @@ int pdc_console;
#define CONSOLE_SERIAL 0x0001
#define CONSOLE_GRAPHICS 0x0002
+int opsys_id = OS_ID_MPEXL; // default OS: OS_ID_HPUX or OS_ID_MPEXL
+
int sti_font;
/* Want PDC boot menu? Enable via qemu "-boot menu=on" option. */
@@ -834,8 +836,30 @@ static void init_stable_storage(void)
stable_storage[0x67] = 0xff;
stable_storage[0x87] = 0xff;
stable_storage[0xa7] = 0xff;
- // 0x0e/0x0f => fastsize = all, needed for HPUX
- stable_storage[0x5f] = 0x0f;
+ stable_storage[0x41] = opsys_id;
+ *(unsigned int *) &stable_storage[0x58] = 0x7B3A; // diag
+ stable_storage[0x5e] = 0x01; // osdep2
+ stable_storage[0x5f] = 0x0f; // 0x0e/0x0f => fastsize = all, needed for HPUX
+}
+
+static const char *model_string(int op_id)
+{
+ if (op_id == OS_ID_MPEXL)
+ return MPE_PARISC_MODEL;
+ else
+ return PARISC_MODEL;
+}
+
+static struct pdc_model model = { PARISC_PDC_MODEL };
+
+static void init_nvolatile_storage(void)
+{
+ const char *model_str;
+
+ memset(nvolatile_storage, 0, sizeof(nvolatile_storage));
+ memcpy(&nvolatile_storage[0], &model, sizeof(model));
+ model_str = model_string(opsys_id);
+ strtcpy((char *)&nvolatile_storage[80], model_str, 32);
}
static unsigned long lasi_rtc_read(void)
@@ -981,8 +1005,6 @@ static int pdc_pim(ARG_LIST)
return PDC_BAD_OPTION;
}
-static struct pdc_model model = { PARISC_PDC_MODEL };
-
static int pdc_model(ARG_LIST)
{
unsigned long option = ARG1;
@@ -1004,16 +1026,9 @@ static int pdc_model(ARG_LIST)
}
return -4; // invalid c_index
case PDC_MODEL_SYSMODEL:
- switch (ARG3) {
- case OS_ID_MPEXL: model_str = "928LX 3kRanger Fox";
- model_str = "e3000/A400-100-11#N";
- break;
- case OS_ID_HPUX:
- default: model_str = PARISC_MODEL;
- break;
- }
+ model_str = model_string(ARG3);
result[0] = strlen(model_str);
- strtcpy((char *)ARG4, model_str, 80);
+ strtcpy((char *)ARG4, model_str, 32);
return PDC_OK;
case PDC_MODEL_ENSPEC:
case PDC_MODEL_DISPEC:
@@ -1103,19 +1118,14 @@ static int pdc_coproc(ARG_LIST)
{
unsigned long option = ARG1;
unsigned long *result = (unsigned long *)ARG2;
- unsigned long mask;
switch (option) {
case PDC_COPROC_CFG:
memset(result, 0, 32 * sizeof(unsigned long));
- /* Set one bit per cpu in ccr_functional and ccr_present.
- Ignore that specification only mentions 8 bits for cr10
- and set all FPUs functional */
- mask = -1UL;
- mtctl(mask, 10); /* initialize cr10 */
- result[0] = mask;
- result[1] = mask;
- result[17] = 1; // Revision
- result[18] = 19; // Model
+ mtctl(-1UL, 10); /* initialize cr10 */
+ result[0] = 0xc0;
+ result[1] = 0xc0;
+ result[17] = 0x01; // Revision /* 1 auf c3k */
+ result[18] = 0x13; // Model /* 0x13 auf c3k */
return PDC_OK;
}
return PDC_BAD_OPTION;
@@ -1235,7 +1245,7 @@ static int pdc_stable(ARG_LIST)
case PDC_STABLE_VERIFY_CONTENTS:
return PDC_OK;
case PDC_STABLE_INITIALIZE:
- init_stable_storage();
+ // init_stable_storage();
return PDC_OK;
}
return PDC_BAD_OPTION;
@@ -1263,7 +1273,7 @@ static int pdc_nvolatile(ARG_LIST)
case PDC_NVOLATILE_VERIFY_CONTENTS:
return PDC_OK;
case PDC_NVOLATILE_INITIALIZE:
- memset(nvolatile_storage, 0, sizeof(nvolatile_storage));
+ init_nvolatile_storage();
return PDC_OK;
}
return PDC_BAD_OPTION;
@@ -2231,6 +2241,14 @@ void __VISIBLE start_parisc_firmware(void)
/* 0,1 = default 8x16 font, 2 = 16x32 font */
sti_font = romfile_loadstring_to_int("opt/font", 0);
+ /* 0: HP-UX/Linux, 2: MPE/XL */
+ opsys_id = romfile_loadstring_to_int("opt/os", opsys_id);
+ if (opsys_id == OS_ID_MPEXL) {
+ struct pdc_model mpe_model = { MPE_PARISC_PDC_MODEL };
+ model = mpe_model;
+ } else
+ opsys_id = OS_ID_HPUX; /* else default to HP-UX */
+
model.sw_id = romfile_loadstring_to_int("opt/hostid", model.sw_id);
dprintf(0, "fw_cfg: machine hostid %lu\n", model.sw_id);
@@ -2277,6 +2295,9 @@ void __VISIBLE start_parisc_firmware(void)
// remove_from_keep_list(LASI_PS2MOU_HPA);
}
+ // Initialize stable storage
+ init_stable_storage();
+
// Initialize boot paths (graphics & keyboard)
if (pdc_console == CONSOLE_DEFAULT) {
if (artist_present())
@@ -2300,9 +2321,6 @@ void __VISIBLE start_parisc_firmware(void)
printf("Kept #%d at 0x%lx\n", i, parisc_devices[i].hpa);
}
- // Initialize stable storage
- init_stable_storage();
-
chassis_code = 0;
// set Qemu serial debug port