summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2007-12-14 16:16:28 +0000
committerjsing <jsing@openbsd.org>2007-12-14 16:16:28 +0000
commit9ab6878ccb5ecfd98d604ac2aebc2d61a9f34fba (patch)
tree1e2ba1ced206aba13e82cf67ba319407f5d2b3b3
parentAdd console/cnattach support to mkbc(4). This allows for early attachment (diff)
downloadwireguard-openbsd-9ab6878ccb5ecfd98d604ac2aebc2d61a9f34fba.tar.xz
wireguard-openbsd-9ab6878ccb5ecfd98d604ac2aebc2d61a9f34fba.zip
Enable console support for SGI O2 workstations. Switch between the serial
and graphical console based on the selection made in the ARCBIOS. Early attachment of gbe(4) is still required, otherwise we have a working graphical console. ok miod@
-rw-r--r--etc/etc.sgi/ttys3
-rw-r--r--sys/arch/sgi/conf/files.sgi6
-rw-r--r--sys/arch/sgi/dev/wscons_machdep.c32
3 files changed, 30 insertions, 11 deletions
diff --git a/etc/etc.sgi/ttys b/etc/etc.sgi/ttys
index 7eade2beb9c..ec6c2fe8c22 100644
--- a/etc/etc.sgi/ttys
+++ b/etc/etc.sgi/ttys
@@ -1,9 +1,10 @@
#
-# $OpenBSD: ttys,v 1.1 2004/08/06 21:58:22 pefo Exp $
+# $OpenBSD: ttys,v 1.2 2007/12/14 16:16:28 jsing Exp $
#
# name getty type status comments
#
console "/usr/libexec/getty std.9600" unknown off secure
+ttyC0 "/usr/libexec/getty Pc" vt220 on secure
tty00 "/usr/libexec/getty std.9600" unknown on secure
tty01 "/usr/libexec/getty std.9600" unknown off secure
tty02 "/usr/libexec/getty std.9600" unknown off secure
diff --git a/sys/arch/sgi/conf/files.sgi b/sys/arch/sgi/conf/files.sgi
index 70dd2fd625d..0ce6823dca3 100644
--- a/sys/arch/sgi/conf/files.sgi
+++ b/sys/arch/sgi/conf/files.sgi
@@ -1,4 +1,4 @@
-# $OpenBSD: files.sgi,v 1.15 2007/11/27 15:31:00 jsing Exp $
+# $OpenBSD: files.sgi,v 1.16 2007/12/14 16:16:28 jsing Exp $
#
# maxpartitions must be first item in files.${ARCH}
#
@@ -112,14 +112,14 @@ file arch/sgi/dev/mavb.c mavb
include "dev/pckbc/files.pckbc"
device mkbc: pckbcslot
attach mkbc at macebus
-file arch/sgi/dev/mkbc.c mkbc
+file arch/sgi/dev/mkbc.c mkbc needs-flag
# Raster operations
include "dev/rasops/files.rasops"
include "dev/wsfont/files.wsfont"
#
-# wscons console
+# wscons console
#
include "dev/wscons/files.wscons"
diff --git a/sys/arch/sgi/dev/wscons_machdep.c b/sys/arch/sgi/dev/wscons_machdep.c
index e51ccdcd8b1..e5142925404 100644
--- a/sys/arch/sgi/dev/wscons_machdep.c
+++ b/sys/arch/sgi/dev/wscons_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wscons_machdep.c,v 1.5 2007/11/13 12:01:45 jsing Exp $ */
+/* $OpenBSD: wscons_machdep.c,v 1.6 2007/12/14 16:16:28 jsing Exp $ */
/*
* Copyright (c) 2001 Aaron Campbell
@@ -36,15 +36,23 @@
#include <machine/autoconf.h>
#include <machine/bus.h>
+#include <mips64/arcbios.h>
+
+#include <sgi/dev/mkbcreg.h>
+#include <sgi/localbus/macebus.h>
+
#include <dev/cons.h>
+#include <dev/ic/pckbcvar.h>
+#include <dev/usb/ukbdvar.h>
+#include <dev/wscons/wskbdvar.h>
+#include <dev/wscons/wsconsio.h>
+
+#include "mkbc.h"
#include "wsdisplay.h"
#if NWSDISPLAY > 0
#include <dev/wscons/wsdisplayvar.h>
#endif
-#include <dev/wscons/wskbdvar.h>
-#include <dev/wscons/wsconsio.h>
-#include <dev/usb/ukbdvar.h>
cons_decl(ws);
@@ -53,19 +61,25 @@ wscnprobe(struct consdev *cp)
{
int maj;
- /* locate the major number */
+ /* Locate the major number. */
for (maj = 0; maj < nchrdev; maj++) {
if (cdevsw[maj].d_open == wsdisplayopen)
break;
}
if (maj == nchrdev) {
- /* we are not in cdevsw[], give up */
+ /* We are not in cdevsw[], give up. */
panic("wsdisplay is not in cdevsw[]");
}
cp->cn_dev = makedev(maj, 0);
- cp->cn_pri = CN_INTERNAL;
+
+ /* Attach as console if necessary. */
+ if (strncmp(bios_console, "video", 5) == 0) {
+ cp->cn_pri = CN_REMOTE;
+ } else {
+ cp->cn_pri = CN_INTERNAL;
+ }
}
void
@@ -78,6 +92,10 @@ static int initted;
initted = 1;
+#if NMKBC > 0
+ if (!mkbc_cnattach(&macebus_tag, 0x00320000, PCKBC_KBD_SLOT))
+ return;
+#endif
#if notyet
ukbd_cnattach();
#endif