diff options
| author | zhouji <[email protected]> | 2021-05-01 16:06:02 +0800 |
|---|---|---|
| committer | zhouji <[email protected]> | 2021-05-14 15:30:31 +0800 |
| commit | 42ce237dc969fa3e6c5f891e87e925f42d5d38ea (patch) | |
| tree | d2858fec8440b7844e5c567d5344612798ff6715 /bsp/qemu-vexpress-a9 | |
| parent | 484cda4d928592bb575f2914dceb84caf4c09d4e (diff) | |
[update] 整理cortex-a aarch32启动代码
1. 去除start_gcc.s中set_secondary_cpu_boot_address代码,这部分提取到qemu-vexpress-a9 bsp中。
2. 移动cpu.c中rt_hw_cpu_id函数到cp15_gcc.s,使用汇编实现,采用wake属性,方便bsp根据cpu特性获取CPU ID(多cpu集群中,不同厂家使用组合不一样).
3. 整理start_gcc.s 适应多核启动,原来的代码只考虑到双核的情况。
Diffstat (limited to 'bsp/qemu-vexpress-a9')
| -rw-r--r-- | bsp/qemu-vexpress-a9/drivers/secondary_cpu.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bsp/qemu-vexpress-a9/drivers/secondary_cpu.c b/bsp/qemu-vexpress-a9/drivers/secondary_cpu.c index 3b0428859f..c0fcb30aa4 100644 --- a/bsp/qemu-vexpress-a9/drivers/secondary_cpu.c +++ b/bsp/qemu-vexpress-a9/drivers/secondary_cpu.c @@ -26,10 +26,16 @@ static void rt_hw_timer2_isr(int vector, void *param) timer_clear_pending(0); } -void rt_hw_secondary_cpu_up(void) +void set_secondary_cpu_boot_address(void) { - extern void set_secondary_cpu_boot_address(void); + extern void secondary_cpu_start(void); + uint32_t *boot_address = (uint32_t *)0x10000030; + *(boot_address + 1) = ~0ul; + *boot_address = (uint32_t )&secondary_cpu_start; +} +void rt_hw_secondary_cpu_up(void) +{ set_secondary_cpu_boot_address(); __asm__ volatile ("dsb":::"memory"); rt_hw_ipi_send(0, 1 << 1); |
