1 /*
2  * Copyright (c) 2021-2022, Arm Limited. All rights reserved.
3  * Copyright (c) 2022 Cypress Semiconductor Corporation (an Infineon
4  * company) or an affiliate of Cypress Semiconductor Corporation. All rights
5  * reserved.
6  *
7  * SPDX-License-Identifier: BSD-3-Clause
8  *
9  */
10 
11 #include <stdint.h>
12 
13 #include "cmsis.h"
14 #include "spm_ipc.h"
15 #include "tfm_hal_interrupt.h"
16 #include "tfm_peripherals_def.h"
17 #include "tfm_peripherals_config.h"
18 #include "load/interrupt_defs.h"
19 #include "ffm/interrupt.h"
20 
irq_init(struct irq_t * irq,IRQn_Type irqn,void * p_pt,const struct irq_load_info_t * p_ildi)21 static enum tfm_hal_status_t irq_init(struct irq_t *irq, IRQn_Type irqn,
22                                       void * p_pt,
23                                       const struct irq_load_info_t *p_ildi)
24 {
25     irq->p_ildi = p_ildi;
26     irq->p_pt = p_pt;
27 
28     NVIC_SetPriority(irqn, DEFAULT_IRQ_PRIORITY);
29     NVIC_ClearTargetState(irqn);
30     NVIC_DisableIRQ(irqn);
31 
32     return TFM_HAL_SUCCESS;
33 }
34 
35 #if TFM_PERIPHERAL_FPU_SECURE
36 static struct irq_t fpu_irq = {0};
37 
FPU_IRQHandler(void)38 void FPU_IRQHandler(void)
39 {
40     spm_handle_interrupt(fpu_irq.p_pt, fpu_irq.p_ildi);
41 }
42 
tfm_fpu_irq_init(void * p_pt,const struct irq_load_info_t * p_ildi)43 enum tfm_hal_status_t tfm_fpu_irq_init(void *p_pt,
44                                          const struct irq_load_info_t *p_ildi)
45 {
46     return irq_init(&fpu_irq, TFM_FPU_IRQ, p_pt, p_ildi);
47 }
48 #endif
49 
50 #if TFM_PERIPHERAL_CLOCK_SECURE || TFM_PERIPHERAL_POWER_SECURE
51 static struct irq_t clock_power_irq = {0};
52 
CLOCK_POWER_IRQHandler(void)53 void CLOCK_POWER_IRQHandler(void)
54 {
55     spm_handle_interrupt(clock_power_irq.p_pt, clock_power_irq.p_ildi);
56 }
57 
tfm_clock_power_irq_init(void * p_pt,const struct irq_load_info_t * p_ildi)58 enum tfm_hal_status_t tfm_clock_power_irq_init(void *p_pt,
59                                                const struct irq_load_info_t *p_ildi)
60 {
61     return irq_init(&clock_power_irq, TFM_CLOCK_POWER_IRQ, p_pt, p_ildi);
62 }
63 
64 enum tfm_hal_status_t tfm_clock_irq_init(void *p_pt,
65                                          const struct irq_load_info_t *p_ildi)
66 __attribute__((alias("tfm_clock_power_irq_init")));
67 
68 enum tfm_hal_status_t tfm_power_irq_init(void *p_pt,
69                                          const struct irq_load_info_t *p_ildi)
70 __attribute__((alias("tfm_clock_power_irq_init")));
71 #endif
72 
73 #if TFM_PERIPHERAL_SPIM0_SECURE || TFM_PERIPHERAL_SPIS0_SECURE || \
74     TFM_PERIPHERAL_TWIM0_SECURE || TFM_PERIPHERAL_TWIS0_SECURE || \
75     TFM_PERIPHERAL_UARTE0_SECURE
76 static struct irq_t serial0_irq = {0};
77 
UARTE0_SPIM0_SPIS0_TWIM0_TWIS0_IRQHandler(void)78 void UARTE0_SPIM0_SPIS0_TWIM0_TWIS0_IRQHandler(void)
79 {
80     spm_handle_interrupt(serial0_irq.p_pt, serial0_irq.p_ildi);
81 }
82 
tfm_serial0_init(void * p_pt,const struct irq_load_info_t * p_ildi)83 enum tfm_hal_status_t tfm_serial0_init(void *p_pt,
84                                         const struct irq_load_info_t *p_ildi)
85 {
86     return irq_init(&serial0_irq, TFM_SERIAL0_IRQ, p_pt, p_ildi);
87 }
88 
89 enum tfm_hal_status_t tfm_spim0_irq_init(void *p_pt,
90                                          const struct irq_load_info_t *p_ildi)
91 __attribute__((alias("tfm_serial0_init")));
92 
93 enum tfm_hal_status_t tfm_spis0_irq_init(void *p_pt,
94                                          const struct irq_load_info_t *p_ildi)
95 __attribute__((alias("tfm_serial0_init")));
96 
97 enum tfm_hal_status_t tfm_twim0_irq_init(void *p_pt,
98                                          const struct irq_load_info_t *p_ildi)
99 __attribute__((alias("tfm_serial0_init")));
100 
101 enum tfm_hal_status_t tfm_twis0_irq_init(void *p_pt,
102                                          const struct irq_load_info_t *p_ildi)
103 __attribute__((alias("tfm_serial0_init")));
104 
105 enum tfm_hal_status_t tfm_uarte0_irq_init(void *p_pt,
106                                          const struct irq_load_info_t *p_ildi)
107 __attribute__((alias("tfm_serial0_init")));
108 #endif
109 
110 #if TFM_PERIPHERAL_SPIM1_SECURE || TFM_PERIPHERAL_SPIS1_SECURE || \
111     TFM_PERIPHERAL_TWIM1_SECURE || TFM_PERIPHERAL_TWIS1_SECURE || \
112     TFM_PERIPHERAL_UARTE1_SECURE
113 static struct irq_t serial1_irq = {0};
114 
UARTE1_SPIM1_SPIS1_TWIM1_TWIS1_IRQHandler_IRQHandler(void)115 void UARTE1_SPIM1_SPIS1_TWIM1_TWIS1_IRQHandler_IRQHandler(void)
116 {
117     spm_handle_interrupt(serial1_irq.p_pt, serial1_irq.p_ildi);
118 }
119 
tfm_serial1_init(void * p_pt,const struct irq_load_info_t * p_ildi)120 enum tfm_hal_status_t tfm_serial1_init(void *p_pt,
121                                         const struct irq_load_info_t *p_ildi)
122 {
123     return irq_init(&serial1_irq, TFM_SERIAL1_IRQ, p_pt, p_ildi);
124 }
125 
126 enum tfm_hal_status_t tfm_spim1_irq_init(void *p_pt,
127                                          const struct irq_load_info_t *p_ildi)
128 __attribute__((alias("tfm_serial1_init")));
129 
130 enum tfm_hal_status_t tfm_spis1_irq_init(void *p_pt,
131                                          const struct irq_load_info_t *p_ildi)
132 __attribute__((alias("tfm_serial1_init")));
133 
134 enum tfm_hal_status_t tfm_twim1_irq_init(void *p_pt,
135                                          const struct irq_load_info_t *p_ildi)
136 __attribute__((alias("tfm_serial1_init")));
137 
138 enum tfm_hal_status_t tfm_twis1_irq_init(void *p_pt,
139                                          const struct irq_load_info_t *p_ildi)
140 __attribute__((alias("tfm_serial1_init")));
141 
142 enum tfm_hal_status_t tfm_uarte1_irq_init(void *p_pt,
143                                          const struct irq_load_info_t *p_ildi)
144 __attribute__((alias("tfm_serial1_init")));
145 #endif
146 
147 #if TFM_PERIPHERAL_SPIM2_SECURE || TFM_PERIPHERAL_SPIS2_SECURE || \
148     TFM_PERIPHERAL_TWIM2_SECURE || TFM_PERIPHERAL_TWIS2_SECURE || \
149     TFM_PERIPHERAL_UARTE2_SECURE
150 static struct irq_t serial2_irq = {0};
151 
UARTE2_SPIM2_SPIS2_TWIM2_TWIS2_IRQHandler(void)152 void UARTE2_SPIM2_SPIS2_TWIM2_TWIS2_IRQHandler(void)
153 {
154     spm_handle_interrupt(serial2_irq.p_pt, serial2_irq.p_ildi);
155 }
156 
tfm_serial2_init(void * p_pt,const struct irq_load_info_t * p_ildi)157 enum tfm_hal_status_t tfm_serial2_init(void *p_pt,
158                                         const struct irq_load_info_t *p_ildi)
159 {
160     return irq_init(&serial2_irq, TFM_SERIAL2_IRQ, p_pt, p_ildi);
161 }
162 
163 enum tfm_hal_status_t tfm_spim2_irq_init(void *p_pt,
164                                          const struct irq_load_info_t *p_ildi)
165 __attribute__((alias("tfm_serial2_init")));
166 
167 enum tfm_hal_status_t tfm_spis2_irq_init(void *p_pt,
168                                          const struct irq_load_info_t *p_ildi)
169 __attribute__((alias("tfm_serial2_init")));
170 
171 enum tfm_hal_status_t tfm_twim2_irq_init(void *p_pt,
172                                          const struct irq_load_info_t *p_ildi)
173 __attribute__((alias("tfm_serial2_init")));
174 
175 enum tfm_hal_status_t tfm_twis2_irq_init(void *p_pt,
176                                          const struct irq_load_info_t *p_ildi)
177 __attribute__((alias("tfm_serial2_init")));
178 
179 enum tfm_hal_status_t tfm_uarte2_irq_init(void *p_pt,
180                                          const struct irq_load_info_t *p_ildi)
181 __attribute__((alias("tfm_serial2_init")));
182 #endif
183 
184 #if TFM_PERIPHERAL_SPIM3_SECURE || TFM_PERIPHERAL_SPIS3_SECURE || \
185     TFM_PERIPHERAL_TWIM3_SECURE || TFM_PERIPHERAL_TWIS3_SECURE || \
186     TFM_PERIPHERAL_UARTE3_SECURE
187 static struct irq_t serial3_irq = {0};
188 
UARTE3_SPIM3_SPIS3_TWIM3_TWIS3_IRQHandler(void)189 void UARTE3_SPIM3_SPIS3_TWIM3_TWIS3_IRQHandler(void)
190 {
191     spm_handle_interrupt(serial3_irq.p_pt, serial3_irq.p_ildi);
192 }
193 
tfm_serial3_init(void * p_pt,const struct irq_load_info_t * p_ildi)194 enum tfm_hal_status_t tfm_serial3_init(void *p_pt,
195                                         const struct irq_load_info_t *p_ildi)
196 {
197     return irq_init(&serial3_irq, TFM_SERIAL3_IRQ, p_pt, p_ildi);
198 }
199 
200 enum tfm_hal_status_t tfm_spim3_irq_init(void *p_pt,
201                                          const struct irq_load_info_t *p_ildi)
202 __attribute__((alias("tfm_serial3_init")));
203 
204 enum tfm_hal_status_t tfm_spis3_irq_init(void *p_pt,
205                                          const struct irq_load_info_t *p_ildi)
206 __attribute__((alias("tfm_serial3_init")));
207 
208 enum tfm_hal_status_t tfm_twim3_irq_init(void *p_pt,
209                                          const struct irq_load_info_t *p_ildi)
210 __attribute__((alias("tfm_serial3_init")));
211 
212 enum tfm_hal_status_t tfm_twis3_irq_init(void *p_pt,
213                                          const struct irq_load_info_t *p_ildi)
214 __attribute__((alias("tfm_serial3_init")));
215 
216 enum tfm_hal_status_t tfm_uarte3_irq_init(void *p_pt,
217                                          const struct irq_load_info_t *p_ildi)
218 __attribute__((alias("tfm_serial3_init")));
219 #endif
220 
221 #if TFM_PERIPHERAL_GPIOTE0_SECURE
222 static struct irq_t gpiote0_irq = {0};
223 
GPIOTE0_IRQHandler(void)224 void GPIOTE0_IRQHandler(void)
225 {
226     spm_handle_interrupt(gpiote0_irq.p_pt, gpiote0_irq.p_ildi);
227 }
228 
tfm_gpiote0_irq_init(void * p_pt,const struct irq_load_info_t * p_ildi)229 enum tfm_hal_status_t tfm_gpiote0_irq_init(void *p_pt,
230                                            const struct irq_load_info_t *p_ildi)
231 {
232     return irq_init(&gpiote0_irq, TFM_GPIOTE0_IRQ, p_pt, p_ildi);
233 }
234 #endif
235 
236 #if TFM_PERIPHERAL_SAADC_SECURE
237 static struct irq_t saadc_irq = {0};
238 
SAADC_IRQHandler(void)239 void SAADC_IRQHandler(void)
240 {
241     spm_handle_interrupt(saadc_irq.p_pt, saadc_irq.p_ildi);
242 }
243 
tfm_saadc_irq_init(void * p_pt,const struct irq_load_info_t * p_ildi)244 enum tfm_hal_status_t tfm_saadc_irq_init(void *p_pt,
245                                          const struct irq_load_info_t *p_ildi)
246 {
247     return irq_init(&saadc_irq, TFM_SAADC_IRQ, p_pt, p_ildi);
248 }
249 #endif
250 
251 #if TFM_PERIPHERAL_TIMER0_SECURE
252 static struct irq_t timer0_irq = {0};
253 
TIMER0_IRQHandler(void)254 void TIMER0_IRQHandler(void)
255 {
256     spm_handle_interrupt(timer0_irq.p_pt, timer0_irq.p_ildi);
257 }
258 
tfm_timer0_irq_init(void * p_pt,const struct irq_load_info_t * p_ildi)259 enum tfm_hal_status_t tfm_timer0_irq_init(void *p_pt,
260                                           const struct irq_load_info_t *p_ildi)
261 {
262     return irq_init(&timer0_irq, TFM_TIMER0_IRQ, p_pt, p_ildi);
263 }
264 #endif
265 
266 #if TFM_PERIPHERAL_TIMER1_SECURE
267 static struct irq_t timer1_irq = {0};
268 
TIMER1_IRQHandler(void)269 void TIMER1_IRQHandler(void)
270 {
271     spm_handle_interrupt(timer1_irq.p_pt, timer1_irq.p_ildi);
272 }
273 
tfm_timer1_irq_init(void * p_pt,const struct irq_load_info_t * p_ildi)274 enum tfm_hal_status_t tfm_timer1_irq_init(void *p_pt,
275                                          const struct irq_load_info_t *p_ildi)
276 {
277     return irq_init(&timer1_irq, TFM_TIMER1_IRQ, p_pt, p_ildi);
278 }
279 #endif
280 
281 #if TFM_PERIPHERAL_TIMER2_SECURE
282 static struct irq_t timer2_irq = {0};
283 
TIMER2_IRQHandler(void)284 void TIMER2_IRQHandler(void)
285 {
286     spm_handle_interrupt(timer2_irq.p_pt, timer2_irq.p_ildi);
287 }
288 
tfm_timer2_irq_init(void * p_pt,const struct irq_load_info_t * p_ildi)289 enum tfm_hal_status_t tfm_timer2_irq_init(void *p_pt,
290                                          const struct irq_load_info_t *p_ildi)
291 {
292     return irq_init(&timer2_irq, TFM_TIMER2_IRQ, p_pt, p_ildi);
293 }
294 #endif
295 
296 #if TFM_PERIPHERAL_RTC0_SECURE
297 static struct irq_t rtc0_irq = {0};
298 
RTC0_IRQHandler(void)299 void RTC0_IRQHandler(void)
300 {
301     spm_handle_interrupt(rtc0_irq.p_pt, rtc0_irq.p_ildi);
302 }
303 
tfm_rtc0_irq_init(void * p_pt,const struct irq_load_info_t * p_ildi)304 enum tfm_hal_status_t tfm_rtc0_irq_init(void *p_pt,
305                                          const struct irq_load_info_t *p_ildi)
306 {
307     return irq_init(&rtc0_irq, TFM_RTC0_IRQ, p_pt, p_ildi);
308 }
309 #endif
310 
311 #if TFM_PERIPHERAL_RTC1_SECURE
312 static struct irq_t rtc1_irq = {0};
313 
RTC1_IRQHandler(void)314 void RTC1_IRQHandler(void)
315 {
316     spm_handle_interrupt(rtc1_irq.p_pt, rtc1_irq.p_ildi);
317 }
318 
tfm_rtc1_irq_init(void * p_pt,const struct irq_load_info_t * p_ildi)319 enum tfm_hal_status_t tfm_rtc1_irq_init(void *p_pt,
320                                          const struct irq_load_info_t *p_ildi)
321 {
322     return irq_init(&rtc1_irq, TFM_RTC1_IRQ, p_pt, p_ildi);
323 }
324 #endif
325 
326 #if TFM_PERIPHERAL_WDT_SECURE
327 static struct irq_t wdt_irq = {0};
328 
WDT_IRQHandler(void)329 void WDT_IRQHandler(void)
330 {
331     spm_handle_interrupt(wdt_irq.p_pt, wdt_irq.p_ildi);
332 }
333 
tfm_wdt_irq_init(void * p_pt,const struct irq_load_info_t * p_ildi)334 enum tfm_hal_status_t tfm_wdt_irq_init(void *p_pt,
335                                          const struct irq_load_info_t *p_ildi)
336 {
337     return irq_init(&wdt_irq, TFM_WDT_IRQ, p_pt, p_ildi);
338 }
339 #endif
340 
341 #if TFM_PERIPHERAL_EGU0_SECURE
342 static struct irq_t egu0_irq = {0};
343 
EGU0_IRQHandler(void)344 void EGU0_IRQHandler(void)
345 {
346     spm_handle_interrupt(egu0_irq.p_pt, egu0_irq.p_ildi);
347 }
348 
tfm_egu0_irq_init(void * p_pt,const struct irq_load_info_t * p_ildi)349 enum tfm_hal_status_t tfm_egu0_irq_init(void *p_pt,
350                                          const struct irq_load_info_t *p_ildi)
351 {
352     return irq_init(&egu0_irq, TFM_EGU0_IRQ, p_pt, p_ildi);
353 }
354 #endif
355 
356 #if TFM_PERIPHERAL_EGU1_SECURE
357 static struct irq_t egu1_irq = {0};
358 
EGU1_IRQHandler(void)359 void EGU1_IRQHandler(void)
360 {
361     spm_handle_interrupt(egu1_irq.p_pt, egu1_irq.p_ildi);
362 }
363 
tfm_egu1_irq_init(void * p_pt,const struct irq_load_info_t * p_ildi)364 enum tfm_hal_status_t tfm_egu1_irq_init(void *p_pt,
365                                          const struct irq_load_info_t *p_ildi)
366 {
367     return irq_init(&egu1_irq, TFM_EGU1_IRQ, p_pt, p_ildi);
368 }
369 #endif
370 
371 #if TFM_PERIPHERAL_EGU2_SECURE
372 static struct irq_t egu2_irq = {0};
373 
EGU2_IRQHandler(void)374 void EGU2_IRQHandler(void)
375 {
376     spm_handle_interrupt(egu2_irq.p_pt, egu2_irq.p_ildi);
377 }
378 
tfm_egu2_irq_init(void * p_pt,const struct irq_load_info_t * p_ildi)379 enum tfm_hal_status_t tfm_egu2_irq_init(void *p_pt,
380                                          const struct irq_load_info_t *p_ildi)
381 {
382     return irq_init(&egu2_irq, TFM_EGU2_IRQ, p_pt, p_ildi);
383 }
384 #endif
385 
386 #if TFM_PERIPHERAL_EGU3_SECURE
387 static struct irq_t egu3_irq = {0};
388 
EGU3_IRQHandler(void)389 void EGU3_IRQHandler(void)
390 {
391     spm_handle_interrupt(egu3_irq.p_pt, egu3_irq.p_ildi);
392 }
393 
tfm_egu3_irq_init(void * p_pt,const struct irq_load_info_t * p_ildi)394 enum tfm_hal_status_t tfm_egu3_irq_init(void *p_pt,
395                                          const struct irq_load_info_t *p_ildi)
396 {
397     return irq_init(&egu3_irq, TFM_EGU3_IRQ, p_pt, p_ildi);
398 }
399 #endif
400 
401 #if TFM_PERIPHERAL_EGU4_SECURE
402 static struct irq_t egu4_irq = {0};
403 
EGU4_IRQHandler(void)404 void EGU4_IRQHandler(void)
405 {
406     spm_handle_interrupt(egu4_irq.p_pt, egu4_irq.p_ildi);
407 }
408 
tfm_egu4_irq_init(void * p_pt,const struct irq_load_info_t * p_ildi)409 enum tfm_hal_status_t tfm_egu4_irq_init(void *p_pt,
410                                          const struct irq_load_info_t *p_ildi)
411 {
412     return irq_init(&egu4_irq, TFM_EGU4_IRQ, p_pt, p_ildi);
413 }
414 #endif
415 
416 #if TFM_PERIPHERAL_EGU5_SECURE
417 static struct irq_t egu5_irq = {0};
418 
EGU5_IRQHandler(void)419 void EGU5_IRQHandler(void)
420 {
421     spm_handle_interrupt(egu5_irq.p_pt, egu5_irq.p_ildi);
422 }
423 
tfm_egu5_irq_init(void * p_pt,const struct irq_load_info_t * p_ildi)424 enum tfm_hal_status_t tfm_egu5_irq_init(void *p_pt,
425                                          const struct irq_load_info_t *p_ildi)
426 {
427     return irq_init(&egu5_irq, TFM_EGU5_IRQ, p_pt, p_ildi);
428 }
429 #endif
430 
431 #if TFM_PERIPHERAL_PWM0_SECURE
432 static struct irq_t pwm0_irq = {0};
433 
PWM0_IRQHandler(void)434 void PWM0_IRQHandler(void)
435 {
436     spm_handle_interrupt(pwm0_irq.p_pt, pwm0_irq.p_ildi);
437 }
438 
tfm_pwm0_irq_init(void * p_pt,const struct irq_load_info_t * p_ildi)439 enum tfm_hal_status_t tfm_pwm0_irq_init(void *p_pt,
440                                          const struct irq_load_info_t *p_ildi)
441 {
442     return irq_init(&pwm0_irq, TFM_PWM0_IRQ, p_pt, p_ildi);
443 }
444 #endif
445 
446 #if TFM_PERIPHERAL_PWM1_SECURE
447 static struct irq_t pwm1_irq = {0};
448 
PWM1_IRQHandler(void)449 void PWM1_IRQHandler(void)
450 {
451     spm_handle_interrupt(pwm1_irq.p_pt, pwm1_irq.p_ildi);
452 }
453 
tfm_pwm1_irq_init(void * p_pt,const struct irq_load_info_t * p_ildi)454 enum tfm_hal_status_t tfm_pwm1_irq_init(void *p_pt,
455                                          const struct irq_load_info_t *p_ildi)
456 {
457     return irq_init(&pwm1_irq, TFM_PWM1_IRQ, p_pt, p_ildi);
458 }
459 #endif
460 
461 #if TFM_PERIPHERAL_PWM2_SECURE
462 static struct irq_t pwm2_irq = {0};
463 
PWM2_IRQHandler(void)464 void PWM2_IRQHandler(void)
465 {
466     spm_handle_interrupt(pwm2_irq.p_pt, pwm2_irq.p_ildi);
467 }
468 
tfm_pwm2_irq_init(void * p_pt,const struct irq_load_info_t * p_ildi)469 enum tfm_hal_status_t tfm_pwm2_irq_init(void *p_pt,
470                                          const struct irq_load_info_t *p_ildi)
471 {
472     return irq_init(&pwm2_irq, TFM_PWM2_IRQ, p_pt, p_ildi);
473 }
474 #endif
475 
476 #if TFM_PERIPHERAL_PWM3_SECURE
477 static struct irq_t pwm3_irq = {0};
478 
PWM3_IRQHandler(void)479 void PWM3_IRQHandler(void)
480 {
481     spm_handle_interrupt(pwm3_irq.p_pt, pwm3_irq.p_ildi);
482 }
483 
tfm_pwm3_irq_init(void * p_pt,const struct irq_load_info_t * p_ildi)484 enum tfm_hal_status_t tfm_pwm3_irq_init(void *p_pt,
485                                          const struct irq_load_info_t *p_ildi)
486 {
487     return irq_init(&pwm3_irq, TFM_PWM3_IRQ, p_pt, p_ildi);
488 }
489 #endif
490 
491 #if TFM_PERIPHERAL_PDM_SECURE
492 static struct irq_t pdm_irq = {0};
493 
PDM_IRQHandler(void)494 void PDM_IRQHandler(void)
495 {
496     spm_handle_interrupt(pdm_irq.p_pt, pdm_irq.p_ildi);
497 }
498 
tfm_pdm_irq_init(void * p_pt,const struct irq_load_info_t * p_ildi)499 enum tfm_hal_status_t tfm_pdm_irq_init(void *p_pt,
500                                          const struct irq_load_info_t *p_ildi)
501 {
502     return irq_init(&pdm_irq, TFM_PDM_IRQ, p_pt, p_ildi);
503 }
504 #endif
505 
506 #ifdef TFM_PERIPHERAL_IPC_SECURE
507 static struct irq_t ipc_irq = {0};
508 
IPC_IRQHandler(void)509 void IPC_IRQHandler(void)
510 {
511     spm_handle_interrupt(ipc_irq.p_pt, ipc_irq.p_ildi);
512 }
513 
tfm_ipc_irq_init(void * p_pt,const struct irq_load_info_t * p_ildi)514 enum tfm_hal_status_t tfm_ipc_irq_init(void *p_pt,
515                                          const struct irq_load_info_t *p_ildi)
516 {
517     return irq_init(&ipc_irq, TFM_IPC_IRQ, p_pt, p_ildi);
518 }
519 #endif
520 
521 #if TFM_PERIPHERAL_I2S_SECURE
522 static struct irq_t i2s_irq = {0};
523 
I2S_IRQHandler(void)524 void I2S_IRQHandler(void)
525 {
526     spm_handle_interrupt(i2s_irq.p_pt, i2s_irq.p_ildi);
527 }
528 
tfm_i20_irq_init(void * p_pt,const struct irq_load_info_t * p_ildi)529 enum tfm_hal_status_t tfm_i20_irq_init(void *p_pt,
530                                          const struct irq_load_info_t *p_ildi)
531 {
532     return irq_init(&i2s_irq, TFM_I2S_IRQ, p_pt, p_ildi);
533 }
534 #endif
535 
536 
537 #ifdef PSA_API_TEST_IPC
538 enum tfm_hal_status_t ff_test_uart_irq_init(void *p_pt,
539                                             const struct irq_load_info_t *p_ildi)
540 __attribute__((alias("tfm_egu5_irq_init")));
541 
542 #endif
543