1 /*
2 * Copyright (c) 2012-2014 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 * ======== InterruptIpu.xs ========
35 *
36 */
38 /*
39 * ======== module$use ========
40 */
41 function module$use()
42 {
43 xdc.useModule("xdc.runtime.Assert");
45 xdc.useModule("ti.sysbios.BIOS");
46 xdc.useModule("ti.sysbios.family.arm.ducati.Core");
47 xdc.useModule("ti.sysbios.family.arm.m3.Hwi");
48 xdc.useModule("ti.sysbios.family.shared.vayu.IntXbar");
50 xdc.useModule("ti.sdo.ipc.family.vayu.NotifySetup");
51 xdc.useModule("ti.sdo.ipc.notifyDrivers.IInterrupt");
52 xdc.useModule("ti.sdo.utils.MultiProc");
54 var TableInit = xdc.useModule("ti.sdo.ipc.family.vayu.TableInit");
56 /* Initisalize procIdTable */
57 TableInit.initProcId(this);
59 /* Initialize mailboxTable */
60 TableInit.generateTable(this);
62 /* Initialize mailbox base addrs */
63 if (this.mailboxBaseAddr[0] == undefined) {
64 this.mailboxBaseAddr[0] = 0x6208B000; /* EVE1 Internal Mailbox 0 */
65 }
66 if (this.mailboxBaseAddr[1] == undefined) {
67 this.mailboxBaseAddr[1] = 0x6208C000; /* EVE1 Internal Mailbox 1 */
68 }
69 if (this.mailboxBaseAddr[2] == undefined) {
70 this.mailboxBaseAddr[2] = 0; /* EVE1 Internal Mailbox 2 */
71 } else {
72 this.$logWarning("InterruptIpu.mailboxBaseAddr[2] is the EVE1 MBOX2, "
73 + "which is not used for IPU communication and should not be "
74 + "configured.", this);
75 }
76 if (this.mailboxBaseAddr[3] == undefined) {
77 this.mailboxBaseAddr[3] = 0x6218B000; /* EVE2 Internal Mailbox 0 */
78 }
79 if (this.mailboxBaseAddr[4] == undefined) {
80 this.mailboxBaseAddr[4] = 0x6218C000; /* EVE2 Internal Mailbox 1 */
81 }
82 if (this.mailboxBaseAddr[5] == undefined) {
83 this.mailboxBaseAddr[5] = 0; /* EVE2 Internal Mailbox 2 */
84 } else {
85 this.$logWarning("InterruptIpu.mailboxBaseAddr[5] is the EVE2 MBOX2, "
86 + "which is not used for IPU communication and should not be "
87 + "configured.", this);
88 }
90 if (this.mailboxBaseAddr[6] == undefined) {
91 this.mailboxBaseAddr[6] = 0x6228B000; /* EVE3 Internal Mailbox 0 */
92 }
93 if (this.mailboxBaseAddr[7] == undefined) {
94 this.mailboxBaseAddr[7] = 0x6228C000; /* EVE3 Internal Mailbox 1 */
95 }
96 if (this.mailboxBaseAddr[8] == undefined) {
97 this.mailboxBaseAddr[8] = 0; /* EVE3 Internal Mailbox 2 */
98 } else {
99 this.$logWarning("InterruptIpu.mailboxBaseAddr[8] is the EVE3 MBOX2, "
100 + "which is not used for IPU communication and should not be "
101 + "configured.", this);
102 }
104 if (this.mailboxBaseAddr[9] == undefined) {
105 this.mailboxBaseAddr[9] = 0x6238B000; /* EVE4 Internal Mailbox 0 */
106 }
107 if (this.mailboxBaseAddr[10] == undefined) {
108 this.mailboxBaseAddr[10] = 0x6238C000; /* EVE4 Internal Mailbox 1 */
109 }
110 if (this.mailboxBaseAddr[11] == undefined) {
111 this.mailboxBaseAddr[11] = 0; /* EVE4 Internal Mailbox 2 */
112 } else {
113 this.$logWarning("InterruptIpu.mailboxBaseAddr[11] is the EVE4 MBOX2, "
114 + "which is not used for IPU communication and should not be "
115 + "configured.", this);
116 }
118 if (this.mailboxBaseAddr[12] == undefined) {
119 this.mailboxBaseAddr[12] = 0x68840000; /* System Mailbox 5 */
120 }
121 if (this.mailboxBaseAddr[13] == undefined) {
122 this.mailboxBaseAddr[13] = 0x68842000; /* System Mailbox 6 */
123 }
124 if (this.mailboxBaseAddr[14] == undefined) {
125 this.mailboxBaseAddr[14] = 0x68844000; /* System Mailbox 7 */
126 }
127 if (this.mailboxBaseAddr[15] == undefined) {
128 this.mailboxBaseAddr[15] = 0x68846000; /* System Mailbox 8 */
129 }
131 /*
132 * In case of a spec change, follow the process shown below:
133 * 1. Update the mailboxBaseAddr Table.
134 * 2. Update the dspInterruptTable.
135 * 3. Update Virtual Index assignment.
136 * 4. Update numCores, numEves and eveMbx2BaseIdx variables
137 * in order to correctly intialize the mailboxTable.
138 */
139 }
141 /*
142 * ======== module$static$init ========
143 * Initialize module values.
144 */
145 function module$static$init(state, mod)
146 {
147 for (var i = 0; i < this.procIdTable.length; i++) {
148 state.fxnTable[i].func = null;
149 state.fxnTable[i].arg = 0;
150 }
151 }