Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/amlogic Fix cnmagic handling, now I can enter d...
details: https://anonhg.NetBSD.org/src/rev/ceea991f0de0
branches: trunk
changeset: 337121:ceea991f0de0
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Fri Apr 03 15:50:15 2015 +0000
description:
Fix cnmagic handling, now I can enter ddb from serial console.
diffstat:
sys/arch/arm/amlogic/amlogic_com.c | 21 ++++++++++++++++++---
sys/arch/arm/amlogic/amlogic_comreg.h | 3 ++-
2 files changed, 20 insertions(+), 4 deletions(-)
diffs (66 lines):
diff -r fb83ef136f51 -r ceea991f0de0 sys/arch/arm/amlogic/amlogic_com.c
--- a/sys/arch/arm/amlogic/amlogic_com.c Fri Apr 03 14:57:41 2015 +0000
+++ b/sys/arch/arm/amlogic/amlogic_com.c Fri Apr 03 15:50:15 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: amlogic_com.c,v 1.4 2015/03/03 21:56:25 jmcneill Exp $ */
+/* $NetBSD: amlogic_com.c,v 1.5 2015/04/03 15:50:15 jmcneill Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -33,7 +33,13 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: amlogic_com.c,v 1.4 2015/03/03 21:56:25 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: amlogic_com.c,v 1.5 2015/04/03 15:50:15 jmcneill Exp $");
+
+#define cn_trap() \
+ do { \
+ console_debugger(); \
+ cn_trapped = 1; \
+ } while (/* CONSTCOND */ 0)
#include <sys/param.h>
#include <sys/bus.h>
@@ -430,14 +436,23 @@
uint32_t status, c;
for (;;) {
+ int cn_trapped = 0;
status = bus_space_read_4(sc->sc_bst, sc->sc_bsh,
UART_STATUS_REG);
if (status & UART_STATUS_RX_EMPTY) {
break;
}
+ if (status & UART_STATUS_BREAK) {
+ cn_check_magic(tp->t_dev, CNC_BREAK,
+ amlogic_com_cnm_state);
+ if (cn_trapped)
+ continue;
+ }
c = bus_space_read_4(sc->sc_bst, sc->sc_bsh, UART_RFIFO_REG);
- cn_check_magic(tp->t_dev, c, amlogic_com_cnm_state);
+ cn_check_magic(tp->t_dev, c & 0xff, amlogic_com_cnm_state);
+ if (cn_trapped)
+ continue;
tp->t_linesw->l_rint(c & 0xff, tp);
}
diff -r fb83ef136f51 -r ceea991f0de0 sys/arch/arm/amlogic/amlogic_comreg.h
--- a/sys/arch/arm/amlogic/amlogic_comreg.h Fri Apr 03 14:57:41 2015 +0000
+++ b/sys/arch/arm/amlogic/amlogic_comreg.h Fri Apr 03 15:50:15 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: amlogic_comreg.h,v 1.3 2015/03/01 23:39:28 jmcneill Exp $ */
+/* $NetBSD: amlogic_comreg.h,v 1.4 2015/04/03 15:50:15 jmcneill Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -49,6 +49,7 @@
#define UART_STATUS_TX_EMPTY __BIT(22)
#define UART_STATUS_TX_FULL __BIT(21)
#define UART_STATUS_RX_EMPTY __BIT(20)
+#define UART_STATUS_BREAK __BIT(17)
#define UART_MISC_TX_IRQ_CNT __BITS(15,8)
#define UART_MISC_RX_IRQ_CNT __BITS(7,0)
Home |
Main Index |
Thread Index |
Old Index