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 *
32 */
33 /*
34 * ======== Interrupt.xs ========
35 */
37 var deviceSettings = {
38 'Kepler' : {
39 IPCGR0: 0x02620240,
40 IPCAR0: 0x02620280,
41 IPCGRH: 0x02620260,
42 IPCARH: 0x026202A0,
43 KICK0: 0x02620038,
44 KICK1: 0x0262003C,
45 INTERDSPINT: 105,
46 DSPINT: 5,
47 },
48 'TMS320TCI6638' : {
49 IPCGR0: 0x02620240,
50 IPCAR0: 0x02620280,
51 IPCGRH: 0x02620260,
52 IPCARH: 0x026202A0,
53 KICK0: 0x02620038,
54 KICK1: 0x0262003C,
55 INTERDSPINT: 105,
56 DSPINT: 5,
57 },
58 'TMS320TCI6636' : {
59 IPCGR0: 0x02620240,
60 IPCAR0: 0x02620280,
61 IPCGRH: 0x02620260,
62 IPCARH: 0x026202A0,
63 KICK0: 0x02620038,
64 KICK1: 0x0262003C,
65 INTERDSPINT: 105,
66 DSPINT: 5
67 },
68 'TMS320TCI6630K2L' : {
69 IPCGR0: 0x02620240,
70 IPCAR0: 0x02620280,
71 IPCGRH: 0x02620260,
72 IPCARH: 0x026202A0,
73 KICK0: 0x02620038,
74 KICK1: 0x0262003C,
75 INTERDSPINT: 105,
76 DSPINT: 5
77 },
78 'TMS320C66AK2E05' : {
79 IPCGR0: 0x02620240,
80 IPCAR0: 0x02620280,
81 IPCGRH: 0x02620260,
82 IPCARH: 0x026202A0,
83 KICK0: 0x02620038,
84 KICK1: 0x0262003C,
85 INTERDSPINT: 105,
86 DSPINT: 5
87 }
88 }
89 var Settings = xdc.loadCapsule('ti/sdo/ipc/family/Settings.xs');
90 Settings.setDeviceAliases(deviceSettings, Settings.deviceAliases);
91 var Hwi = null;
92 var Interrupt = null;
93 var MultiProc = null;
95 /*
96 * ======== module$meta$init ========
97 */
98 function module$meta$init()
99 {
100 /* Only process during "cfg" phase */
101 if (xdc.om.$name != "cfg") {
102 return;
103 }
105 var settings = deviceSettings[Program.cpu.deviceName];
107 this.IPCGR0 = settings.IPCGR0;
108 this.IPCAR0 = settings.IPCAR0;
109 this.IPCGRH = settings.IPCGRH;
110 this.IPCARH = settings.IPCARH;
111 this.KICK0 = settings.KICK0;
112 this.KICK1 = settings.KICK1;
113 this.INTERDSPINT = settings.INTERDSPINT;
114 this.DSPINT = settings.DSPINT;
115 }
116 /*
117 * ======== module$use ========
118 */
119 function module$use()
120 {
121 Interrupt = this;
123 Hwi = xdc.useModule("ti.sysbios.family.c64p.Hwi");
124 MultiProc = xdc.useModule("ti.sdo.utils.MultiProc");
125 }
127 /*
128 * ======== module$static$init ========
129 */
130 function module$static$init(state, mod)
131 {
133 state.numPlugged = 0;
134 state.clusterId = MultiProc.baseIdOfCluster;
136 /* The function table length should be the number of IPCAR bits */
137 state.fxnTable.length = 32;
139 for (var i = 0; i < state.fxnTable.length; i++) {
140 state.fxnTable[i].func = null;
141 state.fxnTable[i].arg = 0;
142 }
143 }