secondary_cpu.c 655 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2006-2022, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. */
  9. #include <rthw.h>
  10. #include <rtthread.h>
  11. #include <cpu.h>
  12. #include "gic.h"
  13. #include "interrupt.h"
  14. #include "mmu.h"
  15. #include "gtimer.h"
  16. #ifdef RT_USING_SMP
  17. extern unsigned long MMUTable[];
  18. void rt_hw_secondary_cpu_bsp_start(void)
  19. {
  20. rt_hw_spin_lock(&_cpus_lock);
  21. rt_hw_mmu_ktbl_set((unsigned long)MMUTable);
  22. // interrupt init
  23. rt_hw_vector_init();
  24. arm_gic_cpu_init(0, 0);
  25. // local timer init
  26. rt_hw_gtimer_init();
  27. rt_system_scheduler_start();
  28. }
  29. #endif // SMP