1 /*
2 * Copyright (c) 2013-2014, 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 */
34 /*
35 * We don't use MultiProcSetup, but we have to pull it in first to shut it
36 * up so it doesn't causes MultiProc ids to be set in a Startup_first fxn.
37 */
38 if (Program.platformName.match(/6614/)) {
39 MultiProcSetup = xdc.useModule('ti.sdo.ipc.family.c647x.MultiProcSetup');
40 }
41 else if (Program.platformName.match(/simKepler/) ||
42 Program.cpu.deviceName.match(/^TMS320TCI663(0K2L|6|8)$/)) {
43 MultiProcSetup = xdc.useModule('ti.sdo.ipc.family.tci663x.MultiProcSetup');
44 }
45 MultiProcSetup.configureProcId = false;
47 /* Nothing in here uses IPC tree Settings.xs: */
48 xdc.loadCapsule("messageq_common.cfg.xs");
50 /*
51 * Plug shared Interrupt used in TransportRpmsg into NotifyDriverShm, before
52 * Settings.xs does it:
53 */
54 if (Program.platformName.match(/6614/)) {
55 var NotifyDriverShm =
56 xdc.useModule('ti.sdo.ipc.notifyDrivers.NotifyDriverShm');
57 var Interrupt = xdc.useModule('ti.ipc.family.tci6614.Interrupt');
58 NotifyDriverShm.InterruptProxy = Interrupt;
59 }
60 else if (Program.platformName.match(/simKepler/) ||
61 Program.cpu.deviceName.match(/^TMS320TCI663(0K2L|6|8)$/)) {
62 var NotifyDriverCirc =
63 xdc.useModule('ti.sdo.ipc.notifyDrivers.NotifyDriverCirc');
64 var Interrupt = xdc.useModule('ti.ipc.family.tci6638.Interrupt');
65 NotifyDriverCirc.InterruptProxy = Interrupt;
66 }
68 /*
69 * Notify brings in the ti.sdo.ipc.family.Settings module, which does
70 * lots of config magic which will need to be UNDONE later, or setup earlier,
71 * to get the necessary overrides to various IPC module proxies!
72 */
73 var Notify = xdc.module('ti.sdo.ipc.Notify');
74 var Ipc = xdc.useModule('ti.sdo.ipc.Ipc');
76 /* Note: Must call this to override what's done in Settings.xs ! */
77 if (Program.platformName.match(/6614/)) {
78 Notify.SetupProxy = xdc.module('ti.ipc.family.tci6614.NotifySetup');
79 }
80 else if (Program.platformName.match(/simKepler/) ||
81 Program.cpu.deviceName.match(/^TMS320TCI663(0K2L|6|8)$/)) {
82 Notify.SetupProxy = xdc.module('ti.ipc.family.tci6638.NotifyCircSetup');
83 }
85 /* Synchronize all processors (this will be done in Ipc_start()) */
86 Ipc.procSync = Ipc.ProcSync_ALL;
87 var BIOS = xdc.useModule('ti.sysbios.BIOS');
88 BIOS.addUserStartupFunction('&IpcMgr_callIpcStart');
90 /* Shared Memory base address and length */
91 var SHAREDMEM = 0x0C000000;
92 var SHAREDMEMSIZE = 0x00200000;
94 /*
95 * Need to define the shared region. The IPC modules use this
96 * to make portable pointers. All processors need to add this
97 * call with their base address of the shared memory region.
98 * If the processor cannot access the memory, do not add it.
99 */
100 var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
101 SharedRegion.setEntryMeta(0,
102 { base: SHAREDMEM,
103 len: SHAREDMEMSIZE,
104 ownerProcId: 1, /* Ensure CORE0 SR0 is owner, NOT HOST! */
105 isValid: true,
106 name: "MSMC SRAM",
107 });
109 /* TBD: Application specific: move out of here to yet another .cfg file: */
111 /* Modules explicitly used in the application */
112 var HeapBufMP = xdc.useModule('ti.sdo.ipc.heaps.HeapBufMP');
114 var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
115 Program.global.semStartMultiCoreTest = Semaphore.create(0);