e99e7cc7283a37bbf224b21cfe6e86ee444ea45b
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 */
33 /*
34 * ======== Settings.xs ========
35 */
37 /*
38 * ======== setDeviceAliases ========
39 */
40 function setDeviceAliases(settingsTable, aliasTable)
41 {
42 /* Number of times to call the outer loop */
43 var numLoops = 6;
45 /*
46 * Execute the 2nd loop 'numLoops' times to allow aliases of aliases
47 * to be applied to the table
48 */
49 for (var i = 0; i < numLoops; i++) {
50 for (var device in aliasTable) {
51 for each (var alias in aliasTable[device]) {
52 /*
53 * Define the alias only if the alias doesn't already exist
54 * in the table and if the device does exist in the table.
55 */
56 if (settingsTable[alias] == null &&
57 settingsTable[device] != null) {
58 settingsTable[alias] = settingsTable[device];
59 }
60 }
61 }
62 }
63 }
65 /*
66 * ======== setCatalogAliases ========
67 */
68 function setCatalogAliases(settingsTable, aliasTable)
69 {
70 for (var catalogName in settingsTable) {
71 if (aliasTable[catalogName] != null) {
72 var catalogAlias = aliasTable[catalogName];
73 if (settingsTable[catalogAlias] == null) {
74 settingsTable[catalogAlias] = settingsTable[catalogName];
75 continue;
76 }
77 for (var deviceName in settingsTable[catalogName]) {
78 settingsTable[catalogAlias][deviceName] =
79 settingsTable[catalogName][deviceName];
80 }
81 }
82 }
83 }
85 /*
86 * ======== deviceSupportCheck ========
87 * Check validity of device
88 */
89 function deviceSupportCheck()
90 {
91 var deviceName;
93 /* look for exact match */
94 for (deviceName in procNames) {
95 if (deviceName == Program.cpu.deviceName) {
96 return deviceName;
97 }
98 }
100 /* now look for wild card match */
101 for (deviceName in procNames) {
102 if (Program.cpu.deviceName.match(deviceName)) {
103 return deviceName;
104 }
105 }
106 }
108 /*
109 * ======== catalogAliases ========
110 * Aliases for catalog
111 */
112 var catalogAliases = {
113 'ti.catalog.arm.cortexm3' : ['ti.catalog.arm'],
114 }
116 /*
117 * ======== deviceAliases ========
118 * Aliases for devices used in IPC
119 */
120 var deviceAliases = {
121 'TMS320C6472' : ['TMS320CTCI6486'],
122 'TMS320C6474' : ['TMS320CTCI6488'],
123 'TMS320DA830' : ['OMAPL138',
124 'OMAPL137'],
125 'OMAP3530' : ['TMS320C3430'],
126 'TMS320TI816X' : ['TMS320CDM740',
127 'TMS320DM8148',
128 'TMS320DM8168',
129 'TMS320C6A8168',
130 'TMS320C6A8149',
131 'TMS320TI811X',
132 'TMS320TI813X',
133 'TMS320TI814X'],
134 'TMS320C6678' : ['TMS320TCI6608',
135 'TMS320C6674',
136 'TMS320C6672'],
137 'TMS320C6670' : ['TMS320TCI6616',
138 'TMS320CTCI6497',
139 'TMS320CTCI6498',
140 'TMS320TCI6618',
141 'TMS320TCI6614',
142 'TMS320C6657'],
143 'TMS320TCI6634' : ['TMS320TCI6636',
144 'TMS320TCI6638',
145 'Kepler'],
146 'LM3.*' : ['LM4.*'],
147 }
149 /*
150 * ======== procNames ========
151 */
152 var procNames = {
153 'TMS320CDM6446' : ["DSP", "HOST"],
154 'TMS320DA830' : ["DSP", "HOST"],
155 'OMAPL138' : ["DSP", "HOST"],
156 'TMS320TI816X' : ["DSP", "VIDEO-M3", "VPSS-M3", "HOST"],
157 'TMS320TI813X' : ["VIDEO-M3", "VPSS-M3", "HOST"],
158 'TMS320C6A8168' : ["DSP", "VPSS-M3", "HOST"],
159 'TMS320C6A8149' : ["DSP", "EVE", "VIDEO-M3", "VPSS-M3", "HOST"],
160 'TMS320C6670' : ["CORE0", "CORE1", "CORE2", "CORE3"],
161 'TMS320C6657' : ["CORE0", "CORE1"],
162 'TMS320C6672' : ["CORE0", "CORE1"],
163 'TMS320TCI6614' : ["CORE0", "CORE1", "CORE2", "CORE3", "HOST"],
164 'TMS320TCI6634' : ["CORE0", "CORE1", "CORE2", "CORE3",
165 "CORE4", "CORE5", "CORE6", "CORE7"],
166 'TMS320TCI6636' : ["CORE0", "CORE1", "CORE2", "CORE3",
167 "CORE4", "CORE5", "CORE6", "CORE7",
168 "HOST0", "HOST1", "HOST2", "HOST3"],
170 /*
171 * Note, the name "HOST" was intentionally chosen as a proc name to
172 * accomodate TransportRpmsg, a common transport on these platforms.
173 */
174 'TMS320TCI6638' : ["HOST", "CORE0", "CORE1", "CORE2", "CORE3",
175 "CORE4", "CORE5", "CORE6", "CORE7"],
176 'Kepler' : ["HOST", "CORE0", "CORE1", "CORE2", "CORE3",
177 "CORE4", "CORE5", "CORE6", "CORE7"],
179 'TMS320C6674' : ["CORE0", "CORE1", "CORE2", "CORE3"],
180 'TMS320C6678' : ["CORE0", "CORE1", "CORE2", "CORE3",
181 "CORE4", "CORE5", "CORE6", "CORE7"],
182 'TMS320C6472' : ["CORE0", "CORE1", "CORE2",
183 "CORE3", "CORE4", "CORE5"],
184 'TMS320C6474' : ["CORE0", "CORE1", "CORE2"],
185 'OMAP3530' : ["DSP", "HOST"],
186 'OMAP4430' : ["DSP", "CORE0", "CORE1", "HOST"],
188 /*
189 * Note that only SMP-BIOS is supported on OMAP5430, so there's only
190 * one "IPU" proc defined for the dual-core M4.
191 */
192 'OMAP5430' : ["DSP", "IPU", "HOST"],
194 'Arctic' : ["DSP", "ARP32"],
195 'F28M3.*' : ["M3", "C28"],
196 'LM3.*' : [ "" ], /* single core, any name can be used */
197 'Vayu' : ["DSP1", "DSP2", "EVE1", "EVE2", "EVE3", "EVE4",
198 "IPU1", "IPU2", "IPU1-0", "IPU1-1", "IPU2-0",
199 "IPU2-1", "HOST"],
200 };
201 setDeviceAliases(procNames, deviceAliases);
203 /*
204 * ======== hostNeedsSlaveData =======
205 */
206 var hostNeedsSlaveData = {
207 'TMS320TI816X' : 1,
208 'OMAP3530' : 1,
209 'OMAP4430' : 1,
210 'TMS320CDM6446' : 1,
211 'TMS320DA830' : 1,
212 'OMAPL138' : 1,
213 'Vayu' : 1,
214 };
215 setDeviceAliases(hostNeedsSlaveData, deviceAliases);
217 /*
218 * ======== sr0MemorySetup =======
219 * The devices in this list means these devices have a slave mmu
220 * that needs to be configured by the host before the slave can proceed.
221 */
222 var sr0MemorySetup = {
223 'TMS320TI816X' : 1,
224 'OMAP3530' : 1,
225 'OMAP4430' : 1,
226 };
227 setDeviceAliases(sr0MemorySetup, deviceAliases);
229 /*
230 * ======== hostProcNames =======
231 * The name of the host or master processor.
232 */
233 var hostProcNames = {
234 'TMS320CDM6446' : ["HOST"],
235 'TMS320DA830' : ["HOST"],
236 'OMAPL138' : ["HOST"],
237 'TMS320TI816X' : ["HOST"],
238 'OMAP3530' : ["HOST"],
239 'OMAP4430' : ["HOST"],
240 'TMS320C6678' : ["CORE0"],
241 'TMS320C6670' : ["CORE0"],
242 'TMS320C6472' : ["CORE0"],
243 'TMS320C6474' : ["CORE0"],
244 'F28M3.*' : ["M3"],
245 'TMS320TCI6634' : ["CORE0"],
246 'TMS320TCI6636' : ["HOST0"],
247 'TMS320TCI6638' : ["HOST0"],
248 'Kepler' : ["HOST"],
249 };
250 setDeviceAliases(hostProcNames, deviceAliases);
252 /*
253 * ======== nameServerRemoteDelegates ========
254 */
255 var nameServerRemoteDelegates = {
256 'OMAP3530' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
257 'TMS320CDM6446' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
258 'TMS320DA830' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
259 'TMS320TI816X' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
260 'TMS320C6678' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
261 'TMS320C6670' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
262 'TMS320C6472' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
263 'TMS320C6474' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
264 'OMAP4430' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
265 'Arctic' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
266 'F28M3.*' : { del: 'ti.sdo.ipc.family.f28m35x.NameServerBlock', },
267 'Vayu' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
268 'TMS320TCI6634' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
269 };
270 setDeviceAliases(nameServerRemoteDelegates, deviceAliases);
272 /*
273 * ======== notifySetupDelegates ========
274 */
275 var notifySetupDelegates = {
276 'OMAP3530' : { del: 'ti.sdo.ipc.family.omap3530.NotifySetup', },
277 'TMS320CDM6446' : { del: 'ti.sdo.ipc.family.dm6446.NotifySetup', },
278 'TMS320DA830' : { del: 'ti.sdo.ipc.family.da830.NotifySetup', },
279 'TMS320TI816X' : { del: 'ti.sdo.ipc.family.ti81xx.NotifySetup', },
280 'TMS320C6A8149' : { del: 'ti.sdo.ipc.family.c6a8149.NotifySetup', },
281 'TMS320C6678' : { del: 'ti.sdo.ipc.family.c647x.NotifySetup', },
282 'TMS320C6670' : { del: 'ti.sdo.ipc.family.c647x.NotifySetup', },
283 'TMS320C6472' : { del: 'ti.sdo.ipc.family.c647x.NotifySetup', },
284 'TMS320C6474' : { del: 'ti.sdo.ipc.family.c647x.NotifySetup', },
285 'TMS320TCI6634' : { del: 'ti.sdo.ipc.family.tci663x.NotifyCircSetup', },
286 'OMAP4430' : { del: 'ti.sdo.ipc.family.omap4430.NotifySetup', },
287 'Arctic' : { del: 'ti.sdo.ipc.family.arctic.NotifyCircSetup', },
288 'F28M3.*' : { del: 'ti.sdo.ipc.notifyDrivers.NotifySetupNull', },
289 'LM3.*' : { del: 'ti.sdo.ipc.notifyDrivers.NotifySetupNull', },
290 'Vayu' : { del: 'ti.sdo.ipc.family.vayu.NotifySetup', },
292 };
293 setDeviceAliases(notifySetupDelegates, deviceAliases);
295 /*
296 * ======== messageQSetupDelegates ========
297 */
298 var messageQSetupDelegates = {
299 'OMAP3530' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
300 'TMS320CDM6446' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
301 'TMS320DA830' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
302 'TMS320TI816X' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
303 'TMS320C6A8149' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
304 'TMS320C6678' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
305 'TMS320C6670' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
306 'TMS320C6472' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
307 'TMS320C6474' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
308 'TMS320TCI6634' : { del: 'ti.sdo.ipc.transports.TransportShmNotifySetup', },
309 'OMAP4430' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
310 'Arctic' : { del: 'ti.sdo.ipc.transports.TransportShmNotifySetup', },
311 'F28M3.*' : { del: 'ti.sdo.ipc.transports.TransportNullSetup', },
312 'LM3.*' : { del: 'ti.sdo.ipc.transports.TransportNullSetup', },
313 'Vayu' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
314 };
315 setDeviceAliases(messageQSetupDelegates, deviceAliases);
317 /*
318 * ======== interruptDelegates ========
319 */
320 var interruptDelegates = {
321 'ti.catalog.arm' : {
322 'TMS320CDM6446' : { del: 'ti.sdo.ipc.family.dm6446.InterruptArm', },
323 'TMS320DA830' : { del: 'ti.sdo.ipc.family.da830.InterruptArm', },
324 'OMAPL138' : { del: 'ti.sdo.ipc.family.da830.InterruptArm', },
325 },
326 'ti.catalog.arm.cortexm3' : {
327 'TMS320TI816X' : { del: 'ti.sdo.ipc.family.ti81xx.InterruptDucati', },
328 'TMS320C6A8149' : { del: 'ti.sdo.ipc.family.c6a8149.InterruptDucati', },
329 'OMAP4430' : { del: 'ti.sdo.ipc.family.omap4430.InterruptDucati', },
330 'F28M3.*' : { del: 'ti.sdo.ipc.family.f28m35x.InterruptM3', },
331 },
332 'ti.catalog.arm.cortexm4' : {
333 'Vayu' : { del: 'ti.sdo.ipc.family.vayu.InterruptIpu', },
334 },
335 'ti.catalog.arm.cortexa8' : {
336 'TMS320TI816X' : { del: 'ti.sdo.ipc.family.ti81xx.InterruptHost', },
337 'TMS320C6A8149' : { del: 'ti.sdo.ipc.family.c6a8149.InterruptHost', },
338 'OMAP3530' : { del: 'ti.sdo.ipc.family.omap3530.InterruptHost', },
339 },
340 'ti.catalog.arm.cortexa15' : {
341 'Vayu' : { del: 'ti.sdo.ipc.family.vayu.InterruptHost', },
342 },
343 'ti.catalog.c6000' : {
344 'OMAP3530' : { del: 'ti.sdo.ipc.family.omap3530.InterruptDsp', },
345 'TMS320CDM6446' : { del: 'ti.sdo.ipc.family.dm6446.InterruptDsp', },
346 'TMS320DA830' : { del: 'ti.sdo.ipc.family.da830.InterruptDsp', },
347 'OMAPL138' : { del: 'ti.sdo.ipc.family.da830.InterruptDsp', },
348 'TMS320TI816X' : { del: 'ti.sdo.ipc.family.ti81xx.InterruptDsp', },
349 'TMS320C6A8149' : { del: 'ti.sdo.ipc.family.c6a8149.InterruptDsp', },
350 'TMS320C6472' : { del: 'ti.sdo.ipc.family.c647x.Interrupt', },
351 'TMS320C6474' : { del: 'ti.sdo.ipc.family.c647x.Interrupt', },
352 'TMS320C6678' : { del: 'ti.sdo.ipc.family.c647x.Interrupt', },
353 'TMS320C6670' : { del: 'ti.sdo.ipc.family.c647x.Interrupt', },
354 'TMS320TCI6634' : { del: 'ti.sdo.ipc.family.tci663x.Interrupt', },
356 'OMAP4430' : { del: 'ti.sdo.ipc.family.omap4430.InterruptDsp', },
357 'Arctic' : { del: 'ti.sdo.ipc.family.arctic.InterruptDsp', },
358 'Vayu' : { del: 'ti.sdo.ipc.family.vayu.InterruptDsp', },
359 },
360 'ti.catalog.arp32' : {
361 'TMS320C6A8149' : { del: 'ti.sdo.ipc.family.c6a8149.InterruptEve', },
362 'Arctic' : { del: 'ti.sdo.ipc.family.arctic.InterruptArp32', },
363 'Vayu' : { del: 'ti.sdo.ipc.family.vayu.InterruptArp32', },
364 },
365 'ti.catalog.c2800' : {
366 'F28M3.*' : { del: 'ti.sdo.ipc.family.f28m35x.InterruptC28', },
367 },
368 };
369 for (var family in interruptDelegates) {
370 setDeviceAliases(interruptDelegates[family], deviceAliases);
371 }
372 setCatalogAliases(interruptDelegates, catalogAliases);
374 /*
375 * ======== spinlockDelegates ========
376 */
377 var spinlockDelegates = {
378 'ti.catalog.arm.cortexm3' : {
379 'OMAP4430' : {
380 baseAddr: 0x4A0F6800,
381 numLocks: 32,
382 },
383 'TMS320TI816X' : {
384 baseAddr: 0x480CA800,
385 numLocks: 64,
386 },
387 },
388 'ti.catalog.arm.cortexm4' : {
389 'Vayu' : {
390 baseAddr: 0x4A0F6800,
391 numLocks: 32
392 },
393 },
394 'ti.catalog.arm.cortexa8' : {
395 'TMS320TI816X' : {
396 baseAddr: 0x480CA800,
397 numLocks: 64,
398 },
399 },
400 'ti.catalog.arm.cortexa15' : {
401 'Vayu' : {
402 baseAddr: 0x4A0F6800,
403 numLocks: 32
404 },
405 },
406 'ti.catalog.c6000' : {
407 'TMS320TI816X' : {
408 baseAddr: 0x080CA800,
409 numLocks: 64,
410 },
411 'OMAP4430' : {
412 baseAddr: 0x4A0F6800,
413 numLocks: 32,
414 },
415 'Arctic' : {
416 baseAddr: 0x480CA800,
417 numLocks: 64,
418 },
419 'Vayu' : {
420 baseAddr: 0x4A0F6800,
421 numLocks: 32
422 },
423 },
424 'ti.catalog.arp32' : {
425 /* 'TMS320C6A8149' : {
426 baseAddr: 0x480CA800,
427 numLocks: 64,
428 },
429 */
430 'Arctic' : {
431 baseAddr: 0x480CA800,
432 numLocks: 64,
433 },
434 'Vayu' : {
435 baseAddr: 0x4A0F6800,
436 numLocks: 32
437 },
438 }
439 }
440 for (var family in spinlockDelegates) {
441 setDeviceAliases(spinlockDelegates[family], deviceAliases);
442 }
443 setCatalogAliases(spinlockDelegates, catalogAliases);
445 /*
446 * ======== hwSemDelegates ========
447 */
448 var hwSemDelegates = {
449 'ti.catalog.c6000' : {
450 'TMS320C6474' : {
451 baseAddr: 0x02B40100,
452 queryAddr: 0x02B40300,
453 numSems: 32,
454 },
455 'TMS320C6678' : {
456 baseAddr: 0x02640100,
457 queryAddr: 0x02640200,
458 numSems: 32,
459 },
460 'TMS320C6670' : {
461 baseAddr: 0x02640100,
462 queryAddr: 0x02640200,
463 numSems: 32,
464 },
465 'TMS320TCI6634' : {
466 baseAddr: 0x02640100,
467 queryAddr: 0x02640200,
468 numSems: 32,
469 },
470 },
471 }
472 for (var family in hwSemDelegates) {
473 setDeviceAliases(hwSemDelegates[family], deviceAliases);
474 }
475 setCatalogAliases(hwSemDelegates, catalogAliases);
477 /*
478 * ======== getGateHWSemSettings ========
479 */
480 function getGateHWSemSettings()
481 {
482 var errorString = "IPC does not have a default GateHWSem" +
483 " delegate for the " + deviceName + " device!";
484 var catalogName = Program.cpu.catalogName;
485 var deviceName = deviceSupportCheck();
487 var errStr = "The device " + deviceName +
488 " does not support hardware semaphores!";
490 try {
491 var hwSemSettings = hwSemDelegates[catalogName][deviceName];
492 }
493 catch(e) {
494 throw new Error(errStr);
495 }
497 if (hwSemSettings == null) {
498 throw new Error(errStr);
499 }
501 return (hwSemSettings);
502 }
504 /*
505 * ======== getGateHWSpinlockSettings ========
506 */
507 function getGateHWSpinlockSettings()
508 {
509 var errorString = "IPC does not have a default GateHWSpinlock" +
510 " delegate for the " + deviceName + " device!";
511 var catalogName = Program.cpu.catalogName;
512 var deviceName = deviceSupportCheck();
514 var errStr = "The device " + deviceName +
515 " does not support hardware spinlocks!";
517 try {
518 var spinLockSettings = spinlockDelegates[catalogName][deviceName];
519 }
520 catch(e) {
521 throw new Error(errStr);
522 }
524 if (spinLockSettings == null) {
525 throw new Error(errStr);
526 }
528 return (spinLockSettings);
529 }
531 /*
532 * ======== generateSlaveDataForHost ========
533 */
534 function generateSlaveDataForHost()
535 {
536 var deviceName = deviceSupportCheck();
537 var retval = hostNeedsSlaveData[deviceName];
539 /* A15 is the already the host no need to generate data */
540 if ((Program.cpu.catalogName == 'ti.catalog.arm.cortexa8') ||
541 (Program.cpu.catalogName == 'ti.catalog.arm.cortexa9') ||
542 (Program.cpu.catalogName == 'ti.catalog.arm.cortexa15')) {
543 return (false);
544 }
546 if (retval != null) {
547 return (true);
548 }
550 return (false);
551 }
553 /*
554 * ======== getHostProcId ========
555 */
556 function getHostProcId()
557 {
558 var MultiProc = xdc.module("ti.sdo.utils.MultiProc");
559 var deviceName = deviceSupportCheck();
560 var hostProcName = hostProcNames[deviceName];
562 if (hostProcName == null) {
563 /* The device doesn't have a core that runs a hlos */
564 return (MultiProc.INVALIDID);
565 }
567 /*
568 * If the device may run a hlos, return the corresponding core's MultiProc
569 * id. MultiProc.INVALIDID will be returned if the core exists but isn't
570 * being used in the application
571 */
572 return(MultiProc.getIdMeta(String(hostProcName)));
573 }
575 /*
576 * ======== getIpcSR0Setup ========
577 */
578 function getIpcSR0Setup()
579 {
580 var deviceName = deviceSupportCheck();
581 var memorySetup = sr0MemorySetup[deviceName];
583 if (memorySetup == null) {
584 /* The device has memory available to it */
585 return (true);
586 }
587 else {
588 /* The device needs host to enable memory through mmu */
589 return (false);
590 }
591 }
593 /*
594 * ======== getHWGate ========
595 */
596 function getHWGate()
597 {
598 var deviceName = deviceSupportCheck();
599 if (deviceName == "TMS320C6472" ||
600 deviceName == "TMS320CTCI6486") {
601 return ('ti.sdo.ipc.gates.GateAAMonitor');
602 }
603 else if (deviceName == "TMS320C6A8149") {
604 return ('ti.sdo.ipc.gates.GatePetersonN');
605 }
606 try {
607 this.getGateHWSpinlockSettings();
608 return ('ti.sdo.ipc.gates.GateHWSpinlock');
609 }
610 catch(e) {
611 }
613 try {
614 this.getGateHWSemSettings();
615 return ('ti.sdo.ipc.gates.GateHWSem');
616 }
617 catch(e) {
618 }
620 return('ti.sdo.ipc.gates.GatePeterson');
621 }
623 /*
624 * ======== getDefaultInterruptDelegate ========
625 */
626 function getDefaultInterruptDelegate()
627 {
628 var catalogName = Program.cpu.catalogName;
629 var deviceName = deviceSupportCheck();
631 var delegate = interruptDelegates[catalogName][deviceName];
633 if (delegate == null) {
634 throw new Error ("IPC does not have a default Interrupt"
635 + " delegate for the " + deviceName + " device!");
636 }
638 return (delegate.del);
639 }
641 /*
642 * ======== getNameServerRemoteDelegate ========
643 */
644 function getNameServerRemoteDelegate()
645 {
646 var deviceName = deviceSupportCheck();
648 var delegate = nameServerRemoteDelegates[deviceName];
650 if (delegate == null) {
651 delegate = { del: 'ti.sdo.utils.NameServerRemoteNull', };
652 }
654 return (delegate.del);
655 }
657 /*
658 * ======== getNotifySetupDelegate ========
659 */
660 function getNotifySetupDelegate()
661 {
662 var deviceName = deviceSupportCheck();
664 var delegate = notifySetupDelegates[deviceName];
666 if (delegate == null) {
667 throw new Error ("IPC does not have a default NotifySetup"
668 + " delegate for the " + deviceName + " device!");
669 }
671 return (delegate.del);
672 }
674 /*
675 * ======== getMessageQSetupDelegate ========
676 */
677 function getMessageQSetupDelegate()
678 {
679 var deviceName = deviceSupportCheck();
681 var delegate = messageQSetupDelegates[deviceName];
683 if (delegate == null) {
684 throw new Error ("IPC does not have a default MessageQ setup"
685 + " delegate for the " + deviceName + " device!");
686 }
688 return (delegate.del);
689 }
691 /*
692 * ======== procInDevice ========
693 */
694 function procInDevice(procName)
695 {
696 var deviceName = deviceSupportCheck();
697 if (procNames[deviceName] == null) {
698 throw("The device (" + Program.cpu.deviceName +
699 ") isn't supported by IPC");
700 }
702 /* Search through the procNames table */
703 for each (name in procNames[deviceName]) {
704 if (name == procName) {
705 return (true);
706 }
707 }
709 return (false);
710 }
712 /*
713 * ======== getDeviceProcNames ========
714 */
715 function getDeviceProcNames()
716 {
717 var deviceName = deviceSupportCheck();
718 if (procNames[deviceName] == null) {
719 throw("The device (" + Program.cpu.deviceName +
720 ") isn't supported by IPC");
721 }
723 return (procNames[deviceName]);
724 }