From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 9AC5E21E7491E for ; Mon, 4 Sep 2017 18:54:41 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP; 04 Sep 2017 18:57:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,477,1498546800"; d="scan'208";a="1214702952" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga002.fm.intel.com with ESMTP; 04 Sep 2017 18:57:29 -0700 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 4 Sep 2017 18:57:29 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 4 Sep 2017 18:57:29 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.117]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.98]) with mapi id 14.03.0319.002; Tue, 5 Sep 2017 09:57:21 +0800 From: "Ni, Ruiyu" To: "Wu, Hao A" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH] MdeModulePkg/UefiBootManagerLib: Generate boot description for SD/eMMC Thread-Index: AQHTJd6OIIcgKRLQqkGtELK4xB5qbqKliLWQ Date: Tue, 5 Sep 2017 01:57:20 +0000 Deferred-Delivery: Tue, 5 Sep 2017 01:57:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5BA23843@SHSMSX104.ccr.corp.intel.com> References: <20170905003305.30180-1-hao.a.wu@intel.com> In-Reply-To: <20170905003305.30180-1-hao.a.wu@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: , X-List-Received-Date: Tue, 05 Sep 2017 01:54:41 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ruiyu Ni Thanks/Ray > -----Original Message----- > From: Wu, Hao A > Sent: Tuesday, September 5, 2017 8:33 AM > To: edk2-devel@lists.01.org > Cc: Wu, Hao A ; Ni, Ruiyu > Subject: [PATCH] MdeModulePkg/UefiBootManagerLib: Generate boot > description for SD/eMMC >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D620 >=20 > Adds the support for SD/eMMC device path to show as a boot option. >=20 > The CID register content (returned from DiskInfo->Inquiry) seems do not > provide very useful/readable 'OEM/Application ID' and 'Product name' > field. >=20 > For SD devices, the OID is a 2-character ASCII string and the Product nam= e is a > 5-character ASCII string. >=20 > For eMMC devices, the OID is an 8-bit binary number and the Product name > is a 6-character ASCII string. >=20 > 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. >=20 > Cc: Ruiyu Ni > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Hao Wu > --- > .../Library/UefiBootManagerLib/BmBootDescription.c | 23 > ++++++++++++++++++++++ > .../UefiBootManagerLib/UefiBootManagerLib.inf | 1 + > 2 files changed, 24 insertions(+) >=20 > 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, > &gEfiDiskInfoSdMmcInterfaceGuid)) { > + 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 ## > GUID > gEfiDiskInfoIdeInterfaceGuid ## SOMETIMES_CONSUMES ##= GUID > gEfiDiskInfoScsiInterfaceGuid ## SOMETIMES_CONSUMES ##= GUID > + gEfiDiskInfoSdMmcInterfaceGuid ## SOMETIMES_CONSUMES ## > GUID >=20 > [Protocols] > gEfiPciRootBridgeIoProtocolGuid ## CONSUMES > -- > 2.12.0.windows.1