From e7815343da050319b9f07e6173e24b291c08612b Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sun, 19 Aug 2012 18:38:13 +0000 Subject: 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@ --- sys/dev/ic/com.c | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'sys/dev/ic') 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 + } } } -- cgit v1.2.3