[4/9] ArmPlatformPkg/ArmVExpressPkg: add Shutdown support

Message ID 1371801922-15142-5-git-send-email-ryan.harkin@linaro.org
State New
Headers show

Commit Message

Ryan Harkin June 21, 2013, 8:05 a.m.
LibResetSystem was performing a cold reboot for both reboot and
shutdown.

This patch updates LibResetSystem to pass SYS_CFG_SHUTDOWN to the
microcontroller when called wit EfiResetShutdown.

Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
---
 .../Library/ResetSystemLib/ResetSystemLib.c        |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Olivier Martin June 21, 2013, 10:10 a.m. | #1
Done. Committed revision 14438.

> -----Original Message-----
> From: Ryan Harkin [mailto:ryan.harkin@linaro.org]
> Sent: 21 June 2013 09:05
> To: ryan.harkin@linaro.org; edk2-devel@lists.sourceforge.net;
> patches@linaro.org; boot-architecture@lists.linaro.org; Olivier Martin
> Subject: [PATCH 4/9] ArmPlatformPkg/ArmVExpressPkg: add Shutdown
> support
> 
> LibResetSystem was performing a cold reboot for both reboot and
> shutdown.
> 
> This patch updates LibResetSystem to pass SYS_CFG_SHUTDOWN to the
> microcontroller when called wit EfiResetShutdown.
> 
> Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
> ---
>  .../Library/ResetSystemLib/ResetSystemLib.c        |    9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git
> a/ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.c
> b/ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.c
> index f858317..f32b533 100644
> ---
> a/ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.c
> +++
> b/ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.c
> @@ -49,12 +49,19 @@ LibResetSystem (
>    case EfiResetWarm:
>      // Map a warm reset into a cold reset
>    case EfiResetCold:
> -  case EfiResetShutdown:
>      // Send the REBOOT function to the platform microcontroller
>      ArmPlatformSysConfigSet (SYS_CFG_REBOOT, 0);
> 
>      // We should never be here
>      while(1);
> +    break;
> +  case EfiResetShutdown:
> +    // Send the SHUTDOWN function to the platform microcontroller
> +    ArmPlatformSysConfigSet (SYS_CFG_SHUTDOWN, 0);
> +
> +    // We should never be here
> +    while(1);
> +    break;
>    }
> 
>    ASSERT(FALSE);
> --
> 1.7.9.5
>

Patch

diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.c b/ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.c
index f858317..f32b533 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.c
+++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.c
@@ -49,12 +49,19 @@  LibResetSystem (
   case EfiResetWarm:
     // Map a warm reset into a cold reset
   case EfiResetCold:
-  case EfiResetShutdown:
     // Send the REBOOT function to the platform microcontroller
     ArmPlatformSysConfigSet (SYS_CFG_REBOOT, 0);
 
     // We should never be here
     while(1);
+    break;
+  case EfiResetShutdown:
+    // Send the SHUTDOWN function to the platform microcontroller
+    ArmPlatformSysConfigSet (SYS_CFG_SHUTDOWN, 0);
+
+    // We should never be here
+    while(1);
+    break;
   }
 
   ASSERT(FALSE);