summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/shared
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2012-06-19 14:49:40 +0200
committerDaniel Hellstrom <daniel@gaisler.com>2015-04-17 01:10:18 +0200
commit18564f5317731ec701dda129f095a3358ffbfbad (patch)
treebebf0b9b542f3579805908aada7d426c982ce469 /c/src/lib/libbsp/sparc/shared
parentGRSPW: New packet based driver for SPW/SPW2/SPW2_DMA (diff)
downloadrtems-18564f5317731ec701dda129f095a3358ffbfbad.tar.bz2
APBUART: fix GRMON -u support for older UARTs
Diffstat (limited to 'c/src/lib/libbsp/sparc/shared')
-rw-r--r--c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c b/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c
index 2785286406..64d1b15045 100644
--- a/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c
+++ b/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c
@@ -197,18 +197,30 @@ int apbuart_init1(struct drvmgr_dev *dev)
/* Clear HW regs, leave baudrate register as it is */
priv->regs->status = 0;
- /* leave debug bit, and Transmitter/receiver if this is the debug UART */
+ /* leave debug bit, and Transmitter/receiver if this is the debug UART.
+ * With old APBUARTs debug is enabled by setting LB and FL, since LB is
+ * not reset we can not trust is, however since FL is reset we guess
+ * that we are debugging old UART if both FL and LB is already set.
+ */
#ifdef LEON3
if (priv->regs == dbg_uart) {
db = priv->regs->ctrl & (LEON_REG_UART_CTRL_DB |
LEON_REG_UART_CTRL_RE |
LEON_REG_UART_CTRL_TE |
LEON_REG_UART_CTRL_FL |
+ LEON_REG_UART_CTRL_LB |
LEON_REG_UART_CTRL_PE |
LEON_REG_UART_CTRL_PS);
} else
#endif
- db = priv->regs->ctrl & LEON_REG_UART_CTRL_DB;
+ {
+ if (priv->regs->ctrl & (LEON_REG_UART_CTRL_FL |
+ LEON_REG_UART_CTRL_LB))
+ db = priv->regs->ctrl & (LEON_REG_UART_CTRL_FL |
+ LEON_REG_UART_CTRL_LB);
+ else
+ db = priv->regs->ctrl & LEON_REG_UART_CTRL_DB;
+ }
priv->regs->ctrl = db;