Skip to content

[libcpu][aarch64] Fixed the rt_hw_secondary_cpu_bsp_start() bug #8898

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 0 additions & 46 deletions bsp/qemu-virt64-aarch64/drivers/secondary_cpu.c

This file was deleted.

3 changes: 3 additions & 0 deletions libcpu/aarch64/common/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ if GetDepend('RT_USING_OFW') == False:
if GetDepend('RT_USING_PIC') == True:
SrcRemove(src, ['gicv3.c', 'gic.c', 'gtimer.c', 'interrupt.c'])

if GetDepend('RT_HWTIMER_ARM_ARCH') == True:
SrcRemove(src, ['gtimer.c'])

group = DefineGroup('libcpu', src, depend = [''], CPPPATH = CPPPATH)

# build for sub-directory
Expand Down
19 changes: 17 additions & 2 deletions libcpu/aarch64/common/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include <stdlib.h>
#include <ioremap.h>
#include <rtdevice.h>
#include <gic.h>
#include <gicv3.h>

#define SIZE_KB 1024
#define SIZE_MB (1024 * SIZE_KB)
Expand Down Expand Up @@ -413,10 +415,12 @@ void rt_hw_common_setup(void)

/* initialize uart */
rt_hw_uart_init();
#endif

#ifndef RT_HWTIMER_ARM_ARCH
/* initialize timer for os tick */
rt_hw_gtimer_init();
#endif
#endif /* !RT_HWTIMER_ARM_ARCH */

#ifdef RT_USING_COMPONENTS_INIT
rt_components_board_init();
Expand Down Expand Up @@ -497,9 +501,20 @@ rt_weak void rt_hw_secondary_cpu_bsp_start(void)
#ifdef RT_USING_PIC
rt_pic_irq_init();
#else
rt_hw_interrupt_init();
/* initialize vector table */
rt_hw_vector_init();

arm_gic_cpu_init(0, 0);
#ifdef BSP_USING_GICV3
arm_gic_redist_init(0, 0);
#endif /* BSP_USING_GICV3 */
#endif

#ifndef RT_HWTIMER_ARM_ARCH
/* initialize timer for os tick */
rt_hw_gtimer_local_enable();
#endif /* !RT_HWTIMER_ARM_ARCH */

rt_dm_secondary_cpu_init();

rt_hw_interrupt_umask(RT_SCHEDULE_IPI);
Expand Down
Loading