summaryrefslogtreecommitdiff
path: root/sys/dev/ic/com.c
diff options
context:
space:
mode:
authormacallan <macallan@NetBSD.org>2013-01-10 17:38:10 +0000
committermacallan <macallan@NetBSD.org>2013-01-10 17:38:10 +0000
commitb741ecbb52bf35ea7afd4eccbf383c40cf55dc51 (patch)
treeffbabd2ab12b2015439bcb966962328341615611 /sys/dev/ic/com.c
parent0d27a1c9594c8fe60afc67651bfb2c2362b324b1 (diff)
don't try to become console if we get is_console=false as device property
Diffstat (limited to 'sys/dev/ic/com.c')
-rw-r--r--sys/dev/ic/com.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c
index cf4ce59a461..9ea5537bfb8 100644
--- a/sys/dev/ic/com.c
+++ b/sys/dev/ic/com.c
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.306 2012/05/21 20:51:46 skrll Exp $ */
+/* $NetBSD: com.c,v 1.307 2013/01/10 17:38:10 macallan Exp $ */
/*-
* Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.306 2012/05/21 20:51:46 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.307 2013/01/10 17:38:10 macallan Exp $");
#include "opt_com.h"
#include "opt_ddb.h"
@@ -379,9 +379,14 @@ com_attach_subr(struct com_softc *sc)
u_int8_t lcr;
#endif
const char *fifo_msg = NULL;
+ prop_dictionary_t dict;
+ bool is_console = true;
aprint_naive("\n");
+ dict = device_properties(sc->sc_dev);
+ prop_dictionary_get_bool(dict, "is_console", &is_console);
+
callout_init(&sc->sc_diag_callout, 0);
mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_HIGH);
@@ -402,9 +407,13 @@ com_attach_subr(struct com_softc *sc)
(u_long)comcons_info.regs.cr_iobase);
}
+
/* Make sure the console is always "hardwired". */
delay(10000); /* wait for output to finish */
- SET(sc->sc_hwflags, COM_HW_CONSOLE);
+ if (is_console) {
+ SET(sc->sc_hwflags, COM_HW_CONSOLE);
+ }
+
SET(sc->sc_swflags, TIOCFLAG_SOFTCAR);
}