1 // SPDX-License-Identifier: BSD-3-Clause
2 //
3 // Copyright 2021 NXP
4 //
5 // Author: Peng Zhang <peng.zhang_8@nxp.com>
6
7 #include <sof/common.h>
8 #include <rtos/interrupt.h>
9 #include <sof/lib/cpu.h>
10 #include <sof/lib/io.h>
11 #include <sof/lib/memory.h>
12 #include <sof/lib/uuid.h>
13 #include <sof/list.h>
14 #include <rtos/spinlock.h>
15 #include <errno.h>
16 #include <inttypes.h>
17 #include <stdbool.h>
18 #include <stddef.h>
19 #include <stdint.h>
20
21 LOG_MODULE_REGISTER(generic_irq_imx, CONFIG_SOF_LOG_LEVEL);
22
23 /* fa00558c-d653-4851-a03a-b21f125a9524 */
24 DECLARE_SOF_UUID("generic-irq-imx", generic_irq_imx_uuid, 0xfa00558c, 0xd653, 0x4851,
25 0xa0, 0x3a, 0xb2, 0x1f, 0x12, 0x5a, 0x95, 0x24);
26
27 DECLARE_TR_CTX(noirq_i_tr, SOF_UUID(generic_irq_imx_uuid), LOG_LEVEL_INFO);
28
29 /* this is needed because i.MX8 implementation assumes all boards have an irqsteer.
30 * Needs to be fixed.
31 */
irqstr_get_sof_int(int irqstr_int)32 int irqstr_get_sof_int(int irqstr_int)
33 {
34 return irqstr_int;
35 }
36
platform_interrupt_init(void)37 void platform_interrupt_init(void) {}
38
platform_interrupt_set(uint32_t irq)39 void platform_interrupt_set(uint32_t irq)
40 {
41 arch_interrupt_set(irq);
42 }
43
platform_interrupt_clear(uint32_t irq,uint32_t mask)44 void platform_interrupt_clear(uint32_t irq, uint32_t mask)
45 {
46 arch_interrupt_clear(irq);
47 }
48
platform_interrupt_get_enabled(void)49 uint32_t platform_interrupt_get_enabled(void)
50 {
51 return 0;
52 }
53
interrupt_mask(uint32_t irq,unsigned int cpu)54 void interrupt_mask(uint32_t irq, unsigned int cpu) {}
55
interrupt_unmask(uint32_t irq,unsigned int cpu)56 void interrupt_unmask(uint32_t irq, unsigned int cpu) {}
57