1 /* root of the configuration object model */
2 var Program = xdc.useModule('xdc.cfg.Program');
4 /* application uses the following modules and packages */
5 xdc.useModule('xdc.runtime.Assert');
6 xdc.useModule('xdc.runtime.Diags');
7 xdc.useModule('xdc.runtime.Error');
8 xdc.useModule('xdc.runtime.Log');
9 xdc.useModule('xdc.runtime.Registry');
11 xdc.useModule('ti.sysbios.knl.Semaphore');
12 xdc.useModule('ti.sysbios.knl.Task');
15 xdc.loadPackage('ti.sdo.ipc.family.vayu');
16 xdc.useModule('ti.sdo.ipc.family.vayu.InterruptDsp');
17 xdc.loadPackage('ti.ipc.rpmsg');
18 xdc.loadPackage('ti.ipc.family.vayu');
21 /*
22 * ======== IPC Configuration ========
23 */
24 xdc.loadPackage('ti.ipc.ipcmgr');
25 var BIOS = xdc.useModule('ti.sysbios.BIOS');
26 BIOS.addUserStartupFunction('&IpcMgr_ipcStartup');
27 BIOS.addUserStartupFunction('&IpcMgr_callIpcStart');
29 /* describe the processors in the system */
30 var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
31 MultiProc.setConfig("DSP1", ["HOST", "IPU2", "IPU1", "DSP2", "DSP1"]);
33 /* GateMP host support */
34 var GateMP = xdc.useModule('ti.sdo.ipc.GateMP');
35 GateMP.hostSupport = true;
37 /* shared region configuration */
38 var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
40 /* configure SharedRegion #0 (IPC) */
41 var SR0Mem = Program.cpu.memoryMap["SR_0"];
43 SharedRegion.setEntryMeta(0,
44 new SharedRegion.Entry({
45 name: "SR0",
46 base: SR0Mem.base,
47 len: SR0Mem.len,
48 ownerProcId: MultiProc.getIdMeta("DSP1"),
49 cacheEnable: true,
50 isValid: true
51 })
52 );
54 /* Override the default resource table with my own to add SR0 */
55 var Resource = xdc.useModule('ti.ipc.remoteproc.Resource');
56 Resource.customTable = true;
58 var Cache = xdc.useModule('ti.sysbios.family.c66.Cache');
59 Cache.setMarMeta(0xa0000000, 0x02000000, Cache.Mar_DISABLE);
61 /*
62 * ======== SYS/BIOS Configuration ========
63 */
64 if (Program.build.profile == "debug") {
65 BIOS.libType = BIOS.LibType_Debug;
66 } else {
67 BIOS.libType = BIOS.LibType_Custom;
68 }
71 /* no rts heap */
72 Program.argSize = 100; /* minimum size */
73 Program.stack = 0x1000;
75 xdc.useModule('ti.sysbios.xdcruntime.GateThreadSupport');
76 var GateSwi = xdc.useModule('ti.sysbios.gates.GateSwi');
78 var Task = xdc.useModule('ti.sysbios.knl.Task');
79 Task.common$.namedInstance = true;
81 /* default memory heap */
82 var Memory = xdc.useModule('xdc.runtime.Memory');
83 Memory.defaultHeapSize = 0x20000;
85 /* create a heap for MessageQ messages */
86 var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf');
87 var params = new HeapBuf.Params;
88 params.align = 8;
89 params.blockSize = 512;
90 params.numBlocks = 256;
91 var msgHeap = HeapBuf.create(params);
93 var MessageQ = xdc.useModule('ti.sdo.ipc.MessageQ');
94 MessageQ.registerHeapMeta(msgHeap, 0);
96 var VirtioSetup = xdc.useModule('ti.ipc.transports.TransportRpmsgSetup');
97 //MessageQ.SetupTransportProxy = VirtioSetup;
99 /* Setup NameServer remote proxy */
100 var NameServer = xdc.useModule("ti.sdo.utils.NameServer");
101 var NsRemote = xdc.useModule("ti.ipc.namesrv.NameServerRemoteRpmsg");
102 NameServer.SetupProxy = NsRemote;
104 /* Enable Memory Translation module that operates on the BIOS Resource Table */
105 var Resource = xdc.useModule('ti.ipc.remoteproc.Resource');
106 Resource.loadSegment = "EXT_CODE"
109 /* Use SysMin because trace buffer address is required for Linux/QNX
110 * trace debug driver, plus provides better performance.
111 */
112 var System = xdc.useModule('xdc.runtime.System');
113 var SysMin = xdc.useModule('ti.trace.SysMin');
114 System.SupportProxy = SysMin;
115 SysMin.bufSize = 0x8000;
117 Program.sectMap[".tracebuf"] = "TRACE_BUF";
118 Program.sectMap[".errorbuf"] = "EXC_DATA";
120 var Clock = xdc.useModule('ti.sysbios.knl.Clock');
121 Clock.tickSource = Clock.TickSource_NULL;
123 var Timer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
125 /* Skip the Timer frequency verification check. Need to remove this later */
126 Timer.checkFrequency = false;
128 /* Match this to the SYS_CLK frequency sourcing the dmTimers.
129 * Not needed once the SYS/BIOS family settings is updated. */
130 Timer.intFreq.hi = 0;
131 Timer.intFreq.lo = 19200000;
134 /*
135 * ======== Power Management Configuration ========
136 */
137 /* Modules used in Power Management */
138 xdc.loadPackage('ti.pm');
140 /* Idle function that periodically flushes the unicache */
141 var Idle = xdc.useModule('ti.sysbios.knl.Idle');
142 Idle.addFunc('&VirtQueue_cacheWb');
145 /*
146 * ======== Instrumentation Configuration ========
147 */
149 /* system logger */
150 var LoggerSys = xdc.useModule('xdc.runtime.LoggerSys');
151 var LoggerSysParams = new LoggerSys.Params();
152 var Defaults = xdc.useModule('xdc.runtime.Defaults');
154 /* Enable Logger: */
155 Defaults.common$.logger = LoggerSys.create(LoggerSysParams);
157 /* Enable runtime Diags_setMask() for non-XDC spec'd modules: */
158 var Text = xdc.useModule('xdc.runtime.Text');
159 Text.isLoaded = true;
161 /* enable runtime Diags_setMask() for non-XDC spec'd modules */
162 var Diags = xdc.useModule('xdc.runtime.Diags');
163 Diags.setMaskEnabled = true;
165 /* override diags mask for selected modules */
166 xdc.useModule('xdc.runtime.Main');
167 Diags.setMaskMeta("xdc.runtime.Main",
168 Diags.ENTRY | Diags.EXIT | Diags.INFO, Diags.RUNTIME_ON);
170 var Registry = xdc.useModule('xdc.runtime.Registry');
171 Registry.common$.diags_ENTRY = Diags.RUNTIME_OFF;
172 Registry.common$.diags_EXIT = Diags.RUNTIME_OFF;
173 Registry.common$.diags_INFO = Diags.RUNTIME_OFF;
174 Registry.common$.diags_USER1 = Diags.RUNTIME_OFF;
175 Registry.common$.diags_LIFECYCLE = Diags.RUNTIME_OFF;
176 Registry.common$.diags_STATUS = Diags.RUNTIME_OFF;
178 VirtioSetup.common$.diags_INFO = Diags.RUNTIME_OFF;
180 var Main = xdc.useModule('xdc.runtime.Main');
181 Main.common$.diags_ASSERT = Diags.ALWAYS_ON;
182 Main.common$.diags_INTERNAL = Diags.ALWAYS_ON;
184 /* enable exception callstack backtrace */
185 var Hwi = xdc.useModule('ti.sysbios.family.c64p.Hwi');
186 if (Program.build.profile == "debug") {
187 Hwi.enableException = true;
188 }