blob: 7483c49450e4c27bd0db98308d02abc2a0cfcf0d [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 */
Saurabh Gorechab8493012022-04-05 00:11:52 +053028void qti_setup_page_tables(
29 uintptr_t total_base,
Saurabh Gorecha70389ca2020-04-22 21:31:24 +053030 size_t total_size,
31 uintptr_t code_start,
32 uintptr_t code_limit,
33 uintptr_t rodata_start,
Saurabh Gorechab8493012022-04-05 00:11:52 +053034 uintptr_t rodata_limit
35 );
Saurabh Gorecha70389ca2020-04-22 21:31:24 +053036
37/*
38 * Mandatory functions required in ARM standard platforms
39 */
40void plat_qti_gic_driver_init(void);
41void plat_qti_gic_init(void);
42void plat_qti_gic_cpuif_enable(void);
43void plat_qti_gic_cpuif_disable(void);
44void plat_qti_gic_pcpu_init(void);
45
46/*
47 * Optional functions required in ARM standard platforms
48 */
49unsigned int plat_qti_core_pos_by_mpidr(u_register_t mpidr);
50unsigned int plat_qti_my_cluster_pos(void);
51
52void gic_set_spi_routing(unsigned int id, unsigned int irm, u_register_t mpidr);
53
Julius Werner0375d322019-02-20 17:33:23 -080054void qti_pmic_prepare_reset(void);
55void qti_pmic_prepare_shutdown(void);
56
Bharath N89084c82022-11-01 17:57:17 +053057typedef struct chip_id_info {
58 uint16_t jtag_id;
59 uint16_t chipinfo_id;
60} chip_id_info_t;
61
Saurabh Gorecha70389ca2020-04-22 21:31:24 +053062#endif /* QTI_PLAT_H */