1 /*
2 * Copyright (c) 2013, 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 MultiProcSetup = xdc.useModule('ti.sdo.ipc.family.tci663x.MultiProcSetup');
43 }
44 MultiProcSetup.configureProcId = false;
46 /* Nothing in here uses IPC tree Settings.xs: */
47 xdc.loadCapsule("messageq_common.cfg.xs");
49 /*
50 * Plug shared Interrupt used in TransportVirtio into NotifyDriverShm, before
51 * Settings.xs does it:
52 */
53 if (Program.platformName.match(/6614/)) {
54 var NotifyDriverShm =
55 xdc.useModule('ti.sdo.ipc.notifyDrivers.NotifyDriverShm');
56 var Interrupt = xdc.useModule('ti.ipc.family.tci6614.Interrupt');
57 NotifyDriverShm.InterruptProxy = xdc.useModule(Interrupt);
58 }
59 else if (Program.platformName.match(/simKepler/)) {
60 var NotifyDriverCirc =
61 xdc.useModule('ti.sdo.ipc.notifyDrivers.NotifyDriverCirc');
62 var Interrupt = xdc.useModule('ti.ipc.family.tci6638.Interrupt');
63 NotifyDriverCirc.InterruptProxy = xdc.useModule(Interrupt);
64 }
66 /*
67 * Notify brings in the ti.sdo.ipc.family.Settings module, which does
68 * lots of config magic which will need to be UNDONE later, or setup earlier,
69 * to get the necessary overrides to various IPC module proxies!
70 */
71 var Notify = xdc.module('ti.sdo.ipc.Notify');
72 var Ipc = xdc.useModule('ti.sdo.ipc.Ipc');
74 /* Note: Must call this to override what's done in Settings.xs ! */
75 if (Program.platformName.match(/6614/)) {
76 Notify.SetupProxy = xdc.module('ti.ipc.family.tci6614.NotifySetup');
77 }
78 else if (Program.platformName.match(/simKepler/)) {
79 Notify.SetupProxy = xdc.module('ti.ipc.family.tci6638.NotifyCircSetup');
80 }
82 /* Synchronize all processors (this will be done in Ipc_start()) */
83 Ipc.procSync = Ipc.ProcSync_ALL;
84 var BIOS = xdc.useModule('ti.sysbios.BIOS');
85 BIOS.addUserStartupFunction('&IpcMgr_callIpcStart');
87 /* Shared Memory base address and length */
88 var SHAREDMEM = 0x0C000000;
89 var SHAREDMEMSIZE = 0x00200000;
91 /*
92 * Need to define the shared region. The IPC modules use this
93 * to make portable pointers. All processors need to add this
94 * call with their base address of the shared memory region.
95 * If the processor cannot access the memory, do not add it.
96 */
97 var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
98 SharedRegion.setEntryMeta(0,
99 { base: SHAREDMEM,
100 len: SHAREDMEMSIZE,
101 ownerProcId: 1, /* Ensure CORE0 SR0 is owner, NOT HOST! */
102 isValid: true,
103 name: "MSMC SRAM",
104 });
106 /* TBD: Application specific: move out of here to yet another .cfg file: */
108 /* Modules explicitly used in the application */
109 var HeapBufMP = xdc.useModule('ti.sdo.ipc.heaps.HeapBufMP');
111 var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
112 Program.global.semStartMultiCoreTest = Semaphore.create(0);