[processor-sdk/performance-audio-sr.git] / processor_audio_sdk_1_00_00_00 / psdk_cust / ipc_3_43_00_00_eng / docs / cdoc / ti / sdo / ipc / family / tci663x / Interrupt-src.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html><head><title>module ti.sdo.ipc.family.tci663x.Interrupt</title>
3 <meta name="googlebot" content="noindex,nofollow">
4 <link rel="stylesheet" type="text/css" href="../../../../../src.css"/>
5 </head>
6 <body>
7 <pre class=src>
8 1 <span class="comment">/*
9 </span> 2 <span class="comment"> * Copyright (c) 2014-2015 Texas Instruments Incorporated - http://www.ti.com
10 </span> 3 <span class="comment"> *
11 </span> 4 <span class="comment"> * Redistribution and use in source and binary forms, with or without
12 </span> 5 <span class="comment"> * modification, are permitted provided that the following conditions
13 </span> 6 <span class="comment"> * are met:
14 </span> 7 <span class="comment"> *
15 </span> 8 <span class="comment"> * Redistributions of source code must retain the above copyright
16 </span> 9 <span class="comment"> * notice, this list of conditions and the following disclaimer.
17 </span> 10 <span class="comment"> *
18 </span> 11 <span class="comment"> * Redistributions in binary form must reproduce the above copyright
19 </span> 12 <span class="comment"> * notice, this list of conditions and the following disclaimer in the
20 </span> 13 <span class="comment"> * documentation and/or other materials provided with the
21 </span> 14 <span class="comment"> * distribution.
22 </span> 15 <span class="comment"> *
23 </span> 16 <span class="comment"> * Neither the name of Texas Instruments Incorporated nor the names of
24 </span> 17 <span class="comment"> * its contributors may be used to endorse or promote products derived
25 </span> 18 <span class="comment"> * from this software without specific prior written permission.
26 </span> 19 <span class="comment"> *
27 </span> 20 <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 </span> 21 <span class="comment"> * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 </span> 22 <span class="comment"> * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30 </span> 23 <span class="comment"> * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31 </span> 24 <span class="comment"> * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32 </span> 25 <span class="comment"> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33 </span> 26 <span class="comment"> * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34 </span> 27 <span class="comment"> * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35 </span> 28 <span class="comment"> * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36 </span> 29 <span class="comment"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37 </span> 30 <span class="comment"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 </span> 31 <span class="comment"> */</span>
39 32
40 33 <span class="comment">/*
41 </span> 34 <span class="comment"> * ======== Interrupt.xdc ========
42 </span> 35 <span class="comment"> */</span>
43 36 <span class=key>package</span> ti.sdo.ipc.family.tci663x;
44 37
45 38 import xdc.rov.ViewInfo;
46 39 import xdc.runtime.Assert;
47 40 import ti.sysbios.hal.Hwi;
48 41
49 42 <span class="xdoc">/*!
50 </span> 43 <span class="xdoc"> * ======== Interrupt ========
51 </span> 44 <span class="xdoc"> * TCI663x based interrupt manager
52 </span> 45 <span class="xdoc"> */</span>
53 46 @ModuleStartup
54 47
55 48 <span class=key>module</span> Interrupt <span class=key>inherits</span> ti.sdo.ipc.notifyDrivers.IInterrupt
56 49 {
57 50
58 51 <span class="xdoc">/*! Return value from Interrupt_intClear() when procId != HOST
59 </span> 52 <span class="xdoc"> *
60 </span> 53 <span class="xdoc"> * When acknowledging an interrupt from the host, the IPCGR register
61 </span> 54 <span class="xdoc"> * value is returned as the payload. For all other processors,
62 </span> 55 <span class="xdoc"> * Interrupt_INVALIDPAYLOAD is returned.
63 </span> 56 <span class="xdoc"> */</span>
64 57 <span class=key>const</span> UInt INVALIDPAYLOAD = 0xFFFFFFFF;
65 58
66 59 <span class="xdoc">/*!
67 </span> 60 <span class="xdoc"> * ======== enableKick ========
68 </span> 61 <span class="xdoc"> * If set to 'true' IPC will unlock the KICK registers on C66x devices
69 </span> 62 <span class="xdoc"> *
70 </span> 63 <span class="xdoc"> * IPC unlocks the KICK registers on the local core if the local
71 </span> 64 <span class="xdoc"> * core is CORE0.
72 </span> 65 <span class="xdoc"> */</span>
73 66 <span class=key>config</span> Bool enableKick = <span class=key>true</span>;
74 67
75 68 <span class="xdoc">/*! cpu interrupt number for IPC */</span>
76 69 <span class=key>config</span> UInt ipcIntr = 5;
77 70
78 71 <span class="xdoc">/*! Host processor must be first in MultiProc name list
79 </span> 72 <span class="xdoc"> *
80 </span> 73 <span class="xdoc"> * If the host processor is present in the MultiProc name list,
81 </span> 74 <span class="xdoc"> * it must be listed as the first member. The internal implementation
82 </span> 75 <span class="xdoc"> * depends on this ordering.
83 </span> 76 <span class="xdoc"> */</span>
84 77 <span class=key>config</span> Assert.Id A_hostConfig = {
85 78 msg: <span class="string">"A_hostConfig: HOST must be first in MultiProc name list"</span>
86 79 };
87 80
88 81 <span class="xdoc">/*! The cluster base ID has not been set
89 </span> 82 <span class="xdoc"> *
90 </span> 83 <span class="xdoc"> * The cluster base ID must be set either by the configuration script
91 </span> 84 <span class="xdoc"> * or during the startup phase by a user defined function. This assert
92 </span> 85 <span class="xdoc"> * indicates neither has been done.
93 </span> 86 <span class="xdoc"> */</span>
94 87 <span class=key>config</span> Assert.Id A_clusterBaseId = {
95 88 msg: <span class="string">"A_clusterBaseId: cluster base ID has not been set"</span>
96 89 };
97 90
98 91 <span class="comment">/* @_nodoc */</span>
99 92 <span class=key>metaonly</span> <span class=key>struct</span> InterruptDataStruct {
100 93 UInt remoteCoreId;
101 94 String isrFxn;
102 95 String isrArg;
103 96 Bool isFlagged;
104 97 }
105 98
106 99 <span class="xdoc">/*!
107 </span> 100 <span class="xdoc"> * ======== rovViewInfo ========
108 </span> 101 <span class="xdoc"> */</span>
109 102 @Facet
110 103 <span class=key>metaonly</span> <span class=key>config</span> ViewInfo.Instance rovViewInfo =
111 104 ViewInfo.create({
112 105 viewMap: [
113 106 [<span class="string">'Registered Interrupts'</span>,
114 107 {
115 108 type: ViewInfo.MODULE_DATA,
116 109 viewInitFxn: <span class="string">'viewInterruptsData'</span>,
117 110 structName: <span class="string">'InterruptDataStruct'</span>
118 111 }
119 112 ]
120 113 ]
121 114 });
122 115
123 116 <span class=key>internal</span>:
124 117
125 118 <span class="comment">/* Shift value used for setting/identifying interrupt source */</span>
126 119 <span class=key>const</span> UInt SRCSx_SHIFT = 4;
127 120
128 121 <span class="comment">/* Ptr to the IPC Generation Registers */</span>
129 122 <span class=key>config</span> Ptr IPCGR0;
130 123
131 124 <span class="comment">/* Ptr to the IPC Acknowledgment Registers */</span>
132 125 <span class=key>config</span> Ptr IPCAR0;
133 126
134 127 <span class="comment">/* Ptr to the IPC Host Generation Host Register */</span>
135 128 <span class=key>config</span> Ptr IPCGRH;
136 129
137 130 <span class="comment">/* Ptr to the IPC Acknowledgement Host Register */</span>
138 131 <span class=key>config</span> Ptr IPCARH;
139 132
140 133 <span class="comment">/* Ptr to the KICK0 Bootcfg Registers */</span>
141 134 <span class=key>config</span> Ptr KICK0;
142 135
143 136 <span class="comment">/* Ptr to the KICK1 Bootcfg Registers */</span>
144 137 <span class=key>config</span> Ptr KICK1;
145 138
146 139 <span class="comment">/* Inter-processor interrupt id (varies per device) */</span>
147 140 <span class=key>config</span> UInt INTERDSPINT;
148 141
149 142 <span class="comment">/* client table entry */</span>
150 143 <span class=key>struct</span> ClientEntry {
151 144 Fxn func; <span class="comment">/* client function */</span>
152 145 UArg arg; <span class="comment">/* client argument */</span>
153 146 };
154 147
155 148 <span class="comment">/* hardware configuration data */</span>
156 149 <span class=key>struct</span> HwCfg {
157 150 UInt dnum; <span class="comment">/* DNUM value */</span>
158 151 UInt srcsx; <span class="comment">/* source bit position */</span>
159 152 };
160 153
161 154 <span class="comment">/*
162 </span> 155 <span class="comment"> * ======== isr ========
163 </span> 156 <span class="comment"> * Stub function plugged as interrupt handler
164 </span> 157 <span class="comment"> */</span>
165 158 Void isr(UArg arg);
166 159
167 160 <span class="comment">/*
168 </span> 161 <span class="comment"> * ======== Module_State ========
169 </span> 162 <span class="comment"> * Define the module state structure
170 </span> 163 <span class="comment"> */</span>
171 164 <span class=key>struct</span> Module_State {
172 165 UInt numPlugged; <span class="comment">/* # of times interrupt was registered */</span>
173 166 UInt16 baseId; <span class="comment">/* cluster base procId */</span>
174 167 Hwi.Handle hwi; <span class="comment">/* Hwi object for ipc interrupt */</span>
175 168 ClientEntry clientTab[]; <span class="comment">/* index by clusterId */</span>
176 169 HwCfg hwTab[]; <span class="comment">/* index by clusterId */</span>
177 170 };
178 171 }
179 </pre>
180 </body></html>