Sumit Garg | 4d4df11 | 2018-06-15 14:43:35 +0530 | [diff] [blame] | 1 | /* |
Jassi Brar | 2244bf1 | 2022-03-03 15:24:31 -0600 | [diff] [blame] | 2 | * Copyright (c) 2018-2022, ARM Limited and Contributors. All rights reserved. |
Sumit Garg | 4d4df11 | 2018-06-15 14:43:35 +0530 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 7 | #ifndef SQ_COMMON_H |
| 8 | #define SQ_COMMON_H |
Sumit Garg | 4d4df11 | 2018-06-15 14:43:35 +0530 | [diff] [blame] | 9 | |
Antonio Nino Diaz | 4b32e62 | 2018-08-16 16:52:57 +0100 | [diff] [blame] | 10 | #include <stdint.h> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 11 | |
Masahisa Kojima | ebfd8eb | 2019-03-07 10:41:54 +0900 | [diff] [blame] | 12 | #include <lib/psci/psci.h> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 13 | #include <lib/xlat_tables/xlat_tables_v2.h> |
Sumit Garg | 4d4df11 | 2018-06-15 14:43:35 +0530 | [diff] [blame] | 14 | |
Ard Biesheuvel | 6fc122f | 2018-06-15 15:25:42 +0530 | [diff] [blame] | 15 | struct draminfo { |
| 16 | uint32_t num_regions; |
| 17 | uint32_t reserved; |
| 18 | uint64_t base1; |
| 19 | uint64_t size1; |
| 20 | uint64_t base2; |
| 21 | uint64_t size2; |
| 22 | uint64_t base3; |
| 23 | uint64_t size3; |
| 24 | }; |
| 25 | |
Masahisa Kojima | ebfd8eb | 2019-03-07 10:41:54 +0900 | [diff] [blame] | 26 | uint32_t sq_scp_get_draminfo(struct draminfo *info); |
Ard Biesheuvel | 6fc122f | 2018-06-15 15:25:42 +0530 | [diff] [blame] | 27 | |
Sumit Garg | fe71761 | 2018-06-15 15:17:10 +0530 | [diff] [blame] | 28 | void plat_sq_pwrc_setup(void); |
| 29 | |
Sumit Garg | bda9d3c | 2018-06-15 14:50:19 +0530 | [diff] [blame] | 30 | void plat_sq_interconnect_init(void); |
| 31 | void plat_sq_interconnect_enter_coherency(void); |
| 32 | void plat_sq_interconnect_exit_coherency(void); |
| 33 | |
Sumit Garg | 4d4df11 | 2018-06-15 14:43:35 +0530 | [diff] [blame] | 34 | unsigned int sq_calc_core_pos(u_register_t mpidr); |
| 35 | |
Sumit Garg | c412c2c | 2018-06-15 14:58:25 +0530 | [diff] [blame] | 36 | void sq_gic_driver_init(void); |
| 37 | void sq_gic_init(void); |
| 38 | void sq_gic_cpuif_enable(void); |
| 39 | void sq_gic_cpuif_disable(void); |
| 40 | void sq_gic_pcpu_init(void); |
| 41 | |
Jassi Brar | 2244bf1 | 2022-03-03 15:24:31 -0600 | [diff] [blame] | 42 | int sq_io_setup(void); |
| 43 | struct image_info *sq_get_image_info(unsigned int image_id); |
Sumit Garg | 470255b | 2018-06-15 15:10:16 +0530 | [diff] [blame] | 44 | void sq_mmap_setup(uintptr_t total_base, size_t total_size, |
| 45 | const struct mmap_region *mmap); |
| 46 | |
Masahisa Kojima | ebfd8eb | 2019-03-07 10:41:54 +0900 | [diff] [blame] | 47 | /* SCMI API for power management by SCP */ |
| 48 | void sq_scmi_off(const struct psci_power_state *target_state); |
| 49 | void sq_scmi_on(u_register_t mpidr); |
Masahisa Kojima | cc6d670 | 2021-11-11 10:17:09 +0900 | [diff] [blame] | 50 | void __dead2 sq_scmi_sys_shutdown(void); |
Masahisa Kojima | ebfd8eb | 2019-03-07 10:41:54 +0900 | [diff] [blame] | 51 | void __dead2 sq_scmi_sys_reboot(void); |
| 52 | void __dead2 sq_scmi_system_off(int state); |
| 53 | /* SCMI API for vendor specific protocol */ |
| 54 | uint32_t sq_scmi_get_draminfo(struct draminfo *info); |
| 55 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 56 | #endif /* SQ_COMMON_H */ |