rt-thread/bsp/qemu-vexpress-a9/drivers/board.c

49 lines
1.1 KiB
C
Raw Normal View History

2017-09-19 12:14:52 +08:00
/*
2018-11-22 14:40:43 +08:00
* Copyright (c) 2006-2018, RT-Thread Development Team
2017-09-19 12:14:52 +08:00
*
2018-11-22 14:40:43 +08:00
* SPDX-License-Identifier: Apache-2.0
2017-09-19 12:14:52 +08:00
*
* Change Logs:
* Date Author Notes
* 2012-11-20 Bernard the first version
2018-11-22 14:40:43 +08:00
* 2018-11-22 Jesven add rt_hw_spin_lock
* add rt_hw_spin_unlock
* add smp ipi init
2017-09-19 12:14:52 +08:00
*/
#include <rthw.h>
#include <rtthread.h>
#include "board.h"
2018-11-22 14:40:43 +08:00
#include "drv_timer.h"
2017-09-19 12:14:52 +08:00
#define SYS_CTRL __REG32(REALVIEW_SCTL_BASE)
extern void rt_hw_ipi_handler_install(int ipi_vector, rt_isr_handler_t ipi_isr_handler);
2017-09-19 12:14:52 +08:00
void idle_wfi(void)
{
asm volatile ("wfi");
}
2017-09-19 12:14:52 +08:00
/**
* This function will initialize beaglebone board
*/
void rt_hw_board_init(void)
{
2018-11-22 14:40:43 +08:00
/* initialize hardware interrupt */
2017-09-19 12:14:52 +08:00
rt_hw_interrupt_init();
2018-11-22 14:40:43 +08:00
/* initialize system heap */
2017-09-19 12:14:52 +08:00
rt_system_heap_init(HEAP_BEGIN, HEAP_END);
rt_components_board_init();
rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
rt_thread_idle_sethook(idle_wfi);
2018-11-22 14:40:43 +08:00
#ifdef RT_USING_SMP
/* install IPI handle */
rt_hw_ipi_handler_install(RT_SCHEDULE_IPI, rt_scheduler_ipi_handler);
2018-11-22 14:40:43 +08:00
#endif
2017-09-19 12:14:52 +08:00
}