1 /*
2 * Copyright (c) 2013-2015 Texas Instruments Incorporated - http://www.ti.com
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' : ['TMS320C66AK2E05',
144 'TMS320C66AK2H12',
145 'TMS320TCI6630K2L',
146 'TMS320TCI6636',
147 'TMS320TCI6638',
148 'Kepler'],
149 'TMS320C66AK2H12' : ['TCI66AK2G02',
150 'TCI6636K2H'],
151 'LM3.*' : ['LM4.*'],
152 'Vayu' : ['DRA7XX']
153 }
155 /*
156 * ======== procNames ========
157 */
158 var procNames = {
159 'TMS320CDM6446' : ["DSP", "HOST"],
160 'TMS320DA830' : ["DSP", "HOST"],
161 'OMAPL138' : ["DSP", "HOST"],
162 'TMS320TI816X' : ["DSP", "VIDEO-M3", "VPSS-M3", "HOST"],
163 'TMS320TI813X' : ["VIDEO-M3", "VPSS-M3", "HOST"],
164 'TMS320C6A8168' : ["DSP", "VPSS-M3", "HOST"],
165 'TMS320C6A8149' : ["DSP", "EVE", "VIDEO-M3", "VPSS-M3", "HOST"],
166 'TMS320C6670' : ["CORE0", "CORE1", "CORE2", "CORE3"],
167 'TMS320C6657' : ["CORE0", "CORE1"],
168 'TMS320C6672' : ["CORE0", "CORE1"],
169 'TMS320TCI6614' : ["CORE0", "CORE1", "CORE2", "CORE3", "HOST"],
170 'TMS320TCI6634' : ["CORE0", "CORE1", "CORE2", "CORE3",
171 "CORE4", "CORE5", "CORE6", "CORE7"],
173 /*
174 * Note, the name "HOST" was intentionally chosen as a proc name to
175 * accomodate TransportRpmsg, a common transport on these platforms.
176 */
177 'TMS320TCI6636' : ["HOST", "CORE0", "CORE1", "CORE2", "CORE3",
178 "CORE4", "CORE5", "CORE6", "CORE7"],
179 'TMS320TCI6638' : ["HOST", "CORE0", "CORE1", "CORE2", "CORE3",
180 "CORE4", "CORE5", "CORE6", "CORE7"],
181 'Kepler' : ["HOST", "CORE0", "CORE1", "CORE2", "CORE3",
182 "CORE4", "CORE5", "CORE6", "CORE7"],
183 'TMS320TCI6630K2L' : ["HOST", "CORE0", "CORE1", "CORE2", "CORE3"],
184 'TMS320C66AK2E05' : ["HOST", "CORE0"],
185 'TMS320C66AK2H12' : ["HOST", "CORE0", "CORE1", "CORE2", "CORE3",
186 "CORE4", "CORE5", "CORE6", "CORE7"],
187 'TCI66AK2G02' : ["HOST", "CORE0"],
188 'TMS320C6674' : ["CORE0", "CORE1", "CORE2", "CORE3"],
189 'TMS320C6678' : ["CORE0", "CORE1", "CORE2", "CORE3",
190 "CORE4", "CORE5", "CORE6", "CORE7"],
191 'TMS320C6472' : ["CORE0", "CORE1", "CORE2",
192 "CORE3", "CORE4", "CORE5"],
193 'TMS320C6474' : ["CORE0", "CORE1", "CORE2"],
194 'OMAP3530' : ["DSP", "HOST"],
195 'OMAP4430' : ["DSP", "CORE0", "CORE1", "HOST"],
197 /*
198 * Note that only SMP-BIOS is supported on OMAP5430, so there's only
199 * one "IPU" proc defined for the dual-core M4.
200 */
201 'OMAP5430' : ["DSP", "IPU", "HOST"],
203 'Arctic' : ["DSP", "ARP32"],
204 'LM3.*' : [ "" ], /* single core, any name can be used */
205 'Vayu' : ["DSP1", "DSP2", "EVE1", "EVE2", "EVE3", "EVE4",
206 "IPU1", "IPU2", "IPU1-0", "IPU1-1", "IPU2-0",
207 "IPU2-1", "HOST"],
208 'TDA3X' : ["DSP1", "DSP2", "IPU1", "IPU1-0", "IPU1-1", "EVE1"]
209 };
210 setDeviceAliases(procNames, deviceAliases);
212 /*
213 * ======== hostNeedsSlaveData =======
214 */
215 var hostNeedsSlaveData = {
216 'TMS320TI816X' : 1,
217 'OMAP3530' : 1,
218 'OMAP4430' : 1,
219 'TMS320CDM6446' : 1,
220 'TMS320DA830' : 1,
221 'OMAPL138' : 1,
222 'Vayu' : 1,
223 'TDA3X' : 1
224 };
225 setDeviceAliases(hostNeedsSlaveData, deviceAliases);
227 /*
228 * ======== sr0MemorySetup =======
229 * The devices in this list means these devices have a slave mmu
230 * that needs to be configured by the host before the slave can proceed.
231 */
232 var sr0MemorySetup = {
233 'TMS320TI816X' : 1,
234 'OMAP3530' : 1,
235 'OMAP4430' : 1,
236 };
237 setDeviceAliases(sr0MemorySetup, deviceAliases);
239 /*
240 * ======== hostProcNames =======
241 * The name of the host or master processor.
242 */
243 var hostProcNames = {
244 'TMS320CDM6446' : ["HOST"],
245 'TMS320DA830' : ["HOST"],
246 'OMAPL138' : ["HOST"],
247 'TMS320TI816X' : ["HOST"],
248 'OMAP3530' : ["HOST"],
249 'OMAP4430' : ["HOST"],
250 'TMS320C6678' : ["CORE0"],
251 'TMS320C6670' : ["CORE0"],
252 'TMS320C6472' : ["CORE0"],
253 'TMS320C6474' : ["CORE0"],
254 'TMS320C66AK2E05' : ["HOST"],
255 'TMS320TCI6630K2L' : ["HOST"],
256 'TMS320C66AK2H12' : ["HOST"],
257 'TMS320TCI6634' : ["CORE0"],
258 'TMS320TCI6636' : ["HOST0"],
259 'TMS320TCI6638' : ["HOST0"],
260 'Kepler' : ["HOST"],
261 };
262 setDeviceAliases(hostProcNames, deviceAliases);
264 /*
265 * ======== nameServerRemoteDelegates ========
266 */
267 var nameServerRemoteDelegates = {
268 'OMAP3530' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
269 'TMS320CDM6446' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
270 'TMS320DA830' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
271 'TMS320TI816X' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
272 'TMS320C6678' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
273 'TMS320C6670' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
274 'TMS320C6472' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
275 'TMS320C6474' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
276 'OMAP4430' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
277 'Arctic' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
278 'Vayu' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
279 'TDA3X' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify' },
280 'TMS320TCI6634' : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
281 };
282 setDeviceAliases(nameServerRemoteDelegates, deviceAliases);
284 /*
285 * ======== notifySetupDelegates ========
286 */
287 var notifySetupDelegates = {
288 'OMAP3530' : { del: 'ti.sdo.ipc.family.omap3530.NotifySetup', },
289 'TMS320CDM6446' : { del: 'ti.sdo.ipc.family.dm6446.NotifySetup', },
290 'TMS320DA830' : { del: 'ti.sdo.ipc.family.da830.NotifySetup', },
291 'TMS320TI816X' : { del: 'ti.sdo.ipc.family.ti81xx.NotifySetup', },
292 'TMS320C6A8149' : { del: 'ti.sdo.ipc.family.c6a8149.NotifySetup', },
293 'TMS320C6678' : { del: 'ti.sdo.ipc.family.c647x.NotifySetup', },
294 'TMS320C6670' : { del: 'ti.sdo.ipc.family.c647x.NotifySetup', },
295 'TMS320C6472' : { del: 'ti.sdo.ipc.family.c647x.NotifySetup', },
296 'TMS320C6474' : { del: 'ti.sdo.ipc.family.c647x.NotifySetup', },
297 'TMS320TCI6634' : { del: 'ti.sdo.ipc.family.tci663x.NotifyCircSetup', },
298 'TCI6636K2H' : { del: 'ti.sdo.ipc.family.tci663x.NotifyCircSetup', },
299 'OMAP4430' : { del: 'ti.sdo.ipc.family.omap4430.NotifySetup', },
300 'Arctic' : { del: 'ti.sdo.ipc.family.arctic.NotifyCircSetup', },
301 'LM3.*' : { del: 'ti.sdo.ipc.notifyDrivers.NotifySetupNull', },
302 'Vayu' : { del: 'ti.sdo.ipc.family.vayu.NotifySetup', },
303 'TDA3X' : { del: 'ti.sdo.ipc.family.tda3xx.NotifySetup' },
304 'OMAP5430' : { del: 'ti.sdo.ipc.notifyDrivers.NotifySetupNull' }
306 };
307 setDeviceAliases(notifySetupDelegates, deviceAliases);
309 /*
310 * ======== messageQSetupDelegates ========
311 */
312 var messageQSetupDelegates = {
313 'OMAP3530' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
314 'TMS320CDM6446' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
315 'TMS320DA830' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
316 'TMS320TI816X' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
317 'TMS320C6A8149' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
318 'TMS320C6678' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
319 'TMS320C6670' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
320 'TMS320C6472' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
321 'TMS320C6474' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
322 'TMS320TCI6634' : { del: 'ti.sdo.ipc.transports.TransportShmNotifySetup', },
323 'OMAP4430' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
324 'Arctic' : { del: 'ti.sdo.ipc.transports.TransportShmNotifySetup', },
325 'LM3.*' : { del: 'ti.sdo.ipc.transports.TransportNullSetup', },
326 'Vayu' : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
327 'TDA3X' : { del: 'ti.sdo.ipc.transports.TransportShmSetup' }
328 };
329 setDeviceAliases(messageQSetupDelegates, deviceAliases);
331 /*
332 * ======== interruptDelegates ========
333 */
334 var interruptDelegates = {
335 'ti.catalog.arm' : {
336 'TMS320CDM6446' : { del: 'ti.sdo.ipc.family.dm6446.InterruptArm', },
337 'TMS320DA830' : { del: 'ti.sdo.ipc.family.da830.InterruptArm', },
338 'OMAPL138' : { del: 'ti.sdo.ipc.family.da830.InterruptArm', },
339 },
340 'ti.catalog.arm.cortexm3' : {
341 'TMS320TI816X' : { del: 'ti.sdo.ipc.family.ti81xx.InterruptDucati', },
342 'TMS320C6A8149' : { del: 'ti.sdo.ipc.family.c6a8149.InterruptDucati', },
343 'OMAP4430' : { del: 'ti.sdo.ipc.family.omap4430.InterruptDucati', },
344 },
345 'ti.catalog.arm.cortexm4' : {
346 'Vayu' : { del: 'ti.sdo.ipc.family.vayu.InterruptIpu', },
347 'TDA3X' : { del: 'ti.sdo.ipc.family.tda3xx.InterruptIpu' },
348 },
349 'ti.catalog.arm.cortexa8' : {
350 'TMS320TI816X' : { del: 'ti.sdo.ipc.family.ti81xx.InterruptHost', },
351 'TMS320C6A8149' : { del: 'ti.sdo.ipc.family.c6a8149.InterruptHost', },
352 'OMAP3530' : { del: 'ti.sdo.ipc.family.omap3530.InterruptHost', },
353 },
354 'ti.catalog.arm.cortexa15' : {
355 'Vayu' : { del: 'ti.sdo.ipc.family.vayu.InterruptHost', },
356 'TCI66AK2G02' : { del: 'ti.sdo.ipc.family.tci663x.Interrupt', },
357 'TCI6636K2H' : { del: 'ti.sdo.ipc.family.tci663x.Interrupt', },
358 'TMS320C66AK2E05' : { del: 'ti.sdo.ipc.family.tci663x.Interrupt', },
359 'TMS320TCI6630K2L' : { del: 'ti.sdo.ipc.family.tci663x.Interrupt', },
360 },
361 'ti.catalog.c6000' : {
362 'OMAP3530' : { del: 'ti.sdo.ipc.family.omap3530.InterruptDsp', },
363 'TMS320CDM6446' : { del: 'ti.sdo.ipc.family.dm6446.InterruptDsp', },
364 'TMS320DA830' : { del: 'ti.sdo.ipc.family.da830.InterruptDsp', },
365 'OMAPL138' : { del: 'ti.sdo.ipc.family.da830.InterruptDsp', },
366 'TMS320TI816X' : { del: 'ti.sdo.ipc.family.ti81xx.InterruptDsp', },
367 'TMS320C6A8149' : { del: 'ti.sdo.ipc.family.c6a8149.InterruptDsp', },
368 'TMS320C6472' : { del: 'ti.sdo.ipc.family.c647x.Interrupt', },
369 'TMS320C6474' : { del: 'ti.sdo.ipc.family.c647x.Interrupt', },
370 'TMS320C6678' : { del: 'ti.sdo.ipc.family.c647x.Interrupt', },
371 'TMS320C6670' : { del: 'ti.sdo.ipc.family.c647x.Interrupt', },
372 'TMS320TCI6634' : { del: 'ti.sdo.ipc.family.tci663x.Interrupt', },
373 'TCI6636K2H' : { del: 'ti.sdo.ipc.family.tci663x.Interrupt', },
375 'OMAP4430' : { del: 'ti.sdo.ipc.family.omap4430.InterruptDsp', },
376 'Arctic' : { del: 'ti.sdo.ipc.family.arctic.InterruptDsp', },
377 'Vayu' : { del: 'ti.sdo.ipc.family.vayu.InterruptDsp', },
378 'TDA3X' : { del: 'ti.sdo.ipc.family.tda3xx.InterruptDsp' },
379 },
380 'ti.catalog.arp32' : {
381 'TMS320C6A8149' : { del: 'ti.sdo.ipc.family.c6a8149.InterruptEve', },
382 'Arctic' : { del: 'ti.sdo.ipc.family.arctic.InterruptArp32', },
383 'Vayu' : { del: 'ti.sdo.ipc.family.vayu.InterruptArp32', },
384 'TDA3X' : { del: 'ti.sdo.ipc.family.tda3xx.InterruptArp32' },
385 },
386 };
387 for (var family in interruptDelegates) {
388 setDeviceAliases(interruptDelegates[family], deviceAliases);
389 }
390 setCatalogAliases(interruptDelegates, catalogAliases);
392 /*
393 * ======== spinlockDelegates ========
394 */
395 var spinlockDelegates = {
396 'ti.catalog.arm.cortexm3' : {
397 'OMAP4430' : {
398 baseAddr: 0x4A0F6800,
399 numLocks: 32,
400 },
401 'TMS320TI816X' : {
402 baseAddr: 0x480CA800,
403 numLocks: 64,
404 },
405 },
406 'ti.catalog.arm.cortexm4' : {
407 'Vayu' : {
408 baseAddr: 0x4A0F6800,
409 numLocks: 256
410 },
411 'TDA3X' : {
412 baseAddr: 0x4A0F6800,
413 numLocks: 256
414 }
415 },
416 'ti.catalog.arm.cortexa8' : {
417 'TMS320TI816X' : {
418 baseAddr: 0x480CA800,
419 numLocks: 64,
420 },
421 },
422 'ti.catalog.arm.cortexa15' : {
423 'Vayu' : {
424 baseAddr: 0x4A0F6800,
425 numLocks: 256
426 },
427 },
428 'ti.catalog.c6000' : {
429 'TMS320TI816X' : {
430 baseAddr: 0x080CA800,
431 numLocks: 64,
432 },
433 'OMAP4430' : {
434 baseAddr: 0x4A0F6800,
435 numLocks: 32,
436 },
437 'Arctic' : {
438 baseAddr: 0x480CA800,
439 numLocks: 64,
440 },
441 'Vayu' : {
442 baseAddr: 0x4A0F6800,
443 numLocks: 256
444 },
445 'TDA3X' : {
446 baseAddr: 0x4A0F6800,
447 numLocks: 256
448 }
449 },
450 'ti.catalog.arp32' : {
451 /* 'TMS320C6A8149' : {
452 baseAddr: 0x480CA800,
453 numLocks: 64,
454 },
455 */
456 'Arctic' : {
457 baseAddr: 0x480CA800,
458 numLocks: 64,
459 },
460 'Vayu' : {
461 baseAddr: 0x4A0F6800,
462 numLocks: 256
463 },
464 'TDA3X' : {
465 baseAddr: 0x4A0F6800,
466 numLocks: 256
467 }
468 }
469 }
470 for (var family in spinlockDelegates) {
471 setDeviceAliases(spinlockDelegates[family], deviceAliases);
472 }
473 setCatalogAliases(spinlockDelegates, catalogAliases);
475 /*
476 * ======== hwSemDelegates ========
477 */
478 var hwSemDelegates = {
479 'ti.catalog.c6000' : {
480 'TMS320C6474' : {
481 baseAddr: 0x02B40100,
482 queryAddr: 0x02B40300,
483 numSems: 32,
484 },
485 'TMS320C6678' : {
486 baseAddr: 0x02640100,
487 queryAddr: 0x02640200,
488 numSems: 32,
489 },
490 'TMS320C6670' : {
491 baseAddr: 0x02640100,
492 queryAddr: 0x02640200,
493 numSems: 32,
494 },
495 'TMS320TCI6634' : {
496 baseAddr: 0x02640100,
497 queryAddr: 0x02640200,
498 numSems: 32,
499 }
500 },
501 'ti.catalog.arm.cortexa15' : {
502 'TMS320C66AK2H12' : {
503 baseAddr: 0x02640100,
504 queryAddr: 0x02640200,
505 numSems: 32,
506 },
507 'TMS320C66AK2E05' : {
508 baseAddr: 0x02640100,
509 queryAddr: 0x02640200,
510 numSems: 32,
511 },
512 'TMS320TCI6630K2L' : {
513 baseAddr: 0x02640100,
514 queryAddr: 0x02640200,
515 numSems: 32,
516 }
517 }
518 }
519 for (var family in hwSemDelegates) {
520 setDeviceAliases(hwSemDelegates[family], deviceAliases);
521 }
522 setCatalogAliases(hwSemDelegates, catalogAliases);
524 /*
525 * ======== getGateHWSemSettings ========
526 */
527 function getGateHWSemSettings()
528 {
529 var errorString = "IPC does not have a default GateHWSem" +
530 " delegate for the " + deviceName + " device!";
531 var catalogName = Program.cpu.catalogName;
532 var deviceName = deviceSupportCheck();
534 var errStr = "The device " + deviceName +
535 " does not support hardware semaphores!";
537 try {
538 var hwSemSettings = hwSemDelegates[catalogName][deviceName];
539 }
540 catch(e) {
541 throw new Error(errStr);
542 }
544 if (hwSemSettings == null) {
545 throw new Error(errStr);
546 }
548 return (hwSemSettings);
549 }
551 /*
552 * ======== getGateHWSpinlockSettings ========
553 */
554 function getGateHWSpinlockSettings()
555 {
556 var errorString = "IPC does not have a default GateHWSpinlock" +
557 " delegate for the " + deviceName + " device!";
558 var catalogName = Program.cpu.catalogName;
559 var deviceName = deviceSupportCheck();
561 var errStr = "The device " + deviceName +
562 " does not support hardware spinlocks!";
564 try {
565 var spinLockSettings = spinlockDelegates[catalogName][deviceName];
566 }
567 catch(e) {
568 throw new Error(errStr);
569 }
571 if (spinLockSettings == null) {
572 throw new Error(errStr);
573 }
575 return (spinLockSettings);
576 }
578 /*
579 * ======== generateSlaveDataForHost ========
580 */
581 function generateSlaveDataForHost()
582 {
583 var deviceName = deviceSupportCheck();
584 var retval = hostNeedsSlaveData[deviceName];
586 /* A15 is the already the host no need to generate data */
587 if ((Program.cpu.catalogName == 'ti.catalog.arm.cortexa8') ||
588 (Program.cpu.catalogName == 'ti.catalog.arm.cortexa9') ||
589 (Program.cpu.catalogName == 'ti.catalog.arm.cortexa15')) {
590 return (false);
591 }
593 if (retval != null) {
594 return (true);
595 }
597 return (false);
598 }
600 /*
601 * ======== getHostProcId ========
602 */
603 function getHostProcId()
604 {
605 var MultiProc = xdc.module("ti.sdo.utils.MultiProc");
606 var deviceName = deviceSupportCheck();
607 var hostProcName = hostProcNames[deviceName];
609 if (hostProcName == null) {
610 /* The device doesn't have a core that runs a hlos */
611 return (MultiProc.INVALIDID);
612 }
614 /*
615 * If the device may run a hlos, return the corresponding core's MultiProc
616 * id. MultiProc.INVALIDID will be returned if the core exists but isn't
617 * being used in the application
618 */
619 return(MultiProc.getIdMeta(String(hostProcName)));
620 }
622 /*
623 * ======== getIpcSR0Setup ========
624 */
625 function getIpcSR0Setup()
626 {
627 var deviceName = deviceSupportCheck();
628 var memorySetup = sr0MemorySetup[deviceName];
630 if (memorySetup == null) {
631 /* The device has memory available to it */
632 return (true);
633 }
634 else {
635 /* The device needs host to enable memory through mmu */
636 return (false);
637 }
638 }
640 /*
641 * ======== getHWGate ========
642 */
643 function getHWGate()
644 {
645 var deviceName = deviceSupportCheck();
646 if (deviceName == "TMS320C6472" ||
647 deviceName == "TMS320CTCI6486") {
648 return ('ti.sdo.ipc.gates.GateAAMonitor');
649 }
650 else if (deviceName == "TMS320C6A8149") {
651 return ('ti.sdo.ipc.gates.GatePetersonN');
652 }
653 try {
654 this.getGateHWSpinlockSettings();
655 return ('ti.sdo.ipc.gates.GateHWSpinlock');
656 }
657 catch(e) {
658 }
660 try {
661 this.getGateHWSemSettings();
662 return ('ti.sdo.ipc.gates.GateHWSem');
663 }
664 catch(e) {
665 }
667 return('ti.sdo.ipc.gates.GatePeterson');
668 }
670 /*
671 * ======== getDefaultInterruptDelegate ========
672 */
673 function getDefaultInterruptDelegate()
674 {
675 var catalogName = Program.cpu.catalogName;
676 var deviceName = deviceSupportCheck();
678 var delegate = interruptDelegates[catalogName][deviceName];
680 if (delegate == null) {
681 throw new Error ("IPC does not have a default Interrupt"
682 + " delegate for the " + deviceName + " device!");
683 }
685 return (delegate.del);
686 }
688 /*
689 * ======== getNameServerRemoteDelegate ========
690 */
691 function getNameServerRemoteDelegate()
692 {
693 var deviceName = deviceSupportCheck();
695 var delegate = nameServerRemoteDelegates[deviceName];
697 if (delegate == null) {
698 delegate = { del: 'ti.sdo.utils.NameServerRemoteNull', };
699 }
701 return (delegate.del);
702 }
704 /*
705 * ======== getNotifySetupDelegate ========
706 */
707 function getNotifySetupDelegate()
708 {
709 var deviceName = deviceSupportCheck();
711 var delegate = notifySetupDelegates[deviceName];
713 if (delegate == null) {
714 throw new Error ("IPC does not have a default NotifySetup"
715 + " delegate for the " + deviceName + " device!");
716 }
718 return (delegate.del);
719 }
721 /*
722 * ======== getMessageQSetupDelegate ========
723 */
724 function getMessageQSetupDelegate()
725 {
726 var deviceName = deviceSupportCheck();
728 var delegate = messageQSetupDelegates[deviceName];
730 if (delegate == null) {
731 throw new Error ("IPC does not have a default MessageQ setup"
732 + " delegate for the " + deviceName + " device!");
733 }
735 return (delegate.del);
736 }
738 /*
739 * ======== procInDevice ========
740 */
741 function procInDevice(procName)
742 {
743 var deviceName = deviceSupportCheck();
744 if (procNames[deviceName] == null) {
745 throw("The device (" + Program.cpu.deviceName +
746 ") isn't supported by IPC");
747 }
749 /* Search through the procNames table */
750 for each (name in procNames[deviceName]) {
751 if (name == procName) {
752 return (true);
753 }
754 }
756 return (false);
757 }
759 /*
760 * ======== getDeviceProcNames ========
761 */
762 function getDeviceProcNames()
763 {
764 var deviceName = deviceSupportCheck();
765 if (procNames[deviceName] == null) {
766 throw("The device (" + Program.cpu.deviceName +
767 ") isn't supported by IPC");
768 }
770 return (procNames[deviceName]);
771 }