xref: /nrf52832-nimble/rt-thread/libcpu/arm/realview-a8-vmm/interrupt.h (revision 104654410c56c573564690304ae786df310c91fc)
1 /*
2  * Copyright (c) 2006-2018, RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2013-07-06     Bernard      first version
9  */
10 
11 #ifndef __INTERRUPT_H__
12 #define __INTERRUPT_H__
13 
14 #define INT_IRQ     0x00
15 #define INT_FIQ     0x01
16 
17 #define INTC_REVISION(hw_base) 		    REG32((hw_base) + 0x0)
18 #define INTC_SYSCONFIG(hw_base) 		REG32((hw_base) + 0x10)
19 #define INTC_SYSSTATUS(hw_base) 		REG32((hw_base) + 0x14)
20 #define INTC_SIR_IRQ(hw_base) 		    REG32((hw_base) + 0x40)
21 #define INTC_SIR_FIQ(hw_base) 		    REG32((hw_base) + 0x44)
22 #define INTC_CONTROL(hw_base) 		    REG32((hw_base) + 0x48)
23 #define INTC_PROTECTION(hw_base) 	    REG32((hw_base) + 0x4c)
24 #define INTC_IDLE(hw_base)  			REG32((hw_base) + 0x50)
25 #define INTC_IRQ_PRIORITY(hw_base) 	    REG32((hw_base) + 0x60)
26 #define INTC_FIQ_PRIORITY(hw_base) 	    REG32((hw_base) + 0x64)
27 #define INTC_THRESHOLD(hw_base) 		REG32((hw_base) + 0x68)
28 #define INTC_SICR(hw_base)  			REG32((hw_base) + 0x6c)
29 #define INTC_SCR(hw_base, n) 		    REG32((hw_base) + 0x70 + ((n) * 0x04))
30 #define INTC_ITR(hw_base, n) 		    REG32((hw_base) + 0x80 + ((n) * 0x20))
31 #define INTC_MIR(hw_base, n) 		    REG32((hw_base) + 0x84 + ((n) * 0x20))
32 #define INTC_MIR_CLEAR(hw_base, n)  	REG32((hw_base) + 0x88 + ((n) * 0x20))
33 #define INTC_MIR_SET(hw_base, n) 	    REG32((hw_base) + 0x8c + ((n) * 0x20))
34 #define INTC_ISR_SET(hw_base, n) 	    REG32((hw_base) + 0x90 + ((n) * 0x20))
35 #define INTC_ISR_CLEAR(hw_base, n) 	    REG32((hw_base) + 0x94 + ((n) * 0x20))
36 #define INTC_PENDING_IRQ(hw_base, n)    REG32((hw_base) + 0x98 + ((n) * 0x20))
37 #define INTC_PENDING_FIQ(hw_base, n)    REG32((hw_base) + 0x9c + ((n) * 0x20))
38 #define INTC_ILR(hw_base, n)  		    REG32((hw_base) + 0x100 + ((n) * 0x04))
39 
40 void rt_hw_interrupt_control(int vector, int priority, int route);
41 int rt_hw_interrupt_get_active(int fiq_irq);
42 void rt_hw_interrupt_ack(int fiq_irq);
43 void rt_hw_interrupt_trigger(int vector);
44 void rt_hw_interrupt_clear(int vector);
45 
46 #endif
47