aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaojian Zhuang <haojian.zhuang@linaro.org>2018-03-29 16:17:12 +0800
committerHaojian Zhuang <haojian.zhuang@linaro.org>2018-03-29 16:21:14 +0800
commit78d4383225fe4e2e11d047e9ad7ec5a69d0b57c3 (patch)
tree3edcdd16d242ac3c9fe6ef628418babf006561c4
parentb2e01b201b1de31db139b29ccb819bbd9e70a943 (diff)
downloadOpenPlatformPkg-78d4383225fe4e2e11d047e9ad7ec5a69d0b57c3.tar.gz
Platforms/HiKey960Dxe: check flag before clearing virtual key
Add reboot flag before checking virtual key of reboot reason. Since we add the delay before reboot, the virtual key event will be clear automatically by virtual key driver. Add the reboot flag to guranatee the clear option could only be executed for reboot scenario. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
-rw-r--r--Platforms/Hisilicon/HiKey960/HiKey960Dxe/HiKey960Dxe.c9
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.