blob: 4d9d3204a14a52c9a15e031cec31da9e378c30bc [file] [log] [blame]
Saurabh Gorecha70389ca2020-04-22 21:31:24 +05301/*
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 */
21int qti_mmap_add_dynamic_region(uintptr_t base_pa, size_t size,
22 unsigned int attr);
23int qti_mmap_remove_dynamic_region(uintptr_t base_va, size_t size);
24
25/*
26 * Utility functions common to ARM standard platforms
27 */
28void 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 */
39void plat_qti_gic_driver_init(void);
40void plat_qti_gic_init(void);
41void plat_qti_gic_cpuif_enable(void);
42void plat_qti_gic_cpuif_disable(void);
43void plat_qti_gic_pcpu_init(void);
44
45/*
46 * Optional functions required in ARM standard platforms
47 */
48unsigned int plat_qti_core_pos_by_mpidr(u_register_t mpidr);
49unsigned int plat_qti_my_cluster_pos(void);
50
51void gic_set_spi_routing(unsigned int id, unsigned int irm, u_register_t mpidr);
52
Julius Werner0375d322019-02-20 17:33:23 -080053void qti_pmic_prepare_reset(void);
54void qti_pmic_prepare_shutdown(void);
55
Saurabh Gorecha70389ca2020-04-22 21:31:24 +053056#endif /* QTI_PLAT_H */