mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-24 22:04:54 +08:00
[bsp/ls1cdev]
1、uart驱动重写,采用uart驱动框架 2、添加并修改勤为本ls1c_uart 3、开启main为用户程序入口,删除application.c和startup.c,并对初始化部分做相应调整更新。 4、开启dhcp
This commit is contained in:
@@ -1,61 +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
|
||||
* 2015-07-06 chinesebear modified for Loongson LS1C
|
||||
* 2018-02-08 sundm75 modified for Loongson LS1C SmartLoongV3
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
#include "net/synopGMAC.h"
|
||||
#include <lwip/api.h>
|
||||
|
||||
void rt_init_thread_entry(void *parameter)
|
||||
{
|
||||
#ifdef RT_USING_COMPONENTS_INIT
|
||||
/* initialization RT-Thread Components */
|
||||
rt_components_init();
|
||||
#endif
|
||||
#if defined(RT_USING_DFS) && defined(RT_USING_DFS_ELMFAT)
|
||||
/* mount sd card fat partition 1 as root directory */
|
||||
if( dfs_mount("sd0", "/", "elm", 0, 0) == 0)
|
||||
{
|
||||
rt_kprintf("File System initialized!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_kprintf("File System initialzation failed!\n");
|
||||
}
|
||||
#endif /* RT_USING_DFS && RT_USING_DFS_ELMFAT */
|
||||
|
||||
/*网口EMAC初始化*/
|
||||
rt_hw_eth_init();
|
||||
#if defined(RT_USING_RTGUI)
|
||||
/*触摸屏使用SPI总线SPI1 CS0 初始化*/
|
||||
rtgui_touch_hw_init("spi10");
|
||||
#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, RT_THREAD_PRIORITY_MAX/3, 20);
|
||||
if (tid != RT_NULL)
|
||||
rt_thread_startup(tid);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* File : main.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2008 - 2017, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2018-05-10 zhuangwei first version
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1,93 +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
|
||||
* 2015-07-06 chinesebear modified for Loongson LS1C
|
||||
*/
|
||||
|
||||
#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, 0x80);
|
||||
rt_memcpy((void *)(A_K0BASE + 0x180), general_exception, 0x80);
|
||||
rt_memcpy((void *)(A_K0BASE + 0x200), irq_exception, 0x80);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/*@}*/
|
||||
Reference in New Issue
Block a user