source: rtems/c/src/lib/libbsp/sparc/leon2/startup/bsppredriver.c @ 47190194

5
Last change on this file since 47190194 was 47190194, checked in by Sebastian Huber <sebastian.huber@…>, on 01/26/16 at 06:16:52

drvmgr: Remove dupl bsp_driver_level_hook() decl

  • Property mode set to 100644
File size: 2.5 KB
Line 
1/**
2 * @file
3 * @ingroup sparc_leon2
4 * @brief Installs BSP pre-driver hook
5 */
6
7/*  Installs the BSP pre-driver hook
8 *
9 *  COPYRIGHT (c) 2011
10 *  Aeroflex Gaisler
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.org/license/LICENSE.
15 */
16
17#include <bsp.h>
18#include <bsp/bootcard.h>
19
20/* If RTEMS_DRVMGR_STARTUP is defined extra code is added that
21 * registers the LEON2 AMBA bus driver as root driver into the
22 * driver manager.
23 *
24 * The structues here are declared weak so that the user can override
25 * the configuration and add custom cores in the RTEMS project.
26 */
27#ifdef RTEMS_DRVMGR_STARTUP
28#include <drvmgr/drvmgr.h>
29#include <drvmgr/leon2_amba_bus.h>
30
31/* All drivers included by BSP, this is overridden by the user by including
32 * the devmgr_confdefs.h. No specifc drivers needed by BSP since IRQ/TIMER/UART
33 * is not drvmgr drivers.
34 */
35drvmgr_drv_reg_func drvmgr_drivers[] __attribute__((weak)) =
36{
37  NULL /* End array with NULL */
38};
39
40/* Defines what cores are avilable on the bus in addition to the standard
41 * LEON2 peripherals.
42 */
43struct leon2_core leon2_amba_custom_cores[] __attribute__((weak)) =
44{
45  EMPTY_LEON2_CORE
46};
47
48/* Configure LEON2 Root bus driver */
49struct leon2_bus leon2_bus_config __attribute__((weak)) =
50{
51  &leon2_std_cores[0], /* The standard cores, defined by driver */
52  &leon2_amba_custom_cores[0],   /* custom cores, defined by us */
53  DRVMGR_TRANSLATE_ONE2ONE,
54  DRVMGR_TRANSLATE_ONE2ONE,
55};
56
57/* Driver resources on LEON2 AMBA bus. Used to set options for particular
58 * LEON2 cores, it is up to the driver to look at the configuration paramters
59 * once started.
60 */
61struct drvmgr_bus_res leon2_amba_res __attribute__((weak)) =
62{
63  .next = NULL,
64  .resource = {
65    DRVMGR_RES_EMPTY
66  },
67};
68
69/*
70 *  bsp_driver_level_hook
71 *
72 *  BSP driver level hook. Called just after drivers have reached initialization
73 *  level 'level' (1,2,3,4). See exinit.c for meaning of the every level.
74 */
75void bsp_driver_level_hook( int level )
76{
77}
78
79#endif
80
81/*
82 *  bsp_predriver_hook
83 *
84 *  BSP predriver hook. Called just before drivers are initialized.
85 *  Is used to initialize shared interrupt handling.
86 */
87void bsp_predriver_hook( void )
88{
89  bsp_spurious_initialize();
90
91  /* Initialize shared interrupt handling, must be done after IRQ
92   * controller has been found and initialized.
93   */
94  BSP_shared_interrupt_init();
95
96#ifdef RTEMS_DRVMGR_STARTUP
97  leon2_root_register(&leon2_bus_config, &leon2_amba_res);
98#endif
99}
Note: See TracBrowser for help on using the repository browser.