]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - apps/tidep0074.git/blob - ipu2/Ipu2.cfg
initial release
[apps/tidep0074.git] / ipu2 / Ipu2.cfg
1 /*
2  * Copyright (c) 2013-2015 Texas Instruments Incorporated - http://www.ti.com
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * *  Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  *
12  * *  Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * *  Neither the name of Texas Instruments Incorporated nor the names of
17  *    its contributors may be used to endorse or promote products derived
18  *    from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
33 /*
34  *  ======== Ipu2.cfg ========
35  *  Platform: DRA7XX_linux_elf
36  *  Target: ti.targets.arm.elf.M4
37  */
39 /* root of the configuration object model */
40 var Program = xdc.useModule('xdc.cfg.Program');
42 /* build arguments for this executable */
43 var cfgArgs = Program.build.cfgArgs;
44 var configBld = xdc.loadCapsule(cfgArgs.configBld);
46 /* application uses the following modules and packages */
47 xdc.useModule('xdc.runtime.Assert');
48 xdc.useModule('xdc.runtime.Diags');
49 xdc.useModule('xdc.runtime.Error');
50 xdc.useModule('xdc.runtime.Log');
51 xdc.useModule('xdc.runtime.Registry');
53 xdc.useModule('ti.sysbios.gates.GateHwi');
54 xdc.useModule('ti.sysbios.knl.Semaphore');
55 xdc.useModule('ti.sysbios.knl.Task');
57 /*
58  *  ======== IPC Configuration ========
59  */
60 xdc.useModule('ti.ipc.ipcmgr.IpcMgr');
62 Program.global.procName = "IPU2";
63 var ipc_cfg = xdc.loadCapsule("../shared/ipc.cfg.xs");
65 var BIOS        = xdc.useModule('ti.sysbios.BIOS');
66 BIOS.addUserStartupFunction('&IpcMgr_ipcStartup');
68 /*
69  *  ======== SYS/BIOS Configuration ========
70  */
71 if (Program.build.profile == "debug") {
72     BIOS.libType = BIOS.LibType_Debug;
73 } else {
74     BIOS.libType = BIOS.LibType_Custom;
75 }
76 BIOS.smpEnabled = true; /* only support SMP mode on IPU */
78 var Core = xdc.useModule('ti.sysbios.family.arm.ducati.Core');
79 Core.ipuId = 2;
81 /* no rts heap */
82 Program.argSize = 100;  /* minimum size */
83 Program.stack = 0x1000;
85 var Task = xdc.useModule('ti.sysbios.knl.Task');
86 Task.common$.namedInstance = true;
88 /* Remap the interrupt xbar mmr base address to match AMMU settings */
89 var IntXbar = xdc.useModule('ti.sysbios.family.shared.vayu.IntXbar');
90 IntXbar.mmrBaseAddr = 0x6A002000;
92 /* default memory heap */
93 var Memory = xdc.useModule('xdc.runtime.Memory');
94 var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
95 var heapMemParams = new HeapMem.Params();
96 heapMemParams.size = 0x8000;
97 Memory.defaultHeapInstance = HeapMem.create(heapMemParams);
99 /* create a heap for MessageQ messages */
100 var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf');
101 var params = new HeapBuf.Params;
102 params.align = 8;
103 params.blockSize = 512;
104 params.numBlocks = 256;
105 var msgHeap = HeapBuf.create(params);
107 var MessageQ  = xdc.useModule('ti.sdo.ipc.MessageQ');
108 MessageQ.registerHeapMeta(msgHeap, 0);
110 /* Setup MessageQ transport */
111 var VirtioSetup = xdc.useModule('ti.ipc.transports.TransportRpmsgSetup');
112 MessageQ.SetupTransportProxy = VirtioSetup;
114 /* Setup NameServer remote proxy */
115 var NameServer = xdc.useModule("ti.sdo.utils.NameServer");
116 var NsRemote = xdc.useModule("ti.ipc.namesrv.NameServerRemoteRpmsg");
117 NameServer.SetupProxy = NsRemote;
119 /* Enable Memory Translation module that operates on the BIOS Resource Table */
120 var Resource = xdc.useModule('ti.ipc.remoteproc.Resource');
122 /*  Use SysMin because trace buffer address is required for Linux/QNX
123  *  trace debug driver, plus provides better performance.
124  */
125 var System = xdc.useModule('xdc.runtime.System');
126 var SysMin = xdc.useModule('ti.trace.SysMin');
127 System.SupportProxy = SysMin;
128 SysMin.bufSize  = 0x8000;
130 Program.sectMap[".tracebuf"] = "TRACE_BUF";
131 Program.sectMap[".errorbuf"] = "EXC_DATA";
133 /*  Configure external timer base address to match resource table mapping.
134  */
135 var dmTimer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
136 /* dmTimer 0 mapped to GPT1 */
137 dmTimer.timerSettings[0].baseAddr = 0x6AE18000;
138 /* dmTimer 1 mapped to GPT2 */
139 dmTimer.timerSettings[1].baseAddr = 0x68032000;
140 /* dmTimer 2 mapped to GPT3 */
141 dmTimer.timerSettings[2].baseAddr = 0x68034000;
142 /* dmTimer 3 mapped to GPT4 */
143 dmTimer.timerSettings[3].baseAddr = 0x68036000;
144 /* dmTimer 4 mapped to GPT5 */
145 dmTimer.timerSettings[4].baseAddr = 0x68820000;
146 /* dmTimer 5 mapped to GPT6 */
147 dmTimer.timerSettings[5].baseAddr = 0x68822000;
148 /* dmTimer 6 mapped to GPT7 */
149 dmTimer.timerSettings[6].baseAddr = 0x68034000;
150 /* dmTimer 7 mapped to GPT8 */
151 dmTimer.timerSettings[7].baseAddr = 0x68036000;
152 /* dmTimer 8 mapped to GPT9 */
153 dmTimer.timerSettings[8].baseAddr = 0x6803E000;
154 /* dmTimer 9 mapped to GPT10 */
155 dmTimer.timerSettings[9].baseAddr = 0x68086000;
156 /* dmTimer 10 mapped to GPT11 */
157 dmTimer.timerSettings[10].baseAddr = 0x68088000;
158 /* dmTimer 11 mapped to GPT12 */
159 dmTimer.timerSettings[11].baseAddr = 0x6AE20000;
160 /* dmTimer 12 mapped to GPT13 */
161 dmTimer.timerSettings[12].baseAddr = 0x68828000;
162 /* dmTimer 13 mapped to GPT14 */
163 dmTimer.timerSettings[13].baseAddr = 0x6882A000;
164 /* dmTimer 14 mapped to GPT15 */
165 dmTimer.timerSettings[14].baseAddr = 0x6882C000;
166 /* dmTimer 15 mapped to GPT16 */
167 dmTimer.timerSettings[15].baseAddr = 0x6882E000;
169 /* use external timers because they keep running when IPU is not */
170 var halTimer = xdc.useModule('ti.sysbios.hal.Timer');
171 halTimer.TimerProxy = dmTimer;
173 /* ----------------------------- TICK ---------------------------------------*/
174 var Clock = xdc.useModule('ti.sysbios.knl.Clock');
175 Clock.tickSource = Clock.TickSource_USER;
176 /* Configure GPTimer3 as BIOS clock source */
177 Clock.timerId = 2;
179 var Timer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
180 var timerParams = new Timer.Params();
181 timerParams.period = Clock.tickPeriod;
182 timerParams.periodType = Timer.PeriodType_MICROSECS;
183 /* Smart-idle wake-up-capable mode */
184 timerParams.tiocpCfg.idlemode = 0x3;
185 /* Wake-up generation for Overflow */
186 timerParams.twer.ovf_wup_ena = 0x1;
187 Timer.create(Clock.timerId, Clock.doTick, timerParams);
189 /* configure the IPU AMMU */
190 xdc.loadCapsule("IpuAmmu.cfg");
193 /* idle functions */
194 var Idle = xdc.useModule('ti.sysbios.knl.Idle');
196 /* function to flush unicache on each core */
197 Idle.addCoreFunc('&VirtQueue_cacheWb', 0);
198 Idle.addCoreFunc('&VirtQueue_cacheWb', 1);
200 var Deh = xdc.useModule('ti.deh.Deh');
202 /* Watchdog detection functions in each core */
203 /* Must be placed before pwr mgmt */
204 Idle.addCoreFunc('&ti_deh_Deh_idleBegin', 0);
205 Idle.addCoreFunc('&ti_deh_Deh_idleBegin', 1);
207 /*
208  *  ======== Instrumentation Configuration ========
209  */
211 /* system logger */
212 var LoggerSys = xdc.useModule('xdc.runtime.LoggerSys');
213 var LoggerSysParams = new LoggerSys.Params();
214 var Defaults = xdc.useModule('xdc.runtime.Defaults');
215 Defaults.common$.logger = LoggerSys.create(LoggerSysParams);
217 /* enable runtime Diags_setMask() for non-XDC spec'd modules */
218 var Diags = xdc.useModule('xdc.runtime.Diags');
219 Diags.setMaskEnabled = true;
221 /* override diags mask for selected modules */
222 xdc.useModule('xdc.runtime.Main');
223 Diags.setMaskMeta("xdc.runtime.Main",
224     Diags.ENTRY | Diags.EXIT | Diags.INFO, Diags.RUNTIME_ON);
226 var Registry = xdc.useModule('xdc.runtime.Registry');
227 Registry.common$.diags_ENTRY = Diags.RUNTIME_OFF;
228 Registry.common$.diags_EXIT  = Diags.RUNTIME_OFF;
229 Registry.common$.diags_INFO  = Diags.RUNTIME_OFF;
230 Registry.common$.diags_USER1 = Diags.RUNTIME_OFF;
231 Registry.common$.diags_LIFECYCLE = Diags.RUNTIME_OFF;
232 Registry.common$.diags_STATUS = Diags.RUNTIME_OFF;
234 var Main = xdc.useModule('xdc.runtime.Main');
235 Main.common$.diags_ASSERT = Diags.ALWAYS_ON;
236 Main.common$.diags_INTERNAL = Diags.ALWAYS_ON;
238 var Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');
239 Hwi.nvicCCR.DIV_0_TRP = 1;