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 | 73b7bf9 | 2017-05-03 12:58:41 +0100 | [diff] [blame] | 10 | #include <types.h> |
| 11 | #include "../scpi/css_scpi.h" |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 12 | |
Soby Mathew | 73b7bf9 | 2017-05-03 12:58:41 +0100 | [diff] [blame] | 13 | /* Forward declarations */ |
| 14 | struct psci_power_state; |
| 15 | |
| 16 | /* API for power management by SCP */ |
| 17 | void css_scp_suspend(const struct psci_power_state *target_state); |
| 18 | void css_scp_off(const struct psci_power_state *target_state); |
Soby Mathew | 200fffd | 2016-10-21 11:34:59 +0100 | [diff] [blame] | 19 | void css_scp_on(u_register_t mpidr); |
| 20 | int css_scp_get_power_state(u_register_t mpidr, unsigned int power_level); |
| 21 | void __dead2 css_scp_sys_shutdown(void); |
| 22 | void __dead2 css_scp_sys_reboot(void); |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 23 | |
Soby Mathew | 73b7bf9 | 2017-05-03 12:58:41 +0100 | [diff] [blame] | 24 | /* API for SCP Boot Image transfer. Return 0 on success, -1 on error */ |
| 25 | int css_scp_boot_image_xfer(void *image, unsigned int image_size); |
| 26 | |
| 27 | /* |
| 28 | * API to wait for SCP to signal till it's ready after booting the transferred |
| 29 | * image. |
| 30 | */ |
| 31 | static inline int css_scp_boot_ready(void) |
| 32 | { |
| 33 | VERBOSE("Waiting for SCP to signal it is ready to go on\n"); |
| 34 | return scpi_wait_ready(); |
| 35 | } |
| 36 | |
Soby Mathew | 200fffd | 2016-10-21 11:34:59 +0100 | [diff] [blame] | 37 | #endif /* __CSS_SCP_H__ */ |