2015-07-09 07:38:07 +08:00
|
|
|
/*
|
2018-12-24 18:49:00 +08:00
|
|
|
* Copyright (c) 2006-2018, RT-Thread Development Team
|
2015-07-09 07:38:07 +08:00
|
|
|
*
|
2018-12-24 18:49:00 +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-07 01:04:25 +08:00
|
|
|
* 2019-12-04 Jiaxun Yang Adapt new generic MIPS code
|
2015-07-09 07:38:07 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <rtthread.h>
|
|
|
|
#include <rthw.h>
|
2019-12-07 01:04:25 +08:00
|
|
|
#include <mips.h>
|
2015-07-09 07:38:07 +08:00
|
|
|
|
|
|
|
#include "board.h"
|
2018-05-10 22:20:37 +08:00
|
|
|
#include "drv_uart.h"
|
2015-07-09 07:38:07 +08:00
|
|
|
#include "ls1c.h"
|
|
|
|
|
2018-05-10 22:20:37 +08:00
|
|
|
extern unsigned char __bss_end;
|
|
|
|
|
2019-12-07 01:04:25 +08:00
|
|
|
#define RT_HW_HEAP_END (0x80000000 + MEM_SIZE)
|
2017-08-10 15:35:03 +08:00
|
|
|
|
|
|
|
|
2015-07-09 07:38:07 +08:00
|
|
|
/**
|
|
|
|
* This function will initial sam7s64 board.
|
|
|
|
*/
|
|
|
|
void rt_hw_board_init(void)
|
|
|
|
{
|
2019-12-07 01:04:25 +08:00
|
|
|
/* init hardware interrupt */
|
|
|
|
rt_hw_exception_init();
|
|
|
|
|
|
|
|
/* init hardware interrupt */
|
|
|
|
rt_hw_interrupt_init();
|
|
|
|
|
2018-05-10 22:20:37 +08:00
|
|
|
#ifdef RT_USING_HEAP
|
2019-12-07 01:04:25 +08:00
|
|
|
rt_system_heap_init((void*)&__bss_end, (void*)RT_HW_HEAP_END);
|
2018-05-10 22:20:37 +08:00
|
|
|
#endif
|
|
|
|
|
2018-03-17 18:59:50 +08:00
|
|
|
#ifdef RT_USING_SERIAL
|
2019-12-07 01:04:25 +08:00
|
|
|
/* init hardware UART device */
|
|
|
|
rt_hw_uart_init();
|
2015-07-09 07:38:07 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RT_USING_CONSOLE
|
2019-12-07 01:04:25 +08:00
|
|
|
/* set console device */
|
|
|
|
rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
|
2015-07-09 07:38:07 +08:00
|
|
|
#endif
|
2018-03-17 18:59:50 +08:00
|
|
|
/* init operating system timer */
|
|
|
|
rt_hw_timer_init();
|
2015-07-09 07:38:07 +08:00
|
|
|
|
2017-09-13 15:21:09 +08:00
|
|
|
#ifdef RT_USING_FPU
|
2017-08-10 15:35:03 +08:00
|
|
|
/* init hardware fpu */
|
|
|
|
rt_hw_fpu_init();
|
2017-09-13 15:21:09 +08:00
|
|
|
#endif
|
2017-08-10 15:35:03 +08:00
|
|
|
|
2018-03-17 18:59:50 +08:00
|
|
|
#ifdef RT_USING_COMPONENTS_INIT
|
|
|
|
rt_components_board_init();
|
|
|
|
#endif
|
2018-01-15 14:56:48 +08:00
|
|
|
|
2018-03-17 18:59:50 +08:00
|
|
|
rt_kprintf("current sr: 0x%08x\n", read_c0_status());
|
2018-01-15 14:56:48 +08:00
|
|
|
}
|
|
|
|
|
2015-07-09 07:38:07 +08:00
|
|
|
/*@}*/
|