[processor-sdk/pdk.git] / packages / ti / transport / ndk / nimu / example / helloWorld / k2k / c66 / bios / helloWorld.cfg
1 /*
2 * helloWorld.cfg
3 *
4 * Memory Map and Program intiializations for the helloWorld example Utility
5 *
6 * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the
18 * distribution.
19 *
20 * Neither the name of Texas Instruments Incorporated nor the names of
21 * its contributors may be used to endorse or promote products derived
22 * from this software without specific prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 *
36 */
38 /*
39 * @file helloWorld.cfg
40 *
41 * @brief
42 * Memory Map and Program intiializations for the hello world NDK unit test.
43 *
44 */
46 /********************************************************************************************************************
47 * Specify all needed RTSC MOudles and ocnfigure them. *
48 ********************************************************************************************************************/
50 var Memory = xdc.useModule('xdc.runtime.Memory');
52 var BIOS = xdc.useModule('ti.sysbios.BIOS');
54 var Task = xdc.useModule('ti.sysbios.knl.Task');
56 var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf');
58 var Log = xdc.useModule('xdc.runtime.Log');
60 /*
61 ** Allow storing of task names. By default if you name a task with a friendly display name it will not be saved
62 ** to conserve RAM. This must be set to true to allow it. We use friendly names on the Task List display.
63 */
64 //Defaults.common$.namedInstance = true;
65 Task.common$.namedInstance = true;
67 var Clock = xdc.useModule ('ti.sysbios.knl.Clock');
69 /*
70 ** Interface with IPC. Depending on the version of BIOS you are using the
71 ** module name may have changed.
72 */
73 /* Use this for pre BIOS 6.30 */
74 /* var Sem = xdc.useModule ('ti.sysbios.ipc.Semaphore'); */
76 /* Use this for BIOS 6.30 plus to get the IPC module */
77 var Sem = xdc.useModule ('ti.sysbios.knl.Semaphore');
79 var Hwi = xdc.useModule ('ti.sysbios.hal.Hwi');
81 var Ecm = xdc.useModule ('ti.sysbios.family.c64p.EventCombiner');
83 /*
84 ** Configure this to turn on the CPU Load Module for BIOS.
85 **
86 */
87 /*
88 var Load = xdc.useModule('ti.sysbios.utils.Load');
89 Load.common$.diags_USER4 = Diags.ALWAYS_ON;
90 */
92 var Diags = xdc.useModule('xdc.runtime.Diags');
95 /* Load the CSL package */
96 var devType = "k2k";
97 var Csl = xdc.useModule('ti.csl.Settings');
98 Csl.deviceType = devType;
99 Csl.useCSLIntcLib = true;
100 /* Load the OSAL package */
101 var osType = "tirtos"
102 var Osal = xdc.useModule('ti.osal.Settings');
103 Osal.osType = osType;
105 /* Load the CPPI package */
106 var Cppi = xdc.loadPackage('ti.drv.cppi');
108 var Rm = xdc.loadPackage('ti.drv.rm');
110 /* Load the QMSS package */
111 var Qmss = xdc.loadPackage('ti.drv.qmss');
113 /* Load the PA package */
114 var Pa = xdc.useModule('ti.drv.pa.Settings');
116 var socType = "k2k";
117 var Nimu = xdc.loadPackage('ti.transport.ndk.nimu');
118 Nimu.Settings.socType = socType;
119 /*
120 ** Sets up the exception log so you can read it with ROV in CCS
121 */
122 var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
123 var Exc = xdc.useModule('ti.sysbios.family.c64p.Exception');
124 Exc.common$.logger = LoggerBuf.create();
125 Exc.enablePrint = true; /* prints exception details to the CCS console */
127 /*
128 ** Give the Load module it's own LoggerBuf to make sure the
129 ** events are not overwritten.
130 */
131 /* var loggerBufParams = new LoggerBuf.Params();
132 loggerBufParams.exitFlush = true;
133 loggerBufParams.numEntries = 64;
134 Load.common$.logger = LoggerBuf.create(loggerBufParams);
135 */
137 /*
138 ** Use this load to configure NDK 2.2 and above using RTSC. In previous versions of
139 ** the NDK RTSC configuration was not supported and you should comment this out.
140 */
141 var Ndk = xdc.loadPackage('ti.ndk.config');
142 var Global = xdc.useModule('ti.ndk.config.Global');
144 /*
145 ** This allows the heart beat (poll function) to be created but does not generate the stack threads
146 **
147 ** Look in the cdoc (help files) to see what CfgAddEntry items can be configured. We tell it NOT
148 ** to create any stack threads (services) as we configure those ourselves in our Main Task
149 ** thread hpdspuaStart.
150 */
151 Global.enableCodeGeneration = false;
154 /* Define a variable to set the MAR mode for MSMCSRAM as all cacheable */
155 var Cache = xdc.useModule('ti.sysbios.family.c66.Cache');
156 //Cache.MAR224_255 = 0x0000000f;
158 var Startup = xdc.useModule('xdc.runtime.Startup');
160 var System = xdc.useModule('xdc.runtime.System');
162 /*
163 ** Create a Heap.
164 */
165 var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
166 var heapMemParams = new HeapMem.Params();
167 heapMemParams.size = 0x300000;
168 heapMemParams.sectionName = "systemHeap";
169 Program.global.heap0 = HeapMem.create(heapMemParams);
171 /* This is the default memory heap. */
172 Memory.defaultHeapInstance = Program.global.heap0;
173 Program.sectMap["sharedL2"] = "MSMCSRAM";
174 Program.sectMap["systemHeap"] = "MSMCSRAM";
175 Program.sectMap[".sysmem"] = "MSMCSRAM";
176 Program.sectMap[".args"] = "MSMCSRAM";
177 Program.sectMap[".cio"] = "MSMCSRAM";
178 Program.sectMap[".far"] = "MSMCSRAM";
179 Program.sectMap[".rodata"] = "MSMCSRAM";
180 Program.sectMap[".neardata"] = "MSMCSRAM";
181 Program.sectMap[".cppi"] = "MSMCSRAM";
182 Program.sectMap[".init_array"] = "MSMCSRAM";
183 Program.sectMap[".qmss"] = "MSMCSRAM";
184 Program.sectMap[".cinit"] = "MSMCSRAM";
185 Program.sectMap[".bss"] = "MSMCSRAM";
186 Program.sectMap[".const"] = "MSMCSRAM";
187 Program.sectMap[".text"] = "MSMCSRAM";
188 Program.sectMap[".code"] = "MSMCSRAM";
189 Program.sectMap[".switch"] = "MSMCSRAM";
190 Program.sectMap[".data"] = "MSMCSRAM";
191 Program.sectMap[".fardata"] = "MSMCSRAM";
192 Program.sectMap[".args"] = "MSMCSRAM";
193 Program.sectMap[".cio"] = "MSMCSRAM";
194 Program.sectMap[".vecs"] = "MSMCSRAM";
195 Program.sectMap[".far:taskStackSection"] = "L2SRAM";
196 Program.sectMap[".stack"] = "L2SRAM";
197 Program.sectMap[".nimu_eth_ll2"] = "L2SRAM";
198 Program.sectMap[".resmgr_memregion"] = {loadSegment: "L2SRAM", loadAlign:128}; /* QMSS descriptors region */
199 Program.sectMap[".resmgr_handles"] = {loadSegment: "L2SRAM", loadAlign:16}; /* CPPI/QMSS/PA Handles */
200 Program.sectMap[".resmgr_pa"] = {loadSegment: "L2SRAM", loadAlign:8}; /* PA Memory */
201 Program.sectMap[".far:IMAGEDATA"] = {loadSegment: "L2SRAM", loadAlign: 8};
202 Program.sectMap[".far:NDK_OBJMEM"] = {loadSegment: "L2SRAM", loadAlign: 8};
203 Program.sectMap[".far:NDK_PACKETMEM"] = {loadSegment: "L2SRAM", loadAlign: 128};
205 /* Required if using System_printf to output on the console */
206 SysStd = xdc.useModule('xdc.runtime.SysStd');
207 System.SupportProxy = SysStd;
209 /********************************************************************************************************************
210 * Define hooks and static tasks that will always be running. *
211 ********************************************************************************************************************/
213 /*
214 ** Register an EVM Init handler with BIOS. This will initialize the hardware. BIOS calls before it starts.
215 **
216 ** If yuo are debugging with CCS, then this function will execute as CCS loads it if the option in your
217 ** Target Configuraiton file (.ccxml) has the option set to execute all code before Main. That is the
218 ** default.
219 */
220 //Startup.lastFxns.$add('&EVM_init');
222 /*
223 ** Create the stack Thread Task for our application.
224 */
225 var tskNdkStackTest = Task.create("&StackTest");
226 tskNdkStackTest.stackSize = 0x1400;
227 tskNdkStackTest.priority = 0x5;
230 /*
231 ** Create a Periodic task to handle all NDK polling functions.
232 ** If you are using RTSC configuration with NDK 2.2 and above, this is done by default and
233 ** you do not need to do this.
234 */
235 /*var prdNdkClkParams = new Clock.Params ();
236 prdNdkClkParams.period = 0x64;
237 prdNdkClkParams.startFlag = true;
238 Program.global.clockInst1 = Clock.create("&llTimerTick", 5, prdNdkClkParams);
239 */
241 /*
242 ** If you are using RTSC configuration with NDK 2.2 and above, this is done by default, else
243 ** register hooks so that the stack can track all Task creation
244 Task.common$.namedInstance = true;
245 Task.addHookSet ({ registerFxn: '&NDK_hookInit', createFxn: '&NDK_hookCreate', });
247 /* Enable BIOS Task Scheduler */
248 BIOS.taskEnabled = true;
250 /*
251 * Enable Event Groups here and registering of ISR for specific GEM INTC is done
252 * using EventCombiner_dispatchPlug() and Hwi_eventMap() APIs
253 */
255 Ecm.eventGroupHwiNum[0] = 7;
256 Ecm.eventGroupHwiNum[1] = 8;
257 Ecm.eventGroupHwiNum[2] = 9;
258 Ecm.eventGroupHwiNum[3] = 10;