board.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2006-2018, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2012-11-20 Bernard the first version
  9. * 2018-11-22 Jesven add rt_hw_spin_lock
  10. * add rt_hw_spin_unlock
  11. * add smp ipi init
  12. */
  13. #include <rthw.h>
  14. #include <rtthread.h>
  15. #include "board.h"
  16. #include "drv_timer.h"
  17. #define SYS_CTRL __REG32(REALVIEW_SCTL_BASE)
  18. extern void rt_hw_ipi_handler_install(int ipi_vector, rt_isr_handler_t ipi_isr_handler);
  19. void idle_wfi(void)
  20. {
  21. asm volatile ("wfi");
  22. }
  23. /**
  24. * This function will initialize beaglebone board
  25. */
  26. void rt_hw_board_init(void)
  27. {
  28. /* initialize hardware interrupt */
  29. rt_hw_interrupt_init();
  30. /* initialize system heap */
  31. rt_system_heap_init(HEAP_BEGIN, HEAP_END);
  32. rt_components_board_init();
  33. rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
  34. rt_thread_idle_sethook(idle_wfi);
  35. #ifdef RT_USING_SMP
  36. /* install IPI handle */
  37. rt_hw_ipi_handler_install(RT_SCHEDULE_IPI, rt_scheduler_ipi_handler);
  38. #endif
  39. }