• Subject: [edk2] [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Correct Names.
  • Author: lushifex
  • Date: Sept. 20, 2017, 3:23 a.m.
  • Patches: 1 / 1
Changeset
.../Include/Library/GenericBdsLib.h                |  5 ++-
.../Library/GenericBdsLib/BdsBoot.c                | 51 +++++++++++++++++++++-
.../Library/GenericBdsLib/GenericBdsStrings.uni    |  8 +++-
3 files changed, 61 insertions(+), 3 deletions(-)
Git apply log
Switched to a new branch '1fc115b1-2045-4339-9fd6-9bac06dd9182@SHWDEOPENPSI011.local'
Applying: Correct Names.
error: sha1 information is lacking or useless (Core/IntelFrameworkModulePkg/Include/Library/GenericBdsLib.h).
error: could not build fake ancestor
Patch failed at 0001 Correct Names.
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Failed to apply patch:
[edk2] [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Correct Names.
[edk2] [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Correct Names.
Posted by lushifex, 4 weeks ago
Correct Boot Option Names.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: lushifex <shifeix.a.lu@intel.com>
---
 .../Include/Library/GenericBdsLib.h                |  5 ++-
 .../Library/GenericBdsLib/BdsBoot.c                | 51 +++++++++++++++++++++-
 .../Library/GenericBdsLib/GenericBdsStrings.uni    |  8 +++-
 3 files changed, 61 insertions(+), 3 deletions(-)

diff --git a/Core/IntelFrameworkModulePkg/Include/Library/GenericBdsLib.h b/Core/IntelFrameworkModulePkg/Include/Library/GenericBdsLib.h
index c338c4d..fa59235 100644
--- a/Core/IntelFrameworkModulePkg/Include/Library/GenericBdsLib.h
+++ b/Core/IntelFrameworkModulePkg/Include/Library/GenericBdsLib.h
@@ -4,7 +4,7 @@
     2) BDS boot device connect interface.
     3) BDS Misc interfaces for mainting boot variable, ouput string.
 
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials are licensed and made available under 
 the terms and conditions of the BSD License that accompanies this distribution.  
 The full text of the license may be found at
@@ -821,6 +821,9 @@ SetupResetReminder (
 #define  BDS_EFI_MESSAGE_USB_DEVICE_BOOT  0x0305 // Type 03; Sub-Type 05
 #define  BDS_EFI_MESSAGE_SATA_BOOT        0x0312 // Type 03; Sub-Type 18
 #define  BDS_EFI_MESSAGE_MAC_BOOT         0x030b // Type 03; Sub-Type 11
+#define  BDS_EFI_MESSAGE_NVME_BOOT        0x0317 // Type 03; Sub-Type 17
+#define  BDS_EFI_MESSAGE_SD_BOOT          0x031a // Type 03; Sub-Type 1a
+#define  BDS_EFI_MESSAGE_EMMC_BOOT        0x031d // Type 03; Sub-Type 1d
 #define  BDS_EFI_MESSAGE_MISC_BOOT        0x03FF
 
 ///
diff --git a/Core/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c b/Core/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
index ce1dd4a..41611cf 100644
--- a/Core/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
+++ b/Core/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
@@ -3123,6 +3123,9 @@ BdsLibEnumerateAllBootOption (
   UINT16                        UsbNumber;
   UINT16                        MiscNumber;
   UINT16                        ScsiNumber;
+  UINT16                        NvmeNumber;
+  UINT16                        SdNumber;
+  UINT16                        EmmcNumber;
   UINT16                        NonBlockNumber;
   UINTN                         NumberBlockIoHandles;
   EFI_HANDLE                    *BlockIoHandles;
@@ -3157,6 +3160,9 @@ BdsLibEnumerateAllBootOption (
   UsbNumber       = 0;
   MiscNumber      = 0;
   ScsiNumber      = 0;
+  NvmeNumber      = 0;
+  SdNumber        = 0;
+  EmmcNumber      = 0;
   PlatLang        = NULL;
   LastLang        = NULL;
   ZeroMem (Buffer, sizeof (Buffer));
@@ -3299,6 +3305,36 @@ BdsLibEnumerateAllBootOption (
         ScsiNumber++;
         break;
 
+      case BDS_EFI_MESSAGE_NVME_BOOT:
+        if (NvmeNumber != 0) {
+          UnicodeSPrint (Buffer, sizeof (Buffer), L"%s %d", BdsLibGetStringById (STRING_TOKEN (STR_DESCRIPTION_NVME)), NvmeNumber);
+        } else {
+          UnicodeSPrint (Buffer, sizeof (Buffer), L"%s", BdsLibGetStringById (STRING_TOKEN (STR_DESCRIPTION_NVME)));
+        }
+        BdsLibBuildOptionFromHandle (BlockIoHandles[Index], BdsBootOptionList, Buffer);
+        NvmeNumber++;
+        break;
+
+      case BDS_EFI_MESSAGE_SD_BOOT:
+        if (SdNumber != 0) {
+          UnicodeSPrint (Buffer, sizeof (Buffer), L"%s %d", BdsLibGetStringById (STRING_TOKEN (STR_DESCRIPTION_SD)), SdNumber);
+        } else {
+          UnicodeSPrint (Buffer, sizeof (Buffer), L"%s", BdsLibGetStringById (STRING_TOKEN (STR_DESCRIPTION_SD)));
+        }
+        BdsLibBuildOptionFromHandle (BlockIoHandles[Index], BdsBootOptionList, Buffer);
+        SdNumber++;
+        break;
+
+      case BDS_EFI_MESSAGE_EMMC_BOOT:
+        if (EmmcNumber != 0) {
+          UnicodeSPrint (Buffer, sizeof (Buffer), L"%s %d", BdsLibGetStringById (STRING_TOKEN (STR_DESCRIPTION_EMMC)), EmmcNumber);
+        } else {
+          UnicodeSPrint (Buffer, sizeof (Buffer), L"%s", BdsLibGetStringById (STRING_TOKEN (STR_DESCRIPTION_EMMC)));
+        }
+        BdsLibBuildOptionFromHandle (BlockIoHandles[Index], BdsBootOptionList, Buffer);
+        EmmcNumber++;
+        break;
+
       case BDS_EFI_MESSAGE_MISC_BOOT:
       default:
         if (MiscNumber != 0) {
@@ -3927,7 +3963,8 @@ BdsGetBootTypeFromDevicePath (
         // Get the last device path node
         //
         LastDeviceNode = NextDevicePathNode (TempDevicePath);
-        if (DevicePathSubType(LastDeviceNode) == MSG_DEVICE_LOGICAL_UNIT_DP) {
+        if ((DevicePathSubType(LastDeviceNode) == MSG_DEVICE_LOGICAL_UNIT_DP) ||
+            (DevicePathSubType(LastDeviceNode) == HW_CONTROLLER_DP)) {
           //
           // if the next node type is Device Logical Unit, which specify the Logical Unit Number (LUN),
           // skip it
@@ -3965,6 +4002,18 @@ BdsGetBootTypeFromDevicePath (
           BootType = BDS_EFI_MESSAGE_MAC_BOOT;
           break;
 
+        case MSG_NVME_NAMESPACE_DP:
+          BootType = BDS_EFI_MESSAGE_NVME_BOOT;
+          break;
+
+        case MSG_SD_DP:
+          BootType = BDS_EFI_MESSAGE_SD_BOOT;
+          break;
+
+        case MSG_EMMC_DP:
+          BootType = BDS_EFI_MESSAGE_EMMC_BOOT;
+          break;
+
         default:
           BootType = BDS_EFI_MESSAGE_MISC_BOOT;
           break;
diff --git a/Core/IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsStrings.uni b/Core/IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsStrings.uni
index 5326685..acc0d77 100644
--- a/Core/IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsStrings.uni
+++ b/Core/IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsStrings.uni
@@ -2,7 +2,7 @@
 //  
 //  String definitions for Boot Option description.
 //  
-//  Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
+//  Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
 //  This program and the accompanying materials
 //  are licensed and made available under the terms and conditions of the BSD License
 //  which accompanies this distribution.  The full text of the license may be found at
@@ -30,6 +30,12 @@
                                        #language fr-FR  "fr-FR: EFI SCSI Device"
 #string STR_DESCRIPTION_MISC           #language en-US  "EFI Misc Device"
                                        #language fr-FR  "fr-FR: EFI Misc Device"
+#string STR_DESCRIPTION_NVME           #language en-US  "EFI NVM Express"
+                                       #language fr-FR  "fr-FR: EFI NVM Express"
+#string STR_DESCRIPTION_SD             #language en-US  "EFI SD Card"
+                                       #language fr-FR  "fr-FR: EFI SD Card"
+#string STR_DESCRIPTION_EMMC           #language en-US  "EFI EMMC Device"
+                                       #language fr-FR  "fr-FR: EFI EMMC Device"
 #string STR_DESCRIPTION_NETWORK        #language en-US  "EFI Network"
                                        #language fr-FR  "fr-FR: EFI Network"
 #string STR_DESCRIPTION_NON_BLOCK      #language en-US  "EFI Non-Block Boot Device"
-- 
2.7.0.windows.1


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel