diff options
| author | Jiaxun Yang <[email protected]> | 2019-12-07 01:04:25 +0800 |
|---|---|---|
| committer | Jiaxun Yang <[email protected]> | 2019-12-17 11:09:59 +0800 |
| commit | c236e8c5d56b579eb4a9d573f22590e0d858ae48 (patch) | |
| tree | 90026733f49375b77c7e65e4a832f6ca02f09958 /bsp/ls1bdev/applications | |
| parent | 4584054e17e8143b3a09bd6cec63c6a8f2658d06 (diff) | |
[bsp] Adapt ls{1b,1c}dev to new mips common code
LS1C selfboot feature have been rewiritten, and we changed
bare boot base to 0x80000000 to better utilize memory.
Signed-off-by: Jiaxun Yang <[email protected]>
Diffstat (limited to 'bsp/ls1bdev/applications')
| -rw-r--r-- | bsp/ls1bdev/applications/application.c | 59 | ||||
| -rw-r--r-- | bsp/ls1bdev/applications/main.c | 17 | ||||
| -rw-r--r-- | bsp/ls1bdev/applications/startup.c | 92 |
3 files changed, 17 insertions, 151 deletions
diff --git a/bsp/ls1bdev/applications/application.c b/bsp/ls1bdev/applications/application.c deleted file mode 100644 index 3daf489a3e..0000000000 --- a/bsp/ls1bdev/applications/application.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * File : application.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006-2012, RT-Thread Develop Team - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE - * - * Change Logs: - * Date Author Notes - * 2010-06-25 Bernard first version - * 2011-08-08 lgnq modified for Loongson LS1B - */ - -#include <rtthread.h> -#include <ls1b.h> - -#ifdef RT_USING_RTGUI -#include <rtgui/rtgui.h> -extern void rt_hw_dc_init(void); -#endif - -void rt_init_thread_entry(void *parameter) -{ -#ifdef RT_USING_RTGUI - { - rt_device_t dc; - - /* init Display Controller */ - rt_hw_dc_init(); - - /* find Display Controller device */ - dc = rt_device_find("dc"); - - /* set Display Controller device as rtgui graphic driver */ - rtgui_graphic_set_device(dc); - } -#endif - -#ifdef RT_USING_COMPONENTS_INIT - /* initialization RT-Thread Components */ - rt_components_init(); -#endif -} - -int rt_application_init(void) -{ - rt_thread_t tid; - - /* create initialization thread */ - tid = rt_thread_create("init", - rt_init_thread_entry, RT_NULL, - 4096, 8, 20); - if (tid != RT_NULL) - rt_thread_startup(tid); - - return 0; -} diff --git a/bsp/ls1bdev/applications/main.c b/bsp/ls1bdev/applications/main.c new file mode 100644 index 0000000000..fac004d832 --- /dev/null +++ b/bsp/ls1bdev/applications/main.c @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2006-2018, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2018-05-10 zhuangwei first version + */ + +#include <rtthread.h> + +int main(int argc, char** argv) +{ + + return 0; +} diff --git a/bsp/ls1bdev/applications/startup.c b/bsp/ls1bdev/applications/startup.c deleted file mode 100644 index deedf962f6..0000000000 --- a/bsp/ls1bdev/applications/startup.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * File : startup.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006-2012, RT-Thread Develop Team - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE - * - * Change Logs: - * Date Author Notes - * 2010-06-25 Bernard first version - * 2011-08-08 lgnq modified for Loongson LS1B - */ - -#include <rthw.h> -#include <rtthread.h> - -#include "board.h" -#define A_K0BASE 0x80000000 - -/** - * @addtogroup Loongson LS1B - */ - -/*@{*/ - -extern unsigned char __bss_end; - -extern int rt_application_init(void); - -extern void tlb_refill_exception(void); -extern void general_exception(void); -extern void irq_exception(void); -extern void rt_hw_cache_init(void); -extern void invalidate_writeback_dcache_all(void); -extern void invalidate_icache_all(void); - -/** - * This function will startup RT-Thread RTOS. - */ -void rtthread_startup(void) -{ - /* disable interrupt first */ - rt_hw_interrupt_disable(); - - /* init cache */ - rt_hw_cache_init(); - /* init hardware interrupt */ - rt_hw_interrupt_init(); - - /* copy vector */ - rt_memcpy((void *)A_K0BASE, tlb_refill_exception, 0x20); - rt_memcpy((void *)(A_K0BASE + 0x180), general_exception, 0x20); - rt_memcpy((void *)(A_K0BASE + 0x200), irq_exception, 0x20); - - invalidate_writeback_dcache_all(); - invalidate_icache_all(); - - /* init board */ - rt_hw_board_init(); - - /* show version */ - rt_show_version(); - -#ifdef RT_USING_HEAP - rt_system_heap_init((void*)&__bss_end, (void*)RT_HW_HEAP_END); -#endif - - /* init scheduler system */ - rt_system_scheduler_init(); - - /* initialize timer */ - rt_system_timer_init(); - - /* initialize timer thread */ - rt_system_timer_thread_init(); - - /* init idle thread */ - rt_thread_idle_init(); - - /* init application */ - rt_application_init(); - - /* start scheduler */ - rt_system_scheduler_start(); - - /* never reach here */ - return; -} - -/*@}*/ |
