css_scp.h 1.55 KB
Newer Older
1
/*
2
 * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
3
 *
dp-arm's avatar
dp-arm committed
4
 * SPDX-License-Identifier: BSD-3-Clause
5
6
 */

7
8
#ifndef CSS_SCP_H
#define CSS_SCP_H
9

Soby Mathew's avatar
Soby Mathew committed
10
11
#include <cassert.h>
#include <platform_def.h>
12
#include <stdint.h>
13

14
15
16
17
/* Forward declarations */
struct psci_power_state;

/* API for power management by SCP */
18
int css_system_reset2(int is_vendor, int reset_type, u_register_t cookie);
19
20
void css_scp_suspend(const struct psci_power_state *target_state);
void css_scp_off(const struct psci_power_state *target_state);
21
22
23
24
void css_scp_on(u_register_t mpidr);
int css_scp_get_power_state(u_register_t mpidr, unsigned int power_level);
void __dead2 css_scp_sys_shutdown(void);
void __dead2 css_scp_sys_reboot(void);
25
void __dead2 css_scp_system_off(int state);
26

27
28
29
30
31
32
33
/* API for SCP Boot Image transfer. Return 0 on success, -1 on error */
int css_scp_boot_image_xfer(void *image, unsigned int image_size);

/*
 * API to wait for SCP to signal till it's ready after booting the transferred
 * image.
 */
Soby Mathew's avatar
Soby Mathew committed
34
35
36
int css_scp_boot_ready(void);

#if CSS_LOAD_SCP_IMAGES
37

Soby Mathew's avatar
Soby Mathew committed
38
/*
39
40
41
 * All CSS platforms load SCP_BL2/SCP_BL2U just below BL2 (this is where BL31
 * usually resides except when ARM_BL31_IN_DRAM is
 * set). Ensure that SCP_BL2/SCP_BL2U do not overflow into tb_fw_config.
Soby Mathew's avatar
Soby Mathew committed
42
 */
43
44
CASSERT(SCP_BL2_LIMIT <= BL2_BASE, assert_scp_bl2_overwrite_bl2);
CASSERT(SCP_BL2U_LIMIT <= BL2_BASE, assert_scp_bl2u_overwrite_bl2);
Soby Mathew's avatar
Soby Mathew committed
45

46
47
CASSERT(SCP_BL2_BASE >= ARM_TB_FW_CONFIG_LIMIT, assert_scp_bl2_overflow);
CASSERT(SCP_BL2U_BASE >= ARM_TB_FW_CONFIG_LIMIT, assert_scp_bl2u_overflow);
Soby Mathew's avatar
Soby Mathew committed
48
#endif
49

50
#endif /* CSS_SCP_H */