[rtems commit] bsp/leon3: Use sysinit for amba_initialize()

Sebastian Huber sebh at rtems.org
Mon Jun 20 06:21:10 UTC 2016


Module:    rtems
Branch:    master
Commit:    a4fa007be94a44ac363a6f177fb6b2f451b3e849
Changeset: http://git.rtems.org/rtems/commit/?id=a4fa007be94a44ac363a6f177fb6b2f451b3e849

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Jun 20 08:03:18 2016 +0200

bsp/leon3: Use sysinit for amba_initialize()

---

 c/src/lib/libbsp/sparc/leon3/amba/amba.c        | 9 ++++++++-
 c/src/lib/libbsp/sparc/leon3/include/amba.h     | 2 --
 c/src/lib/libbsp/sparc/leon3/startup/bspstart.c | 5 -----
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/c/src/lib/libbsp/sparc/leon3/amba/amba.c b/c/src/lib/libbsp/sparc/leon3/amba/amba.c
index 988aeda..f1598b8 100644
--- a/c/src/lib/libbsp/sparc/leon3/amba/amba.c
+++ b/c/src/lib/libbsp/sparc/leon3/amba/amba.c
@@ -15,6 +15,7 @@
 #include <bsp/fatal.h>
 #include <leon.h>
 #include <ambapp.h>
+#include <rtems/sysinit.h>
 
 unsigned int leon3_timer_prescaler __attribute__((weak)) = 0;
 int leon3_timer_core_index __attribute__((weak)) = 0;
@@ -85,7 +86,7 @@ struct ambapp_dev *LEON3_Timer_Adev;
  *  amba_ahb_masters, amba_ahb_slaves and amba.
  */
 
-void amba_initialize(void)
+static void amba_initialize(void)
 {
   int icsel;
   struct ambapp_dev *adev;
@@ -157,3 +158,9 @@ void amba_initialize(void)
   ambapp_grlib_root_register(&grlib_bus_config);
 #endif
 }
+
+RTEMS_SYSINIT_ITEM(
+  amba_initialize,
+  RTEMS_SYSINIT_BSP_START,
+  RTEMS_SYSINIT_ORDER_FIRST
+);
diff --git a/c/src/lib/libbsp/sparc/leon3/include/amba.h b/c/src/lib/libbsp/sparc/leon3/include/amba.h
index 2bbc333..059b28c 100644
--- a/c/src/lib/libbsp/sparc/leon3/include/amba.h
+++ b/c/src/lib/libbsp/sparc/leon3/include/amba.h
@@ -41,8 +41,6 @@ extern "C" {
 /* The AMBA Plug&Play info of the bus that the LEON3 sits on */
 extern struct ambapp_bus ambapp_plb;
 
-void amba_initialize(void);
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c b/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c
index ca4f38f..a49afd2 100644
--- a/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c
+++ b/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c
@@ -66,11 +66,6 @@ void bsp_start( void )
    */
   LEON3_Cpu_Index = _LEON3_Get_current_processor();
 
-  /* Scan AMBA Plug&Play and parse it into a RAM description (ambapp_plb),
-   * find GPTIMER for bus frequency, find IRQ Controller and initialize
-   * interrupt support
-   */
-  amba_initialize();
   leon3_cpu_counter_initialize();
 
   /* find debug UART for printk() */




More information about the vc mailing list