Changeset d936c1a in rtems


Ignore:
Timestamp:
Jun 3, 2013, 12:12:08 PM (6 years ago)
Author:
Daniel Hellstrom <daniel@…>
Branches:
4.11, master
Children:
51347053
Parents:
ab907e8e
git-author:
Daniel Hellstrom <daniel@…> (06/03/13 12:12:08)
git-committer:
Daniel Hellstrom <daniel@…> (04/16/15 23:10:20)
Message:

APBUART: debug bit was cleared incorrectly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c

    rab907e8e rd936c1a  
    198198        /* Clear HW regs, leave baudrate register as it is */
    199199        priv->regs->status = 0;
    200         /* leave debug bit, and Transmitter/receiver if this is the debug UART.
    201          * With old APBUARTs debug is enabled by setting LB and FL, since LB is
    202          * not reset we can not trust is, however since FL is reset we guess
    203          * that we are debugging old UART if both FL and LB is already set.
     200
     201        /* leave Transmitter/receiver if this is the RTEMS debug UART (assume
     202         * it has been setup by boot loader).
    204203         */
     204        db = 0;
    205205#ifdef LEON3
    206206        if (priv->regs == dbg_uart) {
    207                 db = priv->regs->ctrl & (LEON_REG_UART_CTRL_DB |
    208                                         LEON_REG_UART_CTRL_RE |
     207                db = priv->regs->ctrl & (LEON_REG_UART_CTRL_RE |
    209208                                        LEON_REG_UART_CTRL_TE |
    210                                         LEON_REG_UART_CTRL_FL |
    211                                         LEON_REG_UART_CTRL_LB |
    212209                                        LEON_REG_UART_CTRL_PE |
    213210                                        LEON_REG_UART_CTRL_PS);
    214         } else
     211        }
    215212#endif
    216         {
    217                 if (priv->regs->ctrl & (LEON_REG_UART_CTRL_FL |
    218                                         LEON_REG_UART_CTRL_LB))
    219                         db = priv->regs->ctrl & (LEON_REG_UART_CTRL_FL |
    220                                         LEON_REG_UART_CTRL_LB);
    221                 else                                   
    222                         db = priv->regs->ctrl & LEON_REG_UART_CTRL_DB;
     213        /* Let UART debug tunnelling be untouched if Flow-control is set.
     214         *
     215         * With old APBUARTs debug is enabled by setting LB and FL, since LB or
     216         * DB are not reset we can not trust them. However since FL is reset we
     217         * guess that we are debugging if FL is already set, the debugger set
     218         * either LB or DB depending on UART capabilities.
     219         */
     220        if (priv->regs->ctrl & LEON_REG_UART_CTRL_FL) {
     221                db |= priv->regs->ctrl & (LEON_REG_UART_CTRL_DB |
     222                      LEON_REG_UART_CTRL_LB | LEON_REG_UART_CTRL_FL);
    223223        }
    224224
Note: See TracChangeset for help on using the changeset viewer.