]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/blob - packages/ti/sdo/ipc/family/Settings.xs
SDOCM00112254 - Add IPC support for Soprano
[ipc/ipcdev.git] / packages / ti / sdo / ipc / family / Settings.xs
1 /*
2  * Copyright (c) 2013-2014, 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     }
108 /*
109  *  ======== catalogAliases ========
110  *  Aliases for catalog
111  */
112 var catalogAliases = {
113     'ti.catalog.arm.cortexm3' : ['ti.catalog.arm'],
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                            'TMS320TCI6630K2L',
145                            'TMS320TCI6636',
146                            'TMS320TCI6638',
147                            'Kepler'],
148     'LM3.*'             : ['LM4.*'],
149     'Vayu'              : ['DRA7XX']
152 /*
153  *  ======== procNames ========
154  */
155 var procNames = {
156     'TMS320CDM6446'     : ["DSP", "HOST"],
157     'TMS320DA830'       : ["DSP", "HOST"],
158     'OMAPL138'          : ["DSP", "HOST"],
159     'TMS320TI816X'      : ["DSP", "VIDEO-M3", "VPSS-M3", "HOST"],
160     'TMS320TI813X'      : ["VIDEO-M3", "VPSS-M3", "HOST"],
161     'TMS320C6A8168'     : ["DSP", "VPSS-M3", "HOST"],
162     'TMS320C6A8149'     : ["DSP", "EVE", "VIDEO-M3", "VPSS-M3", "HOST"],
163     'TMS320C6670'       : ["CORE0", "CORE1", "CORE2", "CORE3"],
164     'TMS320C6657'       : ["CORE0", "CORE1"],
165     'TMS320C6672'       : ["CORE0", "CORE1"],
166     'TMS320TCI6614'     : ["CORE0", "CORE1", "CORE2", "CORE3", "HOST"],
167     'TMS320TCI6634'     : ["CORE0", "CORE1", "CORE2", "CORE3",
168                            "CORE4", "CORE5", "CORE6", "CORE7"],
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     'TMS320TCI6636'     : ["HOST", "CORE0", "CORE1", "CORE2", "CORE3",
175                            "CORE4", "CORE5", "CORE6", "CORE7"],
176     'TMS320TCI6638'     : ["HOST", "CORE0", "CORE1", "CORE2", "CORE3",
177                            "CORE4", "CORE5", "CORE6", "CORE7"],
178     'Kepler'            : ["HOST", "CORE0", "CORE1", "CORE2", "CORE3",
179                            "CORE4", "CORE5", "CORE6", "CORE7"],
180     'TMS320TCI6630K2L'  : ["HOST", "CORE0", "CORE1", "CORE2", "CORE3"],
181     'TMS320C66AK2E05'     : ["HOST", "CORE0"],
183     'TMS320C6674'       : ["CORE0", "CORE1", "CORE2", "CORE3"],
184     'TMS320C6678'       : ["CORE0", "CORE1", "CORE2", "CORE3",
185                            "CORE4", "CORE5", "CORE6", "CORE7"],
186     'TMS320C6472'       : ["CORE0", "CORE1", "CORE2",
187                            "CORE3", "CORE4", "CORE5"],
188     'TMS320C6474'       : ["CORE0", "CORE1", "CORE2"],
189     'OMAP3530'          : ["DSP", "HOST"],
190     'OMAP4430'          : ["DSP", "CORE0", "CORE1", "HOST"],
192     /*
193      * Note that only SMP-BIOS is supported on OMAP5430, so there's only
194      * one "IPU" proc defined for the dual-core M4.
195      */
196     'OMAP5430'          : ["DSP", "IPU", "HOST"],
198     'Arctic'            : ["DSP", "ARP32"],
199     'F28M3.*'           : ["M3", "C28"],
200     'TMS320F2837.*'     : ["CORE0", "CORE1"],
201     'LM3.*'             : [ "" ],  /* single core, any name can be used */
202     'Vayu'              : ["DSP1", "DSP2", "EVE1", "EVE2", "EVE3", "EVE4",
203                            "IPU1", "IPU2", "IPU1-0", "IPU1-1", "IPU2-0",
204                            "IPU2-1", "HOST"],
205     'TDA3X'             : ["DSP1", "DSP2", "IPU1", "IPU1-0", "IPU1-1", "EVE1"]
206 };
207 setDeviceAliases(procNames, deviceAliases);
209 /*
210  *  ======== hostNeedsSlaveData =======
211  */
212 var hostNeedsSlaveData = {
213     'TMS320TI816X'      : 1,
214     'OMAP3530'          : 1,
215     'OMAP4430'          : 1,
216     'TMS320CDM6446'     : 1,
217     'TMS320DA830'       : 1,
218     'OMAPL138'          : 1,
219     'Vayu'              : 1,
220     'TDA3X'             : 1
221 };
222 setDeviceAliases(hostNeedsSlaveData, deviceAliases);
224 /*
225  *  ======== sr0MemorySetup =======
226  *  The devices in this list means these devices have a slave mmu
227  *  that needs to be configured by the host before the slave can proceed.
228  */
229 var sr0MemorySetup = {
230     'TMS320TI816X'      : 1,
231     'OMAP3530'          : 1,
232     'OMAP4430'          : 1,
233 };
234 setDeviceAliases(sr0MemorySetup, deviceAliases);
236 /*
237  *  ======== hostProcNames =======
238  *  The name of the host or master processor.
239  */
240 var hostProcNames = {
241     'TMS320CDM6446'     : ["HOST"],
242     'TMS320DA830'       : ["HOST"],
243     'OMAPL138'          : ["HOST"],
244     'TMS320TI816X'      : ["HOST"],
245     'OMAP3530'          : ["HOST"],
246     'OMAP4430'          : ["HOST"],
247     'TMS320C6678'       : ["CORE0"],
248     'TMS320C6670'       : ["CORE0"],
249     'TMS320C6472'       : ["CORE0"],
250     'TMS320C6474'       : ["CORE0"],
251     'F28M3.*'           : ["M3"],
252     'TMS320F2837.*'     : ["CORE0"],
253     'TMS320TCI6630K2L'  : ["HOST"],
254     'TMS320TCI6634'     : ["CORE0"],
255     'TMS320TCI6636'     : ["HOST0"],
256     'TMS320TCI6638'     : ["HOST0"],
257     'Kepler'            : ["HOST"],
258 };
259 setDeviceAliases(hostProcNames, deviceAliases);
261 /*
262  *  ======== nameServerRemoteDelegates ========
263  */
264 var nameServerRemoteDelegates = {
265     'OMAP3530'          : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
266     'TMS320CDM6446'     : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
267     'TMS320DA830'       : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
268     'TMS320TI816X'      : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
269     'TMS320C6678'       : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
270     'TMS320C6670'       : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
271     'TMS320C6472'       : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
272     'TMS320C6474'       : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
273     'OMAP4430'          : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
274     'Arctic'            : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
275     'F28M3.*'           : { del: 'ti.sdo.ipc.family.f28m35x.NameServerBlock', },
276     'TMS320F2837.*'     : { del: 'ti.sdo.ipc.family.f2837x.NameServerBlock', },
277     'Vayu'              : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
278     'TDA3X'             : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify' },
279     'TMS320TCI6634'     : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
280 };
281 setDeviceAliases(nameServerRemoteDelegates, deviceAliases);
283 /*
284  *  ======== notifySetupDelegates ========
285  */
286 var notifySetupDelegates = {
287     'OMAP3530'          : { del: 'ti.sdo.ipc.family.omap3530.NotifySetup', },
288     'TMS320CDM6446'     : { del: 'ti.sdo.ipc.family.dm6446.NotifySetup', },
289     'TMS320DA830'       : { del: 'ti.sdo.ipc.family.da830.NotifySetup', },
290     'TMS320TI816X'      : { del: 'ti.sdo.ipc.family.ti81xx.NotifySetup', },
291     'TMS320C6A8149'     : { del: 'ti.sdo.ipc.family.c6a8149.NotifySetup', },
292     'TMS320C6678'       : { del: 'ti.sdo.ipc.family.c647x.NotifySetup', },
293     'TMS320C6670'       : { del: 'ti.sdo.ipc.family.c647x.NotifySetup', },
294     'TMS320C6472'       : { del: 'ti.sdo.ipc.family.c647x.NotifySetup', },
295     'TMS320C6474'       : { del: 'ti.sdo.ipc.family.c647x.NotifySetup', },
296     'TMS320TCI6634'     : { del: 'ti.sdo.ipc.family.tci663x.NotifyCircSetup', },
297     'OMAP4430'          : { del: 'ti.sdo.ipc.family.omap4430.NotifySetup', },
298     'Arctic'            : { del: 'ti.sdo.ipc.family.arctic.NotifyCircSetup', },
299     'F28M3.*'           : { del: 'ti.sdo.ipc.notifyDrivers.NotifySetupNull', },
300     'TMS320F2837.*'     : { del: 'ti.sdo.ipc.notifyDrivers.NotifySetupNull', },
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     'F28M3.*'           : { del: 'ti.sdo.ipc.transports.TransportNullSetup', },
326     'TMS320F2837.*'     : { del: 'ti.sdo.ipc.transports.TransportNullSetup', },
327     'LM3.*'             : { del: 'ti.sdo.ipc.transports.TransportNullSetup', },
328     'Vayu'              : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
329     'TDA3X'             : { del: 'ti.sdo.ipc.transports.TransportShmSetup' }
330 };
331 setDeviceAliases(messageQSetupDelegates, deviceAliases);
333 /*
334  *  ======== interruptDelegates ========
335  */
336 var interruptDelegates = {
337     'ti.catalog.arm' : {
338         'TMS320CDM6446' : { del: 'ti.sdo.ipc.family.dm6446.InterruptArm', },
339         'TMS320DA830'   : { del: 'ti.sdo.ipc.family.da830.InterruptArm', },
340         'OMAPL138'      : { del: 'ti.sdo.ipc.family.da830.InterruptArm', },
341     },
342     'ti.catalog.arm.cortexm3' : {
343         'TMS320TI816X'  : { del: 'ti.sdo.ipc.family.ti81xx.InterruptDucati', },
344         'TMS320C6A8149' : { del: 'ti.sdo.ipc.family.c6a8149.InterruptDucati', },
345         'OMAP4430'      : { del: 'ti.sdo.ipc.family.omap4430.InterruptDucati', },
346         'F28M3.*'       : { del: 'ti.sdo.ipc.family.f28m35x.InterruptM3', },
347     },
348     'ti.catalog.arm.cortexm4' : {
349         'Vayu'          : { del: 'ti.sdo.ipc.family.vayu.InterruptIpu', },
350         'TDA3X'         : { del: 'ti.sdo.ipc.family.tda3xx.InterruptIpu' },
351     },
352     'ti.catalog.arm.cortexa8' : {
353         'TMS320TI816X'  : { del: 'ti.sdo.ipc.family.ti81xx.InterruptHost', },
354         'TMS320C6A8149' : { del: 'ti.sdo.ipc.family.c6a8149.InterruptHost', },
355         'OMAP3530'      : { del: 'ti.sdo.ipc.family.omap3530.InterruptHost', },
356     },
357     'ti.catalog.arm.cortexa15' : {
358         'Vayu'          : { del: 'ti.sdo.ipc.family.vayu.InterruptHost', },
359     },
360     'ti.catalog.c6000' : {
361         'OMAP3530'      : { del: 'ti.sdo.ipc.family.omap3530.InterruptDsp', },
362         'TMS320CDM6446' : { del: 'ti.sdo.ipc.family.dm6446.InterruptDsp', },
363         'TMS320DA830'   : { del: 'ti.sdo.ipc.family.da830.InterruptDsp', },
364         'OMAPL138'      : { del: 'ti.sdo.ipc.family.da830.InterruptDsp', },
365         'TMS320TI816X'  : { del: 'ti.sdo.ipc.family.ti81xx.InterruptDsp', },
366         'TMS320C6A8149' : { del: 'ti.sdo.ipc.family.c6a8149.InterruptDsp', },
367         'TMS320C6472'   : { del: 'ti.sdo.ipc.family.c647x.Interrupt', },
368         'TMS320C6474'   : { del: 'ti.sdo.ipc.family.c647x.Interrupt', },
369         'TMS320C6678'   : { del: 'ti.sdo.ipc.family.c647x.Interrupt', },
370         'TMS320C6670'   : { del: 'ti.sdo.ipc.family.c647x.Interrupt', },
371         'TMS320TCI6634' : { del: 'ti.sdo.ipc.family.tci663x.Interrupt', },
373         'OMAP4430'      : { del: 'ti.sdo.ipc.family.omap4430.InterruptDsp', },
374         'Arctic'        : { del: 'ti.sdo.ipc.family.arctic.InterruptDsp', },
375         'Vayu'          : { del: 'ti.sdo.ipc.family.vayu.InterruptDsp', },
376         'TDA3X'         : { del: 'ti.sdo.ipc.family.tda3xx.InterruptDsp' },
377     },
378     'ti.catalog.arp32' : {
379         'TMS320C6A8149' : { del: 'ti.sdo.ipc.family.c6a8149.InterruptEve', },
380         'Arctic'        : { del: 'ti.sdo.ipc.family.arctic.InterruptArp32', },
381         'Vayu'          : { del: 'ti.sdo.ipc.family.vayu.InterruptArp32', },
382         'TDA3X'         : { del: 'ti.sdo.ipc.family.tda3xx.InterruptArp32' },
383     },
384     'ti.catalog.c2800' : {
385         'F28M3.*'       : { del: 'ti.sdo.ipc.family.f28m35x.InterruptC28', },
386     },
387 };
388 for (var family in interruptDelegates) {
389     setDeviceAliases(interruptDelegates[family], deviceAliases);
391 setCatalogAliases(interruptDelegates, catalogAliases);
393 /*
394  *  ======== spinlockDelegates ========
395  */
396 var spinlockDelegates = {
397     'ti.catalog.arm.cortexm3' : {
398         'OMAP4430' : {
399             baseAddr:   0x4A0F6800,
400             numLocks:   32,
401         },
402         'TMS320TI816X' : {
403             baseAddr:   0x480CA800,
404             numLocks:   64,
405         },
406     },
407     'ti.catalog.arm.cortexm4' : {
408         'Vayu' : {
409             baseAddr:   0x4A0F6800,
410             numLocks:   32
411         },
412         'TDA3X' : {
413             baseAddr:   0x4A0F6800,
414             numLocks:   256
415         }
416     },
417     'ti.catalog.arm.cortexa8' : {
418         'TMS320TI816X' : {
419             baseAddr:   0x480CA800,
420             numLocks:   64,
421         },
422     },
423     'ti.catalog.arm.cortexa15' : {
424         'Vayu' : {
425             baseAddr:   0x4A0F6800,
426             numLocks:   32
427         },
428     },
429     'ti.catalog.c6000' : {
430         'TMS320TI816X' : {
431             baseAddr:   0x080CA800,
432             numLocks:   64,
433         },
434         'OMAP4430' : {
435             baseAddr:   0x4A0F6800,
436             numLocks:   32,
437         },
438         'Arctic' : {
439             baseAddr:   0x480CA800,
440             numLocks:   64,
441         },
442         'Vayu' : {
443             baseAddr:   0x4A0F6800,
444             numLocks:   32
445         },
446         'TDA3X' : {
447             baseAddr:   0x4A0F6800,
448             numLocks:   256
449         }
450     },
451     'ti.catalog.arp32' : {
452         /*      'TMS320C6A8149' : {
453                     baseAddr:   0x480CA800,
454                     numLocks:   64,
455                 },
456         */
457         'Arctic' : {
458             baseAddr:   0x480CA800,
459             numLocks:   64,
460         },
461         'Vayu' : {
462             baseAddr:   0x4A0F6800,
463             numLocks:   32
464         },
465         'TDA3X' : {
466             baseAddr:   0x4A0F6800,
467             numLocks:   256
468         }
469     }
471 for (var family in spinlockDelegates) {
472     setDeviceAliases(spinlockDelegates[family], deviceAliases);
474 setCatalogAliases(spinlockDelegates, catalogAliases);
476 /*
477  *  ======== hwSemDelegates ========
478  */
479 var hwSemDelegates = {
480     'ti.catalog.c6000' : {
481         'TMS320C6474' : {
482             baseAddr:   0x02B40100,
483             queryAddr:  0x02B40300,
484             numSems:    32,
485         },
486         'TMS320C6678' : {
487             baseAddr:   0x02640100,
488             queryAddr:  0x02640200,
489             numSems:    32,
490         },
491         'TMS320C6670' : {
492             baseAddr:   0x02640100,
493             queryAddr:  0x02640200,
494             numSems:    32,
495         },
496         'TMS320TCI6634' : {
497             baseAddr:   0x02640100,
498             queryAddr:  0x02640200,
499             numSems:    32,
500         },
501     },
503 for (var family in hwSemDelegates) {
504     setDeviceAliases(hwSemDelegates[family], deviceAliases);
506 setCatalogAliases(hwSemDelegates, catalogAliases);
508 /*
509  *  ======== getGateHWSemSettings ========
510  */
511 function getGateHWSemSettings()
513     var errorString = "IPC does not have a default GateHWSem" +
514                       " delegate for the " + deviceName + " device!";
515     var catalogName = Program.cpu.catalogName;
516     var deviceName = deviceSupportCheck();
518     var errStr = "The device " + deviceName +
519         " does not support hardware semaphores!";
521     try {
522         var hwSemSettings = hwSemDelegates[catalogName][deviceName];
523     }
524     catch(e) {
525         throw new Error(errStr);
526     }
528     if (hwSemSettings == null) {
529         throw new Error(errStr);
530     }
532     return (hwSemSettings);
535 /*
536  *  ======== getGateHWSpinlockSettings ========
537  */
538 function getGateHWSpinlockSettings()
540     var errorString = "IPC does not have a default GateHWSpinlock" +
541                       " delegate for the " + deviceName + " device!";
542     var catalogName = Program.cpu.catalogName;
543     var deviceName = deviceSupportCheck();
545     var errStr = "The device " + deviceName +
546         " does not support hardware spinlocks!";
548     try {
549         var spinLockSettings = spinlockDelegates[catalogName][deviceName];
550     }
551     catch(e) {
552         throw new Error(errStr);
553     }
555     if (spinLockSettings == null) {
556         throw new Error(errStr);
557     }
559     return (spinLockSettings);
562 /*
563  *  ======== generateSlaveDataForHost ========
564  */
565 function generateSlaveDataForHost()
567     var deviceName = deviceSupportCheck();
568     var retval = hostNeedsSlaveData[deviceName];
570     /* A15 is the already the host no need to generate data */
571     if ((Program.cpu.catalogName == 'ti.catalog.arm.cortexa8') ||
572         (Program.cpu.catalogName == 'ti.catalog.arm.cortexa9') ||
573         (Program.cpu.catalogName == 'ti.catalog.arm.cortexa15')) {
574         return (false);
575     }
577     if (retval != null) {
578         return (true);
579     }
581     return (false);
584 /*
585  *  ======== getHostProcId ========
586  */
587 function getHostProcId()
589     var MultiProc = xdc.module("ti.sdo.utils.MultiProc");
590     var deviceName = deviceSupportCheck();
591     var hostProcName = hostProcNames[deviceName];
593     if (hostProcName == null) {
594         /* The device doesn't have a core that runs a hlos */
595         return (MultiProc.INVALIDID);
596     }
598     /*
599      *  If the device may run a hlos, return the corresponding core's MultiProc
600      *  id. MultiProc.INVALIDID will be returned if the core exists but isn't
601      *  being used in the application
602      */
603     return(MultiProc.getIdMeta(String(hostProcName)));
606 /*
607  *  ======== getIpcSR0Setup ========
608  */
609 function getIpcSR0Setup()
611     var deviceName = deviceSupportCheck();
612     var memorySetup = sr0MemorySetup[deviceName];
614     if (memorySetup == null) {
615         /* The device has memory available to it */
616         return (true);
617     }
618     else {
619         /* The device needs host to enable memory through mmu */
620         return (false);
621     }
624 /*
625  *  ======== getHWGate ========
626  */
627 function getHWGate()
629     var deviceName = deviceSupportCheck();
630     if (deviceName == "TMS320C6472" ||
631         deviceName == "TMS320CTCI6486") {
632         return ('ti.sdo.ipc.gates.GateAAMonitor');
633     }
634     else if (deviceName == "TMS320C6A8149") {
635         return ('ti.sdo.ipc.gates.GatePetersonN');
636     }
637     try {
638         this.getGateHWSpinlockSettings();
639         return ('ti.sdo.ipc.gates.GateHWSpinlock');
640     }
641     catch(e) {
642     }
644     try {
645         this.getGateHWSemSettings();
646         return ('ti.sdo.ipc.gates.GateHWSem');
647     }
648     catch(e) {
649     }
651     return('ti.sdo.ipc.gates.GatePeterson');
654 /*
655  *  ======== getDefaultInterruptDelegate ========
656  */
657 function getDefaultInterruptDelegate()
659     var catalogName = Program.cpu.catalogName;
660     var deviceName = deviceSupportCheck();
662     var delegate = interruptDelegates[catalogName][deviceName];
664     if (delegate == null) {
665         throw new Error ("IPC does not have a default Interrupt"
666             + " delegate for the " + deviceName + " device!");
667     }
669     return (delegate.del);
672 /*
673  *  ======== getNameServerRemoteDelegate ========
674  */
675 function getNameServerRemoteDelegate()
677     var deviceName = deviceSupportCheck();
679     var delegate = nameServerRemoteDelegates[deviceName];
681     if (delegate == null) {
682         delegate = { del: 'ti.sdo.utils.NameServerRemoteNull', };
683     }
685     return (delegate.del);
688 /*
689  *  ======== getNotifySetupDelegate ========
690  */
691 function getNotifySetupDelegate()
693     var deviceName = deviceSupportCheck();
695     var delegate = notifySetupDelegates[deviceName];
697     if (delegate == null) {
698         throw new Error ("IPC does not have a default NotifySetup"
699             + " delegate for the " + deviceName + " device!");
700     }
702     return (delegate.del);
705 /*
706  *  ======== getMessageQSetupDelegate ========
707  */
708 function getMessageQSetupDelegate()
710     var deviceName = deviceSupportCheck();
712     var delegate = messageQSetupDelegates[deviceName];
714     if (delegate == null) {
715         throw new Error ("IPC does not have a default MessageQ setup"
716             + " delegate for the " + deviceName + " device!");
717     }
719     return (delegate.del);
722 /*
723  *  ======== procInDevice ========
724  */
725 function procInDevice(procName)
727     var deviceName = deviceSupportCheck();
728     if (procNames[deviceName] == null) {
729         throw("The device (" + Program.cpu.deviceName +
730                        ") isn't supported by IPC");
731     }
733     /* Search through the procNames table */
734     for each (name in procNames[deviceName]) {
735         if (name == procName) {
736             return (true);
737         }
738     }
740     return (false);
743 /*
744  *  ======== getDeviceProcNames ========
745  */
746 function getDeviceProcNames()
748     var deviceName = deviceSupportCheck();
749     if (procNames[deviceName] == null) {
750         throw("The device (" + Program.cpu.deviceName +
751                        ") isn't supported by IPC");
752     }
754     return (procNames[deviceName]);