Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 1 | /* |
Antonio Nino Diaz | 4b32e62 | 2018-08-16 16:52:57 +0100 | [diff] [blame] | 2 | * Copyright (c) 2016-2018, 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 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [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 | |
Antonio Nino Diaz | 4b32e62 | 2018-08-16 16:52:57 +0100 | [diff] [blame] | 10 | #include <stdint.h> |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 11 | |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 12 | #include <platform_def.h> |
| 13 | |
| 14 | #include <lib/cassert.h> |
| 15 | |
Soby Mathew | 73b7bf9 | 2017-05-03 12:58:41 +0100 | [diff] [blame] | 16 | /* Forward declarations */ |
| 17 | struct psci_power_state; |
| 18 | |
| 19 | /* API for power management by SCP */ |
Roberto Vargas | 3caafd7 | 2017-08-16 08:57:45 +0100 | [diff] [blame] | 20 | int css_system_reset2(int is_vendor, int reset_type, u_register_t cookie); |
Soby Mathew | 73b7bf9 | 2017-05-03 12:58:41 +0100 | [diff] [blame] | 21 | void css_scp_suspend(const struct psci_power_state *target_state); |
| 22 | void css_scp_off(const struct psci_power_state *target_state); |
Soby Mathew | 200fffd | 2016-10-21 11:34:59 +0100 | [diff] [blame] | 23 | void css_scp_on(u_register_t mpidr); |
| 24 | int css_scp_get_power_state(u_register_t mpidr, unsigned int power_level); |
| 25 | void __dead2 css_scp_sys_shutdown(void); |
| 26 | void __dead2 css_scp_sys_reboot(void); |
Roberto Vargas | fc2b4eb | 2017-07-31 09:45:10 +0100 | [diff] [blame] | 27 | void __dead2 css_scp_system_off(int state); |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 28 | |
Soby Mathew | 73b7bf9 | 2017-05-03 12:58:41 +0100 | [diff] [blame] | 29 | /* API for SCP Boot Image transfer. Return 0 on success, -1 on error */ |
| 30 | int 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 Mathew | 1ced6b8 | 2017-06-12 12:37:10 +0100 | [diff] [blame] | 36 | int css_scp_boot_ready(void); |
| 37 | |
| 38 | #if CSS_LOAD_SCP_IMAGES |
Soby Mathew | af14b46 | 2018-06-01 16:53:38 +0100 | [diff] [blame] | 39 | |
Soby Mathew | 1ced6b8 | 2017-06-12 12:37:10 +0100 | [diff] [blame] | 40 | /* |
Soby Mathew | af14b46 | 2018-06-01 16:53:38 +0100 | [diff] [blame] | 41 | * 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 |
| 43 | * set). Ensure that SCP_BL2/SCP_BL2U do not overflow into tb_fw_config. |
Soby Mathew | 1ced6b8 | 2017-06-12 12:37:10 +0100 | [diff] [blame] | 44 | */ |
Soby Mathew | af14b46 | 2018-06-01 16:53:38 +0100 | [diff] [blame] | 45 | CASSERT(SCP_BL2_LIMIT <= BL2_BASE, assert_scp_bl2_overwrite_bl2); |
| 46 | CASSERT(SCP_BL2U_LIMIT <= BL2_BASE, assert_scp_bl2u_overwrite_bl2); |
Soby Mathew | 1ced6b8 | 2017-06-12 12:37:10 +0100 | [diff] [blame] | 47 | |
Soby Mathew | af14b46 | 2018-06-01 16:53:38 +0100 | [diff] [blame] | 48 | CASSERT(SCP_BL2_BASE >= ARM_TB_FW_CONFIG_LIMIT, assert_scp_bl2_overflow); |
| 49 | CASSERT(SCP_BL2U_BASE >= ARM_TB_FW_CONFIG_LIMIT, assert_scp_bl2u_overflow); |
Soby Mathew | 1ced6b8 | 2017-06-12 12:37:10 +0100 | [diff] [blame] | 50 | #endif |
Soby Mathew | 73b7bf9 | 2017-05-03 12:58:41 +0100 | [diff] [blame] | 51 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 52 | #endif /* CSS_SCP_H */ |