Ignore:
Timestamp:
Nov 25, 2013, 7:46:19 AM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
847fc79
Parents:
224b888
git-author:
Sebastian Huber <sebastian.huber@…> (11/25/13 07:46:19)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/06/14 07:47:03)
Message:

bsp/leon3: New BSP variant leon3_qemu

File:
1 edited

Legend:

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

    r224b888 r7579e25  
    2626static struct apbuart_regs *dbg_uart = NULL;
    2727
     28#ifndef LEON3_QEMU
    2829/* Before UART driver has registered (or when no UART is available), calls to
    2930 * printk that gets to bsp_out_char() will be filling data into the
     
    7475  }
    7576}
     77#else
     78static void bsp_out_char(char c);
     79
     80static void leon3_qemu_debug_uart_init(char c)
     81{
     82  bsp_debug_uart_init();
     83
     84  BSP_output_char = bsp_out_char;
     85
     86  bsp_out_char(c);
     87}
     88
     89void bsp_debug_uart_init(void)
     90{
     91  dbg_uart = (struct apbuart_regs *)0x80000100;
     92  dbg_uart->ctrl |= LEON_REG_UART_CTRL_RE | LEON_REG_UART_CTRL_TE;
     93  dbg_uart->status = 0;
     94}
     95#endif
    7696
    7797/*
     
    129149static void bsp_out_char(char c)
    130150{
     151#ifndef LEON3_QEMU
    131152  if (dbg_uart == NULL) {
    132153    /* Local debug buffer when UART driver has not registered */
     
    135156    return;
    136157  }
     158#endif
    137159
    138160  apbuart_outbyte_polled(dbg_uart, c, 1, 1);
     
    145167#include <rtems/bspIo.h>
    146168
     169#ifndef LEON3_QEMU
    147170BSP_output_char_function_type BSP_output_char = bsp_out_char;
     171#else
     172BSP_output_char_function_type BSP_output_char = leon3_qemu_debug_uart_init;
     173#endif
    148174
    149175static int bsp_in_char(void)
Note: See TracChangeset for help on using the changeset viewer.