]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c
MdeModulePkg/UefiBootManagerLib: Generate boot description for SD/eMMC
[mirror_edk2.git] / MdeModulePkg / Library / UefiBootManagerLib / BmBootDescription.c
index 7647bac2d03711298d65ab13703ed9c7ea42f74f..d56c3e7e2ca7acf41b7d602b27371dcf8c600e87 100644 (file)
@@ -155,6 +155,7 @@ BmGetDescriptionFromDiskInfo (
   CONST UINTN                  SerialNumberLength = 20;\r
   CHAR8                        *StrPtr;\r
   UINT8                        Temp;\r
+  EFI_DEVICE_PATH_PROTOCOL     *DevicePath;\r
 \r
   Description  = NULL;\r
 \r
@@ -229,6 +230,28 @@ BmGetDescriptionFromDiskInfo (
 \r
       BmEliminateExtraSpaces (Description);\r
     }\r
+  } else if (CompareGuid (&DiskInfo->Interface, &gEfiDiskInfoSdMmcInterfaceGuid)) {\r
+    DevicePath = DevicePathFromHandle (Handle);\r
+    if (DevicePath == NULL) {\r
+      return NULL;\r
+    }\r
+\r
+    while (!IsDevicePathEnd (DevicePath) && (DevicePathType (DevicePath) != MESSAGING_DEVICE_PATH)) {\r
+      DevicePath = NextDevicePathNode (DevicePath);\r
+    }\r
+    if (IsDevicePathEnd (DevicePath)) {\r
+      return NULL;\r
+    }\r
+\r
+    if (DevicePathSubType (DevicePath) == MSG_SD_DP) {\r
+      Description = L"SD Device";\r
+    } else if (DevicePathSubType (DevicePath) == MSG_EMMC_DP) {\r
+      Description = L"eMMC Device";\r
+    } else {\r
+      return NULL;\r
+    }\r
+\r
+    Description = AllocateCopyPool (StrSize (Description), Description);\r
   }\r
 \r
   return Description;\r