|
/*
|
|
* Copyright (c) 2012, Texas Instruments Incorporated
|
|
* All rights reserved.
|
|
*
|
|
* Redistribution and use in source and binary forms, with or without
|
|
* modification, are permitted provided that the following conditions
|
|
* are met:
|
|
*
|
|
* * Redistributions of source code must retain the above copyright
|
|
* notice, this list of conditions and the following disclaimer.
|
|
*
|
|
* * Redistributions in binary form must reproduce the above copyright
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
* documentation and/or other materials provided with the distribution.
|
|
*
|
|
* * Neither the name of Texas Instruments Incorporated nor the names of
|
|
* its contributors may be used to endorse or promote products derived
|
|
* from this software without specific prior written permission.
|
|
*
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
|
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
*/
|
|
|
|
/*
|
|
* ======== Dsp.cfg ========
|
|
*
|
|
*/
|
|
|
|
/* root of the configuration object model */
|
|
var Program = xdc.useModule('xdc.cfg.Program');
|
|
|
|
/* application uses the following modules and packages */
|
|
xdc.useModule('xdc.runtime.Assert');
|
|
xdc.useModule('xdc.runtime.Diags');
|
|
xdc.useModule('xdc.runtime.Error');
|
|
xdc.useModule('xdc.runtime.Log');
|
|
xdc.useModule('xdc.runtime.Registry');
|
|
|
|
xdc.useModule('ti.sysbios.gates.GateHwi');
|
|
xdc.useModule('ti.sysbios.knl.Semaphore');
|
|
xdc.useModule('ti.sysbios.knl.Task');
|
|
|
|
var BIOS = xdc.useModule('ti.sysbios.BIOS');
|
|
BIOS.libType = BIOS.LibType_NonInstrumented;
|
|
|
|
|
|
/*
|
|
* ======== IPC Configuration ========
|
|
*/
|
|
|
|
/* required because SysLink is running on the host processor */
|
|
xdc.useModule('ti.syslink.ipc.rtos.Syslink');
|
|
|
|
/* configure processor names */
|
|
var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
|
|
var procNameAry = MultiProc.getDeviceProcNames();
|
|
MultiProc.setConfig("DSP", procNameAry);
|
|
|
|
/* ipc configuration */
|
|
var Ipc = xdc.useModule('ti.sdo.ipc.Ipc');
|
|
|
|
/* ipc setup for SR0 Memory (host processor not running Sys/Bios) */
|
|
Ipc.sr0MemorySetup = false;
|
|
|
|
/* set ipc sync to pair, requiring Ipc_attach() call on all processors */
|
|
Ipc.procSync = Ipc.ProcSync_PAIR;
|
|
|
|
/* define host processor */
|
|
Ipc.hostProcId = MultiProc.getIdMeta("HOST");
|
|
|
|
/* shared region configuration */
|
|
var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
|
|
|
|
/* configure SharedRegion #0 (IPC) */
|
|
var SR0Mem = Program.cpu.memoryMap["SR_0"];
|
|
|
|
SharedRegion.setEntryMeta(0,
|
|
new SharedRegion.Entry({
|
|
name: "SR0",
|
|
base: SR0Mem.base,
|
|
len: SR0Mem.len,
|
|
ownerProcId: MultiProc.getIdMeta("HOST"),
|
|
cacheEnable: false,
|
|
isValid: true
|
|
})
|
|
);
|
|
|
|
// Andri's note: ignore this map
|
|
|
|
/* configure external memory cache property
|
|
*
|
|
* C000_0000 - C7FF_FFFF 800_0000 ( 128 MB) Cache.MAR192_223
|
|
* --------------------------------------------------------------------------
|
|
* C000_0000 - C1FF_FFFF 200_0000 ( 32 MB) -------- don't care
|
|
* C200_0000 - C200_FFFF 1_0000 ( 64 KB) SR_0 no-cache MAR194
|
|
* C201_0000 - C2FF_FFFF FF_0000 ( ~15 MB) -------- no-cache MAR194
|
|
* C300_0000 - C37F_FFFF 80_0000 ( 8 MB) DSP_PROG cache enable MAR195
|
|
* C380_0000 - C3FF_FFFF 80_0000 ( 8 MB) -------- cache enable MAR195
|
|
* C400_0000 - C7FF_FFFF 400_0000 ( 64 MB) -------- don't care
|
|
*/
|
|
|
|
Cache = xdc.useModule('ti.sysbios.family.c64p.Cache');
|
|
// Cache.MAR192_223 = 0x00000008; /* xxxx xxxx xxxx xxxx xxxx xxxx xxxx 10xx */
|
|
|
|
|
|
// Modified by andri : START here
|
|
|
|
/* configure external memory cache property
|
|
*
|
|
* C000_0000 - CFFF_FFFF 1000_0000 ( 256 MB) Cache.MAR192_223
|
|
* --------------------------------------------------------------------------
|
|
* C000_0000 - C5FF_FFFF 400_0000 ( 96 MB) -------- LINUX - don't care
|
|
* C600_0000 - C600_0080 80 ( 80 B) -------- RESET CONTROL - don't care
|
|
* C600_0081 - CF7F_FFFF 96F_FF80 ( 151 MB) DSP_PROG cache enable MAR198 - MAR207
|
|
* CF70_0000 - CF70_5000 5000 ( 20 KB) DSPLINK MEM cache enable MAR207
|
|
* CF70_5001 - CF7F_FFFF FB000 ( 1 MB) DSPLINK MEM cache enable MAR207
|
|
* CF80_0000 - CFFF_FFFF 800000 ( 8 MB) POOLMEM cache enable MAR207
|
|
*/
|
|
Cache.MAR192_223 = 0x00008000;
|
|
|
|
/*
|
|
* ======== Operating System Configuration ========
|
|
*/
|
|
|
|
/* no rts heap */
|
|
Program.heap = 0;
|
|
Program.argSize = 100; /* minimum size */
|
|
Program.stack = 0x1000;
|
|
|
|
/* create a default heap */
|
|
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
|
|
var heapMemParams = new HeapMem.Params();
|
|
heapMemParams.size = 0x4000;
|
|
|
|
var Memory = xdc.useModule('xdc.runtime.Memory');
|
|
Memory.defaultHeapInstance = HeapMem.create(heapMemParams);
|
|
|
|
/* configure System module */
|
|
var SysMin = xdc.useModule('xdc.runtime.SysMin');
|
|
SysMin.bufSize = 0x1000;
|
|
SysMin.flushAtExit = false;
|
|
|
|
var System = xdc.useModule('xdc.runtime.System');
|
|
System.SupportProxy = SysMin;
|
|
|
|
/* configure SysBios to use the lower half of Timer 1 */
|
|
var Timer = xdc.useModule('ti.sysbios.timers.timer64.Timer');
|
|
var Clock = xdc.useModule('ti.sysbios.knl.Clock');
|
|
Timer.timerSettings[1].master = true;
|
|
Timer.defaultHalf = Timer.Half_LOWER;
|
|
Clock.timerId = 1;
|
|
|
|
/*
|
|
* ======== Miscellaneous Configuration ========
|
|
*/
|
|
|
|
/* set default diags mask */
|
|
var Diags = xdc.useModule('xdc.runtime.Diags');
|
|
var Defaults = xdc.useModule('xdc.runtime.Defaults');
|
|
|
|
Defaults.common$.diags_ENTRY = Diags.ALWAYS_OFF;
|
|
Defaults.common$.diags_EXIT = Diags.ALWAYS_OFF;
|
|
Defaults.common$.diags_LIFECYCLE = Diags.ALWAYS_OFF;
|
|
Defaults.common$.diags_INTERNAL = Diags.ALWAYS_OFF; /* needed for asserts */
|
|
Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF; /* development only */
|
|
Defaults.common$.diags_STATUS = Diags.RUNTIME_ON;
|
|
Defaults.common$.diags_USER1 = Diags.ALWAYS_OFF;
|
|
Defaults.common$.diags_USER2 = Diags.ALWAYS_OFF;
|
|
Defaults.common$.diags_USER3 = Diags.ALWAYS_OFF;
|
|
Defaults.common$.diags_USER4 = Diags.ALWAYS_OFF;
|
|
Defaults.common$.diags_USER5 = Diags.ALWAYS_OFF;
|
|
Defaults.common$.diags_USER6 = Diags.ALWAYS_OFF;
|
|
Defaults.common$.diags_INFO = Diags.ALWAYS_OFF;
|
|
Defaults.common$.diags_ANALYSIS = Diags.ALWAYS_OFF;
|
|
|
|
/* override diags mask for selected modules */
|
|
xdc.useModule('xdc.runtime.Main');
|
|
Diags.setMaskMeta(
|
|
"xdc.runtime.Main",
|
|
Diags.ENTRY | Diags.EXIT | Diags.INFO,
|
|
Diags.RUNTIME_ON
|
|
);
|
|
|
|
var Registry = xdc.useModule('xdc.runtime.Registry');
|
|
Registry.common$.diags_ENTRY = Diags.RUNTIME_OFF;
|
|
Registry.common$.diags_EXIT = Diags.RUNTIME_OFF;
|
|
Registry.common$.diags_INFO = Diags.RUNTIME_OFF;
|
|
Registry.common$.diags_USER1 = Diags.RUNTIME_OFF;
|
|
|
|
/* create a logger instance */
|
|
var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
|
|
var loggerBufP = new LoggerBuf.Params();
|
|
loggerBufP.numEntries = 128; /* 128 entries = 4 KB of memory */
|
|
loggerBufP.bufType = LoggerBuf.BufType_FIXED;
|
|
|
|
var appLogger = LoggerBuf.create(loggerBufP);
|
|
appLogger.instance.name = "AppLog_Core1";
|
|
Defaults.common$.logger = appLogger;
|