public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ard Biesheuvel" <ardb@kernel.org>
To: Pranav Madhu <pranav.madhu@arm.com>
Cc: edk2-devel-groups-io <devel@edk2.groups.io>,
	Ard Biesheuvel <ardb+tianocore@kernel.org>,
	 Sami Mujawar <sami.mujawar@arm.com>
Subject: Re: [edk2][PATCH V1 1/1] ArmPkg: Handle warm reboot request correctly
Date: Thu, 10 Mar 2022 16:26:26 +0100	[thread overview]
Message-ID: <CAMj1kXG_FyR06vwZKDy2uyc92E4_fkGr3XpUcnUbD4YTTiqFTQ@mail.gmail.com> (raw)
In-Reply-To: <20220310131037.22334-1-pranav.madhu@arm.com>

On Thu, 10 Mar 2022 at 14:10, Pranav Madhu <pranav.madhu@arm.com> wrote:
>
> 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 <pranav.madhu@arm.com>

What happens on 32-bit platforms with this change?

What happens if the firmware does not implement
ARM_SMC_ID_PSCI_SYSTEM_RESET2_AARCH64?

> ---
>  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
>
>  /* 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;
>
>    switch (ResetType) {
> +    case EfiResetWarm:
> +      ArmSmcArgs.Arg0 = ARM_SMC_ID_PSCI_SYSTEM_RESET2_AARCH64;
> +      ArmSmcArgs.Arg1 = 0;
> +      ArmSmcArgs.Arg2 = 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 = ARM_SMC_ID_PSCI_SYSTEM_RESET;
> --
> 2.17.1
>

  reply	other threads:[~2022-03-10 15:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-10 13:10 [edk2][PATCH V1 1/1] ArmPkg: Handle warm reboot request correctly Pranav Madhu
2022-03-10 15:26 ` Ard Biesheuvel [this message]
2022-03-11  6:40   ` Pranav Madhu
2022-03-10 15:30 ` Sami Mujawar
2022-03-11  6:06   ` Pranav Madhu
2022-03-11 14:28     ` Sami Mujawar
  -- strict thread matches above, loose matches on Subject: below --
2022-03-11  6:52 Pranav Madhu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMj1kXG_FyR06vwZKDy2uyc92E4_fkGr3XpUcnUbD4YTTiqFTQ@mail.gmail.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox