FreeCalypso > hg > tcs211-pirelli
comparison chipsetsw/drivers/drv_core/dma/sys_dma_it.c @ 0:509db1a7b7b8
initial import: leo2moko-r1
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 01 Jun 2015 03:24:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:509db1a7b7b8 |
---|---|
1 /* @(#) nom : sys_dma_it.c SID: 1.2 date : 05/23/03 */ | |
2 /* Filename: sys_dma_it.c */ | |
3 /* Version: 1.2 */ | |
4 /****************************************************************************** | |
5 * WIRELESS COMMUNICATION SYSTEM DEVELOPMENT | |
6 * | |
7 * (C) 2002 Texas Instruments France. All rights reserved | |
8 * | |
9 * Author : Guillaume Leterrier | |
10 * Francois Amand | |
11 * | |
12 * | |
13 * Important Note | |
14 * -------------- | |
15 * | |
16 * This S/W is a preliminary version. It contains information on a product | |
17 * under development and is issued for evaluation purposes only. Features | |
18 * characteristics, data and other information are subject to change. | |
19 * | |
20 * The S/W is furnished under Non Disclosure Agreement and may be used or | |
21 * copied only in accordance with the terms of the agreement. It is an offence | |
22 * to copy the software in any way except as specifically set out in the | |
23 * agreement. No part of this document may be reproduced or transmitted in any | |
24 * form or by any means, electronic or mechanical, including photocopying and | |
25 * recording, for any purpose without the express written permission of Texas | |
26 * Instruments Inc. | |
27 * | |
28 ****************************************************************************** | |
29 * | |
30 * FILE NAME: sys_dma_it.c | |
31 * | |
32 * | |
33 * PURPOSE: Interruption DMA drivers for CALYPSO PLUS. | |
34 * | |
35 * | |
36 * | |
37 * FILE REFERENCES: | |
38 * | |
39 * Name IO Description | |
40 * ------------- -- --------------------------------------------- | |
41 * | |
42 * | |
43 * | |
44 * EXTERNAL VARIABLES: | |
45 * | |
46 * Source: | |
47 * | |
48 * Name Type IO Description | |
49 * ------------- --------------- -- ------------------------------ | |
50 * | |
51 * | |
52 * | |
53 * EXTERNAL REFERENCES: | |
54 * | |
55 * Name Description | |
56 * ------------------ ------------------------------------------------------- | |
57 * | |
58 * | |
59 * | |
60 * ABNORMAL TERMINATION CONDITIONS, ERROR AND WARNING MESSAGES: | |
61 * | |
62 * | |
63 * | |
64 * ASSUMPTION, CONSTRAINTS, RESTRICTIONS: | |
65 * | |
66 * | |
67 * | |
68 * NOTES: | |
69 * | |
70 * | |
71 * | |
72 * REQUIREMENTS/FUNCTIONAL SPECIFICATION REFERENCES: | |
73 * | |
74 * | |
75 * | |
76 * | |
77 * DEVELOPMENT HISTORY: | |
78 * | |
79 * Date Name(s) Version Description | |
80 * ----------- -------------- ------- ------------------------------------- | |
81 * 23-Oct-2002 G.Leterrier 0.0.1 First implementation | |
82 * | |
83 * ALGORITHM: | |
84 * | |
85 * | |
86 *****************************************************************************/ | |
87 | |
88 #include "chipset.cfg" | |
89 | |
90 #if (CHIPSET == 12) | |
91 | |
92 #include "sys_dma.h" | |
93 | |
94 | |
95 /*****************************************************************************/ | |
96 /* global variable definition */ | |
97 /***************************************************************************/ | |
98 | |
99 | |
100 /* Array of pointer on call back function with argument SYS_UWORD16. */ | |
101 /* This argument is the value of the status IT register of the channel which has generated the IT event. */ | |
102 /* The size of the array is defined by the number of DMA channel available on the device */ | |
103 | |
104 | |
105 | |
106 T_DMA_CALL_BACK pf_dma_call_back_address[C_DMA_NUMBER_OF_CHANNEL]= | |
107 {f_dma_default_call_back_it, | |
108 f_dma_default_call_back_it, | |
109 f_dma_default_call_back_it, | |
110 f_dma_default_call_back_it, | |
111 f_dma_default_call_back_it, | |
112 f_dma_default_call_back_it, | |
113 }; | |
114 | |
115 | |
116 | |
117 /****************************************************************************** | |
118 * | |
119 * FUNCTION NAME:f_dma_interrupt_manager | |
120 * The function is called when a DMA interrupt event occurs on the ARM interrupt handler. | |
121 * | |
122 * ARGUMENT LIST: | |
123 * | |
124 * Argument Type IO Description | |
125 * ---------- ---------- -- ------------------------------------------- | |
126 * none | |
127 * | |
128 * | |
129 * RETURN VALUE: none | |
130 * | |
131 *****************************************************************************/ | |
132 void f_dma_interrupt_manager(void) | |
133 { | |
134 | |
135 SYS_UWORD16 d_dma_isr; | |
136 SYS_UWORD8 d_dma_index=0; | |
137 /* MASK to eliminate interruption from channel allocation to DSP and secure channel allocated to ARM */ | |
138 d_dma_isr=C_DMA_ISR_REG & (~C_DMA_CAR_REG) & (~C_DMA_SCR_REG); | |
139 | |
140 | |
141 | |
142 /* shift ISR register from channel 0 to channel n in order to determine the channel with interrrupt active*/ | |
143 | |
144 for (d_dma_index;d_dma_index<C_DMA_NUMBER_OF_CHANNEL;d_dma_index++) /* end condition need to be checked */ | |
145 { | |
146 if ((d_dma_isr & 0x0001)==1) | |
147 { | |
148 pf_dma_call_back_address[d_dma_index](F_DMA_GET_CHANNEL_IT_STATUS(d_dma_index)); | |
149 } /* JUMP to the call back function with the status register in argument */ | |
150 d_dma_isr >>=1; | |
151 } | |
152 | |
153 } | |
154 | |
155 | |
156 /****************************************************************************** | |
157 * | |
158 * FUNCTION NAME:f_dma_secure_interrupt_manager | |
159 * The function is called when a secure DMA interrupt event occurs on the ARM interrupt handler. | |
160 * | |
161 * ARGUMENT LIST: | |
162 * | |
163 * Argument Type IO Description | |
164 * ---------- ---------- -- ------------------------------------------- | |
165 * none | |
166 * | |
167 * | |
168 * RETURN VALUE: none | |
169 * | |
170 *****************************************************************************/ | |
171 void f_dma_secure_interrupt_manager(void) | |
172 { | |
173 | |
174 SYS_UWORD16 d_dma_isr; | |
175 SYS_UWORD8 d_dma_index=0; | |
176 /* MASK to eliminate interruption from channel allocation to DSP and non-secure channel allocated to ARM */ | |
177 d_dma_isr=C_DMA_ISR_REG & (~C_DMA_CAR_REG) & (C_DMA_SCR_REG); | |
178 | |
179 /* shift ISR register from channel 0 to channel n in order to determine the channel with interrrupt active*/ | |
180 | |
181 for (d_dma_index;d_dma_index<C_DMA_NUMBER_OF_CHANNEL;d_dma_index++) /* end condition need to be checked */ | |
182 { | |
183 if ((d_dma_isr & 0x0001)==1) | |
184 { | |
185 pf_dma_call_back_address[d_dma_index](F_DMA_GET_CHANNEL_IT_STATUS(d_dma_index)); | |
186 } /* JUMP to the call back function with the status register in argument */ | |
187 d_dma_isr >>=1; | |
188 } | |
189 | |
190 } | |
191 | |
192 | |
193 /****************************************************************************** | |
194 * | |
195 * FUNCTION NAME:f_dma_default_call_back_it | |
196 * The address of that function will be called by default | |
197 * by the DMA interrupt handler, if no call-back function has been defined yet on this channel | |
198 * | |
199 * ARGUMENT LIST: | |
200 * | |
201 * Argument Type IO Description | |
202 * ---------- ---------- -- ------------------------------------------- | |
203 * d_dma_channel_status_it SYS_UWORD16 I contains a default IT status of the channel from which the event occurs. | |
204 * | |
205 * | |
206 * RETURN VALUE: none | |
207 * | |
208 *****************************************************************************/ | |
209 void f_dma_default_call_back_it(SYS_UWORD16 d_dma_channel_it_status) | |
210 { | |
211 } | |
212 | |
213 | |
214 | |
215 | |
216 | |
217 | |
218 #endif /* (CHIPSET == 12) */ | |
219 |