diff options
Diffstat (limited to 'bsps/sparc/leon3/start/bspsmp.c')
-rw-r--r-- | bsps/sparc/leon3/start/bspsmp.c | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/bsps/sparc/leon3/start/bspsmp.c b/bsps/sparc/leon3/start/bspsmp.c index 1c72027ebf..8c7c88da63 100644 --- a/bsps/sparc/leon3/start/bspsmp.c +++ b/bsps/sparc/leon3/start/bspsmp.c @@ -1,6 +1,6 @@ /** * @file - * @ingroup sparc_leon3 + * @ingroup RTEMSBSPsSPARCLEON3 * @brief LEON3 SMP BSP Support */ @@ -17,7 +17,7 @@ #include <bsp/bootcard.h> #include <bsp/fatal.h> #include <bsp/irq.h> -#include <leon.h> +#include <bsp/leon3.h> #include <rtems/bspIo.h> #include <rtems/sysinit.h> #include <rtems/score/assert.h> @@ -39,18 +39,20 @@ static void bsp_inter_processor_interrupt( void *arg ) void bsp_start_on_secondary_processor(Per_CPU_Control *cpu_self) { - /* - * If data cache snooping is not enabled we terminate using BSP_fatal_exit() - * instead of bsp_fatal(). This is done since the latter function tries to - * acquire a ticket lock, an operation which requires data cache snooping to - * be enabled. - */ - if ( !leon3_data_cache_snooping_enabled() ) - BSP_fatal_exit( LEON3_FATAL_INVALID_CACHE_CONFIG_SECONDARY_PROCESSOR ); + if ( !leon3_data_cache_snooping_enabled() ) { + bsp_fatal( LEON3_FATAL_INVALID_CACHE_CONFIG_SECONDARY_PROCESSOR ); + } _SMP_Start_multitasking_on_secondary_processor(cpu_self); } +static rtems_interrupt_entry leon3_inter_processor_interrupt_entry = + RTEMS_INTERRUPT_ENTRY_INITIALIZER( + bsp_inter_processor_interrupt, + NULL, + "IPI" + ); + static void leon3_install_inter_processor_interrupt( void ) { rtems_status_code sc; @@ -60,12 +62,10 @@ static void leon3_install_inter_processor_interrupt( void ) bsp_interrupt_set_affinity( irq, _SMP_Get_online_processors() ); - sc = rtems_interrupt_handler_install( + sc = rtems_interrupt_entry_install( irq, - "IPI", RTEMS_INTERRUPT_SHARED, - bsp_inter_processor_interrupt, - NULL + &leon3_inter_processor_interrupt_entry ); _Assert_Unused_variable_equals( sc, RTEMS_SUCCESSFUL ); } @@ -73,7 +73,7 @@ static void leon3_install_inter_processor_interrupt( void ) uint32_t _CPU_SMP_Initialize( void ) { if ( !leon3_data_cache_snooping_enabled() ) - bsp_fatal( LEON3_FATAL_INVALID_CACHE_CONFIG_MAIN_PROCESSOR ); + bsp_fatal( LEON3_FATAL_INVALID_CACHE_CONFIG_BOOT_PROCESSOR ); return leon3_get_cpu_count(LEON3_IrqCtrl_Regs); } @@ -84,7 +84,10 @@ bool _CPU_SMP_Start_processor( uint32_t cpu_index ) printk( "Waking CPU %d\n", cpu_index ); #endif - LEON3_IrqCtrl_Regs->mpstat = 1U << cpu_index; + grlib_store_32( + &LEON3_IrqCtrl_Regs->mpstat, + IRQAMP_MPSTAT_STATUS(1U << cpu_index) + ); return true; } @@ -100,13 +103,16 @@ void _CPU_SMP_Finalize_initialization( uint32_t cpu_count ) void _CPU_SMP_Prepare_start_multitasking( void ) { - rtems_cache_invalidate_entire_instruction(); + /* Do nothing */ } 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; + grlib_store_32( + &LEON3_IrqCtrl_Regs->piforce[target_processor_index], + 1U << LEON3_mp_irq + ); } #if defined(RTEMS_DRVMGR_STARTUP) |