Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 1 | /* |
Soby Mathew | 73b7bf9 | 2017-05-03 12:58:41 +0100 | [diff] [blame] | 2 | * Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved. |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
Soby Mathew | 200fffd | 2016-10-21 11:34:59 +0100 | [diff] [blame] | 7 | #ifndef __CSS_SCP_H__ |
| 8 | #define __CSS_SCP_H__ |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 9 | |
Soby Mathew | 1ced6b8 | 2017-06-12 12:37:10 +0100 | [diff] [blame] | 10 | #include <cassert.h> |
| 11 | #include <platform_def.h> |
Soby Mathew | 73b7bf9 | 2017-05-03 12:58:41 +0100 | [diff] [blame] | 12 | #include <types.h> |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 13 | |
Soby Mathew | 73b7bf9 | 2017-05-03 12:58:41 +0100 | [diff] [blame] | 14 | /* Forward declarations */ |
| 15 | struct psci_power_state; |
| 16 | |
| 17 | /* API for power management by SCP */ |
| 18 | void css_scp_suspend(const struct psci_power_state *target_state); |
| 19 | void css_scp_off(const struct psci_power_state *target_state); |
Soby Mathew | 200fffd | 2016-10-21 11:34:59 +0100 | [diff] [blame] | 20 | void css_scp_on(u_register_t mpidr); |
| 21 | int css_scp_get_power_state(u_register_t mpidr, unsigned int power_level); |
| 22 | void __dead2 css_scp_sys_shutdown(void); |
| 23 | void __dead2 css_scp_sys_reboot(void); |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 24 | |
Soby Mathew | 73b7bf9 | 2017-05-03 12:58:41 +0100 | [diff] [blame] | 25 | /* API for SCP Boot Image transfer. Return 0 on success, -1 on error */ |
| 26 | int 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 Mathew | 1ced6b8 | 2017-06-12 12:37:10 +0100 | [diff] [blame] | 32 | int 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 | */ |
| 41 | CASSERT(SCP_BL2_LIMIT <= BL1_RW_BASE, assert_scp_bl2_limit_overwrite_bl1); |
| 42 | CASSERT(SCP_BL2U_LIMIT <= BL1_RW_BASE, assert_scp_bl2u_limit_overwrite_bl1); |
| 43 | |
| 44 | CASSERT(SCP_BL2_BASE >= BL2_LIMIT, assert_scp_bl2_overwrite_bl2); |
| 45 | CASSERT(SCP_BL2U_BASE >= BL2U_LIMIT, assert_scp_bl2u_overwrite_bl2u); |
| 46 | #endif |
Soby Mathew | 73b7bf9 | 2017-05-03 12:58:41 +0100 | [diff] [blame] | 47 | |
Soby Mathew | 200fffd | 2016-10-21 11:34:59 +0100 | [diff] [blame] | 48 | #endif /* __CSS_SCP_H__ */ |