]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/pdk.git/blob - packages/ti/transport/ndk/nimu/example/helloWorld/k2l/c66/bios/helloWorld.cfg
transport: add to PDK
[processor-sdk/pdk.git] / packages / ti / transport / ndk / nimu / example / helloWorld / k2l / 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  */
45  
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                                     =       "k2l";
97 var Csl                                             =   xdc.useModule('ti.csl.Settings');
98 Csl.deviceType                                  =       devType;
99 Csl.useCSLIntcLib                               =       true;
101 /* Load the OSAL package */
102 var osType = "tirtos"
103 var Osal = xdc.useModule('ti.osal.Settings');
104 Osal.osType = osType;
106 /* Load the CPPI package */
107 var Cppi                        =   xdc.loadPackage('ti.drv.cppi');     
109 var Rm                        =   xdc.loadPackage('ti.drv.rm');     
111 /* Load the QMSS package */
112 var Qmss                        =   xdc.loadPackage('ti.drv.qmss');
114 /* Load the PA package */
115 var Pa                                                  =       xdc.useModule('ti.drv.pa.Settings');
117 var socType           = "k2l";
118 var Nimu                = xdc.loadPackage('ti.transport.ndk.nimu');
119 Nimu.Settings.socType  = socType;
120 /* 
121 ** Sets up the exception log so you can read it with ROV in CCS 
122 */
123 var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
124 var Exc = xdc.useModule('ti.sysbios.family.c64p.Exception');
125 Exc.common$.logger = LoggerBuf.create();
126 Exc.enablePrint = true; /* prints exception details to the CCS console */
128 /*
129 **  Give the Load module it's own LoggerBuf to make sure the
130 **  events are not overwritten.
131 */
132 /* var loggerBufParams = new LoggerBuf.Params();
133 loggerBufParams.exitFlush = true;
134 loggerBufParams.numEntries = 64;
135 Load.common$.logger = LoggerBuf.create(loggerBufParams); 
136 */
138 /*
139 ** Use this load to configure NDK 2.2 and above using RTSC. In previous versions of
140 ** the NDK RTSC configuration was not supported and you should comment this out.
141 */
142 var Ndk       = xdc.loadPackage('ti.ndk.config');
143 var Global    = xdc.useModule('ti.ndk.config.Global');
145 /* 
146 ** This allows the heart beat (poll function) to be created but does not generate the stack threads 
147 **
148 ** Look in the cdoc (help files) to see what CfgAddEntry items can be configured. We tell it NOT
149 ** to create any stack threads (services) as we configure those ourselves in our Main Task
150 ** thread hpdspuaStart.
151 */  
152 Global.enableCodeGeneration = false;
155 /* Define a variable to set the MAR mode for MSMCSRAM as all cacheable */
156 var Cache       =   xdc.useModule('ti.sysbios.family.c66.Cache');
157 //Cache.MAR224_255 = 0x0000000f;
159 var Startup     =   xdc.useModule('xdc.runtime.Startup');
161 var System      =   xdc.useModule('xdc.runtime.System');
165 /*
166 ** Create a Heap. 
167 */
168 var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
169 var heapMemParams = new HeapMem.Params();
170 //heapMemParams.size = 0x300000;
171 heapMemParams.size = 0x100000;
172 heapMemParams.sectionName = "systemHeap";
173 Program.global.heap0 = HeapMem.create(heapMemParams);
175 /* This is the default memory heap. */
176 Memory.defaultHeapInstance  =   Program.global.heap0;
177 Program.sectMap["sharedL2"] = "MSMCSRAM"; 
178 Program.sectMap["systemHeap"] = "MSMCSRAM";
179 Program.sectMap[".sysmem"]  = "MSMCSRAM";
180 Program.sectMap[".args"]    = "MSMCSRAM";
181 Program.sectMap[".cio"]     = "MSMCSRAM";
182 Program.sectMap[".far"]         =       "MSMCSRAM";
183 Program.sectMap[".rodata"]      =       "MSMCSRAM";
184 Program.sectMap[".neardata"]    =       "MSMCSRAM";
185 Program.sectMap[".cppi"]        =       "MSMCSRAM";
186 Program.sectMap[".init_array"]  =       "MSMCSRAM";
187 Program.sectMap[".qmss"]        =       "MSMCSRAM";
188 Program.sectMap[".cinit"]       =       "MSMCSRAM";
189 Program.sectMap[".bss"]         =       "MSMCSRAM";
190 Program.sectMap[".const"]       =       "MSMCSRAM";
191 Program.sectMap[".text"]        =       "MSMCSRAM";
192 Program.sectMap[".code"]        =       "MSMCSRAM";
193 Program.sectMap[".switch"]      =       "MSMCSRAM";
194 Program.sectMap[".data"]        =       "MSMCSRAM";
195 Program.sectMap[".fardata"] =   "MSMCSRAM";
196 Program.sectMap[".args"]        =       "MSMCSRAM";
197 Program.sectMap[".cio"]         =       "MSMCSRAM";
198 Program.sectMap[".vecs"]        =       "MSMCSRAM";
199 Program.sectMap[".far:taskStackSection"] = "L2SRAM";
200 Program.sectMap[".stack"]       =       "L2SRAM";
201 Program.sectMap[".nimu_eth_ll2"] = "L2SRAM";
202 Program.sectMap[".resmgr_memregion"] = {loadSegment: "L2SRAM", loadAlign:128};  /* QMSS descriptors region      */
203 Program.sectMap[".resmgr_handles"] = {loadSegment: "L2SRAM", loadAlign:16};     /* CPPI/QMSS/PA Handles                 */
204 Program.sectMap[".resmgr_pa"]   = {loadSegment: "L2SRAM", loadAlign:8};         /* PA Memory                                    */
205 Program.sectMap[".far:IMAGEDATA"] = {loadSegment: "L2SRAM", loadAlign: 8};
206 Program.sectMap[".far:NDK_OBJMEM"] = {loadSegment: "L2SRAM", loadAlign: 8};
207 Program.sectMap[".far:NDK_PACKETMEM"] = {loadSegment: "L2SRAM", loadAlign: 128};
209 /* Required if using System_printf to output on the console */
210 SysStd                          =   xdc.useModule('xdc.runtime.SysStd');
211 System.SupportProxy     =   SysStd;
213 /********************************************************************************************************************
214 * Define hooks and static tasks  that will always be running.                                                                                           *
215  ********************************************************************************************************************/
217 /* 
218 ** Register an EVM Init handler with BIOS. This will initialize the hardware. BIOS calls before it starts. 
219 **
220 ** If yuo are debugging with CCS, then this function will execute as CCS loads it if the option in your 
221 ** Target Configuraiton file (.ccxml) has the option set to execute all code before Main. That is the 
222 ** default.
223 */
224 //Startup.lastFxns.$add('&EVM_init');
226 /* 
227 ** Create the stack Thread Task for our application.
228 */
229 var tskNdkStackTest             =   Task.create("&StackTest");
230 tskNdkStackTest.stackSize       =       0x1400;
231 tskNdkStackTest.priority    =   0x5;
234 /* 
235 ** Create a Periodic task to handle all NDK polling functions. 
236 ** If you are using RTSC configuration with NDK 2.2 and above, this is done by default and 
237 ** you do not need to do this.
238 */
239 /*var prdNdkClkParams         =   new Clock.Params ();
240 prdNdkClkParams.period      =   0x64;   
241 prdNdkClkParams.startFlag   =   true;
242 Program.global.clockInst1   =   Clock.create("&llTimerTick", 5, prdNdkClkParams);
243 */
245 /* 
246 ** If you are using RTSC configuration with NDK 2.2 and above, this is done by default, else
247 ** register hooks so that the stack can track all Task creation 
248 Task.common$.namedInstance  =   true;
249 Task.addHookSet ({ registerFxn: '&NDK_hookInit', createFxn: '&NDK_hookCreate', });
251 /* Enable BIOS Task Scheduler */
252 BIOS.taskEnabled                        =   true;
254 /*
255  * Enable Event Groups here and registering of ISR for specific GEM INTC is done
256  * using EventCombiner_dispatchPlug() and Hwi_eventMap() APIs
257  */
259 Ecm.eventGroupHwiNum[0] = 7;
260 Ecm.eventGroupHwiNum[1] = 8;
261 Ecm.eventGroupHwiNum[2] = 9;
262 Ecm.eventGroupHwiNum[3] = 10;