rt-thread/bsp/ls1cdev/drivers/board.c

67 lines
1.4 KiB
C
Raw Normal View History

2015-07-09 07:38:07 +08:00
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
2015-07-09 07:38:07 +08:00
*
* SPDX-License-Identifier: Apache-2.0
2015-07-09 07:38:07 +08:00
*
* Change Logs:
* Date Author Notes
* 2010-06-25 Bernard first version
* 2011-08-08 lgnq modified for Loongson LS1B
* 2015-07-06 chinesebear modified for Loongson LS1C
* 2019-12-04 Jiaxun Yang Adapt new generic MIPS code
2015-07-09 07:38:07 +08:00
*/
#include <rtthread.h>
#include <rthw.h>
#include <mips.h>
2015-07-09 07:38:07 +08:00
#include "board.h"
#include "drv_uart.h"
2015-07-09 07:38:07 +08:00
#include "ls1c.h"
extern unsigned char __bss_end;
#define RT_HW_HEAP_END (0x80000000 + MEM_SIZE)
2015-07-09 07:38:07 +08:00
/**
* This function will initial sam7s64 board.
*/
void rt_hw_board_init(void)
{
/* init hardware interrupt */
rt_hw_exception_init();
/* init hardware interrupt */
rt_hw_interrupt_init();
#ifdef RT_USING_HEAP
rt_system_heap_init((void*)&__bss_end, (void*)RT_HW_HEAP_END);
#endif
#ifdef RT_USING_SERIAL
/* init hardware UART device */
rt_hw_uart_init();
2015-07-09 07:38:07 +08:00
#endif
#if defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE)
/* set console device */
rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
2015-07-09 07:38:07 +08:00
#endif
/* init operating system timer */
rt_hw_timer_init();
2015-07-09 07:38:07 +08:00
#ifdef RT_USING_FPU
/* init hardware fpu */
rt_hw_fpu_init();
#endif
#ifdef RT_USING_COMPONENTS_INIT
rt_components_board_init();
#endif
rt_kprintf("current sr: 0x%08x\n", read_c0_status());
}
2015-07-09 07:38:07 +08:00
/*@}*/