Changeset 7579e25 in rtems


Ignore:
Timestamp:
Nov 25, 2013, 7:46:19 AM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 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

Location:
c/src/lib/libbsp/sparc/leon3
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/leon3/Makefile.am

    r224b888 r7579e25  
    2727dist_project_lib_DATA += startup/linkcmds
    2828dist_project_lib_DATA += startup/linkcmds.leon3
     29dist_project_lib_DATA += startup/linkcmds.leon3_qemu
    2930dist_project_lib_DATA += startup/linkcmds.ngmp
    3031
  • c/src/lib/libbsp/sparc/leon3/amba/amba.c

    r224b888 r7579e25  
    4040void amba_initialize(void)
    4141{
     42#ifndef LEON3_QEMU
    4243  int icsel;
    4344  struct ambapp_dev *adev;
     
    9192                     (LEON3_Timer_Regs->scaler_reload + 1) * 1000000);
    9293  }
     94#else /* LEON3_QEMU */
     95  LEON3_IrqCtrl_Regs = (volatile struct irqmp_regs *)0x80000200;
     96#endif /* LEON3_QEMU */
    9397}
  • c/src/lib/libbsp/sparc/leon3/clock/ckinit.c

    r224b888 r7579e25  
    5656#endif
    5757
     58#ifndef LEON3_QEMU
    5859#define Clock_driver_support_find_timer() \
    5960  do { \
     
    7273    } \
    7374  } while (0)
     75#else /* LEON3_QEMU */
     76#define Clock_driver_support_find_timer() \
     77  do { \
     78    LEON3_Timer_Regs = (volatile struct gptimer_regs *) \
     79                       0x80000300; \
     80    clkirq = 6; \
     81  } while (0)
     82#endif /* LEON3_QEMU */
    7483
    7584#define Clock_driver_support_install_isr( _new, _old ) \
     
    7887  } while(0)
    7988
     89#ifndef LEON3_QEMU
    8090#define Clock_driver_support_initialize_hardware() \
    8191  do { \
     
    8797        LEON3_GPTIMER_LD | LEON3_GPTIMER_IRQEN; \
    8898  } while (0)
     99#else
     100#define Clock_driver_support_initialize_hardware() \
     101  do { \
     102    LEON3_Timer_Regs->timer[LEON3_CLOCK_INDEX].reload = \
     103      40 * (rtems_configuration_get_microseconds_per_tick() - 1); \
     104    \
     105    LEON3_Timer_Regs->timer[LEON3_CLOCK_INDEX].ctrl = \
     106      LEON3_GPTIMER_EN | LEON3_GPTIMER_RL | \
     107        LEON3_GPTIMER_LD | LEON3_GPTIMER_IRQEN; \
     108  } while (0)
     109#endif
    89110
    90111#define Clock_driver_support_shutdown_hardware() \
     
    102123    return 0;
    103124
     125#ifndef LEON3_QEMU
    104126  clicks = LEON3_Timer_Regs->timer[LEON3_CLOCK_INDEX].value;
     127#else
     128  clicks = LEON3_Timer_Regs->timer[LEON3_CLOCK_INDEX].value / 40;
     129#endif
    105130
    106131  if ( LEON_Is_interrupt_pending( clkirq ) ) {
  • c/src/lib/libbsp/sparc/leon3/configure.ac

    r224b888 r7579e25  
    2727better.])
    2828
     29RTEMS_BSPOPTS_SET([SIMSPARC_FAST_IDLE],[*qemu],[1])
    2930RTEMS_BSPOPTS_SET([SIMSPARC_FAST_IDLE],[*],[])
    3031RTEMS_BSPOPTS_HELP([SIMSPARC_FAST_IDLE],
     
    3839 determining the CPU core number in an SMP configuration.])
    3940
     41RTEMS_BSPOPTS_SET([LEON3_QEMU],[*qemu],[1])
     42RTEMS_BSPOPTS_HELP([LEON3_QEMU],
     43[If defined, then use settings for QEMU simulator.])
     44
    4045RTEMS_BSP_CLEANUP_OPTIONS(0, 1)
    4146RTEMS_BSP_LINKCMDS
  • c/src/lib/libbsp/sparc/leon3/console/console.c

    r224b888 r7579e25  
    218218}
    219219
     220#ifndef LEON3_QEMU
    220221/* AMBA PP find routine. Extract AMBA PnP information into data structure. */
    221222static int find_matching_apbuart(struct ambapp_dev *dev, int index, void *arg)
     
    249250                  GAISLER_APBUART, find_matching_apbuart, NULL);
    250251}
     252#else /* LEON3_QEMU */
     253static void leon3_console_scan_uarts(void)
     254{
     255  uarts = 1;
     256
     257  apbuarts[0].regs = (struct apbuart_regs *)0x80000100;
     258#if CONSOLE_USE_INTERRUPTS
     259  apbuarts[0].irq = 3;
     260#endif
     261  apbuarts[0].freq_hz = 40000000;
     262}
     263#endif /* LEON3_QEMU */
    251264
    252265/*
  • 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)
  • c/src/lib/libbsp/sparc/leon3/preinstall.am

    r224b888 r7579e25  
    8282PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.leon3
    8383
     84$(PROJECT_LIB)/linkcmds.leon3_qemu: startup/linkcmds.leon3_qemu $(PROJECT_LIB)/$(dirstamp)
     85        $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.leon3_qemu
     86PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.leon3_qemu
     87
    8488$(PROJECT_LIB)/linkcmds.ngmp: startup/linkcmds.ngmp $(PROJECT_LIB)/$(dirstamp)
    8589        $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.ngmp
Note: See TracChangeset for help on using the changeset viewer.