/*
* ======== main ========
*/
Int main(Int argc, Char* argv[])
{
Log_print0(Diags_INFO,"mian----");
/* start scheduler, this never returns */
BIOS_start();
/* should never get here */
Log_print0(Diags_EXIT, "<-- main:");
return (0);
}
ipu1.cfg:
/* root of the configuration object model */
var Program = xdc.useModule('xdc.cfg.Program');
/* build arguments for this executable */
var cfgArgs = Program.build.cfgArgs;
var configBld = xdc.loadCapsule(cfgArgs.configBld);
/* 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');
var Task = xdc.useModule('ti.sysbios.knl.Task');
Task.common$.namedInstance = true;
/* Remap the interrupt xbar mmr base address to match AMMU settings */
var IntXbar = xdc.useModule('ti.sysbios.family.shared.vayu.IntXbar');
IntXbar.mmrBaseAddr = 0x6A002000;
/* Remap the spinlocks to match AMMU settings */
var GateHWSpinlock = xdc.useModule('ti.sdo.ipc.gates.GateHWSpinlock');
GateHWSpinlock.baseAddr = 0x6A0F6800;
/* default memory heap */
var Memory = xdc.useModule('xdc.runtime.Memory');
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
var heapMemParams = new HeapMem.Params();
heapMemParams.size = 0x8000;
Memory.defaultHeapInstance = HeapMem.create(heapMemParams);
var HeapBufMP = xdc.useModule('ti.sdo.ipc.heaps.HeapBufMP');
/* create a heap for MessageQ host<->slave messages */
var MessageQ = xdc.useModule('ti.sdo.ipc.MessageQ');
var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf');
var params = new HeapBuf.Params;
params.align = 8;
params.blockSize = 512;
params.numBlocks = 256;
var msgHeap = HeapBuf.create(params);
MessageQ.registerHeapMeta(msgHeap, 0);
/* Setup MessageQ transport */
var VirtioSetup = xdc.useModule('ti.ipc.transports.TransportRpmsgSetup');
//MessageQ.SetupTransportProxy = VirtioSetup; // Commented out to use standard proxy
/* Setup NameServer remote proxy */
var NameServer = xdc.useModule("ti.sdo.utils.NameServer");
var NsRemote = xdc.useModule("ti.ipc.namesrv.NameServerRemoteRpmsg");
//NameServer.SetupProxy = NsRemote; // Commented out to use standard nsremote
/* Enable Memory Translation module that operates on the BIOS Resource Table */
var Resource = xdc.useModule('ti.ipc.remoteproc.Resource');
/* Use SysMin because trace buffer address is required for Linux/QNX
* trace debug driver, plus provides better performance.
*/
var System = xdc.useModule('xdc.runtime.System');
var SysMin = xdc.useModule('ti.trace.SysMin');
System.SupportProxy = SysMin;
SysMin.bufSize = 0x8000;
/* Configure external timer base address to match resource table mapping.
*/
var dmTimer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
/* dmTimer 0 mapped to GPT1 */
dmTimer.timerSettings[0].baseAddr = 0x6AE18000;
/* dmTimer 1 mapped to GPT2 */
dmTimer.timerSettings[1].baseAddr = 0x68032000;
/* dmTimer 2 mapped to GPT3 */
dmTimer.timerSettings[2].baseAddr = 0x68034000;
/* dmTimer 3 mapped to GPT4 */
dmTimer.timerSettings[3].baseAddr = 0x68036000;
/* dmTimer 4 mapped to GPT5 */
dmTimer.timerSettings[4].baseAddr = 0x68820000;
/* dmTimer 5 mapped to GPT6 */
dmTimer.timerSettings[5].baseAddr = 0x68822000;
/* dmTimer 6 mapped to GPT7 */
dmTimer.timerSettings[6].baseAddr = 0x68034000;
/* dmTimer 7 mapped to GPT8 */
dmTimer.timerSettings[7].baseAddr = 0x68036000;
/* dmTimer 8 mapped to GPT9 */
dmTimer.timerSettings[8].baseAddr = 0x6803E000;
/* dmTimer 9 mapped to GPT10 */
dmTimer.timerSettings[9].baseAddr = 0x68086000;
/* dmTimer 10 mapped to GPT11 */
dmTimer.timerSettings[10].baseAddr = 0x68088000;
/* dmTimer 11 mapped to GPT12 */
dmTimer.timerSettings[11].baseAddr = 0x6AE20000;
/* dmTimer 12 mapped to GPT13 */
dmTimer.timerSettings[12].baseAddr = 0x68828000;
/* dmTimer 13 mapped to GPT14 */
dmTimer.timerSettings[13].baseAddr = 0x6882A000;
/* dmTimer 14 mapped to GPT15 */
dmTimer.timerSettings[14].baseAddr = 0x6882C000;
/* dmTimer 15 mapped to GPT16 */
dmTimer.timerSettings[15].baseAddr = 0x6882E000;
/* use external timers because they keep running when IPU is not */
var halTimer = xdc.useModule('ti.sysbios.hal.Timer');
halTimer.TimerProxy = dmTimer;
/* system logger */
var LoggerSys = xdc.useModule('xdc.runtime.LoggerSys');
var LoggerSysParams = new LoggerSys.Params();
var Defaults = xdc.useModule('xdc.runtime.Defaults');
Defaults.common$.logger = LoggerSys.create(LoggerSysParams);
/* enable runtime Diags_setMask() for non-XDC spec'd modules */
var Diags = xdc.useModule('xdc.runtime.Diags');
Diags.setMaskEnabled = true;