comparison chipsetsw/drivers/drv_core/inth/sys_inth.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_inth.c SID: 1.2 date : 05/23/03 */
2 /* Filename: sys_inth.c */
3 /* Version: 1.2 */
4 /******************************************************************************
5 * WIRELESS COMMUNICATION SYSTEM DEVELOPMENT
6 *
7 * (C) 2002 Texas Instruments France. All rights reserved
8 *
9 * Author : Francois AMAND
10 *
11 *
12 * Important Note
13 * --------------
14 *
15 * This S/W is a preliminary version. It contains information on a product
16 * under development and is issued for evaluation purposes only. Features
17 * characteristics, data and other information are subject to change.
18 *
19 * The S/W is furnished under Non Disclosure Agreement and may be used or
20 * copied only in accordance with the terms of the agreement. It is an offence
21 * to copy the software in any way except as specifically set out in the
22 * agreement. No part of this document may be reproduced or transmitted in any
23 * form or by any means, electronic or mechanical, including photocopying and
24 * recording, for any purpose without the express written permission of Texas
25 * Instruments Inc.
26 *
27 ******************************************************************************
28 *
29 * FILE NAME: sys_inth.c
30 *
31 *
32 * PURPOSE: Interrupt Handler driver compiled in 32-bits mode.
33 *
34 *
35 * FILE REFERENCES:
36 *
37 * Name IO Description
38 * ------------- -- ---------------------------------------------
39 *
40 *
41 *
42 * EXTERNAL VARIABLES:
43 *
44 * Source:
45 *
46 * Name Type IO Description
47 * ------------- --------------- -- ------------------------------
48 *
49 *
50 *
51 * EXTERNAL REFERENCES:
52 *
53 * Name Description
54 * ------------------ -------------------------------------------------------
55 *
56 *
57 *
58 * ABNORMAL TERMINATION CONDITIONS, ERROR AND WARNING MESSAGES:
59 *
60 *
61 *
62 * ASSUMPTION, CONSTRAINTS, RESTRICTIONS:
63 *
64 *
65 *
66 * NOTES:
67 *
68 *
69 *
70 * REQUIREMENTS/FUNCTIONAL SPECIFICATION REFERENCES:
71 *
72 *
73 *
74 *
75 * DEVELOPMENT HISTORY:
76 *
77 * Date Name(s) Version Description
78 * ----------- -------------- ------- -------------------------------------
79 * 11-Oct-2002 Francois AMAND 0.0.1 First implementation
80 *
81 * ALGORITHM:
82 *
83 *
84 *****************************************************************************/
85
86 #include "l1sw.cfg"
87 #include "chipset.cfg"
88
89 #if (CHIPSET == 12)
90
91 #if (OP_L1_STANDALONE == 0)
92 #include "main/sys_types.h"
93 #else
94 #include "sys_types.h"
95 #endif
96 #include "sys_inth.h"
97
98
99 /******************************************************************************
100 *
101 * FUNCTION NAME: f_inth_init
102 * Setup interrupt handler configuration.
103 *
104 *
105 * ARGUMENT LIST:
106 *
107 * Argument Type IO Description
108 * ------------ ------------------- -- ---------------------------------
109 *
110 * RETURN VALUE: None
111 *
112 *****************************************************************************/
113
114 static void f_inth_init(SYS_UWORD16 d_it_num, T_INTH_CONFIG *p_config)
115 {
116 volatile SYS_UWORD16 *p_inth_level_reg;
117 SYS_UWORD8 d_it_num_temp = d_it_num;
118
119 /*
120 * Get interrupt handler main address between INTH and SEC_INTH
121 */
122 if (d_it_num < C_INTH_NUM_INT)
123 p_inth_level_reg = (SYS_UWORD16 *) C_INTH_EXT_REG;
124
125 else if (d_it_num < (C_INTH_NUM_INT + C_INTH_2ND_NUM_INT)) {
126 p_inth_level_reg = (SYS_UWORD16 *) C_INTH2_EXT_REG;
127 d_it_num_temp= d_it_num - C_INTH_NUM_INT;
128 }
129 else
130 return;
131
132 /*
133 * Set the configuration of the selected interrupt
134 */
135 p_inth_level_reg[d_it_num_temp] = p_config->d_fiq_nirq |
136 (p_config->d_edge_nlevel << 1) |
137 (p_config->d_priority << 2);
138
139 /*
140 * Set indirect table
141 */
142 /* Is main interrupt handler? */
143 if (d_it_num < C_INTH_NUM_INT)
144 if (p_config->d_fiq_nirq == C_INTH_IRQ)
145 a_inth_it_handlers[d_it_num_temp][C_INTH_IRQ] = p_config->d_it_handler;
146 else
147 a_inth_it_handlers[d_it_num_temp][C_INTH_FIQ] = p_config->d_it_handler;
148 /* This is the 2nd level interrupt handler */
149 else
150 a_inth2_irq_handlers[d_it_num_temp] = p_config->d_it_handler;
151
152 } /* f_inth_init() */
153
154
155
156 /******************************************************************************
157 *
158 * FUNCTION NAME: f_inth_setup
159 * Setup interrupt handler configuration.
160 *
161 *
162 * ARGUMENT LIST:
163 *
164 * Argument Type IO Description
165 * ------------- ---------------- -- ----------------------------------
166 * p_inth_config T_INTH_CONFIG * I Interrupt handler configuration.
167 *
168 * RETURN VALUE: None
169 *
170 *****************************************************************************/
171
172 void f_inth_setup(T_INTH_CONFIG *p_inth_config)
173 {
174 SYS_UWORD8 d_i;
175
176 /* Setup all interrupts to IRQ or FIQ with different levels and priority */
177 for (d_i = 0 ; d_i < (C_INTH_NUM_INT + C_INTH_2ND_NUM_INT) ; d_i++) {
178 if (p_inth_config[d_i].d_priority != 0xFF) {
179 f_inth_init(d_i, (T_INTH_CONFIG *)&p_inth_config[d_i]);
180 }
181 F_INTH_DISABLE_ONE_IT(d_i);
182 }
183
184 } /* f_inth_setup() */
185
186
187
188 /******************************************************************************
189 *
190 * FUNCTION NAME: f_inth_get_version
191 * Return the version of the interrupt handler driver.
192 *
193 *
194 * ARGUMENT LIST:
195 *
196 * Argument Type IO Description
197 * ------------ ------------------- -- ---------------------------------
198 *
199 * RETURN VALUE: Version of the INTH driver
200 *
201 *****************************************************************************/
202
203 SYS_UWORD16 f_inth_get_version(void) {
204 return(C_INTH_DRIVER_VERSION);
205 }
206
207
208 #endif /* (CHIPSET == 12) */
209