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

4.115
Last change on this file since 291c5391 was 291c5391, checked in by Daniel Hellstrom <daniel@…>, on 04/13/15 at 11:12:33

DRVMGR: remove struct driver registration func

  • Property mode set to 100644
File size: 2.4 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/leon2_amba_bus.h>
29
30/* All drivers included by BSP, this is overridden by the user by including
31 * the devmgr_confdefs.h. No specifc drivers needed by BSP since IRQ/TIMER/UART
32 * is not drvmgr drivers.
33 */
34drvmgr_drv_reg_func drvmgr_drivers[] __attribute__((weak)) =
35{
36  NULL /* End array with NULL */
37};
38
39/* Defines what cores are avilable on the bus in addition to the standard
40 * LEON2 peripherals.
41 */
42struct leon2_core leon2_amba_custom_cores[] __attribute__((weak)) =
43{
44  EMPTY_LEON2_CORE
45};
46
47/* Configure LEON2 Root bus driver */
48struct leon2_bus leon2_bus_config __attribute__((weak)) =
49{
50  &leon2_std_cores[0], /* The standard cores, defined by driver */
51  &leon2_amba_custom_cores[0],   /* custom cores, defined by us */
52  DRVMGR_TRANSLATE_ONE2ONE,
53  DRVMGR_TRANSLATE_ONE2ONE,
54};
55
56/* Driver resources on LEON2 AMBA bus. Used to set options for particular
57 * LEON2 cores, it is up to the driver to look at the configuration paramters
58 * once started.
59 */
60struct drvmgr_bus_res leon2_amba_res __attribute__((weak)) =
61{
62  .next = NULL,
63  .resource = {
64    DRVMGR_RES_EMPTY
65  },
66};
67
68/*
69 *  bsp_driver_level_hook
70 *
71 *  BSP driver level hook. Called just after drivers have reached initialization
72 *  level 'level' (1,2,3,4). See exinit.c for meaning of the every level.
73 */
74void bsp_driver_level_hook( int level )
75{
76}
77
78#endif
79
80/*
81 *  bsp_predriver_hook
82 *
83 *  BSP predriver hook. Called just before drivers are initialized.
84 *  Is used to initialize shared interrupt handling.
85 */
86void bsp_predriver_hook( void )
87{
88  /* Initialize shared interrupt handling, must be done after IRQ
89   * controller has been found and initialized.
90   */
91  BSP_shared_interrupt_init();
92
93#ifdef RTEMS_DRVMGR_STARTUP
94  leon2_root_register(&leon2_bus_config, &leon2_amba_res);
95#endif
96}
Note: See TracBrowser for help on using the repository browser.