summaryrefslogtreecommitdiff
path: root/sys/arch/alpha/stand
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2013-12-22 18:31:30 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2013-12-22 18:31:30 +0000
commit3c285c266a3d910204b65a60919bd7e443389014 (patch)
tree02e997f75f2ee69b6f652f4209860974c9808a22 /sys/arch/alpha/stand
parentb0da51afe4118b5c1ef321d93f6dd88926da8073 (diff)
Set the primary CPU's PAL revision to the OSF/1 PAL revision after switching
to it, per the Green Book; from NetBSD. It turns out this is necessary on some (if not all) systems to properly spin up secondary processors. Bump version.
Diffstat (limited to 'sys/arch/alpha/stand')
-rw-r--r--sys/arch/alpha/stand/OSFpal.c39
-rw-r--r--sys/arch/alpha/stand/boot/version3
-rw-r--r--sys/arch/alpha/stand/netboot/version3
3 files changed, 31 insertions, 14 deletions
diff --git a/sys/arch/alpha/stand/OSFpal.c b/sys/arch/alpha/stand/OSFpal.c
index b0010108dff..4980c3f57ea 100644
--- a/sys/arch/alpha/stand/OSFpal.c
+++ b/sys/arch/alpha/stand/OSFpal.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: OSFpal.c,v 1.7 2004/12/01 20:55:07 deraadt Exp $ */
-/* $NetBSD: OSFpal.c,v 1.4 1996/10/13 03:00:24 christos Exp $ */
+/* $OpenBSD: OSFpal.c,v 1.8 2013/12/22 18:31:29 miod Exp $ */
+/* $NetBSD: OSFpal.c,v 1.8 2001/07/22 15:17:30 wiz Exp $ */
/*
* Copyright (c) 1994, 1996 Carnegie-Mellon University.
@@ -29,26 +29,41 @@
*/
#include <sys/types.h>
+#include <lib/libsa/stand.h>
-#include <machine/rpb.h>
#include <machine/prom.h>
+#include <machine/rpb.h>
+#include <machine/alpha_cpu.h>
+
+paddr_t ptbr_save;
void
OSFpal()
{
struct rpb *r;
- struct ctb *t;
struct pcs *p;
- long result;
- int offset;
r = (struct rpb *)HWRPB_ADDR;
- offset = r->rpb_pcs_size * cpu_number();
- p = (struct pcs *)((u_int8_t *)r + r->rpb_pcs_off + offset);
+ /*
+ * Note, cpu_number() is a VMS op, can't necessarily call it.
+ * Real fun: PAL_VMS_mfpr_whami == PAL_OSF1_rti...
+ * We might not be rpb_primary_cpu_id, but it is supposed to go
+ * first so the answer should apply to everyone.
+ */
+ p = LOCATE_PCS(r, r->rpb_primary_cpu_id);
+
+ printf("VMS PAL rev: 0x%lx\n", p->pcs_palrevisions[PALvar_OpenVMS]);
+ printf("OSF PAL rev: 0x%lx\n", p->pcs_palrevisions[PALvar_OSF1]);
- printf("VMS PAL rev: 0x%lx, OSF PAL rev: 0x%lx\n",
- p->pcs_palrevisions[PALvar_OpenVMS],
- p->pcs_palrevisions[PALvar_OSF1]);
- (void)switch_palcode();
+ if(p->pcs_pal_type==PAL_TYPE_OSF1) {
+ printf("OSF PAL code already running.\n");
+ ptbr_save = ((struct alpha_pcb *)p)->apcb_ptbr;
+ printf("PTBR is: 0x%lx\n", ptbr_save);
+ return;
+ }
+ switch_palcode();
+ memcpy(&p->pcs_pal_rev, &p->pcs_palrevisions[PALvar_OSF1],
+ sizeof(p->pcs_pal_rev));
+ printf("Switch to OSF PAL code succeeded.\n");
}
diff --git a/sys/arch/alpha/stand/boot/version b/sys/arch/alpha/stand/boot/version
index ef4e5e2268e..87e876df5bd 100644
--- a/sys/arch/alpha/stand/boot/version
+++ b/sys/arch/alpha/stand/boot/version
@@ -1,4 +1,4 @@
-$OpenBSD: version,v 1.8 2011/06/05 21:49:36 miod Exp $
+$OpenBSD: version,v 1.9 2013/12/22 18:31:29 miod Exp $
$NetBSD: version,v 1.9 1997/01/23 23:10:38 cgd Exp $
1.1: Initial version
@@ -24,3 +24,4 @@ $NetBSD: version,v 1.9 1997/01/23 23:10:38 cgd Exp $
(OpenBSD 1.6/1.7)
1.8: Use MI loadfile, warn if kernel image would overlap SRM
+1.9: Better PALcode switching sequence
diff --git a/sys/arch/alpha/stand/netboot/version b/sys/arch/alpha/stand/netboot/version
index 11304222405..5c0a94b1d9d 100644
--- a/sys/arch/alpha/stand/netboot/version
+++ b/sys/arch/alpha/stand/netboot/version
@@ -1,4 +1,4 @@
-$OpenBSD: version,v 1.3 2011/06/05 21:49:36 miod Exp $
+$OpenBSD: version,v 1.4 2013/12/22 18:31:29 miod Exp $
$NetBSD: version,v 1.6 1997/01/23 23:10:41 cgd Exp $
1.1: Initial version
@@ -12,3 +12,4 @@ $NetBSD: version,v 1.6 1997/01/23 23:10:41 cgd Exp $
(OpenBSD 1.2)
1.3: Use MI loadfile, warn if kernel image would overlap SRM
+1.4: Better PALcode switching sequence