1 /* 2 * Copyright (c) 2006-2021, RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 * 2010-06-25 Bernard first version 9 * 2011-08-08 lgnq modified for Loongson LS1B 10 * 2015-07-06 chinesebear modified for Loongson LS1C 11 * 2019-12-04 Jiaxun Yang Adapt new generic MIPS code 12 */ 13 14 #include <rtthread.h> 15 #include <rthw.h> 16 #include <mips.h> 17 18 #include "board.h" 19 #include "drv_uart.h" 20 #include "ls1c.h" 21 22 extern unsigned char __bss_end; 23 24 #define RT_HW_HEAP_END (0x80000000 + MEM_SIZE) 25 26 27 /** 28 * This function will initial sam7s64 board. 29 */ rt_hw_board_init(void)30void rt_hw_board_init(void) 31 { 32 /* init hardware interrupt */ 33 rt_hw_exception_init(); 34 35 /* init hardware interrupt */ 36 rt_hw_interrupt_init(); 37 38 #ifdef RT_USING_HEAP 39 rt_system_heap_init((void*)&__bss_end, (void*)RT_HW_HEAP_END); 40 #endif 41 42 #ifdef RT_USING_SERIAL 43 /* init hardware UART device */ 44 rt_hw_uart_init(); 45 #endif 46 47 #if defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE) 48 /* set console device */ 49 rt_console_set_device(RT_CONSOLE_DEVICE_NAME); 50 #endif 51 /* init operating system timer */ 52 rt_hw_timer_init(); 53 54 #ifdef RT_USING_FPU 55 /* init hardware fpu */ 56 rt_hw_fpu_init(); 57 #endif 58 59 #ifdef RT_USING_COMPONENTS_INIT 60 rt_components_board_init(); 61 #endif 62 63 rt_kprintf("current sr: 0x%08x\n", read_c0_status()); 64 } 65 66 /*@}*/ 67