From b741ecbb52bf35ea7afd4eccbf383c40cf55dc51 Mon Sep 17 00:00:00 2001 From: macallan Date: Thu, 10 Jan 2013 17:38:10 +0000 Subject: don't try to become console if we get is_console=false as device property --- sys/dev/ic/com.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'sys/dev/ic/com.c') 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 -__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); } -- cgit