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
This commit is contained in:
oliviermartin 2011-06-11 11:18:40 +00:00
parent 1eb3454b8a
commit 99127e9699
2 changed files with 10 additions and 12 deletions

View File

@ -19,9 +19,9 @@
#include <PiDxe.h> #include <PiDxe.h>
#include <Library/BaseLib.h> #include <Library/BaseLib.h>
#include <Library/PcdLib.h>
#include <Library/DebugLib.h> #include <Library/DebugLib.h>
#include <Library/EfiResetSystemLib.h> #include <Library/EfiResetSystemLib.h>
#include <Library/ArmPlatformSysConfigLib.h>
#include <ArmPlatform.h> #include <ArmPlatform.h>
@ -45,23 +45,20 @@ LibResetSystem (
IN CHAR16 *ResetData OPTIONAL IN CHAR16 *ResetData OPTIONAL
) )
{ {
if (ResetData != NULL) {
DEBUG ((EFI_D_ERROR, "%s", ResetData));
}
switch (ResetType) { switch (ResetType) {
case EfiResetWarm: case EfiResetWarm:
// Map a warm reset into a cold reset // Map a warm reset into a cold reset
case EfiResetCold: case EfiResetCold:
case EfiResetShutdown: case EfiResetShutdown:
default: // Send the REBOOT function to the platform microcontroller
CpuDeadLoop (); ArmPlatformSysConfigSet (SYS_CFG_REBOOT, 0);
break;
// We should never be here
while(1);
} }
// If the reset didn't work, return an error. ASSERT(FALSE);
ASSERT (FALSE); return EFI_UNSUPPORTED;
return EFI_DEVICE_ERROR;
} }
/** /**

View File

@ -27,8 +27,9 @@
[Packages] [Packages]
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
EmbeddedPkg/EmbeddedPkg.dec EmbeddedPkg/EmbeddedPkg.dec
ArmPlatformPkg/ArmVExpressPkg/ArmVExpressPkg.dec ArmPlatformPkg/ArmPlatformPkg.dec
[LibraryClasses] [LibraryClasses]
DebugLib DebugLib
BaseLib BaseLib
ArmPlatformSysConfigLib