From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web11.2518.1571102994279671801 for ; Mon, 14 Oct 2019 18:29:54 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: ray.ni@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Oct 2019 18:29:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,297,1566889200"; d="scan'208";a="201621337" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by FMSMGA003.fm.intel.com with ESMTP; 14 Oct 2019 18:29:53 -0700 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 14 Oct 2019 18:29:53 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 14 Oct 2019 18:29:53 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.166]) by shsmsx102.ccr.corp.intel.com ([169.254.2.176]) with mapi id 14.03.0439.000; Tue, 15 Oct 2019 09:29:50 +0800 From: "Ni, Ray" To: "Kubacki, Michael A" , "devel@edk2.groups.io" CC: "Chaganty, Rangasai V" Subject: Re: [edk2-platforms][PATCH V1 1/1] IntelSiliconPkg/BootMediaLib: Reduce library API Thread-Topic: [edk2-platforms][PATCH V1 1/1] IntelSiliconPkg/BootMediaLib: Reduce library API Thread-Index: AQHVgtYIOTkrtkYpnka2pkFh7v6JB6da6TAg Date: Tue, 15 Oct 2019 01:29:50 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C322E81@SHSMSX104.ccr.corp.intel.com> References: <20191014212616.18376-1-michael.a.kubacki@intel.com> In-Reply-To: <20191014212616.18376-1-michael.a.kubacki@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 Return-Path: ray.ni@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ray Ni Mike, Thanks for reducing the API. For the other comments I raised (single library instance usable for PEI and= DXE), do you have any comments? > -----Original Message----- > From: Kubacki, Michael A > Sent: Tuesday, October 15, 2019 5:26 AM > To: devel@edk2.groups.io > Cc: Chaganty, Rangasai V ; Ni, Ray > > Subject: [edk2-platforms][PATCH V1 1/1] IntelSiliconPkg/BootMediaLib: > Reduce library API >=20 > Removes the following functions from FirmwareBootMediaLib.h: > * FirmwareBootMediaIsSpi () > * FirmwareBootMediaIsUfs () > * FirmwareBootMediaIsEmmc () > * FirmwareBootMediaIsNvme () >=20 > It is preferred to have a single method to retrieve the firmware boot med= ia. > To reduce overall maintenance effort over time, the > FirmwareBootMediaIsXxx () pattern is removed in favor of returning the > firmware boot media type via GetFirmwareBootMediaType (). >=20 > Cc: Sai Chaganty > Cc: Ray Ni > Signed-off-by: Michael Kubacki > --- >=20 > Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFirm > wareBootMediaLib.inf | 1 - >=20 > Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwareB > ootMediaLib.inf | 1 - > Silicon/Intel/IntelSiliconPkg/Include/Library/FirmwareBootMediaLib.h > | 48 --------- >=20 > Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/FirmwareBoo > tMediaLib.c | 109 -------------------- > 4 files changed, 159 deletions(-) >=20 > diff --git > a/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFir > mwareBootMediaLib.inf > b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFir > mwareBootMediaLib.inf > index 83ed5f04af..7e10b5f7a7 100644 > --- > a/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFir > mwareBootMediaLib.inf > +++ > b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmm > +++ FirmwareBootMediaLib.inf > @@ -27,7 +27,6 @@ > # >=20 > [Sources] > - FirmwareBootMediaLib.c > DxeSmmFirmwareBootMediaLib.c >=20 > [Packages] > diff --git > a/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwar > eBootMediaLib.inf > b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwar > eBootMediaLib.inf > index 063c4027d3..ff1da31387 100644 > --- > a/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwar > eBootMediaLib.inf > +++ b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFir > +++ mwareBootMediaLib.inf > @@ -22,7 +22,6 @@ > LIBRARY_CLASS =3D FirmwareBootMediaLib >=20 > [Sources] > - FirmwareBootMediaLib.c > PeiFirmwareBootMediaLib.c >=20 > [Packages] > diff --git > a/Silicon/Intel/IntelSiliconPkg/Include/Library/FirmwareBootMediaLib.h > b/Silicon/Intel/IntelSiliconPkg/Include/Library/FirmwareBootMediaLib.h > index aca9593a84..b36ebacf30 100644 > --- a/Silicon/Intel/IntelSiliconPkg/Include/Library/FirmwareBootMediaLib.= h > +++ b/Silicon/Intel/IntelSiliconPkg/Include/Library/FirmwareBootMediaLib > +++ .h > @@ -55,52 +55,4 @@ FirmwareBootMediaIsKnown ( > VOID > ); >=20 > -/** > - Determines if the platform firmware is booting from SPI. > - > - @retval TRUE Platform firmware is booting from SPI > - @retval FALSE Platform firmware is booting from a non-SPI device= or the > boot media is unknown > -**/ > -BOOLEAN > -EFIAPI > -FirmwareBootMediaIsSpi ( > - VOID > - ); > - > -/** > - Determines if the platform firmware is booting from UFS. > - > - @retval TRUE Platform firmware is booting from UFS > - @retval FALSE Platform firmware is booting from a non-UFS device= or > the boot media is unknown > -**/ > -BOOLEAN > -EFIAPI > -FirmwareBootMediaIsUfs ( > - VOID > - ); > - > -/** > - Determines if the platform firmware is booting from eMMC. > - > - @retval TRUE Platform firmware is booting from eMMC > - @retval FALSE Platform firmware is booting from a non-eMMC devic= e or > the boot media is unknown > -**/ > -BOOLEAN > -EFIAPI > -FirmwareBootMediaIsEmmc ( > - VOID > - ); > - > -/** > - Determines if the platform firmware is booting from NVMe. > - > - @retval TRUE Platform firmware is booting from NVMe. > - @retval FALSE Platform firmware is booting from a non-NVMe devic= e or > the boot media is unknown > -**/ > -BOOLEAN > -EFIAPI > -FirmwareBootMediaIsNvme ( > - VOID > - ); > - > #endif > diff --git > a/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/FirmwareB > ootMediaLib.c > b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/FirmwareB > ootMediaLib.c > deleted file mode 100644 > index 11a14d172d..0000000000 > --- > a/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/FirmwareB > ootMediaLib.c > +++ /dev/null > @@ -1,109 +0,0 @@ > -/** @file > - This library identifies the firmware boot media device. > - > - The firmware boot media device is used to make system initialization > decisions in the boot flow dependent > - upon firmware boot media. Note that the firmware boot media is the > storage media that the boot firmware is stored on. > - It is not the OS storage media which may be stored upon a different no= n- > volatile storage device. > - > - This file contains library implementation common to all boot phases. > - > -Copyright (c) 2019, Intel Corporation. All rights reserved.
> -SPDX-License-Identifier: BSD-2-Clause-Patent > - > -**/ > - > -#include > -#include > -#include > - > -/** > - Determines if the platform firmware is booting from SPI. > - > - @retval TRUE Platform firmware is booting from SPI > - @retval FALSE Platform firmware is booting from a non-SPI device= or the > boot media is unknown > -**/ > -BOOLEAN > -EFIAPI > -FirmwareBootMediaIsSpi ( > - VOID > - ) > -{ > - EFI_STATUS Status; > - FW_BOOT_MEDIA_TYPE BootMedia; > - > - Status =3D GetFirmwareBootMediaType (&BootMedia); > - if (EFI_ERROR (Status) || BootMedia !=3D FwBootMediaSpi) { > - return FALSE; > - } else { > - return TRUE; > - } > -} > - > -/** > - Determines if the platform firmware is booting from UFS. > - > - @retval TRUE Platform firmware is booting from UFS > - @retval FALSE Platform firmware is booting from a non-UFS device= or > the boot media is unknown > -**/ > -BOOLEAN > -EFIAPI > -FirmwareBootMediaIsUfs ( > - VOID > - ) > -{ > - EFI_STATUS Status; > - FW_BOOT_MEDIA_TYPE BootMedia; > - > - Status =3D GetFirmwareBootMediaType (&BootMedia); > - if (EFI_ERROR (Status) || BootMedia !=3D FwBootMediaUfs) { > - return FALSE; > - } else { > - return TRUE; > - } > -} > - > -/** > - Determines if the platform firmware is booting from eMMC. > - > - @retval TRUE Platform firmware is booting from eMMC > - @retval FALSE Platform firmware is booting from a non-eMMC devic= e or > the boot media is unknown > -**/ > -BOOLEAN > -EFIAPI > -FirmwareBootMediaIsEmmc ( > - VOID > - ) > -{ > - EFI_STATUS Status; > - FW_BOOT_MEDIA_TYPE BootMedia; > - > - Status =3D GetFirmwareBootMediaType (&BootMedia); > - if (EFI_ERROR (Status) || BootMedia !=3D FwBootMediaEmmc) { > - return FALSE; > - } else { > - return TRUE; > - } > -} > - > -/** > - Determines if the platform firmware is booting from NVMe. > - > - @retval TRUE Platform firmware is booting from NVMe. > - @retval FALSE Platform firmware is booting from a non-NVMe devic= e or > the boot media is unknown > -**/ > -BOOLEAN > -EFIAPI > -FirmwareBootMediaIsNvme ( > - VOID > - ) > -{ > - EFI_STATUS Status; > - FW_BOOT_MEDIA_TYPE BootMedia; > - > - Status =3D GetFirmwareBootMediaType (&BootMedia); > - if (EFI_ERROR (Status) || BootMedia !=3D FwBootMediaNvme) { > - return FALSE; > - } else { > - return TRUE; > - } > -} > -- > 2.16.2.windows.1