summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2012-08-19 18:38:13 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2012-08-19 18:38:13 +0000
commite7815343da050319b9f07e6173e24b291c08612b (patch)
treecb20df042301b0cbf1e532ccade9030c9f635c95 /sys/dev/ic
parentc447f867d0b5c9a8fa308f326571b36c85d795b9 (diff)
Skip putting a port in sleep mode when it is used as serial console. In that
case the kernel will still be using the port even after the last process closes it. And on machines like the v445 the firmware won't be happy if the console port is in sleep mode when the kernel reboots or halts. ok miod@
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/com.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c
index 5ebea29d72b..63c863c63bd 100644
--- a/sys/dev/ic/com.c
+++ b/sys/dev/ic/com.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: com.c,v 1.149 2012/05/12 18:02:33 kettenis Exp $ */
+/* $OpenBSD: com.c,v 1.150 2012/08/19 18:38:12 kettenis Exp $ */
/* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */
/*
@@ -540,26 +540,28 @@ compwroff(struct com_softc *sc)
bus_space_write_1(iot, ioh, com_fifo,
FIFO_RCV_RST | FIFO_XMT_RST);
- switch (sc->sc_uarttype) {
- case COM_UART_ST16650:
- case COM_UART_ST16650V2:
- bus_space_write_1(iot, ioh, com_lcr, LCR_EFR);
- bus_space_write_1(iot, ioh, com_efr, EFR_ECB);
- bus_space_write_1(iot, ioh, com_ier, IER_SLEEP);
- bus_space_write_1(iot, ioh, com_lcr, 0);
- break;
- case COM_UART_TI16750:
- bus_space_write_1(iot, ioh, com_ier, IER_SLEEP);
- break;
+ if (!ISSET(sc->sc_hwflags, COM_HW_CONSOLE)) {
+ switch (sc->sc_uarttype) {
+ case COM_UART_ST16650:
+ case COM_UART_ST16650V2:
+ bus_space_write_1(iot, ioh, com_lcr, LCR_EFR);
+ bus_space_write_1(iot, ioh, com_efr, EFR_ECB);
+ bus_space_write_1(iot, ioh, com_ier, IER_SLEEP);
+ bus_space_write_1(iot, ioh, com_lcr, 0);
+ break;
+ case COM_UART_TI16750:
+ bus_space_write_1(iot, ioh, com_ier, IER_SLEEP);
+ break;
#ifdef COM_PXA2X0
- case COM_UART_PXA2X0:
- bus_space_write_1(iot, ioh, com_ier, 0);
+ case COM_UART_PXA2X0:
+ bus_space_write_1(iot, ioh, com_ier, 0);
#ifdef __zaurus__
- if (ISSET(sc->sc_hwflags, COM_HW_SIR))
- scoop_set_irled(0);
+ if (ISSET(sc->sc_hwflags, COM_HW_SIR))
+ scoop_set_irled(0);
#endif
- break;
+ break;
#endif
+ }
}
}