f1ab37aa61b3cb7f422c6ceb26f3b715a5761fb4
1 /*
2 * Copyright (c) 2012-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 //print ("Program.cpu.deviceName = " + Program.cpu.deviceName);
35 //print ("Program.platformName = " + Program.platformName);
37 /* This will match for omap5 IPU only: */
38 if (Program.cpu.deviceName.match(/^OMAP5430$/) &&
39 Program.cpu.attrs.cpuCore.match(/^CM4$/)) {
40 /* This initializes the MessageQ Transport RPMSG stack: */
41 xdc.loadPackage('ti.ipc.ipcmgr');
42 var BIOS = xdc.useModule('ti.sysbios.BIOS');
43 BIOS.addUserStartupFunction('&IpcMgr_ipcStartup');
45 var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf');
46 var params = new HeapBuf.Params;
47 params.align = 8;
48 params.blockSize = 512;
49 params.numBlocks = 256;
50 var msgHeap = HeapBuf.create(params);
52 var MessageQ = xdc.useModule('ti.sdo.ipc.MessageQ');
53 MessageQ.registerHeapMeta(msgHeap, 0);
55 xdc.loadCapsule("IpcCommon_omap5.cfg.xs");
56 xdc.loadCapsule("IpuSmp.cfg");
57 xdc.loadCapsule("IpuAmmu_omap5.cfg");
58 }
59 /* This will match for omap5 dsp only: */
60 else if (Program.cpu.deviceName.match(/^OMAP5430$/) &&
61 Program.cpu.attrs.cpuCore.match(/^64T$/)) {
62 /* This initializes the MessageQ Transport RPMSG stack: */
63 xdc.loadPackage('ti.ipc.ipcmgr');
64 var BIOS = xdc.useModule('ti.sysbios.BIOS');
65 BIOS.addUserStartupFunction('&IpcMgr_ipcStartup');
67 var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf');
68 var params = new HeapBuf.Params;
69 params.align = 8;
70 params.blockSize = 512;
71 params.numBlocks = 256;
72 var msgHeap = HeapBuf.create(params);
74 var MessageQ = xdc.useModule('ti.sdo.ipc.MessageQ');
75 MessageQ.registerHeapMeta(msgHeap, 0);
77 xdc.loadCapsule("Dsp.cfg");
78 xdc.loadCapsule("DspAmmu.cfg");
79 }
80 else if (Program.platformName.match(/^ti\.platforms\.evmDRA7XX/) &&
81 Program.cpu.attrs.cpuCore.match(/^CM4$/)) {
82 /* This initializes the MessageQ Transport RPMSG stack: */
83 xdc.loadPackage('ti.ipc.ipcmgr');
84 var BIOS = xdc.useModule('ti.sysbios.BIOS');
85 BIOS.addUserStartupFunction('&IpcMgr_ipcStartup');
87 var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf');
88 var params = new HeapBuf.Params;
89 params.align = 8;
90 params.blockSize = 512;
91 params.numBlocks = 256;
92 var msgHeap = HeapBuf.create(params);
94 var MessageQ = xdc.useModule('ti.sdo.ipc.MessageQ');
95 MessageQ.registerHeapMeta(msgHeap, 0);
97 xdc.loadCapsule("IpcCommon_vayu.cfg.xs");
98 if (Program.platformName.match(/^ti\.platforms\.evmDRA7XX\:ipu1/)) {
99 xdc.loadCapsule("Ipu1Smp.cfg");
100 }
101 else {
102 xdc.loadCapsule("Ipu2Smp.cfg");
103 }
104 xdc.loadCapsule("IpuAmmu_vayu.cfg");
105 }
106 else if (Program.platformName.match(/^ti\.platforms\.evmDRA7XX/) &&
107 Program.cpu.attrs.cpuCore.match(/^6600$/)) {
108 /* This initializes the MessageQ Transport RPMSG stack: */
109 xdc.loadPackage('ti.ipc.ipcmgr');
110 var BIOS = xdc.useModule('ti.sysbios.BIOS');
111 BIOS.addUserStartupFunction('&IpcMgr_ipcStartup');
113 var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf');
114 var params = new HeapBuf.Params;
115 params.align = 8;
116 params.blockSize = 512;
117 params.numBlocks = 256;
118 var msgHeap = HeapBuf.create(params);
120 var MessageQ = xdc.useModule('ti.sdo.ipc.MessageQ');
121 MessageQ.registerHeapMeta(msgHeap, 0);
123 if (Program.platformName.match(/^ti\.platforms\.evmDRA7XX\:dsp1/)) {
124 xdc.loadCapsule("Dsp1.cfg");
125 }
126 else {
127 xdc.loadCapsule("Dsp2.cfg");
128 }
129 }
130 else {
131 xdc.loadCapsule("messageq_common.cfg.xs");
132 }
134 var VirtioSetup = xdc.useModule('ti.ipc.transports.TransportRpmsgSetup');
136 /* Uncomment for rpmsg trace */
137 /*
138 var Diags = xdc.useModule('xdc.runtime.Diags');
139 Diags.setMaskMeta("ti.ipc.transports.TransportRpmsg",
140 Diags.INFO|Diags.USER1|Diags.STATUS, Diags.ALWAYS_ON);
141 Diags.setMaskMeta("ti.ipc.namesrv.NameServerRemoteRpmsg", Diags.INFO,
142 Diags.ALWAYS_ON);
143 VirtioSetup.common$.diags_INFO = Diags.ALWAYS_ON;
144 */
147 var MessageQ = xdc.useModule('ti.sdo.ipc.MessageQ');
148 MessageQ.SetupTransportProxy = VirtioSetup;
150 var NameServer = xdc.useModule("ti.sdo.utils.NameServer");
151 var NsRemote = xdc.useModule("ti.ipc.namesrv.NameServerRemoteRpmsg");
152 NameServer.SetupProxy = NsRemote;
154 var TransportRpmsg = xdc.useModule('ti.ipc.transports.TransportRpmsg');