Ignore:
Timestamp:
Dec 12, 2011, 2:50:57 PM (9 years ago)
Author:
Daniel Hellstrom <daniel@…>
Branches:
4.11, 5, 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

File:
1 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}
Note: See TracChangeset for help on using the changeset viewer.