summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-11 11:18:40 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-11 11:18:40 +0000
commit99127e9699712277102534228dada5afb45ad9ff (patch)
tree1ef394317545388498b35968e41f6d65744708a0
parent1eb3454b8a56a18b1da828a51e35845b3fc0e967 (diff)
downloadedk2-platforms-99127e9699712277102534228dada5afb45ad9ff.tar.xz
ArmPlatformPkg/ArmVExpressPkg: Use SysConfigLib in ResetSystemLib
On ARM Versatile Express, the microcontroller can reset the entire platform. The micro-controller can be accessed by the SysConfigLib. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11792 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.c19
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.inf3
2 files changed, 10 insertions, 12 deletions
diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.c b/ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.c
index 88d075aed7..a471eb2602 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.c
+++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.c
@@ -19,9 +19,9 @@
#include <PiDxe.h>
#include <Library/BaseLib.h>
-#include <Library/PcdLib.h>
#include <Library/DebugLib.h>
#include <Library/EfiResetSystemLib.h>
+#include <Library/ArmPlatformSysConfigLib.h>
#include <ArmPlatform.h>
@@ -45,23 +45,20 @@ LibResetSystem (
IN CHAR16 *ResetData OPTIONAL
)
{
- if (ResetData != NULL) {
- DEBUG ((EFI_D_ERROR, "%s", ResetData));
- }
-
switch (ResetType) {
case EfiResetWarm:
// Map a warm reset into a cold reset
case EfiResetCold:
case EfiResetShutdown:
- default:
- CpuDeadLoop ();
- break;
+ // Send the REBOOT function to the platform microcontroller
+ ArmPlatformSysConfigSet (SYS_CFG_REBOOT, 0);
+
+ // We should never be here
+ while(1);
}
- // If the reset didn't work, return an error.
- ASSERT (FALSE);
- return EFI_DEVICE_ERROR;
+ ASSERT(FALSE);
+ return EFI_UNSUPPORTED;
}
/**
diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.inf b/ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.inf
index 23d47150b9..3965e211ec 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.inf
+++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.inf
@@ -27,8 +27,9 @@
[Packages]
MdePkg/MdePkg.dec
EmbeddedPkg/EmbeddedPkg.dec
- ArmPlatformPkg/ArmVExpressPkg/ArmVExpressPkg.dec
+ ArmPlatformPkg/ArmPlatformPkg.dec
[LibraryClasses]
DebugLib
BaseLib
+ ArmPlatformSysConfigLib