Browse Source

add Program.sectMap to libdsp/SGMII.xs

Signed-off-by: surenyi <surenyi82@qq.com>
master
surenyi 6 years ago
parent
commit
39b789a4cf
  1. 194
      cfg/ether.cfg
  2. 13
      packages/vsky/libdsp/SGMII.xs
  3. 8
      packages/vsky/libdsp/SerialSystem.xs
  4. 12
      packages/vsky/platforms/simple/Platform.xdc
  5. 65
      samples/ether/ether.cfg

194
cfg/ether.cfg

@ -1,194 +0,0 @@
/*
* @file ether.cfg
*
* @brief
* Memory Map and Program intiializations for the HPDSP Utility.
*
*/
var vsky_libdsp_Settings = xdc.useModule('vsky.libdsp.Settings');
var sgmii = xdc.useModule('vsky.libdsp.SGMII');
vsky_libdsp_Settings.sgmii_clock = 312500000;
var SerialSystem = xdc.useModule('vsky.libdsp.SerialSystem');
var System = xdc.useModule('xdc.runtime.System');
System.SupportProxy = SerialSystem;
var Memory = xdc.useModule('xdc.runtime.Memory');
var BIOS = xdc.useModule('ti.sysbios.BIOS');
var Task = xdc.useModule('ti.sysbios.knl.Task');
var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf');
var Log = xdc.useModule('xdc.runtime.Log');
/*
** Allow storing of task names. By default if you name a task with a friendly display name it will not be saved
** to conserve RAM. This must be set to true to allow it. We use friendly names on the Task List display.
*/
//Defaults.common$.namedInstance = true;
Task.common$.namedInstance = true;
var Clock = xdc.useModule ('ti.sysbios.knl.Clock');
/*
** Interface with IPC. Depending on the version of BIOS you are using the
** module name may have changed.
*/
/* Use this for pre BIOS 6.30 */
/* var Sem = xdc.useModule ('ti.sysbios.ipc.Semaphore'); */
/* Use this for BIOS 6.30 plus to get the IPC module */
var Sem = xdc.useModule ('ti.sysbios.knl.Semaphore');
var Hwi = xdc.useModule ('ti.sysbios.hal.Hwi');
var Ecm = xdc.useModule ('ti.sysbios.family.c64p.EventCombiner');
/*
** Configure this to turn on the CPU Load Module for BIOS.
**
*/
/*
var Load = xdc.useModule('ti.sysbios.utils.Load');
Load.common$.diags_USER4 = Diags.ALWAYS_ON;
*/
var Diags = xdc.useModule('xdc.runtime.Diags');
/*
** Sets up the exception log so you can read it with ROV in CCS
*/
var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
var Exc = xdc.useModule('ti.sysbios.family.c64p.Exception');
Exc.common$.logger = LoggerBuf.create();
Exc.enablePrint = true; /* prints exception details to the CCS console */
/*
** Give the Load module it's own LoggerBuf to make sure the
** events are not overwritten.
*/
/* var loggerBufParams = new LoggerBuf.Params();
loggerBufParams.exitFlush = true;
loggerBufParams.numEntries = 64;
Load.common$.logger = LoggerBuf.create(loggerBufParams);
*/
/*
** Use this load to configure NDK 2.2 and above using RTSC. In previous versions of
** the NDK RTSC configuration was not supported and you should comment this out.
*/
var Global = xdc.useModule('ti.ndk.config.Global');
/*
** This allows the heart beat (poll function) to be created but does not generate the stack threads
**
** Look in the cdoc (help files) to see what CfgAddEntry items can be configured. We tell it NOT
** to create any stack threads (services) as we configure those ourselves in our Main Task
** thread hpdspuaStart.
*/
Global.enableCodeGeneration = false;
/* Define a variable to set the MAR mode for MSMCSRAM as all cacheable */
var Cache = xdc.useModule('ti.sysbios.family.c66.Cache');
//Cache.MAR224_255 = 0x0000000f;
var Startup = xdc.useModule('xdc.runtime.Startup');
/*
** Create a Heap.
*/
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
var heapMemParams = new HeapMem.Params();
heapMemParams.size = 0x300000;
heapMemParams.sectionName = "systemHeap";
Program.global.heap0 = HeapMem.create(heapMemParams);
/* This is the default memory heap. */
Memory.defaultHeapInstance = Program.global.heap0;
Program.sectMap["sharedL2"] = "DDR3";
Program.sectMap["systemHeap"] = "DDR3";
Program.sectMap[".sysmem"] = "DDR3";
Program.sectMap[".far"] = "DDR3";
Program.sectMap[".rodata"] = "DDR3";
Program.sectMap[".neardata"] = "DDR3";
Program.sectMap[".cppi"] = "DDR3";
Program.sectMap[".init_array"] = "DDR3";
Program.sectMap[".qmss"] = "DDR3";
Program.sectMap[".cinit"] = "DDR3";
Program.sectMap[".bss"] = "DDR3";
Program.sectMap[".const"] = "DDR3";
Program.sectMap[".text"] = "DDR3";
Program.sectMap[".code"] = "DDR3";
Program.sectMap[".switch"] = "DDR3";
Program.sectMap[".data"] = "DDR3";
Program.sectMap[".fardata"] = "DDR3";
Program.sectMap[".args"] = "DDR3";
Program.sectMap[".stack"] = "DDR3";
Program.sectMap[".cio"] = "DDR3";
Program.sectMap[".vecs"] = "L2SRAM";
Program.sectMap[".far:taskStackSection"] = "DDR3";
Program.sectMap[".nimu_eth_ll2"] = "DDR3";
Program.sectMap[".resmgr_memregion"] = {loadSegment: "DDR3", loadAlign:128}; /* QMSS descriptors region */
Program.sectMap[".resmgr_handles"] = {loadSegment: "DDR3", loadAlign:16}; /* CPPI/QMSS/PA Handles */
Program.sectMap[".resmgr_pa"] = {loadSegment: "DDR3", loadAlign:8}; /* PA Memory */
Program.sectMap[".far:NDK_OBJMEM"] = {loadSegment: "DDR3", loadAlign: 8};
Program.sectMap[".far:NDK_PACKETMEM"] = {loadSegment: "DDR3", loadAlign: 128};
/********************************************************************************************************************
* Define hooks and static tasks that will always be running. *
********************************************************************************************************************/
/*
** Register an EVM Init handler with BIOS. This will initialize the hardware. BIOS calls before it starts.
**
** If yuo are debugging with CCS, then this function will execute as CCS loads it if the option in your
** Target Configuraiton file (.ccxml) has the option set to execute all code before Main. That is the
** default.
*/
//Startup.lastFxns.$add('&EVM_init');
/*
** Create the stack Thread Task for our application.
*/
var tskNdkStackTest = Task.create("&net_test");
tskNdkStackTest.stackSize = 0x1400;
tskNdkStackTest.priority = 0x5;
/*
** Create a Periodic task to handle all NDK polling functions.
** If you are using RTSC configuration with NDK 2.2 and above, this is done by default and
** you do not need to do this.
*/
/*var prdNdkClkParams = new Clock.Params ();
prdNdkClkParams.period = 0x64;
prdNdkClkParams.startFlag = true;
Program.global.clockInst1 = Clock.create("&llTimerTick", 5, prdNdkClkParams);
*/
/*
** If you are using RTSC configuration with NDK 2.2 and above, this is done by default, else
** register hooks so that the stack can track all Task creation
Task.common$.namedInstance = true;
Task.addHookSet ({ registerFxn: '&NDK_hookInit', createFxn: '&NDK_hookCreate', });
/* Enable BIOS Task Scheduler */
BIOS.taskEnabled = true;
/*
* Enable Event Groups here and registering of ISR for specific GEM INTC is done
* using EventCombiner_dispatchPlug() and Hwi_eventMap() APIs
*/
Ecm.eventGroupHwiNum[0] = 7;
Ecm.eventGroupHwiNum[1] = 8;
Ecm.eventGroupHwiNum[2] = 9;
Ecm.eventGroupHwiNum[3] = 10;
vsky_libdsp_Settings.emac_port = 1;
vsky_libdsp_Settings.emac_address = "80:00:00:00:00:aa";

13
packages/vsky/libdsp/SGMII.xs

@ -1,3 +1,5 @@
var Program = null;
function module$static$init(obj, mod) function module$static$init(obj, mod)
{ {
} }
@ -9,4 +11,15 @@ function module$use()
xdc.useModule('ti.drv.pa.Settings'); xdc.useModule('ti.drv.pa.Settings');
xdc.useModule('ti.ndk.config.Global'); xdc.useModule('ti.ndk.config.Global');
xdc.useModule('ti.sysbios.knl.Task'); xdc.useModule('ti.sysbios.knl.Task');
Program = xdc.useModule('xdc.cfg.Program');
Program.sectMap[".qmss"] = "DDR3";
Program.sectMap[".cppi"] = "DDR3";
Program.sectMap[".nimu_eth_ll2"] = "DDR3";
Program.sectMap[".resmgr_memregion"] = {loadSegment: "DDR3", loadAlign:128}; /* QMSS descriptors region */
Program.sectMap[".resmgr_handles"] = {loadSegment: "DDR3", loadAlign:16}; /* CPPI/QMSS/PA Handles */
Program.sectMap[".resmgr_pa"] = {loadSegment: "DDR3", loadAlign:8}; /* PA Memory */
Program.sectMap[".far:taskStackSection"] = "DDR3";
Program.sectMap[".far:NDK_OBJMEM"] = {loadSegment: "DDR3", loadAlign: 8};
Program.sectMap[".far:NDK_PACKETMEM"] = {loadSegment: "DDR3", loadAlign: 128};
} }

8
packages/vsky/libdsp/SerialSystem.xs

@ -1,5 +1,11 @@
var System = null;
var Serial = null;
function module$use(obj, mod) function module$use(obj, mod)
{ {
xdc.module('xdc.runtime.Gate'); xdc.useModule('xdc.runtime.Gate');
xdc.useModule('xdc.runtime.Startup'); xdc.useModule('xdc.runtime.Startup');
System = xdc.useModule('xdc.runtime.System');
Serial = xdc.useModule('vsky.libdsp.SerialSystem');
System.SupportProxy = Serial;
} }

12
packages/vsky/platforms/simple/Platform.xdc

@ -3,14 +3,12 @@
*/ */
metaonly module Platform inherits xdc.platform.IPlatform { metaonly module Platform inherits xdc.platform.IPlatform {
config ti.platforms.generic.Platform.Instance CPU = config ti.platforms.generic.Platform.Instance CPU =
ti.platforms.generic.Platform.create("CPU", { ti.platforms.generic.Platform.create("CPU", {
clockRate: 1000, clockRate: 1000,
catalogName: "ti.catalog.c6000", catalogName: "ti.catalog.c6000",
deviceName: "TMS320C6678", deviceName: "TMS320C6678",
customMemoryMap: customMemoryMap: [
[
["MSMCSRAM", ["MSMCSRAM",
{ {
name: "MSMCSRAM", name: "MSMCSRAM",
@ -74,8 +72,8 @@ metaonly module Platform inherits xdc.platform.IPlatform {
instance : instance :
override config string codeMemory = "L2SRAM"; override config string codeMemory = "DDR3";
override config string dataMemory = "L2SRAM"; override config string dataMemory = "DDR3";
override config string stackMemory = "L2SRAM"; override config string stackMemory = "DDR3";
} }

65
samples/ether/ether.cfg

@ -9,11 +9,9 @@
var vsky_libdsp_Settings = xdc.useModule('vsky.libdsp.Settings'); var vsky_libdsp_Settings = xdc.useModule('vsky.libdsp.Settings');
var sgmii = xdc.useModule('vsky.libdsp.SGMII'); var sgmii = xdc.useModule('vsky.libdsp.SGMII');
vsky_libdsp_Settings.sgmii_clock = 156250000;
var SerialSystem = xdc.useModule('vsky.libdsp.SerialSystem'); var SerialSystem = xdc.useModule('vsky.libdsp.SerialSystem');
var System = xdc.useModule('xdc.runtime.System'); var System = xdc.useModule('xdc.runtime.System');
System.SupportProxy = SerialSystem; //System.SupportProxy = SerialSystem;
var Memory = xdc.useModule('xdc.runtime.Memory'); var Memory = xdc.useModule('xdc.runtime.Memory');
@ -57,7 +55,7 @@ var Load = xdc.useModule('ti.sysbios.utils.Load');
Load.common$.diags_USER4 = Diags.ALWAYS_ON; Load.common$.diags_USER4 = Diags.ALWAYS_ON;
*/ */
var Diags = xdc.useModule('xdc.runtime.Diags'); var Diags = xdc.useModule('xdc.runtime.Diags');
/* /*
** Sets up the exception log so you can read it with ROV in CCS ** Sets up the exception log so you can read it with ROV in CCS
@ -109,35 +107,35 @@ heapMemParams.sectionName = "systemHeap";
Program.global.heap0 = HeapMem.create(heapMemParams); Program.global.heap0 = HeapMem.create(heapMemParams);
/* This is the default memory heap. */ /* This is the default memory heap. */
Memory.defaultHeapInstance = Program.global.heap0; Memory.defaultHeapInstance = Program.global.heap0;
Program.sectMap["sharedL2"] = "DDR3"; Program.sectMap["sharedL2"] = "DDR3";
Program.sectMap["systemHeap"] = "DDR3"; Program.sectMap["systemHeap"] = "DDR3";
Program.sectMap[".sysmem"] = "DDR3"; Program.sectMap[".sysmem"] = "DDR3";
Program.sectMap[".far"] = "DDR3"; Program.sectMap[".far"] = "DDR3";
Program.sectMap[".rodata"] = "DDR3"; Program.sectMap[".rodata"] = "DDR3";
Program.sectMap[".neardata"] = "DDR3"; Program.sectMap[".neardata"] = "DDR3";
Program.sectMap[".cppi"] = "DDR3"; Program.sectMap[".init_array"] = "DDR3";
Program.sectMap[".init_array"] = "DDR3"; Program.sectMap[".cinit"] = "DDR3";
Program.sectMap[".qmss"] = "DDR3"; Program.sectMap[".bss"] = "DDR3";
Program.sectMap[".cinit"] = "DDR3"; Program.sectMap[".const"] = "DDR3";
Program.sectMap[".bss"] = "DDR3"; Program.sectMap[".text"] = "DDR3";
Program.sectMap[".const"] = "DDR3"; Program.sectMap[".code"] = "DDR3";
Program.sectMap[".text"] = "DDR3"; Program.sectMap[".switch"] = "DDR3";
Program.sectMap[".code"] = "DDR3"; Program.sectMap[".data"] = "DDR3";
Program.sectMap[".switch"] = "DDR3"; Program.sectMap[".fardata"] = "DDR3";
Program.sectMap[".data"] = "DDR3"; Program.sectMap[".args"] = "DDR3";
Program.sectMap[".fardata"] = "DDR3"; Program.sectMap[".stack"] = "DDR3";
Program.sectMap[".args"] = "DDR3"; Program.sectMap[".cio"] = "DDR3";
Program.sectMap[".stack"] = "DDR3"; Program.sectMap[".vecs"] = "L2SRAM";
Program.sectMap[".cio"] = "DDR3"; //Program.sectMap[".qmss"] = "DDR3";
Program.sectMap[".vecs"] = "L2SRAM"; //Program.sectMap[".cppi"] = "DDR3";
Program.sectMap[".far:taskStackSection"] = "DDR3"; //Program.sectMap[".far:taskStackSection"] = "DDR3";
Program.sectMap[".nimu_eth_ll2"] = "DDR3"; //Program.sectMap[".nimu_eth_ll2"] = "DDR3";
Program.sectMap[".resmgr_memregion"] = {loadSegment: "DDR3", loadAlign:128}; /* QMSS descriptors region */ //Program.sectMap[".resmgr_memregion"] = {loadSegment: "DDR3", loadAlign:128}; /* QMSS descriptors region */
Program.sectMap[".resmgr_handles"] = {loadSegment: "DDR3", loadAlign:16}; /* CPPI/QMSS/PA Handles */ //Program.sectMap[".resmgr_handles"] = {loadSegment: "DDR3", loadAlign:16}; /* CPPI/QMSS/PA Handles */
Program.sectMap[".resmgr_pa"] = {loadSegment: "DDR3", loadAlign:8}; /* PA Memory */ //Program.sectMap[".resmgr_pa"] = {loadSegment: "DDR3", loadAlign:8}; /* PA Memory */
Program.sectMap[".far:NDK_OBJMEM"] = {loadSegment: "DDR3", loadAlign: 8}; //Program.sectMap[".far:NDK_OBJMEM"] = {loadSegment: "DDR3", loadAlign: 8};
Program.sectMap[".far:NDK_PACKETMEM"] = {loadSegment: "DDR3", loadAlign: 128}; //Program.sectMap[".far:NDK_PACKETMEM"] = {loadSegment: "DDR3", loadAlign: 128};
/******************************************************************************************************************** /********************************************************************************************************************
* Define hooks and static tasks that will always be running. * * Define hooks and static tasks that will always be running. *
@ -190,5 +188,6 @@ Ecm.eventGroupHwiNum[1] = 8;
Ecm.eventGroupHwiNum[2] = 9; Ecm.eventGroupHwiNum[2] = 9;
Ecm.eventGroupHwiNum[3] = 10; Ecm.eventGroupHwiNum[3] = 10;
vsky_libdsp_Settings.sgmii_clock = 156250000;
vsky_libdsp_Settings.emac_port = 0; vsky_libdsp_Settings.emac_port = 0;
vsky_libdsp_Settings.emac_address = "80:00:00:00:00:aa"; vsky_libdsp_Settings.emac_address = "80:00:00:00:00:aa";

Loading…
Cancel
Save