Changeset e428dc4a in rtems


Ignore:
Timestamp:
Dec 12, 2011, 2:50:57 PM (7 years ago)
Author:
Daniel Hellstrom <daniel@…>
Branches:
4.11, master
Children:
d11f228
Parents:
219d4045
git-author:
Daniel Hellstrom <daniel@…> (12/12/11 14:50:57)
git-committer:
Daniel Hellstrom <daniel@…> (04/16/15 23:10:16)
Message:

LEON3: implemented BSP DRVMGR startup initialization

Location:
c/src/lib/libbsp/sparc/leon3
Files:
4 edited

Legend:

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

    r219d4045 re428dc4a  
    2626 */
    2727struct ambapp_bus ambapp_plb;
     28
     29/* If RTEMS_DRVMGR_STARTUP is defined extra code is added that
     30 * registers the GRLIB AMBA PnP bus driver as root driver.
     31 */
     32#ifdef RTEMS_DRVMGR_STARTUP
     33#include <drvmgr/drvmgr.h>
     34#include <drvmgr/ambapp_bus_grlib.h>
     35
     36extern void gptimer_register_drv (void);
     37extern void apbuart_cons_register_drv(void);
     38/* All drivers included by BSP, this is overridden by the user by including
     39 * the drvmgr_confdefs.h. By default the Timer and UART driver are included.
     40 */
     41struct drvmgr_drv_reg_func drvmgr_drivers[] __attribute__((weak)) =
     42{
     43  {gptimer_register_drv},
     44  {apbuart_cons_register_drv},
     45  {NULL} /* End array with NULL */
     46};
     47
     48/* Driver resources configuration for AMBA root bus. It is declared weak
     49 * so that the user may override it, if the defualt settings are not
     50 * enough.
     51 */
     52struct drvmgr_bus_res grlib_drv_resources __attribute__((weak)) =
     53{
     54  .next = NULL,
     55  .resource =
     56  {
     57    RES_EMPTY,
     58  }
     59};
     60
     61/* GRLIB AMBA bus configuration (the LEON3 root bus configuration) */
     62struct grlib_config grlib_bus_config =
     63{
     64  &ambapp_plb,              /* AMBAPP bus setup */
     65  &grlib_drv_resources,     /* Driver configuration */
     66};
     67#endif
    2868
    2969rtems_interrupt_lock LEON3_IrqCtrl_Lock =
     
    88128  leon3_ext_irq_init();
    89129
     130  /* If we are running without Driver Manager at startup, we must still
     131   * assure that Timer and Console UART is working. So we can not
     132   * depend on the DrvMgr capable Timer and Console UART drivers,
     133   * instead we use the small-footprint drivers.
     134   */
     135#ifndef RTEMS_DRVMGR_STARTUP
    90136  /* find GP Timer */
    91137  adev = (void *)ambapp_for_each(&ambapp_plb, (OPTIONS_ALL|OPTIONS_APB_SLVS),
     
    111157      LEON3_Timer_Regs->scaler_reload = leon3_timer_prescaler;
    112158  }
     159#else
     160  /* Register Root bus, Use GRLIB AMBA PnP bus as root bus for LEON3 */
     161  ambapp_grlib_root_register(&grlib_bus_config);
     162#endif
    113163}
  • c/src/lib/libbsp/sparc/leon3/clock/ckinit.c

    r219d4045 re428dc4a  
    2525#include <ambapp.h>
    2626#include <rtems/score/profiling.h>
     27
     28/* The LEON3 BSP Timer driver can rely on the Driver Manager if the
     29 * DrvMgr is initialized during startup. Otherwise the classic driver
     30 * must be used.
     31 *
     32 * The DrvMgr Clock driver is located in the shared/timer directory
     33 */
     34#ifndef RTEMS_DRVMGR_STARTUP
    2735
    2836#if SIMSPARC_FAST_IDLE==1
     
    157165
    158166#include "../../../shared/clockdrv_shell.h"
     167
     168#endif
  • c/src/lib/libbsp/sparc/leon3/console/console.c

    r219d4045 re428dc4a  
    3030#include <bsp/fatal.h>
    3131#include <apbuart_termios.h>
     32
     33/* The LEON3 BSP UART driver can rely on the Driver Manager if the
     34 * DrvMgr is initialized during startup. Otherwise the classic driver
     35 * must be used.
     36 *
     37 * The DrvMgr APBUART driver is located in the shared/uart directory
     38 */
     39#ifndef RTEMS_DRVMGR_STARTUP
    3240
    3341int syscon_uart_index __attribute__((weak)) = 0;
     
    158166  return RTEMS_SUCCESSFUL;
    159167}
     168
     169#endif
  • c/src/lib/libbsp/sparc/leon3/startup/bsppredriver.c

    r219d4045 re428dc4a  
    1717#include <bsp/bootcard.h>
    1818
     19static void leon3_interrupt_common_init( void )
     20{
     21  /* Initialize shared interrupt handling, must be done after IRQ
     22   * controller has been found and initialized.
     23   */
     24  BSP_shared_interrupt_init();
     25}
     26
    1927/*
    2028 *  bsp_predriver_hook
     
    2533void bsp_predriver_hook( void )
    2634{
     35#ifndef RTEMS_DRVMGR_STARTUP
     36  leon3_interrupt_common_init();
     37#endif
     38}
     39
     40#ifdef RTEMS_DRVMGR_STARTUP
     41/*
     42 *  bsp_driver_level_hook
     43 *
     44 *  BSP driver level hook. Called just after drivers have reached initialization
     45 *  level 'level' (1,2,3,4). See exinit.c for meaning of the every level.
     46 *
     47 *  Initializes the BSP Interrupt layer
     48 *  After Level 1 we can trust that interrupt controller and system
     49 *  clock timer drivers now have been initialized.
     50 */
     51void bsp_driver_level_hook( int level )
     52{
    2753  /* Initialize shared interrupt handling, must be done after IRQ
    2854   * controller has been found and initialized.
    2955   */
    30   BSP_shared_interrupt_init();
     56  if (level != 1)
     57        return;
     58
     59  leon3_interrupt_common_init();
    3160}
     61#endif
Note: See TracChangeset for help on using the changeset viewer.