Saurabh Gorecha | 70389ca | 2020-04-22 21:31:24 +0530 | [diff] [blame] | 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 | */ |
Saurabh Gorecha | b849301 | 2022-04-05 00:11:52 +0530 | [diff] [blame] | 28 | void qti_setup_page_tables( |
| 29 | uintptr_t total_base, |
Saurabh Gorecha | 70389ca | 2020-04-22 21:31:24 +0530 | [diff] [blame] | 30 | size_t total_size, |
| 31 | uintptr_t code_start, |
| 32 | uintptr_t code_limit, |
| 33 | uintptr_t rodata_start, |
Saurabh Gorecha | b849301 | 2022-04-05 00:11:52 +0530 | [diff] [blame] | 34 | uintptr_t rodata_limit |
| 35 | ); |
Saurabh Gorecha | 70389ca | 2020-04-22 21:31:24 +0530 | [diff] [blame] | 36 | |
| 37 | /* |
| 38 | * Mandatory functions required in ARM standard platforms |
| 39 | */ |
| 40 | void plat_qti_gic_driver_init(void); |
| 41 | void plat_qti_gic_init(void); |
| 42 | void plat_qti_gic_cpuif_enable(void); |
| 43 | void plat_qti_gic_cpuif_disable(void); |
| 44 | void plat_qti_gic_pcpu_init(void); |
| 45 | |
| 46 | /* |
| 47 | * Optional functions required in ARM standard platforms |
| 48 | */ |
| 49 | unsigned int plat_qti_core_pos_by_mpidr(u_register_t mpidr); |
| 50 | unsigned int plat_qti_my_cluster_pos(void); |
| 51 | |
| 52 | void gic_set_spi_routing(unsigned int id, unsigned int irm, u_register_t mpidr); |
| 53 | |
Julius Werner | 0375d32 | 2019-02-20 17:33:23 -0800 | [diff] [blame] | 54 | void qti_pmic_prepare_reset(void); |
| 55 | void qti_pmic_prepare_shutdown(void); |
| 56 | |
Bharath N | 89084c8 | 2022-11-01 17:57:17 +0530 | [diff] [blame] | 57 | typedef struct chip_id_info { |
| 58 | uint16_t jtag_id; |
| 59 | uint16_t chipinfo_id; |
| 60 | } chip_id_info_t; |
| 61 | |
Saurabh Gorecha | 70389ca | 2020-04-22 21:31:24 +0530 | [diff] [blame] | 62 | #endif /* QTI_PLAT_H */ |