summaryrefslogtreecommitdiffstats
path: root/bsps/sparc/leon3/start
diff options
context:
space:
mode:
Diffstat (limited to 'bsps/sparc/leon3/start')
-rw-r--r--bsps/sparc/leon3/start/bspsmp.c24
-rw-r--r--bsps/sparc/leon3/start/bspstart.c34
2 files changed, 27 insertions, 31 deletions
diff --git a/bsps/sparc/leon3/start/bspsmp.c b/bsps/sparc/leon3/start/bspsmp.c
index c73c3fd5d0..f2749bfa06 100644
--- a/bsps/sparc/leon3/start/bspsmp.c
+++ b/bsps/sparc/leon3/start/bspsmp.c
@@ -18,6 +18,7 @@
#include <bsp/fatal.h>
#include <leon.h>
#include <rtems/bspIo.h>
+#include <rtems/sysinit.h>
#include <rtems/score/assert.h>
#include <rtems/score/smpimpl.h>
#include <stdlib.h>
@@ -55,13 +56,10 @@ void bsp_start_on_secondary_processor(Per_CPU_Control *cpu_self)
_SMP_Start_multitasking_on_secondary_processor(cpu_self);
}
-uint32_t _CPU_SMP_Initialize( void )
+static void leon3_install_inter_processor_interrupt( void )
{
rtems_status_code sc;
- if ( !leon3_data_cache_snooping_enabled() )
- bsp_fatal( LEON3_FATAL_INVALID_CACHE_CONFIG_MAIN_PROCESSOR );
-
sc = rtems_interrupt_handler_install(
LEON3_mp_irq,
"IPI",
@@ -70,6 +68,16 @@ uint32_t _CPU_SMP_Initialize( void )
NULL
);
_Assert_Unused_variable_equals( sc, RTEMS_SUCCESSFUL );
+}
+
+uint32_t _CPU_SMP_Initialize( void )
+{
+ if ( !leon3_data_cache_snooping_enabled() )
+ bsp_fatal( LEON3_FATAL_INVALID_CACHE_CONFIG_MAIN_PROCESSOR );
+
+#if !defined(RTEMS_DRVMGR_STARTUP)
+ leon3_install_inter_processor_interrupt();
+#endif
return leon3_get_cpu_count(LEON3_IrqCtrl_Regs);
}
@@ -102,3 +110,11 @@ void _CPU_SMP_Send_interrupt(uint32_t target_processor_index)
/* send interrupt to destination CPU */
LEON3_IrqCtrl_Regs->force[target_processor_index] = 1 << LEON3_mp_irq;
}
+
+#if defined(RTEMS_DRVMGR_STARTUP)
+RTEMS_SYSINIT_ITEM(
+ leon3_install_inter_processor_interrupt,
+ RTEMS_SYSINIT_DRVMGR_LEVEL_1,
+ RTEMS_SYSINIT_ORDER_LAST_BUT_4
+);
+#endif
diff --git a/bsps/sparc/leon3/start/bspstart.c b/bsps/sparc/leon3/start/bspstart.c
index 69ff519189..75042e4c20 100644
--- a/bsps/sparc/leon3/start/bspstart.c
+++ b/bsps/sparc/leon3/start/bspstart.c
@@ -20,6 +20,7 @@
*/
#include <bsp.h>
+#include <bsp/irq-generic.h>
#include <leon.h>
#include <bsp/bootcard.h>
#include <rtems/sysinit.h>
@@ -66,6 +67,10 @@ static inline int set_snooping(void)
void bsp_start( void )
{
CPU_SPARC_HAS_SNOOPING = set_snooping();
+
+#ifndef RTEMS_DRVMGR_STARTUP
+ bsp_interrupt_initialize();
+#endif
}
static void leon3_cpu_index_init(void)
@@ -84,38 +89,13 @@ RTEMS_SYSINIT_ITEM(
RTEMS_SYSINIT_ORDER_FIRST
);
-static void leon3_interrupt_common_init( void )
-{
- /* Initialize shared interrupt handling, must be done after IRQ
- * controller has been found and initialized.
- */
- BSP_shared_interrupt_init();
-}
-
-/*
- * Called just before drivers are initialized. Is used to initialize shared
- * interrupt handling.
- */
-static void leon3_pre_driver_hook( void )
-{
-#ifndef RTEMS_DRVMGR_STARTUP
- leon3_interrupt_common_init();
-#endif
-}
-
-RTEMS_SYSINIT_ITEM(
- leon3_pre_driver_hook,
- RTEMS_SYSINIT_BSP_PRE_DRIVERS,
- RTEMS_SYSINIT_ORDER_MIDDLE
-);
-
-#ifdef RTEMS_DRVMGR_STARTUP
/*
* Initialize shared interrupt handling, must be done after IRQ controller has
* been found and initialized.
*/
+#ifdef RTEMS_DRVMGR_STARTUP
RTEMS_SYSINIT_ITEM(
- leon3_interrupt_common_init,
+ bsp_interrupt_initialize,
RTEMS_SYSINIT_DRVMGR_LEVEL_1,
RTEMS_SYSINIT_ORDER_LAST_BUT_5
);