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", "HOST"],
199 };
200 setDeviceAliases(procNames, deviceAliases);
202 /*
203 * ======== hostNeedsSlaveData =======
204 */
205 var hostNeedsSlaveData = {
206 'TMS320TI816X' : 1,
207 'OMAP3530' : 1,
208 'OMAP4430' : 1,
209 'TMS320CDM6446' : 1,
210 'TMS320DA830' : 1,
211 'OMAPL138' : 1,
212 'Vayu' : 1,
213 };
214 setDeviceAliases(hostNeedsSlaveData, deviceAliases);
216 /*
217 * ======== sr0MemorySetup =======
218 * The devices in this list means these devices have a slave mmu
219 * that needs to be configured by the host before the slave can proceed.
220 */
221 var sr0MemorySetup = {
222 'TMS320TI816X' : 1,
223 'OMAP3530' : 1,
224 'OMAP4430' : 1,
225 };
226 setDeviceAliases(sr0MemorySetup, deviceAliases);
228 /*
229 * ======== hostProcNames =======
230 * The name of the host or master processor.
231 */
232 var hostProcNames = {
233 'TMS320CDM6446' : ["HOST"],
234 'TMS320DA830' : ["HOST"],
235 'OMAPL138' : ["HOST"],
236 'TMS320TI816X' : ["HOST"],
237 'OMAP3530' : ["HOST"],
238 'OMAP4430' : ["HOST"],
239 'TMS320C6678' : ["CORE0"],
240 'TMS320C6670' : ["CORE0"],
241 'TMS320C6472' : ["CORE0"],
242 'TMS320C6474' : ["CORE0"],
243 'F28M3.*' : ["M3"],
244 'TMS320TCI6634' : ["CORE0"],
245 'TMS320TCI6636' : ["HOST0"],
246 'TMS320TCI6638' : ["HOST0"],
247 'Kepler' : ["HOST"],
248 };
249 setDeviceAliases(hostProcNames, deviceAliases);
251 /*
252 * ======== nameServerRemoteDelegates ========
253 */
254 var nameServerRemoteDelegates = {
255 'OMAP3530' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
256 'TMS320CDM6446' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
257 'TMS320DA830' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
258 'TMS320TI816X' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
259 'TMS320C6678' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
260 'TMS320C6670' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
261 'TMS320C6472' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
262 'TMS320C6474' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
263 'OMAP4430' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
264 'Arctic' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
265 'F28M3.*' : { del: 'ti.sdo.ipc.family.f28m35x.NameServerBlock', },
266 'Vayu' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
267 'TMS320TCI6634' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
268 };
269 setDeviceAliases(nameServerRemoteDelegates, deviceAliases);
271 /*
272 * ======== notifySetupDelegates ========
273 */
274 var notifySetupDelegates = {
275 'OMAP3530' : { del: 'ti.sdo.ipc.family.omap3530.NotifySetup', },
276 'TMS320CDM6446' : { del: 'ti.sdo.ipc.family.dm6446.NotifySetup', },
277 'TMS320DA830' : { del: 'ti.sdo.ipc.family.da830.NotifySetup', },
278 'TMS320TI816X' : { del: 'ti.sdo.ipc.family.ti81xx.NotifySetup', },
279 'TMS320C6A8149' : { del: 'ti.sdo.ipc.family.c6a8149.NotifySetup', },
280 'TMS320C6678' : { del: 'ti.sdo.ipc.family.c647x.NotifySetup', },
281 'TMS320C6670' : { del: 'ti.sdo.ipc.family.c647x.NotifySetup', },
282 'TMS320C6472' : { del: 'ti.sdo.ipc.family.c647x.NotifySetup', },
283 'TMS320C6474' : { del: 'ti.sdo.ipc.family.c647x.NotifySetup', },
284 'TMS320TCI6634' : { del: 'ti.sdo.ipc.family.tci663x.NotifyCircSetup', },
285 'OMAP4430' : { del: 'ti.sdo.ipc.family.omap4430.NotifySetup', },
286 'Arctic' : { del: 'ti.sdo.ipc.family.arctic.NotifyCircSetup', },
287 'F28M3.*' : { del: 'ti.sdo.ipc.notifyDrivers.NotifySetupNull', },
288 'LM3.*' : { del: 'ti.sdo.ipc.notifyDrivers.NotifySetupNull', },
289 'Vayu' : { del: 'ti.sdo.ipc.family.vayu.NotifySetup', },
291 };
292 setDeviceAliases(notifySetupDelegates, deviceAliases);
294 /*
295 * ======== messageQSetupDelegates ========
296 */
297 var messageQSetupDelegates = {
298 'OMAP3530' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
299 'TMS320CDM6446' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
300 'TMS320DA830' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
301 'TMS320TI816X' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
302 'TMS320C6A8149' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
303 'TMS320C6678' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
304 'TMS320C6670' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
305 'TMS320C6472' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
306 'TMS320C6474' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
307 'TMS320TCI6634' : { del: 'ti.sdo.ipc.transports.TransportShmNotifySetup', },
308 'OMAP4430' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
309 'Arctic' : { del: 'ti.sdo.ipc.transports.TransportShmNotifySetup', },
310 'F28M3.*' : { del: 'ti.sdo.ipc.transports.TransportNullSetup', },
311 'LM3.*' : { del: 'ti.sdo.ipc.transports.TransportNullSetup', },
312 'Vayu' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
313 };
314 setDeviceAliases(messageQSetupDelegates, deviceAliases);
316 /*
317 * ======== interruptDelegates ========
318 */
319 var interruptDelegates = {
320 'ti.catalog.arm' : {
321 'TMS320CDM6446' : { del: 'ti.sdo.ipc.family.dm6446.InterruptArm', },
322 'TMS320DA830' : { del: 'ti.sdo.ipc.family.da830.InterruptArm', },
323 'OMAPL138' : { del: 'ti.sdo.ipc.family.da830.InterruptArm', },
324 },
325 'ti.catalog.arm.cortexm3' : {
326 'TMS320TI816X' : { del: 'ti.sdo.ipc.family.ti81xx.InterruptDucati', },
327 'TMS320C6A8149' : { del: 'ti.sdo.ipc.family.c6a8149.InterruptDucati', },
328 'OMAP4430' : { del: 'ti.sdo.ipc.family.omap4430.InterruptDucati', },
329 'F28M3.*' : { del: 'ti.sdo.ipc.family.f28m35x.InterruptM3', },
330 },
331 'ti.catalog.arm.cortexm4' : {
332 'Vayu' : { del: 'ti.sdo.ipc.family.vayu.InterruptIpu', },
333 },
334 'ti.catalog.arm.cortexa8' : {
335 'TMS320TI816X' : { del: 'ti.sdo.ipc.family.ti81xx.InterruptHost', },
336 'TMS320C6A8149' : { del: 'ti.sdo.ipc.family.c6a8149.InterruptHost', },
337 'OMAP3530' : { del: 'ti.sdo.ipc.family.omap3530.InterruptHost', },
338 },
339 'ti.catalog.arm.cortexa15' : {
340 'Vayu' : { del: 'ti.sdo.ipc.family.vayu.InterruptHost', },
341 },
342 'ti.catalog.c6000' : {
343 'OMAP3530' : { del: 'ti.sdo.ipc.family.omap3530.InterruptDsp', },
344 'TMS320CDM6446' : { del: 'ti.sdo.ipc.family.dm6446.InterruptDsp', },
345 'TMS320DA830' : { del: 'ti.sdo.ipc.family.da830.InterruptDsp', },
346 'OMAPL138' : { del: 'ti.sdo.ipc.family.da830.InterruptDsp', },
347 'TMS320TI816X' : { del: 'ti.sdo.ipc.family.ti81xx.InterruptDsp', },
348 'TMS320C6A8149' : { del: 'ti.sdo.ipc.family.c6a8149.InterruptDsp', },
349 'TMS320C6472' : { del: 'ti.sdo.ipc.family.c647x.Interrupt', },
350 'TMS320C6474' : { del: 'ti.sdo.ipc.family.c647x.Interrupt', },
351 'TMS320C6678' : { del: 'ti.sdo.ipc.family.c647x.Interrupt', },
352 'TMS320C6670' : { del: 'ti.sdo.ipc.family.c647x.Interrupt', },
353 'TMS320TCI6634' : { del: 'ti.sdo.ipc.family.tci663x.Interrupt', },
355 'OMAP4430' : { del: 'ti.sdo.ipc.family.omap4430.InterruptDsp', },
356 'Arctic' : { del: 'ti.sdo.ipc.family.arctic.InterruptDsp', },
357 'Vayu' : { del: 'ti.sdo.ipc.family.vayu.InterruptDsp', },
358 },
359 'ti.catalog.arp32' : {
360 'TMS320C6A8149' : { del: 'ti.sdo.ipc.family.c6a8149.InterruptEve', },
361 'Arctic' : { del: 'ti.sdo.ipc.family.arctic.InterruptArp32', },
362 'Vayu' : { del: 'ti.sdo.ipc.family.vayu.InterruptArp32', },
363 },
364 'ti.catalog.c2800' : {
365 'F28M3.*' : { del: 'ti.sdo.ipc.family.f28m35x.InterruptC28', },
366 },
367 };
368 for (var family in interruptDelegates) {
369 setDeviceAliases(interruptDelegates[family], deviceAliases);
370 }
371 setCatalogAliases(interruptDelegates, catalogAliases);
373 /*
374 * ======== spinlockDelegates ========
375 */
376 var spinlockDelegates = {
377 'ti.catalog.arm.cortexm3' : {
378 'OMAP4430' : {
379 baseAddr: 0x4A0F6800,
380 numLocks: 32,
381 },
382 'TMS320TI816X' : {
383 baseAddr: 0x480CA800,
384 numLocks: 64,
385 },
386 },
387 'ti.catalog.arm.cortexm4' : {
388 'Vayu' : {
389 baseAddr: 0x4A0F6800,
390 numLocks: 32
391 },
392 },
393 'ti.catalog.arm.cortexa8' : {
394 'TMS320TI816X' : {
395 baseAddr: 0x480CA800,
396 numLocks: 64,
397 },
398 },
399 'ti.catalog.arm.cortexa15' : {
400 'Vayu' : {
401 baseAddr: 0x4A0F6800,
402 numLocks: 32
403 },
404 },
405 'ti.catalog.c6000' : {
406 'TMS320TI816X' : {
407 baseAddr: 0x080CA800,
408 numLocks: 64,
409 },
410 'OMAP4430' : {
411 baseAddr: 0x4A0F6800,
412 numLocks: 32,
413 },
414 'Arctic' : {
415 baseAddr: 0x480CA800,
416 numLocks: 64,
417 },
418 'Vayu' : {
419 baseAddr: 0x4A0F6800,
420 numLocks: 32
421 },
422 },
423 'ti.catalog.arp32' : {
424 /* 'TMS320C6A8149' : {
425 baseAddr: 0x480CA800,
426 numLocks: 64,
427 },
428 */
429 'Arctic' : {
430 baseAddr: 0x480CA800,
431 numLocks: 64,
432 },
433 'Vayu' : {
434 baseAddr: 0x4A0F6800,
435 numLocks: 32
436 },
437 }
438 }
439 for (var family in spinlockDelegates) {
440 setDeviceAliases(spinlockDelegates[family], deviceAliases);
441 }
442 setCatalogAliases(spinlockDelegates, catalogAliases);
444 /*
445 * ======== hwSemDelegates ========
446 */
447 var hwSemDelegates = {
448 'ti.catalog.c6000' : {
449 'TMS320C6474' : {
450 baseAddr: 0x02B40100,
451 queryAddr: 0x02B40300,
452 numSems: 32,
453 },
454 'TMS320C6678' : {
455 baseAddr: 0x02640100,
456 queryAddr: 0x02640200,
457 numSems: 32,
458 },
459 'TMS320C6670' : {
460 baseAddr: 0x02640100,
461 queryAddr: 0x02640200,
462 numSems: 32,
463 },
464 'TMS320TCI6634' : {
465 baseAddr: 0x02640100,
466 queryAddr: 0x02640200,
467 numSems: 32,
468 },
469 },
470 }
471 for (var family in hwSemDelegates) {
472 setDeviceAliases(hwSemDelegates[family], deviceAliases);
473 }
474 setCatalogAliases(hwSemDelegates, catalogAliases);
476 /*
477 * ======== getGateHWSemSettings ========
478 */
479 function getGateHWSemSettings()
480 {
481 var errorString = "IPC does not have a default GateHWSem" +
482 " delegate for the " + deviceName + " device!";
483 var catalogName = Program.cpu.catalogName;
484 var deviceName = deviceSupportCheck();
486 var errStr = "The device " + deviceName +
487 " does not support hardware semaphores!";
489 try {
490 var hwSemSettings = hwSemDelegates[catalogName][deviceName];
491 }
492 catch(e) {
493 throw new Error(errStr);
494 }
496 if (hwSemSettings == null) {
497 throw new Error(errStr);
498 }
500 return (hwSemSettings);
501 }
503 /*
504 * ======== getGateHWSpinlockSettings ========
505 */
506 function getGateHWSpinlockSettings()
507 {
508 var errorString = "IPC does not have a default GateHWSpinlock" +
509 " delegate for the " + deviceName + " device!";
510 var catalogName = Program.cpu.catalogName;
511 var deviceName = deviceSupportCheck();
513 var errStr = "The device " + deviceName +
514 " does not support hardware spinlocks!";
516 try {
517 var spinLockSettings = spinlockDelegates[catalogName][deviceName];
518 }
519 catch(e) {
520 throw new Error(errStr);
521 }
523 if (spinLockSettings == null) {
524 throw new Error(errStr);
525 }
527 return (spinLockSettings);
528 }
530 /*
531 * ======== generateSlaveDataForHost ========
532 */
533 function generateSlaveDataForHost()
534 {
535 var deviceName = deviceSupportCheck();
536 var retval = hostNeedsSlaveData[deviceName];
538 /* A15 is the already the host no need to generate data */
539 if ((Program.cpu.catalogName == 'ti.catalog.arm.cortexa8') ||
540 (Program.cpu.catalogName == 'ti.catalog.arm.cortexa9') ||
541 (Program.cpu.catalogName == 'ti.catalog.arm.cortexa15')) {
542 return (false);
543 }
545 if (retval != null) {
546 return (true);
547 }
549 return (false);
550 }
552 /*
553 * ======== getHostProcId ========
554 */
555 function getHostProcId()
556 {
557 var MultiProc = xdc.module("ti.sdo.utils.MultiProc");
558 var deviceName = deviceSupportCheck();
559 var hostProcName = hostProcNames[deviceName];
561 if (hostProcName == null) {
562 /* The device doesn't have a core that runs a hlos */
563 return (MultiProc.INVALIDID);
564 }
566 /*
567 * If the device may run a hlos, return the corresponding core's MultiProc
568 * id. MultiProc.INVALIDID will be returned if the core exists but isn't
569 * being used in the application
570 */
571 return(MultiProc.getIdMeta(String(hostProcName)));
572 }
574 /*
575 * ======== getIpcSR0Setup ========
576 */
577 function getIpcSR0Setup()
578 {
579 var deviceName = deviceSupportCheck();
580 var memorySetup = sr0MemorySetup[deviceName];
582 if (memorySetup == null) {
583 /* The device has memory available to it */
584 return (true);
585 }
586 else {
587 /* The device needs host to enable memory through mmu */
588 return (false);
589 }
590 }
592 /*
593 * ======== getHWGate ========
594 */
595 function getHWGate()
596 {
597 var deviceName = deviceSupportCheck();
598 if (deviceName == "TMS320C6472" ||
599 deviceName == "TMS320CTCI6486") {
600 return ('ti.sdo.ipc.gates.GateAAMonitor');
601 }
602 else if (deviceName == "TMS320C6A8149") {
603 return ('ti.sdo.ipc.gates.GatePetersonN');
604 }
605 try {
606 this.getGateHWSpinlockSettings();
607 return ('ti.sdo.ipc.gates.GateHWSpinlock');
608 }
609 catch(e) {
610 }
612 try {
613 this.getGateHWSemSettings();
614 return ('ti.sdo.ipc.gates.GateHWSem');
615 }
616 catch(e) {
617 }
619 return('ti.sdo.ipc.gates.GatePeterson');
620 }
622 /*
623 * ======== getDefaultInterruptDelegate ========
624 */
625 function getDefaultInterruptDelegate()
626 {
627 var catalogName = Program.cpu.catalogName;
628 var deviceName = deviceSupportCheck();
630 var delegate = interruptDelegates[catalogName][deviceName];
632 if (delegate == null) {
633 throw new Error ("IPC does not have a default Interrupt"
634 + " delegate for the " + deviceName + " device!");
635 }
637 return (delegate.del);
638 }
640 /*
641 * ======== getNameServerRemoteDelegate ========
642 */
643 function getNameServerRemoteDelegate()
644 {
645 var deviceName = deviceSupportCheck();
647 var delegate = nameServerRemoteDelegates[deviceName];
649 if (delegate == null) {
650 delegate = { del: 'ti.sdo.utils.NameServerRemoteNull', };
651 }
653 return (delegate.del);
654 }
656 /*
657 * ======== getNotifySetupDelegate ========
658 */
659 function getNotifySetupDelegate()
660 {
661 var deviceName = deviceSupportCheck();
663 var delegate = notifySetupDelegates[deviceName];
665 if (delegate == null) {
666 throw new Error ("IPC does not have a default NotifySetup"
667 + " delegate for the " + deviceName + " device!");
668 }
670 return (delegate.del);
671 }
673 /*
674 * ======== getMessageQSetupDelegate ========
675 */
676 function getMessageQSetupDelegate()
677 {
678 var deviceName = deviceSupportCheck();
680 var delegate = messageQSetupDelegates[deviceName];
682 if (delegate == null) {
683 throw new Error ("IPC does not have a default MessageQ setup"
684 + " delegate for the " + deviceName + " device!");
685 }
687 return (delegate.del);
688 }
690 /*
691 * ======== procInDevice ========
692 */
693 function procInDevice(procName)
694 {
695 var deviceName = deviceSupportCheck();
696 if (procNames[deviceName] == null) {
697 throw("The device (" + Program.cpu.deviceName +
698 ") isn't supported by IPC");
699 }
701 /* Search through the procNames table */
702 for each (name in procNames[deviceName]) {
703 if (name == procName) {
704 return (true);
705 }
706 }
708 return (false);
709 }
711 /*
712 * ======== getDeviceProcNames ========
713 */
714 function getDeviceProcNames()
715 {
716 var deviceName = deviceSupportCheck();
717 if (procNames[deviceName] == null) {
718 throw("The device (" + Program.cpu.deviceName +
719 ") isn't supported by IPC");
720 }
722 return (procNames[deviceName]);
723 }