blob: eef0e1fb1700648e3d18e0c1030a910c2e0437e3 [file] [log] [blame]
Sumit Garg4d4df112018-06-15 14:43:35 +05301/*
Jassi Brar2244bf12022-03-03 15:24:31 -06002 * Copyright (c) 2018-2022, ARM Limited and Contributors. All rights reserved.
Sumit Garg4d4df112018-06-15 14:43:35 +05303 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +00007#ifndef SQ_COMMON_H
8#define SQ_COMMON_H
Sumit Garg4d4df112018-06-15 14:43:35 +05309
Antonio Nino Diaz4b32e622018-08-16 16:52:57 +010010#include <stdint.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000011
Masahisa Kojimaebfd8eb2019-03-07 10:41:54 +090012#include <lib/psci/psci.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000013#include <lib/xlat_tables/xlat_tables_v2.h>
Sumit Garg4d4df112018-06-15 14:43:35 +053014
Ard Biesheuvel6fc122f2018-06-15 15:25:42 +053015struct 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 Kojimaebfd8eb2019-03-07 10:41:54 +090026uint32_t sq_scp_get_draminfo(struct draminfo *info);
Ard Biesheuvel6fc122f2018-06-15 15:25:42 +053027
Sumit Gargfe717612018-06-15 15:17:10 +053028void plat_sq_pwrc_setup(void);
29
Sumit Gargbda9d3c2018-06-15 14:50:19 +053030void plat_sq_interconnect_init(void);
31void plat_sq_interconnect_enter_coherency(void);
32void plat_sq_interconnect_exit_coherency(void);
33
Sumit Garg4d4df112018-06-15 14:43:35 +053034unsigned int sq_calc_core_pos(u_register_t mpidr);
35
Sumit Gargc412c2c2018-06-15 14:58:25 +053036void sq_gic_driver_init(void);
37void sq_gic_init(void);
38void sq_gic_cpuif_enable(void);
39void sq_gic_cpuif_disable(void);
40void sq_gic_pcpu_init(void);
41
Jassi Brar2244bf12022-03-03 15:24:31 -060042int sq_io_setup(void);
43struct image_info *sq_get_image_info(unsigned int image_id);
Sumit Garg470255b2018-06-15 15:10:16 +053044void sq_mmap_setup(uintptr_t total_base, size_t total_size,
45 const struct mmap_region *mmap);
46
Masahisa Kojimaebfd8eb2019-03-07 10:41:54 +090047/* SCMI API for power management by SCP */
48void sq_scmi_off(const struct psci_power_state *target_state);
49void sq_scmi_on(u_register_t mpidr);
Masahisa Kojimacc6d6702021-11-11 10:17:09 +090050void __dead2 sq_scmi_sys_shutdown(void);
Masahisa Kojimaebfd8eb2019-03-07 10:41:54 +090051void __dead2 sq_scmi_sys_reboot(void);
52void __dead2 sq_scmi_system_off(int state);
53/* SCMI API for vendor specific protocol */
54uint32_t sq_scmi_get_draminfo(struct draminfo *info);
55
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +000056#endif /* SQ_COMMON_H */