summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2019-01-28 10:29:36 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2019-01-28 10:29:36 +0000
commit75fa30d74fa6f7abf58e3ffd7f85cb62c4df1c03 (patch)
tree18b07579c81859caf375a0411bfb19e656a1453e
parent26c8d2d12930baad257bc15f0ad101e12453f39f (diff)
Implement breaking into ddb on imxuart(4). When a break is detected,
a flag in the upper byte of the 2-byte-wide receive register is set. ok kettenis@
-rw-r--r--sys/dev/fdt/imxuart.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/dev/fdt/imxuart.c b/sys/dev/fdt/imxuart.c
index 84c7eb5aee6..b9dee6eb9e0 100644
--- a/sys/dev/fdt/imxuart.c
+++ b/sys/dev/fdt/imxuart.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: imxuart.c,v 1.4 2018/08/06 10:52:30 patrick Exp $ */
+/* $OpenBSD: imxuart.c,v 1.5 2019/01/28 10:29:35 patrick Exp $ */
/*
* Copyright (c) 2005 Dale Rahn <drahn@motorola.com>
*
@@ -182,6 +182,7 @@ imxuart_attach(struct device *parent, struct device *self, void *aux)
break;
cn_tab->cn_dev = makedev(maj, sc->sc_dev.dv_unit);
+ SET(sc->sc_hwflags, COM_HW_CONSOLE);
printf(": console");
}
@@ -224,7 +225,17 @@ imxuart_intr(void *arg)
p = sc->sc_ibufp;
while(ISSET(bus_space_read_2(iot, ioh, IMXUART_USR2), IMXUART_SR2_RDR)) {
- c = bus_space_read_1(iot, ioh, IMXUART_URXD);
+ c = bus_space_read_2(iot, ioh, IMXUART_URXD);
+ if (ISSET(c, IMXUART_RX_BRK)) {
+#ifdef DDB
+ if (ISSET(sc->sc_hwflags, COM_HW_CONSOLE)) {
+ if (db_console)
+ db_enter();
+ continue;
+ }
+#endif
+ c &= ~0xff;
+ }
if (p >= sc->sc_ibufend) {
sc->sc_floods++;
if (sc->sc_errors++ == 0)