summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/dev
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2012-05-25 17:11:41 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2012-05-25 17:11:41 +0000
commit058567e2df5e9e80d9ee2c847df71989405848b7 (patch)
treee1e58b9f9ee840f7942f77c3cee5a876d380c2eb /sys/arch/sparc/dev
parent8611ef5b22f4fe7c854e4eec7723a5b89526195a (diff)
Correctly handle the case of a system setup to use glass console, which
frame buffer has been removed, but which keyboard is left plugged in. The PROM will select a `keyboard input, serial output' console, which was being recognized as glass console by the kernel. The kernel would then reset the serial chip at zstty attach time, while still using the PROM output routines at this point, and hang. Fix this by paying attention to split input/output setups and always falling back to serial console in this case. ok kettenis@
Diffstat (limited to 'sys/arch/sparc/dev')
-rw-r--r--sys/arch/sparc/dev/zs.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/arch/sparc/dev/zs.c b/sys/arch/sparc/dev/zs.c
index 10b9452daa8..49468c319fa 100644
--- a/sys/arch/sparc/dev/zs.c
+++ b/sys/arch/sparc/dev/zs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zs.c,v 1.48 2010/07/10 19:32:24 miod Exp $ */
+/* $OpenBSD: zs.c,v 1.49 2012/05/25 17:11:40 miod Exp $ */
/* $NetBSD: zs.c,v 1.50 1997/10/18 00:00:40 gwr Exp $ */
/*-
@@ -1099,6 +1099,24 @@ setup_console:
if (inSource != outSink) {
printf("cninit: mismatched PROM output selector\n");
+ /*
+ * In case of mismatch, force the console to be on
+ * serial.
+ * There are three possible mismatches:
+ * - input and output on different serial lines:
+ * use the output line.
+ * - input on keyboard, output on serial:
+ * use the output line (this allows systems configured
+ * for glass console, which frame buffers have been removed,
+ * to still work if the keyboard is left plugged).
+ * - input on serial, output on video:
+ * use the input line, since we don't know if a keyboard
+ * is connected.
+ */
+ if (outSink == PROMDEV_TTYA || outSink == PROMDEV_TTYB)
+ inSource = outSink;
+ else
+ outSink = inSource;
}
switch (inSource) {