提交 3639963a 编写于 作者: H Huang bo

添加TMS320C6678处理器,keystone架构底层代码

上级 4907b449
<?xml version="1.0" encoding="UTF-8" ?>
<?ccsproject version="1.0"?>
<projectOptions>
<deviceVariant value="TMS320C66XX.TMS320C6678"/>
<deviceFamily value="C6000"/>
<deviceEndianness value="little"/>
<codegenToolVersion value="8.3.5"/>
<isElfFormat value="true"/>
<rts value="libc.a"/>
<templateProperties value="id=com.ti.common.project.core.emptyProjectTemplate,"/>
<isTargetManual value="false"/>
</projectOptions>
此差异已折叠。
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ti-c6678</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.ti.ccstudio.core.ccsNature</nature>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
<linkedResources>
<link>
<name>SConscript</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/src/SConscript</locationURI>
</link>
<link>
<name>clock.c</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/src/clock.c</locationURI>
</link>
<link>
<name>components.c</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/src/components.c</locationURI>
</link>
<link>
<name>context.asm</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/libcpu/ti-dsp/c6x/context.asm</locationURI>
</link>
<link>
<name>cpu.c</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/src/cpu.c</locationURI>
</link>
<link>
<name>cpuport.c</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/libcpu/ti-dsp/c6x/cpuport.c</locationURI>
</link>
<link>
<name>device.c</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/src/device.c</locationURI>
</link>
<link>
<name>idle.c</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/src/idle.c</locationURI>
</link>
<link>
<name>inct.asm</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/libcpu/ti-dsp/c6x/inct.asm</locationURI>
</link>
<link>
<name>interrupt.c</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/libcpu/ti-dsp/c6x/interrupt.c</locationURI>
</link>
<link>
<name>ipc.c</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/src/ipc.c</locationURI>
</link>
<link>
<name>irq.c</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/src/irq.c</locationURI>
</link>
<link>
<name>kservice.c</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/src/kservice.c</locationURI>
</link>
<link>
<name>mem.c</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/src/mem.c</locationURI>
</link>
<link>
<name>memheap.c</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/src/memheap.c</locationURI>
</link>
<link>
<name>mempool.c</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/src/mempool.c</locationURI>
</link>
<link>
<name>object.c</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/src/object.c</locationURI>
</link>
<link>
<name>scheduler.c</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/src/scheduler.c</locationURI>
</link>
<link>
<name>signal.c</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/src/signal.c</locationURI>
</link>
<link>
<name>slab.c</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/src/slab.c</locationURI>
</link>
<link>
<name>stack.asm</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/libcpu/ti-dsp/c6x/stack.asm</locationURI>
</link>
<link>
<name>thread.c</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/src/thread.c</locationURI>
</link>
<link>
<name>timer.c</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/src/timer.c</locationURI>
</link>
<link>
<name>trap.c</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/libcpu/ti-dsp/c6x/trap.c</locationURI>
</link>
<link>
<name>vector.asm</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/libcpu/ti-dsp/c6x/vector.asm</locationURI>
</link>
</linkedResources>
</projectDescription>
eclipse.preferences.version=1
inEditor=false
onBuild=false
eclipse.preferences.version=1
org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker
eclipse.preferences.version=1
encoding//Debug/applications/subdir_rules.mk=UTF-8
encoding//Debug/applications/subdir_vars.mk=UTF-8
encoding//Debug/driver/subdir_rules.mk=UTF-8
encoding//Debug/driver/subdir_vars.mk=UTF-8
encoding//Debug/makefile=UTF-8
encoding//Debug/objects.mk=UTF-8
encoding//Debug/sources.mk=UTF-8
encoding//Debug/subdir_rules.mk=UTF-8
encoding//Debug/subdir_vars.mk=UTF-8
/****************************************************************************/
/* */
/* M6678.cmd */
/* Copyright (c): NUDT */
/* */
/* */
/* Description: This file is a sample linker command file that can be */
/* used for linking programs built with the C compiler and */
/* running the resulting .out file on an M6678 */
/* device. Use it as a guideline. You will want to */
/* change the memory layout to match your specific C6xxx */
/* target system. You may want to change the allocation */
/* scheme according to the size of your program. */
/* */
/* */
/****************************************************************************/
-heap 0x800
-stack 0x1000
MEMORY
{
VECTORS: o = 0x00800000 l = 0x00000200
LL2_CODE: o = 0x00800200 l = 0x0001FE00
LL2_RW_DATA: o = 0x00820000 l = 0x00020000 /*set memory protection attribitue as read/write*/
}
SECTIONS
{
.vecs > VECTORS
.text > LL2_CODE
.cinit > LL2_CODE
.const > LL2_CODE
.switch > LL2_CODE
.stack > LL2_RW_DATA
GROUP
{
.neardata
.rodata
.bss
} > LL2_RW_DATA
.far > LL2_RW_DATA
.fardata > LL2_RW_DATA
.cio > LL2_RW_DATA
.sysmem > LL2_RW_DATA
}
/*
* Copyright (c) 2021, Shenzhen Academy of Aerospace Technology
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2021-11-16 Dystopia the first version
*/
#include "board.h"
#include "trap.h"
#include "interrupt.h"
#include "drv_timer.h"
#include "KeyStone_common.h"
#include <rtthread.h>
/**
* This is the timer interrupt service routine.
*
*/
void rt_hw_systick_isr(void)
{
/* enter interrupt */
rt_interrupt_enter();
rt_tick_increase();
/* leave interrupt */
rt_interrupt_leave();
}
/**
* This function will initial board.
*/
void rt_hw_board_init(void)
{
// initial CPU core
KeyStone_common_CPU_init();
// initial interrupt controller
rt_hw_interrupt_init();
// initial system trap
rt_trap_init();
// initial system timer
hw_system_timer_init();
#ifdef RT_USING_HEAP
/* initialize memory system */
rt_kprintf("heap: 0x%08x - 0x%08x\n", RT_HW_HEAP_BEGIN, RT_HW_HEAP_END);
rt_system_heap_init(RT_HW_HEAP_BEGIN, RT_HW_HEAP_END);
#endif
// ......
hw_system_timer_start();
}
/*
* Copyright (c) 2021, Shenzhen Academy of Aerospace Technology
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2021-11-16 Dystopia the first version
*/
#ifndef __BOARD_H__
#define __BOARD_H__
#define RT_HW_HEAP_BEGIN (void*)0x0C000000
#define RT_HW_HEAP_END (void*)0x0C100000
void rt_hw_board_init(void);
#endif /* __BOARD_H__ */
/*
* Copyright (c) 2021, Shenzhen Academy of Aerospace Technology
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2021-11-16 Dystopia the first version
*/
#include <rthw.h>
#include <rtthread.h>
#include "board.h"
void rt_init_thread_entry(void *parameter)
{
while(1)
{
rt_thread_sleep(10);
}
}
void rt_my_thread_entry(void *parameter)
{
while(1)
{
rt_thread_sleep(20);
}
}
int rt_application_init(void)
{
rt_thread_t tid;
tid = rt_thread_create("init", rt_init_thread_entry, RT_NULL, 4096, 3, 200);
if (tid != RT_NULL)
{
rt_thread_startup(tid);
} else {
return -1;
}
/******************************************************************/
tid = rt_thread_create("mythread", rt_my_thread_entry, RT_NULL, 4096, 3, 200);
if (tid != RT_NULL)
{
rt_thread_startup(tid);
} else {
return -1;
}
return 0;
}
/**
* This function will startup RT-Thread RTOS.
*/
void rtthread_startup(void)
{
/* disable interrupt first */
rt_hw_interrupt_disable();
/* init board */
rt_hw_board_init();
/* show version */
rt_show_version();
/* init timer system */
rt_system_timer_init();
/* init scheduler system */
rt_system_scheduler_init();
/* init application */
rt_application_init();
/* init timer thread */
rt_system_timer_thread_init();
/* init idle thread */
rt_thread_idle_init();
/* start scheduler */
rt_system_scheduler_start();
/* never reach here */
return ;
}
void main(void)
{
/* startup RT-Thread RTOS */
rtthread_startup();
for ( ; ; );
}
此差异已折叠。
此差异已折叠。
/*
* Copyright (c) 2021, Shenzhen Academy of Aerospace Technology
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2021-11-16 Dystopia the first version
*/
#include "drv_timer.h"
#include "KeyStone_common.h"
#include <rthw.h>
#include <rtthread.h>
/**
* @b Description
* @n
* The function initial system timer.
* Use local timer (==DNUM of a core) to generate a clock on TIMO0,interrupts are generated as well
*
* @param[]
*
* @retval
* NULL
*/
void hw_system_timer_init(void)
{
// initial system timer interrupt
// map local timer interrupt to INT14
gpCGEM_regs->INTMUX3 = (CSL_GEM_TINTLN<<CSL_CGEM_INTMUX3_INTSEL14_SHIFT);
// enable INT14
CPU_interrupt_enable(1<<14);
return ;
}
void hw_system_timer_start(void)
{
Timer64_Config tmrCfg;
//select output on TIMO0 from local timer.
gpBootCfgRegs->TOUTSEL = (DNUM*2)<<CSL_BOOTCFG_TOUTSEL_TOUTSEL0_SHIFT;
/* configure the timer to generate clocks and interrupts */
tmrCfg.timer_num= DNUM;
tmrCfg.timerMode= TIMER_PERIODIC_CLOCK;
tmrCfg.period= (unsigned long long) RT_TICK_PER_SECOND*gDSP_Core_Speed_Hz/6000;
tmrCfg.reload_period= 0; //not used for this case
// initial timer
Timer64_Init(&tmrCfg);
}
/*
* Copyright (c) 2021, Shenzhen Academy of Aerospace Technology
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2021-11-16 Dystopia the first version
*/
#ifndef __SYS_TIMER_H__
#define __SYS_TIMER_H__
void hw_system_timer_init(void);
void hw_system_timer_start(void);
#endif /* __SYS_TIMER_H__ */
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册