blob: 2b506eaafbe612cf50a2c633fbb0baacbea88868 [file] [log] [blame]
Dan Handley9df48042015-03-19 18:58:55 +00001/*
Manish V Badarkhe1da211a2020-05-31 10:17:59 +01002 * Copyright (c) 2016-2020, 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
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +00007#ifndef CSS_SCP_H
8#define CSS_SCP_H
Dan Handley9df48042015-03-19 18:58:55 +00009
Antonio Nino Diaz4b32e622018-08-16 16:52:57 +010010#include <stdint.h>
Dan Handley9df48042015-03-19 18:58:55 +000011
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000012#include <platform_def.h>
13
14#include <lib/cassert.h>
15
Soby Mathew73b7bf92017-05-03 12:58:41 +010016/* Forward declarations */
17struct psci_power_state;
18
19/* API for power management by SCP */
Roberto Vargas3caafd72017-08-16 08:57:45 +010020int css_system_reset2(int is_vendor, int reset_type, u_register_t cookie);
Soby Mathew73b7bf92017-05-03 12:58:41 +010021void css_scp_suspend(const struct psci_power_state *target_state);
22void css_scp_off(const struct psci_power_state *target_state);
Soby Mathew200fffd2016-10-21 11:34:59 +010023void css_scp_on(u_register_t mpidr);
24int css_scp_get_power_state(u_register_t mpidr, unsigned int power_level);
25void __dead2 css_scp_sys_shutdown(void);
26void __dead2 css_scp_sys_reboot(void);
Roberto Vargasfc2b4eb2017-07-31 09:45:10 +010027void __dead2 css_scp_system_off(int state);
Dan Handley9df48042015-03-19 18:58:55 +000028
Soby Mathew73b7bf92017-05-03 12:58:41 +010029/* API for SCP Boot Image transfer. Return 0 on success, -1 on error */
30int css_scp_boot_image_xfer(void *image, unsigned int image_size);
31
32/*
33 * API to wait for SCP to signal till it's ready after booting the transferred
34 * image.
35 */
Soby Mathew1ced6b82017-06-12 12:37:10 +010036int css_scp_boot_ready(void);
37
38#if CSS_LOAD_SCP_IMAGES
Soby Mathewaf14b462018-06-01 16:53:38 +010039
Soby Mathew1ced6b82017-06-12 12:37:10 +010040/*
Soby Mathewaf14b462018-06-01 16:53:38 +010041 * All CSS platforms load SCP_BL2/SCP_BL2U just below BL2 (this is where BL31
42 * usually resides except when ARM_BL31_IN_DRAM is
Manish V Badarkhe1da211a2020-05-31 10:17:59 +010043 * set). Ensure that SCP_BL2/SCP_BL2U do not overflow into fw_config.
Soby Mathew1ced6b82017-06-12 12:37:10 +010044 */
Soby Mathewaf14b462018-06-01 16:53:38 +010045CASSERT(SCP_BL2_LIMIT <= BL2_BASE, assert_scp_bl2_overwrite_bl2);
46CASSERT(SCP_BL2U_LIMIT <= BL2_BASE, assert_scp_bl2u_overwrite_bl2);
Soby Mathew1ced6b82017-06-12 12:37:10 +010047
Manish V Badarkhe1da211a2020-05-31 10:17:59 +010048CASSERT(SCP_BL2_BASE >= ARM_FW_CONFIG_LIMIT, assert_scp_bl2_overflow);
49CASSERT(SCP_BL2U_BASE >= ARM_FW_CONFIG_LIMIT, assert_scp_bl2u_overflow);
Soby Mathew1ced6b82017-06-12 12:37:10 +010050#endif
Soby Mathew73b7bf92017-05-03 12:58:41 +010051
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +000052#endif /* CSS_SCP_H */