Changeset 229c4249 in rtems


Ignore:
Timestamp:
04/27/17 11:14:53 (6 years ago)
Author:
Martin Aberg <maberg@…>
Branches:
5, master
Children:
ad203e58
Parents:
011efee8
git-author:
Martin Aberg <maberg@…> (04/27/17 11:14:53)
git-committer:
Daniel Hellstrom <daniel@…> (05/14/17 10:31:57)
Message:

bsp/leon3: Cleaner namespace for LEON3 debug UART

Prefix BSP specific symbols with BSP name:
dbg_uart -> leon3_debug_uart
debug_uart_index -> leon3_debug_uart_index

Location:
c/src/lib/libbsp/sparc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/leon3/console/printk_support.c

    r011efee8 r229c4249  
    2626#include <bsp/apbuart_termios.h>
    2727
    28 int debug_uart_index __attribute__((weak)) = 0;
    29 struct apbuart_regs *dbg_uart = NULL;
     28int leon3_debug_uart_index __attribute__((weak)) = 0;
     29struct apbuart_regs *leon3_debug_uart = NULL;
    3030
    3131/* Before UART driver has registered (or when no UART is available), calls to
     
    4646  struct ambapp_apb_info *apb;
    4747
    48   /* Update debug_uart_index to index used as debug console.
    49    * Let user select Debug console by setting debug_uart_index. If the
    50    * BSP is to provide the default UART (debug_uart_index==0):
     48  /* Update leon3_debug_uart_index to index used as debug console. Let user
     49   * select Debug console by setting leon3_debug_uart_index. If the BSP is to
     50   * provide the default UART (leon3_debug_uart_index==0):
    5151   *   non-MP: APBUART[0] is debug console
    5252   *   MP: LEON CPU index select UART
    5353   */
    54   if (debug_uart_index == 0) {
     54  if (leon3_debug_uart_index == 0) {
    5555#if defined(RTEMS_MULTIPROCESSING)
    56     debug_uart_index = LEON3_Cpu_Index;
     56    leon3_debug_uart_index = LEON3_Cpu_Index;
    5757#else
    58     debug_uart_index = 0;
     58    leon3_debug_uart_index = 0;
    5959#endif
    6060  } else {
    61     debug_uart_index = debug_uart_index - 1; /* User selected dbg-console */
     61    leon3_debug_uart_index--; /* User selected dbg-console */
    6262  }
    6363
    6464  /* Find APBUART core for System Debug Console */
    65   i = debug_uart_index;
     65  i = leon3_debug_uart_index;
    6666  adev = (void *)ambapp_for_each(&ambapp_plb, (OPTIONS_ALL|OPTIONS_APB_SLVS),
    6767                                 VENDOR_GAISLER, GAISLER_APBUART,
     
    7272     */
    7373    apb = (struct ambapp_apb_info *)adev->devinfo;
    74     dbg_uart = (struct apbuart_regs *)apb->start;
    75     dbg_uart->ctrl |= APBUART_CTRL_RE | APBUART_CTRL_TE;
    76     dbg_uart->status = 0;
     74    leon3_debug_uart = (struct apbuart_regs *)apb->start;
     75    leon3_debug_uart->ctrl |= APBUART_CTRL_RE | APBUART_CTRL_TE;
     76    leon3_debug_uart->status = 0;
    7777  }
    7878}
     
    8787static void bsp_out_char(char c)
    8888{
    89   if (dbg_uart == NULL) {
     89  if (leon3_debug_uart == NULL) {
    9090    /* Local debug buffer when UART driver has not registered */
    9191    pre_printk_dbgbuf[pre_printk_pos++] = c;
     
    9494  }
    9595
    96   apbuart_outbyte_polled(dbg_uart, c, 1, 1);
     96  apbuart_outbyte_polled(leon3_debug_uart, c, 1, 1);
    9797}
    9898
     
    109109  int tmp;
    110110
    111   if (dbg_uart == NULL)
     111  if (leon3_debug_uart == NULL)
    112112    return EOF;
    113113
    114   while ((tmp = apbuart_inbyte_nonblocking(dbg_uart)) < 0)
     114  while ((tmp = apbuart_inbyte_nonblocking(leon3_debug_uart)) < 0)
    115115    ;
    116116  return tmp;
  • c/src/lib/libbsp/sparc/leon3/include/leon.h

    r011efee8 r229c4249  
    365365 * ...
    366366 */
    367 extern int debug_uart_index;
     367extern int leon3_debug_uart_index;
    368368
    369369/* Let user override which on-chip TIMER core will be used for system clock
  • c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c

    r011efee8 r229c4249  
    4949  int wait_sent);
    5050extern int apbuart_inbyte_nonblocking(struct apbuart_regs *regs);
    51 extern struct apbuart_regs *dbg_uart; /* The debug UART */
     51#ifdef LEON3
     52extern struct apbuart_regs *leon3_debug_uart; /* The debug UART */
     53#endif
    5254
    5355/* Probed hardware capabilities */
     
    264266        db = 0;
    265267#ifdef LEON3
    266         if (priv->regs == dbg_uart) {
     268        if (priv->regs == leon3_debug_uart) {
    267269                db = priv->regs->ctrl & (LEON_REG_UART_CTRL_RE |
    268270                                        LEON_REG_UART_CTRL_TE |
     
    511513#ifdef LEON3
    512514        /* Disable TX/RX if not used for DEBUG */
    513         if (uart->regs != dbg_uart)
     515        if (uart->regs != leon3_debug_uart)
    514516                uart->regs->ctrl &= ~(APBUART_CTRL_RE | APBUART_CTRL_TE);
    515517#endif
Note: See TracChangeset for help on using the changeset viewer.