diff options
author | Daniel Hellstrom <daniel@gaisler.com> | 2013-06-03 14:12:08 +0200 |
---|---|---|
committer | Daniel Hellstrom <daniel@gaisler.com> | 2015-04-17 01:10:20 +0200 |
commit | d936c1a7818b7e9d7e3fce6c566d18c75a328534 (patch) | |
tree | 85d6f2d9898373779baa4e8eef313de88ffb85d2 | |
parent | NGMP PCI: added support for NGMP prototype boards (diff) | |
download | rtems-d936c1a7818b7e9d7e3fce6c566d18c75a328534.tar.bz2 |
APBUART: debug bit was cleared incorrectly
-rw-r--r-- | c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c | 32 |
1 files changed, 16 insertions, 16 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 64d1b15045..e0fa64e178 100644 --- a/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c +++ b/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c @@ -197,29 +197,29 @@ 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. - * 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. + + /* leave Transmitter/receiver if this is the RTEMS debug UART (assume + * it has been setup by boot loader). */ + db = 0; #ifdef LEON3 if (priv->regs == dbg_uart) { - db = priv->regs->ctrl & (LEON_REG_UART_CTRL_DB | - LEON_REG_UART_CTRL_RE | + db = priv->regs->ctrl & (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 - { - 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; + /* Let UART debug tunnelling be untouched if Flow-control is set. + * + * With old APBUARTs debug is enabled by setting LB and FL, since LB or + * DB are not reset we can not trust them. However since FL is reset we + * guess that we are debugging if FL is already set, the debugger set + * either LB or DB depending on UART capabilities. + */ + if (priv->regs->ctrl & LEON_REG_UART_CTRL_FL) { + db |= priv->regs->ctrl & (LEON_REG_UART_CTRL_DB | + LEON_REG_UART_CTRL_LB | LEON_REG_UART_CTRL_FL); } priv->regs->ctrl = db; |