]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/blob - packages/ti/sdo/ipc/family/Settings.xs
Added TDA3X device to ipc delegate table.
[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     'LM3.*'             : [ "" ],  /* single core, any name can be used */
201     'Vayu'              : ["DSP1", "DSP2", "EVE1", "EVE2", "EVE3", "EVE4",
202                            "IPU1", "IPU2", "IPU1-0", "IPU1-1", "IPU2-0",
203                            "IPU2-1", "HOST"],
204     'TDA3X'             : ["DSP1", "DSP2", "IPU1", "IPU1-0", "IPU1-1", "EVE1"]
205 };
206 setDeviceAliases(procNames, deviceAliases);
208 /*
209  *  ======== hostNeedsSlaveData =======
210  */
211 var hostNeedsSlaveData = {
212     'TMS320TI816X'      : 1,
213     'OMAP3530'          : 1,
214     'OMAP4430'          : 1,
215     'TMS320CDM6446'     : 1,
216     'TMS320DA830'       : 1,
217     'OMAPL138'          : 1,
218     'Vayu'              : 1,
219     'TDA3X'             : 1
220 };
221 setDeviceAliases(hostNeedsSlaveData, deviceAliases);
223 /*
224  *  ======== sr0MemorySetup =======
225  *  The devices in this list means these devices have a slave mmu
226  *  that needs to be configured by the host before the slave can proceed.
227  */
228 var sr0MemorySetup = {
229     'TMS320TI816X'      : 1,
230     'OMAP3530'          : 1,
231     'OMAP4430'          : 1,
232 };
233 setDeviceAliases(sr0MemorySetup, deviceAliases);
235 /*
236  *  ======== hostProcNames =======
237  *  The name of the host or master processor.
238  */
239 var hostProcNames = {
240     'TMS320CDM6446'     : ["HOST"],
241     'TMS320DA830'       : ["HOST"],
242     'OMAPL138'          : ["HOST"],
243     'TMS320TI816X'      : ["HOST"],
244     'OMAP3530'          : ["HOST"],
245     'OMAP4430'          : ["HOST"],
246     'TMS320C6678'       : ["CORE0"],
247     'TMS320C6670'       : ["CORE0"],
248     'TMS320C6472'       : ["CORE0"],
249     'TMS320C6474'       : ["CORE0"],
250     'F28M3.*'           : ["M3"],
251     'TMS320TCI6630K2L'  : ["HOST"],
252     'TMS320TCI6634'     : ["CORE0"],
253     'TMS320TCI6636'     : ["HOST0"],
254     'TMS320TCI6638'     : ["HOST0"],
255     'Kepler'            : ["HOST"],
256 };
257 setDeviceAliases(hostProcNames, deviceAliases);
259 /*
260  *  ======== nameServerRemoteDelegates ========
261  */
262 var nameServerRemoteDelegates = {
263     'OMAP3530'          : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
264     'TMS320CDM6446'     : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
265     'TMS320DA830'       : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
266     'TMS320TI816X'      : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
267     'TMS320C6678'       : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
268     'TMS320C6670'       : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
269     'TMS320C6472'       : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
270     'TMS320C6474'       : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
271     'OMAP4430'          : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
272     'Arctic'            : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
273     'F28M3.*'           : { del: 'ti.sdo.ipc.family.f28m35x.NameServerBlock', },
274     'Vayu'              : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
275     'TDA3X'             : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify' },
276     'TMS320TCI6634'     : { del: 'ti.sdo.ipc.nsremote.NameServerRemoteNotify',},
277 };
278 setDeviceAliases(nameServerRemoteDelegates, deviceAliases);
280 /*
281  *  ======== notifySetupDelegates ========
282  */
283 var notifySetupDelegates = {
284     'OMAP3530'          : { del: 'ti.sdo.ipc.family.omap3530.NotifySetup', },
285     'TMS320CDM6446'     : { del: 'ti.sdo.ipc.family.dm6446.NotifySetup', },
286     'TMS320DA830'       : { del: 'ti.sdo.ipc.family.da830.NotifySetup', },
287     'TMS320TI816X'      : { del: 'ti.sdo.ipc.family.ti81xx.NotifySetup', },
288     'TMS320C6A8149'     : { del: 'ti.sdo.ipc.family.c6a8149.NotifySetup', },
289     'TMS320C6678'       : { del: 'ti.sdo.ipc.family.c647x.NotifySetup', },
290     'TMS320C6670'       : { del: 'ti.sdo.ipc.family.c647x.NotifySetup', },
291     'TMS320C6472'       : { del: 'ti.sdo.ipc.family.c647x.NotifySetup', },
292     'TMS320C6474'       : { del: 'ti.sdo.ipc.family.c647x.NotifySetup', },
293     'TMS320TCI6634'     : { del: 'ti.sdo.ipc.family.tci663x.NotifyCircSetup', },
294     'OMAP4430'          : { del: 'ti.sdo.ipc.family.omap4430.NotifySetup', },
295     'Arctic'            : { del: 'ti.sdo.ipc.family.arctic.NotifyCircSetup', },
296     'F28M3.*'           : { del: 'ti.sdo.ipc.notifyDrivers.NotifySetupNull', },
297     'LM3.*'             : { del: 'ti.sdo.ipc.notifyDrivers.NotifySetupNull', },
298     'Vayu'              : { del: 'ti.sdo.ipc.family.vayu.NotifySetup', },
299     'TDA3X'             : { del: 'ti.sdo.ipc.family.vayu.NotifySetup'  },
300     'OMAP5430'          : { del: 'ti.sdo.ipc.notifyDrivers.NotifySetupNull' }
302 };
303 setDeviceAliases(notifySetupDelegates, deviceAliases);
305 /*
306  *  ======== messageQSetupDelegates ========
307  */
308 var messageQSetupDelegates = {
309     'OMAP3530'          : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
310     'TMS320CDM6446'     : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
311     'TMS320DA830'       : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
312     'TMS320TI816X'      : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
313     'TMS320C6A8149'     : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
314     'TMS320C6678'       : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
315     'TMS320C6670'       : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
316     'TMS320C6472'       : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
317     'TMS320C6474'       : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
318     'TMS320TCI6634'     : { del: 'ti.sdo.ipc.transports.TransportShmNotifySetup', },
319     'OMAP4430'          : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
320     'Arctic'            : { del: 'ti.sdo.ipc.transports.TransportShmNotifySetup', },
321     'F28M3.*'           : { del: 'ti.sdo.ipc.transports.TransportNullSetup', },
322     'LM3.*'             : { del: 'ti.sdo.ipc.transports.TransportNullSetup', },
323     'Vayu'              : { del: 'ti.sdo.ipc.transports.TransportShmSetup', },
324     'TDA3X'             : { del: 'ti.sdo.ipc.transports.TransportShmSetup' }
325 };
326 setDeviceAliases(messageQSetupDelegates, deviceAliases);
328 /*
329  *  ======== interruptDelegates ========
330  */
331 var interruptDelegates = {
332     'ti.catalog.arm' : {
333         'TMS320CDM6446' : { del: 'ti.sdo.ipc.family.dm6446.InterruptArm', },
334         'TMS320DA830'   : { del: 'ti.sdo.ipc.family.da830.InterruptArm', },
335         'OMAPL138'      : { del: 'ti.sdo.ipc.family.da830.InterruptArm', },
336     },
337     'ti.catalog.arm.cortexm3' : {
338         'TMS320TI816X'  : { del: 'ti.sdo.ipc.family.ti81xx.InterruptDucati', },
339         'TMS320C6A8149' : { del: 'ti.sdo.ipc.family.c6a8149.InterruptDucati', },
340         'OMAP4430'      : { del: 'ti.sdo.ipc.family.omap4430.InterruptDucati', },
341         'F28M3.*'       : { del: 'ti.sdo.ipc.family.f28m35x.InterruptM3', },
342     },
343     'ti.catalog.arm.cortexm4' : {
344         'Vayu'          : { del: 'ti.sdo.ipc.family.vayu.InterruptIpu', },
345         'TDA3X'         : { del: 'ti.sdo.ipc.family.vayu.InterruptIpu' },
346     },
347     'ti.catalog.arm.cortexa8' : {
348         'TMS320TI816X'  : { del: 'ti.sdo.ipc.family.ti81xx.InterruptHost', },
349         'TMS320C6A8149' : { del: 'ti.sdo.ipc.family.c6a8149.InterruptHost', },
350         'OMAP3530'      : { del: 'ti.sdo.ipc.family.omap3530.InterruptHost', },
351     },
352     'ti.catalog.arm.cortexa15' : {
353         'Vayu'          : { del: 'ti.sdo.ipc.family.vayu.InterruptHost', },
354     },
355     'ti.catalog.c6000' : {
356         'OMAP3530'      : { del: 'ti.sdo.ipc.family.omap3530.InterruptDsp', },
357         'TMS320CDM6446' : { del: 'ti.sdo.ipc.family.dm6446.InterruptDsp', },
358         'TMS320DA830'   : { del: 'ti.sdo.ipc.family.da830.InterruptDsp', },
359         'OMAPL138'      : { del: 'ti.sdo.ipc.family.da830.InterruptDsp', },
360         'TMS320TI816X'  : { del: 'ti.sdo.ipc.family.ti81xx.InterruptDsp', },
361         'TMS320C6A8149' : { del: 'ti.sdo.ipc.family.c6a8149.InterruptDsp', },
362         'TMS320C6472'   : { del: 'ti.sdo.ipc.family.c647x.Interrupt', },
363         'TMS320C6474'   : { del: 'ti.sdo.ipc.family.c647x.Interrupt', },
364         'TMS320C6678'   : { del: 'ti.sdo.ipc.family.c647x.Interrupt', },
365         'TMS320C6670'   : { del: 'ti.sdo.ipc.family.c647x.Interrupt', },
366         'TMS320TCI6634' : { del: 'ti.sdo.ipc.family.tci663x.Interrupt', },
368         'OMAP4430'      : { del: 'ti.sdo.ipc.family.omap4430.InterruptDsp', },
369         'Arctic'        : { del: 'ti.sdo.ipc.family.arctic.InterruptDsp', },
370         'Vayu'          : { del: 'ti.sdo.ipc.family.vayu.InterruptDsp', },
371         'TDA3X'         : { del: 'ti.sdo.ipc.family.vayu.InterruptDsp' },
372     },
373     'ti.catalog.arp32' : {
374         'TMS320C6A8149' : { del: 'ti.sdo.ipc.family.c6a8149.InterruptEve', },
375         'Arctic'        : { del: 'ti.sdo.ipc.family.arctic.InterruptArp32', },
376         'Vayu'          : { del: 'ti.sdo.ipc.family.vayu.InterruptArp32', },
377         'TDA3X'         : { del: 'ti.sdo.ipc.family.vayu.InterruptArp32' },
378     },
379     'ti.catalog.c2800' : {
380         'F28M3.*'       : { del: 'ti.sdo.ipc.family.f28m35x.InterruptC28', },
381     },
382 };
383 for (var family in interruptDelegates) {
384     setDeviceAliases(interruptDelegates[family], deviceAliases);
386 setCatalogAliases(interruptDelegates, catalogAliases);
388 /*
389  *  ======== spinlockDelegates ========
390  */
391 var spinlockDelegates = {
392     'ti.catalog.arm.cortexm3' : {
393         'OMAP4430' : {
394             baseAddr:   0x4A0F6800,
395             numLocks:   32,
396         },
397         'TMS320TI816X' : {
398             baseAddr:   0x480CA800,
399             numLocks:   64,
400         },
401     },
402     'ti.catalog.arm.cortexm4' : {
403         'Vayu' : {
404             baseAddr:   0x4A0F6800,
405             numLocks:   32
406         },
407         'TDA3X' : {
408             baseAddr:   0x4A0F6800,
409             numLocks:   256
410         }
411     },
412     'ti.catalog.arm.cortexa8' : {
413         'TMS320TI816X' : {
414             baseAddr:   0x480CA800,
415             numLocks:   64,
416         },
417     },
418     'ti.catalog.arm.cortexa15' : {
419         'Vayu' : {
420             baseAddr:   0x4A0F6800,
421             numLocks:   32
422         },
423     },
424     'ti.catalog.c6000' : {
425         'TMS320TI816X' : {
426             baseAddr:   0x080CA800,
427             numLocks:   64,
428         },
429         'OMAP4430' : {
430             baseAddr:   0x4A0F6800,
431             numLocks:   32,
432         },
433         'Arctic' : {
434             baseAddr:   0x480CA800,
435             numLocks:   64,
436         },
437         'Vayu' : {
438             baseAddr:   0x4A0F6800,
439             numLocks:   32
440         },
441         'TDA3X' : {
442             baseAddr:   0x4A0F6800,
443             numLocks:   256
444         }
445     },
446     'ti.catalog.arp32' : {
447         /*      'TMS320C6A8149' : {
448                     baseAddr:   0x480CA800,
449                     numLocks:   64,
450                 },
451         */
452         'Arctic' : {
453             baseAddr:   0x480CA800,
454             numLocks:   64,
455         },
456         'Vayu' : {
457             baseAddr:   0x4A0F6800,
458             numLocks:   32
459         },
460         'TDA3X' : {
461             baseAddr:   0x4A0F6800,
462             numLocks:   256
463         }
464     }
466 for (var family in spinlockDelegates) {
467     setDeviceAliases(spinlockDelegates[family], deviceAliases);
469 setCatalogAliases(spinlockDelegates, catalogAliases);
471 /*
472  *  ======== hwSemDelegates ========
473  */
474 var hwSemDelegates = {
475     'ti.catalog.c6000' : {
476         'TMS320C6474' : {
477             baseAddr:   0x02B40100,
478             queryAddr:  0x02B40300,
479             numSems:    32,
480         },
481         'TMS320C6678' : {
482             baseAddr:   0x02640100,
483             queryAddr:  0x02640200,
484             numSems:    32,
485         },
486         'TMS320C6670' : {
487             baseAddr:   0x02640100,
488             queryAddr:  0x02640200,
489             numSems:    32,
490         },
491         'TMS320TCI6634' : {
492             baseAddr:   0x02640100,
493             queryAddr:  0x02640200,
494             numSems:    32,
495         },
496     },
498 for (var family in hwSemDelegates) {
499     setDeviceAliases(hwSemDelegates[family], deviceAliases);
501 setCatalogAliases(hwSemDelegates, catalogAliases);
503 /*
504  *  ======== getGateHWSemSettings ========
505  */
506 function getGateHWSemSettings()
508     var errorString = "IPC does not have a default GateHWSem" +
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 semaphores!";
516     try {
517         var hwSemSettings = hwSemDelegates[catalogName][deviceName];
518     }
519     catch(e) {
520         throw new Error(errStr);
521     }
523     if (hwSemSettings == null) {
524         throw new Error(errStr);
525     }
527     return (hwSemSettings);
530 /*
531  *  ======== getGateHWSpinlockSettings ========
532  */
533 function getGateHWSpinlockSettings()
535     var errorString = "IPC does not have a default GateHWSpinlock" +
536                       " delegate for the " + deviceName + " device!";
537     var catalogName = Program.cpu.catalogName;
538     var deviceName = deviceSupportCheck();
540     var errStr = "The device " + deviceName +
541         " does not support hardware spinlocks!";
543     try {
544         var spinLockSettings = spinlockDelegates[catalogName][deviceName];
545     }
546     catch(e) {
547         throw new Error(errStr);
548     }
550     if (spinLockSettings == null) {
551         throw new Error(errStr);
552     }
554     return (spinLockSettings);
557 /*
558  *  ======== generateSlaveDataForHost ========
559  */
560 function generateSlaveDataForHost()
562     var deviceName = deviceSupportCheck();
563     var retval = hostNeedsSlaveData[deviceName];
565     /* A15 is the already the host no need to generate data */
566     if ((Program.cpu.catalogName == 'ti.catalog.arm.cortexa8') ||
567         (Program.cpu.catalogName == 'ti.catalog.arm.cortexa9') ||
568         (Program.cpu.catalogName == 'ti.catalog.arm.cortexa15')) {
569         return (false);
570     }
572     if (retval != null) {
573         return (true);
574     }
576     return (false);
579 /*
580  *  ======== getHostProcId ========
581  */
582 function getHostProcId()
584     var MultiProc = xdc.module("ti.sdo.utils.MultiProc");
585     var deviceName = deviceSupportCheck();
586     var hostProcName = hostProcNames[deviceName];
588     if (hostProcName == null) {
589         /* The device doesn't have a core that runs a hlos */
590         return (MultiProc.INVALIDID);
591     }
593     /*
594      *  If the device may run a hlos, return the corresponding core's MultiProc
595      *  id. MultiProc.INVALIDID will be returned if the core exists but isn't
596      *  being used in the application
597      */
598     return(MultiProc.getIdMeta(String(hostProcName)));
601 /*
602  *  ======== getIpcSR0Setup ========
603  */
604 function getIpcSR0Setup()
606     var deviceName = deviceSupportCheck();
607     var memorySetup = sr0MemorySetup[deviceName];
609     if (memorySetup == null) {
610         /* The device has memory available to it */
611         return (true);
612     }
613     else {
614         /* The device needs host to enable memory through mmu */
615         return (false);
616     }
619 /*
620  *  ======== getHWGate ========
621  */
622 function getHWGate()
624     var deviceName = deviceSupportCheck();
625     if (deviceName == "TMS320C6472" ||
626         deviceName == "TMS320CTCI6486") {
627         return ('ti.sdo.ipc.gates.GateAAMonitor');
628     }
629     else if (deviceName == "TMS320C6A8149") {
630         return ('ti.sdo.ipc.gates.GatePetersonN');
631     }
632     try {
633         this.getGateHWSpinlockSettings();
634         return ('ti.sdo.ipc.gates.GateHWSpinlock');
635     }
636     catch(e) {
637     }
639     try {
640         this.getGateHWSemSettings();
641         return ('ti.sdo.ipc.gates.GateHWSem');
642     }
643     catch(e) {
644     }
646     return('ti.sdo.ipc.gates.GatePeterson');
649 /*
650  *  ======== getDefaultInterruptDelegate ========
651  */
652 function getDefaultInterruptDelegate()
654     var catalogName = Program.cpu.catalogName;
655     var deviceName = deviceSupportCheck();
657     var delegate = interruptDelegates[catalogName][deviceName];
659     if (delegate == null) {
660         throw new Error ("IPC does not have a default Interrupt"
661             + " delegate for the " + deviceName + " device!");
662     }
664     return (delegate.del);
667 /*
668  *  ======== getNameServerRemoteDelegate ========
669  */
670 function getNameServerRemoteDelegate()
672     var deviceName = deviceSupportCheck();
674     var delegate = nameServerRemoteDelegates[deviceName];
676     if (delegate == null) {
677         delegate = { del: 'ti.sdo.utils.NameServerRemoteNull', };
678     }
680     return (delegate.del);
683 /*
684  *  ======== getNotifySetupDelegate ========
685  */
686 function getNotifySetupDelegate()
688     var deviceName = deviceSupportCheck();
690     var delegate = notifySetupDelegates[deviceName];
692     if (delegate == null) {
693         throw new Error ("IPC does not have a default NotifySetup"
694             + " delegate for the " + deviceName + " device!");
695     }
697     return (delegate.del);
700 /*
701  *  ======== getMessageQSetupDelegate ========
702  */
703 function getMessageQSetupDelegate()
705     var deviceName = deviceSupportCheck();
707     var delegate = messageQSetupDelegates[deviceName];
709     if (delegate == null) {
710         throw new Error ("IPC does not have a default MessageQ setup"
711             + " delegate for the " + deviceName + " device!");
712     }
714     return (delegate.del);
717 /*
718  *  ======== procInDevice ========
719  */
720 function procInDevice(procName)
722     var deviceName = deviceSupportCheck();
723     if (procNames[deviceName] == null) {
724         throw("The device (" + Program.cpu.deviceName +
725                        ") isn't supported by IPC");
726     }
728     /* Search through the procNames table */
729     for each (name in procNames[deviceName]) {
730         if (name == procName) {
731             return (true);
732         }
733     }
735     return (false);
738 /*
739  *  ======== getDeviceProcNames ========
740  */
741 function getDeviceProcNames()
743     var deviceName = deviceSupportCheck();
744     if (procNames[deviceName] == null) {
745         throw("The device (" + Program.cpu.deviceName +
746                        ") isn't supported by IPC");
747     }
749     return (procNames[deviceName]);