blob: 44dfbca05365b1b6b281620bd7f161c043c98158 [file] [log] [blame]
Dan Handley9df48042015-03-19 18:58:55 +00001/*
Antonio Nino Diaz4b32e622018-08-16 16:52:57 +01002 * Copyright (c) 2016-2018, 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>
Antonio Nino Diaz4b32e622018-08-16 16:52:57 +010012#include <stdint.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 */
Roberto Vargas3caafd72017-08-16 08:57:45 +010018int css_system_reset2(int is_vendor, int reset_type, u_register_t cookie);
Soby Mathew73b7bf92017-05-03 12:58:41 +010019void css_scp_suspend(const struct psci_power_state *target_state);
20void css_scp_off(const struct psci_power_state *target_state);
Soby Mathew200fffd2016-10-21 11:34:59 +010021void css_scp_on(u_register_t mpidr);
22int css_scp_get_power_state(u_register_t mpidr, unsigned int power_level);
23void __dead2 css_scp_sys_shutdown(void);
24void __dead2 css_scp_sys_reboot(void);
Roberto Vargasfc2b4eb2017-07-31 09:45:10 +010025void __dead2 css_scp_system_off(int state);
Dan Handley9df48042015-03-19 18:58:55 +000026
Soby Mathew73b7bf92017-05-03 12:58:41 +010027/* API for SCP Boot Image transfer. Return 0 on success, -1 on error */
28int css_scp_boot_image_xfer(void *image, unsigned int image_size);
29
30/*
31 * API to wait for SCP to signal till it's ready after booting the transferred
32 * image.
33 */
Soby Mathew1ced6b82017-06-12 12:37:10 +010034int css_scp_boot_ready(void);
35
36#if CSS_LOAD_SCP_IMAGES
Soby Mathewaf14b462018-06-01 16:53:38 +010037
Soby Mathew1ced6b82017-06-12 12:37:10 +010038/*
Soby Mathewaf14b462018-06-01 16:53:38 +010039 * All CSS platforms load SCP_BL2/SCP_BL2U just below BL2 (this is where BL31
40 * usually resides except when ARM_BL31_IN_DRAM is
41 * set). Ensure that SCP_BL2/SCP_BL2U do not overflow into tb_fw_config.
Soby Mathew1ced6b82017-06-12 12:37:10 +010042 */
Soby Mathewaf14b462018-06-01 16:53:38 +010043CASSERT(SCP_BL2_LIMIT <= BL2_BASE, assert_scp_bl2_overwrite_bl2);
44CASSERT(SCP_BL2U_LIMIT <= BL2_BASE, assert_scp_bl2u_overwrite_bl2);
Soby Mathew1ced6b82017-06-12 12:37:10 +010045
Soby Mathewaf14b462018-06-01 16:53:38 +010046CASSERT(SCP_BL2_BASE >= ARM_TB_FW_CONFIG_LIMIT, assert_scp_bl2_overflow);
47CASSERT(SCP_BL2U_BASE >= ARM_TB_FW_CONFIG_LIMIT, assert_scp_bl2u_overflow);
Soby Mathew1ced6b82017-06-12 12:37:10 +010048#endif
Soby Mathew73b7bf92017-05-03 12:58:41 +010049
Soby Mathew200fffd2016-10-21 11:34:59 +010050#endif /* __CSS_SCP_H__ */