diff options
author | Haojian Zhuang <haojian.zhuang@linaro.org> | 2018-03-29 16:25:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-29 16:25:44 +0800 |
commit | d581fc19855088832084d531fcb2c406b0863a84 (patch) | |
tree | 3edcdd16d242ac3c9fe6ef628418babf006561c4 | |
parent | b2e01b201b1de31db139b29ccb819bbd9e70a943 (diff) | |
parent | 78d4383225fe4e2e11d047e9ad7ec5a69d0b57c3 (diff) | |
download | OpenPlatformPkg-d581fc19855088832084d531fcb2c406b0863a84.tar.gz |
Merge pull request #113 from hzhuang1/reboot_2
Platforms/HiKey960Dxe: check flag before clearing virtual key
-rw-r--r-- | Platforms/Hisilicon/HiKey960/HiKey960Dxe/HiKey960Dxe.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Platforms/Hisilicon/HiKey960/HiKey960Dxe/HiKey960Dxe.c b/Platforms/Hisilicon/HiKey960/HiKey960Dxe/HiKey960Dxe.c index b4e0e1b..bb7f80d 100644 --- a/Platforms/Hisilicon/HiKey960/HiKey960Dxe/HiKey960Dxe.c +++ b/Platforms/Hisilicon/HiKey960/HiKey960Dxe/HiKey960Dxe.c @@ -104,6 +104,7 @@ enum { };
STATIC UINTN mBoardId;
+STATIC UINTN mReboot;
STATIC EMBEDDED_GPIO *mGpio;
@@ -617,7 +618,8 @@ VirtualKeyboardClear ( if (VirtualKey == NULL) {
return EFI_INVALID_PARAMETER;
}
- if (MmioRead32 (ADB_REBOOT_ADDRESS) == ADB_REBOOT_BOOTLOADER) {
+ // Only clear the reboot flag that is set before reboot.
+ if (mReboot && (MmioRead32 (ADB_REBOOT_ADDRESS) == ADB_REBOOT_BOOTLOADER)) {
MmioWrite32 (ADB_REBOOT_ADDRESS, ADB_REBOOT_NONE);
WriteBackInvalidateDataCacheRange ((VOID *)ADB_REBOOT_ADDRESS, 4);
}
@@ -648,6 +650,11 @@ HiKey960EntryPoint ( InitPeripherals ();
+ // Record whether the reboot flag was set before reboot
+ if (MmioRead32 (ADB_REBOOT_ADDRESS) == ADB_REBOOT_BOOTLOADER) {
+ mReboot = 1;
+ }
+
//
// Create an event belonging to the "gEfiEndOfDxeEventGroupGuid" group.
// The "OnEndOfDxe()" function is declared as the call back function.
|