Changeset 411c297 in rtems


Ignore:
Timestamp:
Jan 18, 2019, 10:24:18 AM (5 months ago)
Author:
Jiri Gaisler <jiri@…>
Branches:
master
Children:
5981c8ca
Parents:
7eb606d3
git-author:
Jiri Gaisler <jiri@…> (01/18/19 10:24:18)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/22/19 11:48:19)
Message:

grlib: make apbuart driver independent of bsp

Update #3678.

Location:
bsps
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • bsps/include/grlib/apbuart.h

    r7eb606d3 r411c297  
    3838#define APBUART_CTRL_TF 0x200
    3939#define APBUART_CTRL_RF 0x400
     40#define APBUART_CTRL_DB 0x800
    4041#define APBUART_CTRL_BI 0x1000
    4142#define APBUART_CTRL_DI 0x2000
  • bsps/shared/grlib/uart/apbuart_cons.c

    r7eb606d3 r411c297  
    261261#ifdef LEON3
    262262        if (priv->regs == leon3_debug_uart) {
    263                 db = priv->regs->ctrl & (LEON_REG_UART_CTRL_RE |
    264                                         LEON_REG_UART_CTRL_TE |
    265                                         LEON_REG_UART_CTRL_PE |
    266                                         LEON_REG_UART_CTRL_PS);
     263                db = priv->regs->ctrl & (APBUART_CTRL_RE |
     264                                        APBUART_CTRL_TE |
     265                                        APBUART_CTRL_PE |
     266                                        APBUART_CTRL_PS);
    267267        }
    268268#endif
     
    274274         * either LB or DB depending on UART capabilities.
    275275         */
    276         if (priv->regs->ctrl & LEON_REG_UART_CTRL_FL) {
    277                 db |= priv->regs->ctrl & (LEON_REG_UART_CTRL_DB |
    278                       LEON_REG_UART_CTRL_LB | LEON_REG_UART_CTRL_FL);
     276        if (priv->regs->ctrl & APBUART_CTRL_FL) {
     277                db |= priv->regs->ctrl & (APBUART_CTRL_DB |
     278                      APBUART_CTRL_LB | APBUART_CTRL_FL);
    279279        }
    280280
     
    562562                case (PARENB|PARODD):
    563563                        /* Odd parity */
    564                         ctrl |= LEON_REG_UART_CTRL_PE|LEON_REG_UART_CTRL_PS;
     564                        ctrl |= APBUART_CTRL_PE|APBUART_CTRL_PS;
    565565                        break;
    566566
    567567                case PARENB:
    568568                        /* Even parity */
    569                         ctrl &= ~LEON_REG_UART_CTRL_PS;
    570                         ctrl |= LEON_REG_UART_CTRL_PE;
     569                        ctrl &= ~APBUART_CTRL_PS;
     570                        ctrl |= APBUART_CTRL_PE;
    571571                        break;
    572572
     
    575575                case PARODD:
    576576                        /* No Parity */
    577                         ctrl &= ~(LEON_REG_UART_CTRL_PS|LEON_REG_UART_CTRL_PE);
     577                        ctrl &= ~(APBUART_CTRL_PS|APBUART_CTRL_PE);
    578578        }
    579579
    580580        if (!(t->c_cflag & CLOCAL))
    581                 ctrl |= LEON_REG_UART_CTRL_FL;
     581                ctrl |= APBUART_CTRL_FL;
    582582        else
    583                 ctrl &= ~LEON_REG_UART_CTRL_FL;
     583                ctrl &= ~APBUART_CTRL_FL;
    584584
    585585        /* Update new settings */
     
    619619        /* Read out current parity */
    620620        ctrl = uart->regs->ctrl;
    621         if (ctrl & LEON_REG_UART_CTRL_PE) {
    622                 if (ctrl & LEON_REG_UART_CTRL_PS)
     621        if (ctrl & APBUART_CTRL_PE) {
     622                if (ctrl & APBUART_CTRL_PS)
    623623                        t->c_cflag |= PARENB|PARODD; /* Odd parity */
    624624                else
     
    626626        }
    627627
    628         if ((ctrl & LEON_REG_UART_CTRL_FL) == 0)
     628        if ((ctrl & APBUART_CTRL_FL) == 0)
    629629                t->c_cflag |= CLOCAL;
    630630
  • bsps/sparc/leon2/include/leon.h

    r7eb606d3 r411c297  
    267267#define LEON_REG_UART_CTRL_FL     0x00000040 /* Flow control enable */
    268268#define LEON_REG_UART_CTRL_LB     0x00000080 /* Loop Back enable */
    269 #define LEON_REG_UART_CTRL_DB     0x00000800 /* Debug FIFO enable */
    270269
    271270#ifndef ASM
Note: See TracChangeset for help on using the changeset viewer.