feat(scmi): set warm reboot entry point

Before issuing the system power down command, set the trusted mailbox
to 0. This will ensure that in the case of a warm/cold reset, the
primary CPU executes from the cold boot sequence, clearing any stale
jump address at this location.

Change-Id: I491ef5baf7a6728acd7e90e4558939ba77b8f9bf
Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
This commit is contained in:
Pranav Madhu 2021-12-11 22:23:25 +05:30
parent e689048e20
commit 5cf9cc130a

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2020, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2017-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -11,6 +11,7 @@
#include <common/debug.h>
#include <drivers/arm/css/css_scp.h>
#include <drivers/arm/css/scmi.h>
#include <lib/mmio.h>
#include <plat/arm/common/plat_arm.h>
#include <plat/arm/css/common/css_pm.h>
#include <plat/common/platform.h>
@ -290,6 +291,13 @@ void __dead2 css_scp_system_off(int state)
{
int ret;
/*
* Before issuing the system power down command, set the trusted mailbox
* to 0. This will ensure that in the case of a warm/cold reset, the
* primary CPU executes from the cold boot sequence.
*/
mmio_write_64(PLAT_ARM_TRUSTED_MAILBOX_BASE, 0U);
/*
* Disable GIC CPU interface to prevent pending interrupt from waking
* up the AP from WFI.