mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-29 16:44:10 +02:00
ArmPkg: Handle warm reboot request correctly
The warm reboot requests from OSPM are mapped to cold reboot. To handle the warm reboot separately from a cold reboot, update ArmSmcPsciResetSystemLib and to invoke the PSCI call with parameters for warm reboot. Signed-off-by: Pranav Madhu <pranav.madhu@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
parent
aefcc91805
commit
52bf4eba45
@ -93,6 +93,8 @@
|
|||||||
#define ARM_SMC_ID_PSCI_MIGRATE_AARCH32 0x84000005
|
#define ARM_SMC_ID_PSCI_MIGRATE_AARCH32 0x84000005
|
||||||
#define ARM_SMC_ID_PSCI_SYSTEM_OFF 0x84000008
|
#define ARM_SMC_ID_PSCI_SYSTEM_OFF 0x84000008
|
||||||
#define ARM_SMC_ID_PSCI_SYSTEM_RESET 0x84000009
|
#define ARM_SMC_ID_PSCI_SYSTEM_RESET 0x84000009
|
||||||
|
#define ARM_SMC_ID_PSCI_FEATURES 0x8400000A
|
||||||
|
#define ARM_SMC_ID_PSCI_SYSTEM_RESET2_AARCH64 0xC4000012
|
||||||
|
|
||||||
/* The current PSCI version is: 0.2 */
|
/* The current PSCI version is: 0.2 */
|
||||||
#define ARM_SMC_PSCI_VERSION_MAJOR 0
|
#define ARM_SMC_PSCI_VERSION_MAJOR 0
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
Copyright (c) 2017 - 2018, Linaro Ltd. All rights reserved.<BR>
|
Copyright (c) 2017 - 2018, Linaro Ltd. All rights reserved.<BR>
|
||||||
Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
|
||||||
|
Copyright (c) 2022, Arm Limited. All rights reserved.<BR>
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
@ -47,8 +48,24 @@ ResetWarm (
|
|||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Map a warm reset into a cold reset
|
UINTN Arg1;
|
||||||
ResetCold ();
|
UINTN Ret;
|
||||||
|
|
||||||
|
Arg1 = ARM_SMC_ID_PSCI_SYSTEM_RESET2_AARCH64;
|
||||||
|
|
||||||
|
// Is SYSTEM_RESET2 supported?
|
||||||
|
Ret = ArmCallSmc0 (ARM_SMC_ID_PSCI_FEATURES, &Arg1, NULL, NULL);
|
||||||
|
if (Ret == ARM_SMC_PSCI_RET_SUCCESS) {
|
||||||
|
// Send PSCI SYSTEM_RESET2 command
|
||||||
|
ArmCallSmc0 (Arg1, NULL, NULL, NULL);
|
||||||
|
} else {
|
||||||
|
// Map a warm reset into a cold reset
|
||||||
|
DEBUG ((
|
||||||
|
DEBUG_INFO,
|
||||||
|
"Warm reboot not supported by platform, issuing cold reboot\n"
|
||||||
|
));
|
||||||
|
ResetCold ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user