mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-17 10:04:26 +00:00

Newer cores in upcoming platforms may refuse to power down. The PSCI library is already prepared for this so convert platform code to also allow this. This is simple - drop the `wfi` + panic and let common code deal with the fallout. The end result will be the same (sans the message) except the platform will have fewer responsibilities. The only exception is for cores being signalled to power off gracefully ahead of system reset. That path must also be terminal so replace the end with the same psci_pwrdown_cpu_end() to behave the same as the generic implementation. It will handle wakeups and panic, hoping that the system gets reset from under it. The dmb is upgraded to a dsb so no functional change. Change-Id: I381f96bec8532bda6ccdac65de57971aac42e7e8 Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
52 lines
1.5 KiB
C
52 lines
1.5 KiB
C
/*
|
|
* Copyright (c) 2016-2020, ARM Limited and Contributors. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef CSS_SCP_H
|
|
#define CSS_SCP_H
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <platform_def.h>
|
|
|
|
#include <lib/cassert.h>
|
|
|
|
/* Forward declarations */
|
|
struct psci_power_state;
|
|
|
|
/* API for power management by SCP */
|
|
int css_system_reset2(int is_vendor, int reset_type, u_register_t cookie);
|
|
void css_scp_suspend(const struct psci_power_state *target_state);
|
|
void css_scp_off(const struct psci_power_state *target_state);
|
|
void css_scp_on(u_register_t mpidr);
|
|
int css_scp_get_power_state(u_register_t mpidr, unsigned int power_level);
|
|
void css_scp_sys_shutdown(void);
|
|
void css_scp_sys_reboot(void);
|
|
void css_scp_system_off(int state);
|
|
|
|
/* 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.
|
|
*/
|
|
int css_scp_boot_ready(void);
|
|
|
|
#if CSS_LOAD_SCP_IMAGES
|
|
|
|
/*
|
|
* 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 fw_config.
|
|
*/
|
|
CASSERT(SCP_BL2_LIMIT <= BL2_BASE, assert_scp_bl2_overwrite_bl2);
|
|
CASSERT(SCP_BL2U_LIMIT <= BL2_BASE, assert_scp_bl2u_overwrite_bl2);
|
|
|
|
CASSERT(SCP_BL2_BASE >= ARM_FW_CONFIG_LIMIT, assert_scp_bl2_overflow);
|
|
CASSERT(SCP_BL2U_BASE >= ARM_FW_CONFIG_LIMIT, assert_scp_bl2u_overflow);
|
|
#endif
|
|
|
|
#endif /* CSS_SCP_H */
|