summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-05-12 09:23:51 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-05-12 09:23:51 +0200
commit6c5c2f39d05543c2d30e8fc44e93dd961c68e43d (patch)
tree00f605882ef2e8290dee8e9a993eefd213c48a50
parentbsps: Use standard file name for BSP support (diff)
downloadrtems-6c5c2f39d05543c2d30e8fc44e93dd961c68e43d.tar.bz2
bsps: Use bsp_start_on_secondary_processor()
Use a standard function for startup on secondary processors.
-rw-r--r--c/src/lib/libbsp/powerpc/qoriq/include/bsp.h2
-rw-r--r--c/src/lib/libbsp/powerpc/qoriq/start/start.S2
-rw-r--r--c/src/lib/libbsp/powerpc/qoriq/startup/bspsmp.c3
-rw-r--r--c/src/lib/libbsp/sparc/leon3/include/leon.h7
-rw-r--r--c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c7
-rw-r--r--c/src/lib/libbsp/sparc/shared/start/start.S2
-rw-r--r--testsuites/smptests/smpfatal08/init.c15
7 files changed, 12 insertions, 26 deletions
diff --git a/c/src/lib/libbsp/powerpc/qoriq/include/bsp.h b/c/src/lib/libbsp/powerpc/qoriq/include/bsp.h
index 6d4f83dbb6..a4be2e29b2 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/include/bsp.h
+++ b/c/src/lib/libbsp/powerpc/qoriq/include/bsp.h
@@ -59,8 +59,6 @@ int qoriq_if_intercom_attach_detach(
#define RTEMS_BSP_NETWORK_DRIVER_NAME3 "tsec3"
#define RTEMS_BSP_NETWORK_DRIVER_NAME4 "intercom1"
-void qoriq_secondary_cpu_initialize(void);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/c/src/lib/libbsp/powerpc/qoriq/start/start.S b/c/src/lib/libbsp/powerpc/qoriq/start/start.S
index 6a671271dd..9ef1c07b9e 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/start/start.S
+++ b/c/src/lib/libbsp/powerpc/qoriq/start/start.S
@@ -208,7 +208,7 @@ _start_core_1:
LA r2, _SDA2_BASE_
LA r13, _SDA_BASE_
- b qoriq_secondary_cpu_initialize
+ b bsp_start_on_secondary_processor
b twiddle
#endif /* RTEMS_SMP */
diff --git a/c/src/lib/libbsp/powerpc/qoriq/startup/bspsmp.c b/c/src/lib/libbsp/powerpc/qoriq/startup/bspsmp.c
index 5b4c12a2db..5e2646d0f5 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/startup/bspsmp.c
+++ b/c/src/lib/libbsp/powerpc/qoriq/startup/bspsmp.c
@@ -22,6 +22,7 @@
#include <bsp/mmu.h>
#include <bsp/qoriq.h>
#include <bsp/vectors.h>
+#include <bsp/bootcard.h>
#include <bsp/irq-generic.h>
#include <bsp/linker-symbols.h>
@@ -107,7 +108,7 @@ static void release_core_1(void)
mmu_config_undo();
}
-void qoriq_secondary_cpu_initialize(void)
+void bsp_start_on_secondary_processor(void)
{
const Per_CPU_Control *second_cpu = _Per_CPU_Get_by_index(1);
diff --git a/c/src/lib/libbsp/sparc/leon3/include/leon.h b/c/src/lib/libbsp/sparc/leon3/include/leon.h
index 3ca33a3f3a..bda28f2bd1 100644
--- a/c/src/lib/libbsp/sparc/leon3/include/leon.h
+++ b/c/src/lib/libbsp/sparc/leon3/include/leon.h
@@ -327,13 +327,6 @@ void apbuart_outbyte_polled(
*/
int apbuart_inbyte_nonblocking(struct apbuart_regs *regs);
-/**
- * @brief Initializes a secondary processor.
- *
- * @param[in] cpu The processor executing this function.
- */
-void leon3_secondary_cpu_initialize(uint32_t cpu);
-
void leon3_cpu_counter_initialize(void);
/* GRLIB extended IRQ controller register */
diff --git a/c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c b/c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c
index bb5313201c..6eec341f93 100644
--- a/c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c
+++ b/c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c
@@ -14,6 +14,7 @@
*/
#include <bsp.h>
+#include <bsp/bootcard.h>
#include <leon.h>
#include <rtems/bspIo.h>
#include <rtems/score/smpimpl.h>
@@ -33,11 +34,13 @@ static rtems_isr bsp_inter_processor_interrupt(
_SMP_Inter_processor_interrupt_handler();
}
-void leon3_secondary_cpu_initialize(uint32_t cpu_index)
+void bsp_start_on_secondary_processor()
{
+ uint32_t cpu_index_self = _CPU_SMP_Get_current_processor();
+
leon3_set_cache_control_register(0x80000F);
/* Unmask IPI interrupts at Interrupt controller for this CPU */
- LEON3_IrqCtrl_Regs->mask[cpu_index] |= 1U << LEON3_MP_IRQ;
+ LEON3_IrqCtrl_Regs->mask[cpu_index_self] |= 1U << LEON3_MP_IRQ;
_SMP_Start_multitasking_on_secondary_processor();
}
diff --git a/c/src/lib/libbsp/sparc/shared/start/start.S b/c/src/lib/libbsp/sparc/shared/start/start.S
index ccf789ea9c..26da7b49b8 100644
--- a/c/src/lib/libbsp/sparc/shared/start/start.S
+++ b/c/src/lib/libbsp/sparc/shared/start/start.S
@@ -241,7 +241,7 @@ SYM(hard_reset):
andn %sp, 0x0f, %sp ! align stack on 16-byte boundary
mov %sp, %fp ! set frame pointer
- call SYM(leon3_secondary_cpu_initialize) ! does not return
+ call SYM(bsp_start_on_secondary_processor) ! does not return
sub %sp, CPU_MINIMUM_STACK_FRAME_SIZE, %sp
ba SYM(bsp_reset) ! just in case
nop
diff --git a/testsuites/smptests/smpfatal08/init.c b/testsuites/smptests/smpfatal08/init.c
index 59fe4a6543..b005443b72 100644
--- a/testsuites/smptests/smpfatal08/init.c
+++ b/testsuites/smptests/smpfatal08/init.c
@@ -20,6 +20,8 @@
#include <rtems/test.h>
#include <rtems/score/smpimpl.h>
+#include <bsp/bootcard.h>
+
#include <assert.h>
#include <stdlib.h>
@@ -30,21 +32,10 @@ const char rtems_test_name[] = "SMPFATAL 8";
* without BSP support.
*/
-#if defined(__PPC__)
-void qoriq_secondary_cpu_initialize(void)
+void bsp_start_on_secondary_processor(void)
{
/* Provided to avoid multiple definitions of the CPU SMP support functions */
}
-#endif
-
-#if defined(__sparc__)
-void leon3_secondary_cpu_initialize(uint32_t cpu_index)
-{
- (void) cpu_index;
-
- /* Provided to avoid multiple definitions of the CPU SMP support functions */
-}
-#endif
uint32_t _CPU_SMP_Initialize(void)
{