summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c
diff options
context:
space:
mode:
authorDaniel Cederman <cederman@gaisler.com>2014-09-10 13:39:53 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-10-23 10:21:41 +0200
commit77a2226a166400d7e641eb38d126a4a014923ab4 (patch)
treee1129a4f89e229d79c9607501026010663735686 /c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c
parentdosfs: Write meta-data only if it changed (diff)
downloadrtems-77a2226a166400d7e641eb38d126a4a014923ab4.tar.bz2
bsp/sparc: Ensure that data cache snooping is enabled
Check that data cache snooping exists and is enabled on all cores.
Diffstat (limited to 'c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c')
-rw-r--r--c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c b/c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c
index 45ac92be0b..42bc15da12 100644
--- a/c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c
+++ b/c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c
@@ -15,6 +15,7 @@
#include <bsp.h>
#include <bsp/bootcard.h>
+#include <bsp/fatal.h>
#include <cache_.h>
#include <leon.h>
#include <rtems/bspIo.h>
@@ -44,7 +45,15 @@ void bsp_start_on_secondary_processor()
{
uint32_t cpu_index_self = _CPU_SMP_Get_current_processor();
- leon3_set_cache_control_register(0x80000F);
+ /*
+ * 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 );
+
/* Unmask IPI interrupts at Interrupt controller for this CPU */
LEON3_IrqCtrl_Regs->mask[cpu_index_self] |= 1U << LEON3_mp_irq;
@@ -53,7 +62,8 @@ void bsp_start_on_secondary_processor()
uint32_t _CPU_SMP_Initialize( void )
{
- leon3_set_cache_control_register(0x80000F);
+ if ( !leon3_data_cache_snooping_enabled() )
+ bsp_fatal( LEON3_FATAL_INVALID_CACHE_CONFIG_MAIN_PROCESSOR );
if ( rtems_configuration_get_maximum_processors() > 1 ) {
LEON_Unmask_interrupt(LEON3_mp_irq);