1 /*
2 * Copyright (c) 2012, Texas Instruments Incorporated
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 var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
35 /*
36 * Get the list of names that the build device supports.
37 * I.e. ["CORE0", "CORE1", "CORE2" ... ]
38 */
39 // var nameList = MultiProc.getDeviceProcNames();
40 var nameList = ["CORE0", "CORE1"];
42 /*
43 * Since this is a single-image example, we don't (at build-time) which
44 * processor we're building for. We therefore supply 'null'
45 * as the local procName and allow IPC to set the local procId at runtime.
46 */
47 MultiProc.setConfig(null, nameList);
49 /*
50 * The SysStd System provider is a good one to use for debugging
51 * but does not have the best performance. Use xdc.runtime.SysMin
52 * for better performance.
53 */
54 var System = xdc.useModule('xdc.runtime.System');
55 var SysStd = xdc.useModule('xdc.runtime.SysStd');
56 System.SupportProxy = SysStd;
58 /* Modules explicitly used in the application */
59 var MessageQ = xdc.useModule('ti.sdo.ipc.MessageQ');
60 var Ipc = xdc.useModule('ti.sdo.ipc.Ipc');
61 var HeapBufMP = xdc.useModule('ti.sdo.ipc.heaps.HeapBufMP');
62 var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
64 /* BIOS/XDC modules */
65 var BIOS = xdc.useModule('ti.sysbios.BIOS');
66 BIOS.heapSize = 0x8000;
67 var Task = xdc.useModule('ti.sysbios.knl.Task');
69 /* Synchronize all processors (this will be done in Ipc_start) */
70 Ipc.procSync = Ipc.ProcSync_ALL;
72 /* Shared Memory base address and length */
73 var SHAREDMEM = 0x0C000000;
74 var SHAREDMEMSIZE = 0x00200000;
76 /*
77 * Need to define the shared region. The IPC modules use this
78 * to make portable pointers. All processors need to add this
79 * call with their base address of the shared memory region.
80 * If the processor cannot access the memory, do not add it.
81 */
82 var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
83 SharedRegion.setEntryMeta(0,
84 { base: SHAREDMEM,
85 len: SHAREDMEMSIZE,
86 ownerProcId: 0,
87 isValid: true,
88 name: "DDR2 RAM",
89 });
91 /* PDK packages */
92 var Csl = xdc.loadPackage('ti.csl');
93 var Rm = xdc.loadPackage('ti.drv.rm');