1 /*
2  * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
3  * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #ifndef QTI_PLAT_H
9 #define QTI_PLAT_H
10 
11 #include <stdint.h>
12 
13 #include <common/bl_common.h>
14 #include <lib/cassert.h>
15 #include <lib/el3_runtime/cpu_data.h>
16 #include <lib/xlat_tables/xlat_tables_v2.h>
17 
18 /*
19  * Utility functions common to QTI platforms
20  */
21 int qti_mmap_add_dynamic_region(uintptr_t base_pa, size_t size,
22 				unsigned int attr);
23 int qti_mmap_remove_dynamic_region(uintptr_t base_va, size_t size);
24 
25 /*
26  * Utility functions common to ARM standard platforms
27  */
28 void qti_setup_page_tables(uintptr_t total_base,
29 			   size_t total_size,
30 			   uintptr_t code_start,
31 			   uintptr_t code_limit,
32 			   uintptr_t rodata_start,
33 			   uintptr_t rodata_limit,
34 			   uintptr_t coh_start, uintptr_t coh_limit);
35 
36 /*
37  * Mandatory functions required in ARM standard platforms
38  */
39 void plat_qti_gic_driver_init(void);
40 void plat_qti_gic_init(void);
41 void plat_qti_gic_cpuif_enable(void);
42 void plat_qti_gic_cpuif_disable(void);
43 void plat_qti_gic_pcpu_init(void);
44 
45 /*
46  * Optional functions required in ARM standard platforms
47  */
48 unsigned int plat_qti_core_pos_by_mpidr(u_register_t mpidr);
49 unsigned int plat_qti_my_cluster_pos(void);
50 
51 void gic_set_spi_routing(unsigned int id, unsigned int irm, u_register_t mpidr);
52 
53 void qti_pmic_prepare_reset(void);
54 void qti_pmic_prepare_shutdown(void);
55 
56 #endif /* QTI_PLAT_H */
57