Ignore:
Timestamp:
Jun 19, 2012, 12:49:40 PM (7 years ago)
Author:
Daniel Hellstrom <daniel@…>
Branches:
4.11, master
Children:
949d0d6
Parents:
0f49c0e
git-author:
Daniel Hellstrom <daniel@…> (06/19/12 12:49:40)
git-committer:
Daniel Hellstrom <daniel@…> (04/16/15 23:10:18)
Message:

APBUART: fix GRMON -u support for older UARTs

File:
1 edited

Legend:

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

    r0f49c0e r18564f5  
    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 */
     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.
     204         */
    201205#ifdef LEON3
    202206        if (priv->regs == dbg_uart) {
     
    205209                                        LEON_REG_UART_CTRL_TE |
    206210                                        LEON_REG_UART_CTRL_FL |
     211                                        LEON_REG_UART_CTRL_LB |
    207212                                        LEON_REG_UART_CTRL_PE |
    208213                                        LEON_REG_UART_CTRL_PS);
    209214        } else
    210215#endif
    211                 db = priv->regs->ctrl & LEON_REG_UART_CTRL_DB;
     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;
     223        }
    212224
    213225        priv->regs->ctrl = db;
Note: See TracChangeset for help on using the changeset viewer.