]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/blob - packages/ti/sdo/ipc/family/vayu/InterruptIpu.xs
612f0d2e3bc56759d9d6c8176e0e29a5618a38d7
[ipc/ipcdev.git] / packages / ti / sdo / ipc / family / vayu / InterruptIpu.xs
1 /*
2  * Copyright (c) 2013, 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  */
32 /*
33  *  ======== InterruptIpu.xs ========
34  *
35  */
37 var BIOS    = null;
38 var Hwi     = null;
39 var Core    = null;
40 var Ipu     = null;
42 /*
43  *  ======== module$use ========
44  */
45 function module$use()
46 {
47     BIOS            = xdc.useModule("ti.sysbios.BIOS");
48     Hwi             = xdc.useModule("ti.sysbios.family.arm.m3.Hwi");
49     Core            = xdc.useModule("ti.sysbios.family.arm.ducati.Core");
50     Ipc             = xdc.useModule("ti.sdo.ipc.Ipc");
51     Ipu             = xdc.useModule("ti.sdo.ipc.family.vayu.InterruptIpu");
52     Xbar            = xdc.useModule("ti.sysbios.hal.vayu.IntXbar");
53     TableInit       = xdc.useModule("ti.sdo.ipc.family.vayu.TableInit");
55     /* Initisalize procIdTable */
56     TableInit.initProcId(Ipu);
58     /* Initialize mailboxTable */
59     TableInit.generateTable(Ipu);
61     /* Initialize mailbox base address table */
62     this.mailboxBaseAddr[0]  = 0x9208B000;  /* EVE1 Internal Mailbox 0 */
63     this.mailboxBaseAddr[1]  = 0x9208C000;  /* EVE1 Internal Mailbox 1 */
64     this.mailboxBaseAddr[2]  = 0x9208D000;  /* EVE1 Internal Mailbox 2 */
65     this.mailboxBaseAddr[3]  = 0x9218B000;  /* EVE2 Internal Mailbox 0 */
66     this.mailboxBaseAddr[4]  = 0x9218C000;  /* EVE2 Internal Mailbox 1 */
67     this.mailboxBaseAddr[5]  = 0x9218D000;  /* EVE2 Internal Mailbox 2 */
68     this.mailboxBaseAddr[6]  = 0x9228B000;  /* EVE3 Internal Mailbox 0 */
69     this.mailboxBaseAddr[7]  = 0x9228C000;  /* EVE3 Internal Mailbox 1 */
70     this.mailboxBaseAddr[8]  = 0x9228D000;  /* EVE3 Internal Mailbox 2 */
71     this.mailboxBaseAddr[9]  = 0x9238B000;  /* EVE4 Internal Mailbox 0 */
72     this.mailboxBaseAddr[10] = 0x9238C000;  /* EVE4 Internal Mailbox 1 */
73     this.mailboxBaseAddr[11] = 0x9238D000;  /* EVE4 Internal Mailbox 2 */
74     this.mailboxBaseAddr[12] = 0x48840000;  /* System Mailbox 5 */
75     this.mailboxBaseAddr[13] = 0x48842000;  /* System Mailbox 6 */
76     this.mailboxBaseAddr[14] = 0x48844000;  /* System Mailbox 7 */
77     this.mailboxBaseAddr[15] = 0x48846000;  /* System Mailbox 8 */
79     /*
80      * In case of a spec change, follow the process shown below:
81      * 1. Update the mailboxBaseAddr Table.
82      * 2. Update the dspInterruptTable.
83      * 3. Update Virtual Index assignment.
84      * 4. Update numCores, numEves and eveMbx2BaseIdx variables
85      *    in order to correctly intialize the mailboxTable.
86      */
87 }
89 /*
90  *  ======== module$static$init ========
91  *  Initialize module values.
92  */
93 function module$static$init(mod, params)
94 {
95     var remoteProcId;
96     var mbxId;
98     for (remoteProcId = 0; remoteProcId < Ipu.procIdTable.length; remoteProcId++) {
99         mod.fxnTable[remoteProcId].func  = null;
100         mod.fxnTable[remoteProcId].arg   = 0;
101     }
103     for (mbxId = 0; mbxId < Ipu.mailboxBaseAddr.length; mbxId++) {
104         mod.numPlugged[mbxId] = 0;
105     }
107     /* Initialize Interrupt Event Ids for communicating with this processor */
108     if (Core.id == 0) {
109         mod.interruptTable[0] = 64; /* EVE1 */
110         mod.interruptTable[1] = 65; /* EVE2 */
111         mod.interruptTable[2] = 67; /* EVE3 */
112         mod.interruptTable[3] = 68; /* EVE4 */
114         /* These are not known at config time and is set a runtime */
115         mod.interruptTable[4] = 0; /* DSP1 */
116         mod.interruptTable[5] = 0; /* DSP2 */
117         mod.interruptTable[6] = 0; /* Ipu1-0 */
118         mod.interruptTable[7] = 0; /* Ipu2-0 */
119         mod.interruptTable[8] = 0; /* HOST */
120         mod.interruptTable[9] = 0; /* Ipu1-1 */
121         mod.interruptTable[10] = 0; /* Ipu2-1 */
122     }
123     else {
124         mod.interruptTable[0] = 71; /* EVE1 */
125         mod.interruptTable[1] = 72; /* EVE2 */
126         mod.interruptTable[2] = 74; /* EVE3 */
127         mod.interruptTable[3] = 75; /* EVE4 */
129         /* These are not known at config time and is set a runtime */
130         mod.interruptTable[4] = 0; /* DSP1 */
131         mod.interruptTable[5] = 0; /* DSP2 */
132         mod.interruptTable[6] = 0; /* Ipu1-0 */
133         mod.interruptTable[7] = 0; /* Ipu2-0 */
134         mod.interruptTable[8] = 0; /* HOST */
135         mod.interruptTable[9] = 0; /* Ipu1-1 */
136         mod.interruptTable[10] = 0; /* Ipu2-1 */
138     }