forked from Imagelibrary/rtems
bsps: Use bsp_start_on_secondary_processor()
Use a standard function for startup on secondary processors.
This commit is contained in:
@@ -59,8 +59,6 @@ int qoriq_if_intercom_attach_detach(
|
|||||||
#define RTEMS_BSP_NETWORK_DRIVER_NAME3 "tsec3"
|
#define RTEMS_BSP_NETWORK_DRIVER_NAME3 "tsec3"
|
||||||
#define RTEMS_BSP_NETWORK_DRIVER_NAME4 "intercom1"
|
#define RTEMS_BSP_NETWORK_DRIVER_NAME4 "intercom1"
|
||||||
|
|
||||||
void qoriq_secondary_cpu_initialize(void);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ _start_core_1:
|
|||||||
LA r2, _SDA2_BASE_
|
LA r2, _SDA2_BASE_
|
||||||
LA r13, _SDA_BASE_
|
LA r13, _SDA_BASE_
|
||||||
|
|
||||||
b qoriq_secondary_cpu_initialize
|
b bsp_start_on_secondary_processor
|
||||||
|
|
||||||
b twiddle
|
b twiddle
|
||||||
#endif /* RTEMS_SMP */
|
#endif /* RTEMS_SMP */
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include <bsp/mmu.h>
|
#include <bsp/mmu.h>
|
||||||
#include <bsp/qoriq.h>
|
#include <bsp/qoriq.h>
|
||||||
#include <bsp/vectors.h>
|
#include <bsp/vectors.h>
|
||||||
|
#include <bsp/bootcard.h>
|
||||||
#include <bsp/irq-generic.h>
|
#include <bsp/irq-generic.h>
|
||||||
#include <bsp/linker-symbols.h>
|
#include <bsp/linker-symbols.h>
|
||||||
|
|
||||||
@@ -107,7 +108,7 @@ static void release_core_1(void)
|
|||||||
mmu_config_undo();
|
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);
|
const Per_CPU_Control *second_cpu = _Per_CPU_Get_by_index(1);
|
||||||
|
|
||||||
|
|||||||
@@ -327,13 +327,6 @@ void apbuart_outbyte_polled(
|
|||||||
*/
|
*/
|
||||||
int apbuart_inbyte_nonblocking(struct apbuart_regs *regs);
|
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);
|
void leon3_cpu_counter_initialize(void);
|
||||||
|
|
||||||
/* GRLIB extended IRQ controller register */
|
/* GRLIB extended IRQ controller register */
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <bsp.h>
|
#include <bsp.h>
|
||||||
|
#include <bsp/bootcard.h>
|
||||||
#include <leon.h>
|
#include <leon.h>
|
||||||
#include <rtems/bspIo.h>
|
#include <rtems/bspIo.h>
|
||||||
#include <rtems/score/smpimpl.h>
|
#include <rtems/score/smpimpl.h>
|
||||||
@@ -33,11 +34,13 @@ static rtems_isr bsp_inter_processor_interrupt(
|
|||||||
_SMP_Inter_processor_interrupt_handler();
|
_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);
|
leon3_set_cache_control_register(0x80000F);
|
||||||
/* Unmask IPI interrupts at Interrupt controller for this CPU */
|
/* 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();
|
_SMP_Start_multitasking_on_secondary_processor();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ SYM(hard_reset):
|
|||||||
andn %sp, 0x0f, %sp ! align stack on 16-byte boundary
|
andn %sp, 0x0f, %sp ! align stack on 16-byte boundary
|
||||||
mov %sp, %fp ! set frame pointer
|
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
|
sub %sp, CPU_MINIMUM_STACK_FRAME_SIZE, %sp
|
||||||
ba SYM(bsp_reset) ! just in case
|
ba SYM(bsp_reset) ! just in case
|
||||||
nop
|
nop
|
||||||
|
|||||||
@@ -20,6 +20,8 @@
|
|||||||
#include <rtems/test.h>
|
#include <rtems/test.h>
|
||||||
#include <rtems/score/smpimpl.h>
|
#include <rtems/score/smpimpl.h>
|
||||||
|
|
||||||
|
#include <bsp/bootcard.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
@@ -30,21 +32,10 @@ const char rtems_test_name[] = "SMPFATAL 8";
|
|||||||
* without BSP support.
|
* without BSP support.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(__PPC__)
|
void bsp_start_on_secondary_processor(void)
|
||||||
void qoriq_secondary_cpu_initialize(void)
|
|
||||||
{
|
{
|
||||||
/* Provided to avoid multiple definitions of the CPU SMP support functions */
|
/* 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)
|
uint32_t _CPU_SMP_Initialize(void)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user