1*91f16700Schasinglulu /* 2*91f16700Schasinglulu * Copyright (c) 2016-2020, ARM Limited and Contributors. All rights reserved. 3*91f16700Schasinglulu * 4*91f16700Schasinglulu * SPDX-License-Identifier: BSD-3-Clause 5*91f16700Schasinglulu */ 6*91f16700Schasinglulu 7*91f16700Schasinglulu #ifndef CSS_SCP_H 8*91f16700Schasinglulu #define CSS_SCP_H 9*91f16700Schasinglulu 10*91f16700Schasinglulu #include <stdint.h> 11*91f16700Schasinglulu 12*91f16700Schasinglulu #include <platform_def.h> 13*91f16700Schasinglulu 14*91f16700Schasinglulu #include <lib/cassert.h> 15*91f16700Schasinglulu 16*91f16700Schasinglulu /* Forward declarations */ 17*91f16700Schasinglulu struct psci_power_state; 18*91f16700Schasinglulu 19*91f16700Schasinglulu /* API for power management by SCP */ 20*91f16700Schasinglulu int css_system_reset2(int is_vendor, int reset_type, u_register_t cookie); 21*91f16700Schasinglulu void css_scp_suspend(const struct psci_power_state *target_state); 22*91f16700Schasinglulu void css_scp_off(const struct psci_power_state *target_state); 23*91f16700Schasinglulu void css_scp_on(u_register_t mpidr); 24*91f16700Schasinglulu int css_scp_get_power_state(u_register_t mpidr, unsigned int power_level); 25*91f16700Schasinglulu void __dead2 css_scp_sys_shutdown(void); 26*91f16700Schasinglulu void __dead2 css_scp_sys_reboot(void); 27*91f16700Schasinglulu void __dead2 css_scp_system_off(int state); 28*91f16700Schasinglulu 29*91f16700Schasinglulu /* API for SCP Boot Image transfer. Return 0 on success, -1 on error */ 30*91f16700Schasinglulu int css_scp_boot_image_xfer(void *image, unsigned int image_size); 31*91f16700Schasinglulu 32*91f16700Schasinglulu /* 33*91f16700Schasinglulu * API to wait for SCP to signal till it's ready after booting the transferred 34*91f16700Schasinglulu * image. 35*91f16700Schasinglulu */ 36*91f16700Schasinglulu int css_scp_boot_ready(void); 37*91f16700Schasinglulu 38*91f16700Schasinglulu #if CSS_LOAD_SCP_IMAGES 39*91f16700Schasinglulu 40*91f16700Schasinglulu /* 41*91f16700Schasinglulu * All CSS platforms load SCP_BL2/SCP_BL2U just below BL2 (this is where BL31 42*91f16700Schasinglulu * usually resides except when ARM_BL31_IN_DRAM is 43*91f16700Schasinglulu * set). Ensure that SCP_BL2/SCP_BL2U do not overflow into fw_config. 44*91f16700Schasinglulu */ 45*91f16700Schasinglulu CASSERT(SCP_BL2_LIMIT <= BL2_BASE, assert_scp_bl2_overwrite_bl2); 46*91f16700Schasinglulu CASSERT(SCP_BL2U_LIMIT <= BL2_BASE, assert_scp_bl2u_overwrite_bl2); 47*91f16700Schasinglulu 48*91f16700Schasinglulu CASSERT(SCP_BL2_BASE >= ARM_FW_CONFIG_LIMIT, assert_scp_bl2_overflow); 49*91f16700Schasinglulu CASSERT(SCP_BL2U_BASE >= ARM_FW_CONFIG_LIMIT, assert_scp_bl2u_overflow); 50*91f16700Schasinglulu #endif 51*91f16700Schasinglulu 52*91f16700Schasinglulu #endif /* CSS_SCP_H */ 53