summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2012-08-25 18:02:18 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2012-08-25 18:02:18 +0000
commit7bc81e7c6c1ccaa21a6e9210d61d47147e065dd6 (patch)
tree378e1b5d54b02a0939cca5ef801bc11350ddb2c0
parent65194e1f16521034e23b4c3f62caab6dd95e6592 (diff)
Better detection of the st16650 v1 (with the broken fifo). Gets rid of
false positives like the DUART on the MPC8347 as found on socppc. ok deraadt@
-rw-r--r--sys/dev/ic/com.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c
index f394c970007..44dcf93a992 100644
--- a/sys/dev/ic/com.c
+++ b/sys/dev/ic/com.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: com.c,v 1.151 2012/08/25 17:40:34 kettenis Exp $ */
+/* $OpenBSD: com.c,v 1.152 2012/08/25 18:02:17 kettenis Exp $ */
/* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */
/*
@@ -1633,7 +1633,10 @@ com_attach_subr(struct com_softc *sc)
if (sc->sc_uarttype == COM_UART_16550A) { /* Probe for ST16650s */
bus_space_write_1(iot, ioh, com_lcr, lcr | LCR_DLAB);
if (bus_space_read_1(iot, ioh, com_efr) == 0) {
- sc->sc_uarttype = COM_UART_ST16650;
+ bus_space_write_1(iot, ioh, com_efr, EFR_CTS);
+ if (bus_space_read_1(iot, ioh, com_efr) != 0)
+ sc->sc_uarttype = COM_UART_ST16650;
+ bus_space_write_1(iot, ioh, com_efr, 0);
} else {
bus_space_write_1(iot, ioh, com_lcr, LCR_EFR);
if (bus_space_read_1(iot, ioh, com_efr) == 0)