From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.9254.1646917844930139708 for ; Thu, 10 Mar 2022 05:10:45 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: pranav.madhu@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EE32D1691; Thu, 10 Mar 2022 05:10:43 -0800 (PST) Received: from usa.arm.com (a074742.blr.arm.com [10.162.16.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A92C33FA27; Thu, 10 Mar 2022 05:10:42 -0800 (PST) From: "Pranav Madhu" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Sami Mujawar Subject: [edk2][PATCH V1 1/1] ArmPkg: Handle warm reboot request correctly Date: Thu, 10 Mar 2022 18:40:37 +0530 Message-Id: <20220310131037.22334-1-pranav.madhu@arm.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable The warm reboot requests are mapped to cold reboot as the power control module was not capable of handling the warm reboot requests in the legacy implementation. The support for warm reboot support is added into the power control module. To support warm reset, update ArmPsciResetSystemLib, and there by invoke the PSCI call with parameters for warm reboot. Signed-off-by: Pranav Madhu --- ArmPkg/Include/IndustryStandard/ArmStdSmc.h | 1 + ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) Link to github branch for this patch - https://github.com/Pranav-Madhu/edk2/tree/topics/warm_reboot diff --git a/ArmPkg/Include/IndustryStandard/ArmStdSmc.h b/ArmPkg/Include= /IndustryStandard/ArmStdSmc.h index 655edc21b205..c9059dead6e9 100644 --- a/ArmPkg/Include/IndustryStandard/ArmStdSmc.h +++ b/ArmPkg/Include/IndustryStandard/ArmStdSmc.h @@ -93,6 +93,7 @@ #define ARM_SMC_ID_PSCI_MIGRATE_AARCH32 0x84000005 #define ARM_SMC_ID_PSCI_SYSTEM_OFF 0x84000008 #define ARM_SMC_ID_PSCI_SYSTEM_RESET 0x84000009 +#define ARM_SMC_ID_PSCI_SYSTEM_RESET2_AARCH64 0xc4000012 =20 /* The current PSCI version is: 0.2 */ #define ARM_SMC_PSCI_VERSION_MAJOR 0 diff --git a/ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.c= b/ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.c index 7bcd34849507..27e048ba0f7a 100644 --- a/ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.c +++ b/ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.c @@ -45,10 +45,13 @@ LibResetSystem ( ARM_SMC_ARGS ArmSmcArgs; =20 switch (ResetType) { + case EfiResetWarm: + ArmSmcArgs.Arg0 =3D ARM_SMC_ID_PSCI_SYSTEM_RESET2_AARCH64; + ArmSmcArgs.Arg1 =3D 0; + ArmSmcArgs.Arg2 =3D 0; + break; case EfiResetPlatformSpecific: // Map the platform specific reset as reboot - case EfiResetWarm: - // Map a warm reset into a cold reset case EfiResetCold: // Send a PSCI 0.2 SYSTEM_RESET command ArmSmcArgs.Arg0 =3D ARM_SMC_ID_PSCI_SYSTEM_RESET; --=20 2.17.1