blob: 223e372a2732bdbdcc2b87f5f79baa3b04ae42b2 [file] [log] [blame]
Dan Handley9df48042015-03-19 18:58:55 +00001/*
Soby Mathew73b7bf92017-05-03 12:58:41 +01002 * Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved.
Dan Handley9df48042015-03-19 18:58:55 +00003 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Dan Handley9df48042015-03-19 18:58:55 +00005 */
6
Soby Mathew200fffd2016-10-21 11:34:59 +01007#ifndef __CSS_SCP_H__
8#define __CSS_SCP_H__
Dan Handley9df48042015-03-19 18:58:55 +00009
Soby Mathew1ced6b82017-06-12 12:37:10 +010010#include <cassert.h>
11#include <platform_def.h>
Soby Mathew73b7bf92017-05-03 12:58:41 +010012#include <types.h>
Dan Handley9df48042015-03-19 18:58:55 +000013
Soby Mathew73b7bf92017-05-03 12:58:41 +010014/* Forward declarations */
15struct psci_power_state;
16
17/* API for power management by SCP */
18void css_scp_suspend(const struct psci_power_state *target_state);
19void css_scp_off(const struct psci_power_state *target_state);
Soby Mathew200fffd2016-10-21 11:34:59 +010020void css_scp_on(u_register_t mpidr);
21int css_scp_get_power_state(u_register_t mpidr, unsigned int power_level);
22void __dead2 css_scp_sys_shutdown(void);
23void __dead2 css_scp_sys_reboot(void);
Dan Handley9df48042015-03-19 18:58:55 +000024
Soby Mathew73b7bf92017-05-03 12:58:41 +010025/* API for SCP Boot Image transfer. Return 0 on success, -1 on error */
26int css_scp_boot_image_xfer(void *image, unsigned int image_size);
27
28/*
29 * API to wait for SCP to signal till it's ready after booting the transferred
30 * image.
31 */
Soby Mathew1ced6b82017-06-12 12:37:10 +010032int css_scp_boot_ready(void);
33
34#if CSS_LOAD_SCP_IMAGES
35/*
36 * All CSS platforms load SCP_BL2/SCP_BL2U just below BL rw-data and above
37 * BL2/BL2U (this is where BL31 usually resides except when ARM_BL31_IN_DRAM is
38 * set. Ensure that SCP_BL2/SCP_BL2U do not overflow into BL1 rw-data nor
39 * BL2/BL2U.
40 */
41CASSERT(SCP_BL2_LIMIT <= BL1_RW_BASE, assert_scp_bl2_limit_overwrite_bl1);
42CASSERT(SCP_BL2U_LIMIT <= BL1_RW_BASE, assert_scp_bl2u_limit_overwrite_bl1);
43
44CASSERT(SCP_BL2_BASE >= BL2_LIMIT, assert_scp_bl2_overwrite_bl2);
45CASSERT(SCP_BL2U_BASE >= BL2U_LIMIT, assert_scp_bl2u_overwrite_bl2u);
46#endif
Soby Mathew73b7bf92017-05-03 12:58:41 +010047
Soby Mathew200fffd2016-10-21 11:34:59 +010048#endif /* __CSS_SCP_H__ */