🎯 [libcpu/arm/cortex-a]修改arm/cortex-a启动方式,解决cortex-a开启SMP工作异常问题 (#8517)

Co-authored-by: wangzongqiang <wangzongqiang1322@phytium.com.cn>
This commit is contained in:
zhangyan
2024-03-02 16:06:07 +08:00
committed by GitHub
parent 53754ff50a
commit 76202e2141
28 changed files with 757 additions and 472 deletions

View File

@@ -8,8 +8,8 @@
#define AUTOMAC0 0x52
#define AUTOMAC1 0x54
#define AUTOMAC2 0x00
#define AUTOMAC3 0x78
#define AUTOMAC4 0xe7
#define AUTOMAC5 0x23
#define AUTOMAC3 0x60
#define AUTOMAC4 0x47
#define AUTOMAC5 0x90
#endif

View File

@@ -62,14 +62,18 @@ rt_region_t init_page_region = {
void rt_hw_board_init(void)
{
#ifdef RT_USING_SMART
rt_uint32_t mmutable_p = 0;
rt_hw_mmu_map_init(&rt_kernel_space, (void*)0xf0000000, 0x10000000, MMUTable, PV_OFFSET);
rt_hw_init_mmu_table(platform_mem_desc,platform_mem_desc_size);
mmutable_p = (rt_uint32_t)MMUTable + (rt_uint32_t)PV_OFFSET ;
rt_hw_mmu_switch((void*)mmutable_p);
rt_page_init(init_page_region);
rt_hw_mmu_ioremap_init(&rt_kernel_space, (void*)0xf0000000, 0x10000000);
arch_kuser_init(&rt_kernel_space, (void*)0xffff0000);
#else
rt_hw_mmu_map_init(&rt_kernel_space, (void*)0x80000000, 0x10000000, MMUTable, 0);
rt_hw_init_mmu_table(platform_mem_desc,platform_mem_desc_size);
rt_hw_mmu_init();
rt_hw_mmu_ioremap_init(&rt_kernel_space, (void*)0x80000000, 0x10000000);
#endif

View File

@@ -49,21 +49,21 @@ void rt_hw_secondary_cpu_up(void)
rt_hw_dsb();
rt_hw_ipi_send(0, RT_CPU_MASK ^ (1 << rt_hw_cpu_id()));
}
extern size_t MMUTable[];
/* Interface */
void rt_hw_secondary_cpu_bsp_start(void)
{
rt_hw_vector_init();
rt_hw_spin_lock(&_cpus_lock);
rt_uint32_t mmutable_p;
mmutable_p = (rt_uint32_t)MMUTable + (rt_uint32_t)PV_OFFSET ;
rt_hw_mmu_switch((void*)mmutable_p) ;
arm_gic_cpu_init(0, 0);
arm_gic_set_cpu(0, IRQ_PBA8_TIMER0_1, 0x2);
timer_init(0, 10000);
rt_hw_interrupt_install(IRQ_PBA8_TIMER0_1, rt_hw_timer2_isr, RT_NULL, "tick");
rt_hw_interrupt_umask(IRQ_PBA8_TIMER0_1);
rt_system_scheduler_start();
}