summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2020-09-05 12:06:45 +0200
committerHelge Deller <deller@gmx.de>2020-12-29 19:02:23 +0100
commitab20b235e5bcc6c296651bf94374e31dbe64c0da (patch)
treea9bbb7786dd450543e19f7569a93346dae00df03
parent812b3b3231869f4dee194491dd3da0e166538953 (diff)
downloadpalo-ab20b235e5bcc6c296651bf94374e31dbe64c0da.tar.gz
Add "m" option to enable manufacturing mode on C8000
Add the hidden option "m" in the menu to turn on manufacturing mode on C8000 workstations. It's then enabl until next hard reset. Signed-off-by: Sven Schnelle <svens@stackframe.org> Signed-off-by: Helge Deller <deller@gmx.de>
-rw-r--r--ipl/ipl.c39
1 files changed, 31 insertions, 8 deletions
diff --git a/ipl/ipl.c b/ipl/ipl.c
index b1a51ef..3e4a732 100644
--- a/ipl/ipl.c
+++ b/ipl/ipl.c
@@ -411,6 +411,16 @@ interact(int *ok)
if (numbuf[0] == 'x')
pdc_do_reset();
+ /* turn on firmware manufacturing mode on C8000 workstation */
+ if (numbuf[0] == 'm') { /* hidden option! */
+ const char *model = get_machine_model()
+ if (strcmp(model, "9000/785/C8000", 14) == 0) {
+ *(unsigned char *)0xfffffff0f04300a0 = 0x4d;
+ pdc_do_reset();
+ }
+ printf("unknown machine - can not enable manufacturing mode\n");
+ }
+
if (numbuf[0] == 'd') /* hidden option! */
{
Debug = !Debug;
@@ -441,6 +451,22 @@ interact(int *ok)
}
/*
+ * Beware: pdc_model_sysmodel() may return a machine name which has trailing
+ * spaces.
+ */
+static char sys_model_name[81];
+
+static const char *get_machine_model()
+{
+ if ((sys_model_name[0] == 0) &&
+ pdc_model_sysmodel(sys_model_name) != PDC_OK)
+ strcpy(sys_model_name, "unknown");
+
+ return &sys_model_name;
+}
+
+
+/*
* On some server models the serial port of the GSP/Management card which
* mirrors the console port shows up as ttyS1 instead of ttyS0. This happens
* on older Linux kernels which set up a serial port for the Diva AUX port.
@@ -448,28 +474,25 @@ interact(int *ok)
* and graphics card") avoids this by hiding the Diva AUX port:
* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bcf3f1752a622f1372d3252d0fea8855d89812e7
*
- * Beware: pdc_model_sysmodel() may return a machine name which has trailing
- * spaces.
*/
static char *
get_default_serial_console()
{
- char sys_model_name[81];
char *ttyS1_models[] = {
"9000/800/rp3410",
"9000/800/rp3420",
"9000/800/rp3440",
NULL
};
+ const char *model;
+ char **check = ttyS1_models;
- if (pdc_model_sysmodel(sys_model_name) == PDC_OK) {
- char **check = ttyS1_models;
- while (*check) {
- if (strncmp(*check, sys_model_name, strlen(*check)) == 0)
+ model = get_machine_model();
+ while (*check) {
+ if (strncmp(*check, model, strlen(*check)) == 0)
printf("WARNING: Found rp34x0 machine. "
"Older Linux kernel may need console=ttyS1.\n");
check++;
- }
}
return "ttyS0";