From 5cf9cc130a90fd8c4503c57ec4af235b469fd473 Mon Sep 17 00:00:00 2001 From: Pranav Madhu Date: Sat, 11 Dec 2021 22:23:25 +0530 Subject: [PATCH] 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 --- drivers/arm/css/scp/css_pm_scmi.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/arm/css/scp/css_pm_scmi.c b/drivers/arm/css/scp/css_pm_scmi.c index 5de2604cb..83278656f 100644 --- a/drivers/arm/css/scp/css_pm_scmi.c +++ b/drivers/arm/css/scp/css_pm_scmi.c @@ -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 #include #include +#include #include #include #include @@ -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. -- 2.39.5