xref: /optee_os/core/include/drivers/gic.h (revision 5a913ee74d3c71af2a2860ce8a4e7aeab2916f9b)
1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright (c) 2016, Linaro Limited
4  * Copyright (c) 2014, STMicroelectronics International N.V.
5  */
6 
7 #ifndef __DRIVERS_GIC_H
8 #define __DRIVERS_GIC_H
9 #include <types_ext.h>
10 #include <kernel/interrupt.h>
11 
12 #define GIC_DIST_REG_SIZE	0x10000
13 #define GIC_CPU_REG_SIZE	0x10000
14 
15 struct gic_data {
16 	vaddr_t gicc_base;
17 	vaddr_t gicd_base;
18 	size_t max_it;
19 	struct itr_chip chip;
20 };
21 
22 /*
23  * The two gic_init_* functions initializes the struct gic_data which is
24  * then used by the other functions.
25  */
26 
27 void gic_init(struct gic_data *gd, vaddr_t gicc_base, vaddr_t gicd_base);
28 /* initial base address only */
29 void gic_init_base_addr(struct gic_data *gd, vaddr_t gicc_base,
30 			vaddr_t gicd_base);
31 /* initial cpu if only, mainly use for secondary cpu setup cpu interface */
32 void gic_cpu_init(struct gic_data *gd);
33 
34 void gic_it_handle(struct gic_data *gd);
35 
36 void gic_dump_state(struct gic_data *gd);
37 #endif /*__DRIVERS_GIC_H*/
38