Platforms/Hisilicon: add hotkey
Add hotkey 'f' to boot AndroidFastbootApp. Since only three hotkeys
are supported at most, remove hotkey 'F2'.
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
diff --git a/Platforms/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c b/Platforms/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c
index e14641e..1239c56 100644
--- a/Platforms/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c
+++ b/Platforms/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c
@@ -319,6 +319,7 @@
Status = EfiBootManagerAddLoadOptionVariable (&NewOption, MAX_UINTN);
ASSERT_EFI_ERROR (Status);
}
+
EfiBootManagerFreeLoadOption (&NewOption);
EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);
}
@@ -332,11 +333,25 @@
{
EFI_STATUS Status;
EFI_INPUT_KEY Enter;
- EFI_INPUT_KEY F2;
EFI_INPUT_KEY Esc;
+ EFI_INPUT_KEY KeyF;
EFI_BOOT_MANAGER_LOAD_OPTION BootOption;
//
+ // Register Android Boot. OptionNumber is 1.
+ //
+ PlatformRegisterFvBootOption (
+ PcdGetPtr (PcdAndroidBootFile), L"Android Boot", LOAD_OPTION_ACTIVE
+ );
+
+ //
+ // Register Android Fastboot. OptionNumber is 2.
+ //
+ PlatformRegisterFvBootOption (
+ PcdGetPtr (PcdAndroidFastbootFile), L"Android Fastboot", LOAD_OPTION_ACTIVE
+ );
+
+ //
// Register ENTER as CONTINUE key
//
Enter.ScanCode = SCAN_NULL;
@@ -345,20 +360,24 @@
ASSERT_EFI_ERROR (Status);
//
- // Map F2 and ESC to Boot Manager Menu
+ // Map ESC to Boot Manager Menu
//
- F2.ScanCode = SCAN_F2;
- F2.UnicodeChar = CHAR_NULL;
Esc.ScanCode = SCAN_ESC;
Esc.UnicodeChar = CHAR_NULL;
Status = EfiBootManagerGetBootManagerMenu (&BootOption);
ASSERT_EFI_ERROR (Status);
Status = EfiBootManagerAddKeyOptionVariable (
- NULL, (UINT16) BootOption.OptionNumber, 0, &F2, NULL
+ NULL, (UINT16) BootOption.OptionNumber, 0, &Esc, NULL
);
ASSERT (Status == EFI_SUCCESS || Status == EFI_ALREADY_STARTED);
+
+ //
+ // Map KeyF to Android Fastboot
+ //
+ KeyF.ScanCode = SCAN_NULL;
+ KeyF.UnicodeChar = 'f';
Status = EfiBootManagerAddKeyOptionVariable (
- NULL, (UINT16) BootOption.OptionNumber, 0, &Esc, NULL
+ NULL, 2, 0, &KeyF, NULL
);
ASSERT (Status == EFI_SUCCESS || Status == EFI_ALREADY_STARTED);
}
@@ -460,20 +479,6 @@
PlatformRegisterFvBootOption (
PcdGetPtr (PcdShellFile), L"UEFI Shell", LOAD_OPTION_ACTIVE
);
-
- //
- // Register Android Fastboot
- //
- PlatformRegisterFvBootOption (
- PcdGetPtr (PcdAndroidFastbootFile), L"Android Fastboot", LOAD_OPTION_ACTIVE
- );
-
- //
- // Register Android Boot
- //
- PlatformRegisterFvBootOption (
- PcdGetPtr (PcdAndroidBootFile), L"Android Boot", LOAD_OPTION_ACTIVE
- );
}
/**