2022-12-20 17:49:37 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2006-2022, RT-Thread Development Team
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
*/
|
|
|
|
#include <rthw.h>
|
|
|
|
#include <rtthread.h>
|
|
|
|
#include <cpu.h>
|
|
|
|
#include "gic.h"
|
|
|
|
#include "interrupt.h"
|
|
|
|
#include "mmu.h"
|
2023-10-25 20:31:25 +08:00
|
|
|
#include "gtimer.h"
|
2022-12-20 17:49:37 +08:00
|
|
|
|
2024-03-02 16:05:19 +08:00
|
|
|
#ifdef BSP_USING_GICV3
|
|
|
|
#include <gicv3.h>
|
|
|
|
#endif
|
|
|
|
|
2022-12-20 17:49:37 +08:00
|
|
|
#ifdef RT_USING_SMP
|
|
|
|
|
|
|
|
extern unsigned long MMUTable[];
|
|
|
|
|
|
|
|
void rt_hw_secondary_cpu_bsp_start(void)
|
|
|
|
{
|
|
|
|
rt_hw_spin_lock(&_cpus_lock);
|
|
|
|
|
|
|
|
rt_hw_mmu_ktbl_set((unsigned long)MMUTable);
|
|
|
|
|
|
|
|
// interrupt init
|
|
|
|
rt_hw_vector_init();
|
|
|
|
|
|
|
|
arm_gic_cpu_init(0, 0);
|
|
|
|
|
2024-03-02 16:05:19 +08:00
|
|
|
#ifdef BSP_USING_GICV3
|
|
|
|
arm_gic_redist_init(0, 0);
|
|
|
|
#endif /* BSP_USING_GICV3 */
|
|
|
|
|
2022-12-20 17:49:37 +08:00
|
|
|
// local timer init
|
2023-10-25 20:31:25 +08:00
|
|
|
rt_hw_gtimer_init();
|
2022-12-20 17:49:37 +08:00
|
|
|
|
|
|
|
rt_system_scheduler_start();
|
|
|
|
}
|
|
|
|
|
2023-10-25 20:31:25 +08:00
|
|
|
#endif // SMP
|