From nobody Thu Dec 26 13:20:53 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1504571594735425.4726646771128; Mon, 4 Sep 2017 17:33:14 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 39DA321EB88C4; Mon, 4 Sep 2017 17:30:22 -0700 (PDT) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 22DFE21EB529B for ; Mon, 4 Sep 2017 17:30:21 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2017 17:33:09 -0700 Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.13]) by orsmga002.jf.intel.com with ESMTP; 04 Sep 2017 17:33:08 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,477,1498546800"; d="scan'208";a="131680877" From: Hao Wu To: edk2-devel@lists.01.org Date: Tue, 5 Sep 2017 08:33:05 +0800 Message-Id: <20170905003305.30180-1-hao.a.wu@intel.com> X-Mailer: git-send-email 2.12.0.windows.1 Subject: [edk2] [PATCH] MdeModulePkg/UefiBootManagerLib: Generate boot description for SD/eMMC X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hao Wu , Ruiyu Ni MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D620 Adds the support for SD/eMMC device path to show as a boot option. The CID register content (returned from DiskInfo->Inquiry) seems do not provide very useful/readable 'OEM/Application ID' and 'Product name' field. For SD devices, the OID is a 2-character ASCII string and the Product name is a 5-character ASCII string. For eMMC devices, the OID is an 8-bit binary number and the Product name is a 6-character ASCII string. These strings are relatively short and do not provide a very readable description. Hence, this commit uses general 'SD (eMMC) Device' for the boot option description. Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu Reviewed-by: Ruiyu Ni --- .../Library/UefiBootManagerLib/BmBootDescription.c | 23 ++++++++++++++++++= ++++ .../UefiBootManagerLib/UefiBootManagerLib.inf | 1 + 2 files changed, 24 insertions(+) diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c b/= MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c index 7647bac2d0..d56c3e7e2c 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c @@ -155,6 +155,7 @@ BmGetDescriptionFromDiskInfo ( CONST UINTN SerialNumberLength =3D 20; CHAR8 *StrPtr; UINT8 Temp; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; =20 Description =3D NULL; =20 @@ -229,6 +230,28 @@ BmGetDescriptionFromDiskInfo ( =20 BmEliminateExtraSpaces (Description); } + } else if (CompareGuid (&DiskInfo->Interface, &gEfiDiskInfoSdMmcInterfac= eGuid)) { + DevicePath =3D DevicePathFromHandle (Handle); + if (DevicePath =3D=3D NULL) { + return NULL; + } + + while (!IsDevicePathEnd (DevicePath) && (DevicePathType (DevicePath) != =3D MESSAGING_DEVICE_PATH)) { + DevicePath =3D NextDevicePathNode (DevicePath); + } + if (IsDevicePathEnd (DevicePath)) { + return NULL; + } + + if (DevicePathSubType (DevicePath) =3D=3D MSG_SD_DP) { + Description =3D L"SD Device"; + } else if (DevicePathSubType (DevicePath) =3D=3D MSG_EMMC_DP) { + Description =3D L"eMMC Device"; + } else { + return NULL; + } + + Description =3D AllocateCopyPool (StrSize (Description), Description); } =20 return Description; diff --git a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf= b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf index 264d726c26..ad4901db57 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf +++ b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf @@ -91,6 +91,7 @@ gEfiDiskInfoAhciInterfaceGuid ## SOMETIMES_CONSUMES ## G= UID gEfiDiskInfoIdeInterfaceGuid ## SOMETIMES_CONSUMES ## G= UID gEfiDiskInfoScsiInterfaceGuid ## SOMETIMES_CONSUMES ## G= UID + gEfiDiskInfoSdMmcInterfaceGuid ## SOMETIMES_CONSUMES ## G= UID =20 [Protocols] gEfiPciRootBridgeIoProtocolGuid ## CONSUMES --=20 2.12.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel