From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: eric.dong@intel.com) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by groups.io with SMTP; Tue, 08 Oct 2019 00:02:04 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Oct 2019 00:02:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,269,1566889200"; d="scan'208";a="277016812" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga001.jf.intel.com with ESMTP; 08 Oct 2019 00:02:03 -0700 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 8 Oct 2019 00:02:02 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 8 Oct 2019 00:02:02 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.176]) by SHSMSX151.ccr.corp.intel.com ([10.239.6.50]) with mapi id 14.03.0439.000; Tue, 8 Oct 2019 15:02:00 +0800 From: "Dong, Eric" To: "Kubacki, Michael A" , "devel@edk2.groups.io" CC: "Gao, Liming" Subject: Re: [edk2-platforms][PATCH V2 2/3] BoardModulePkg/FirmwareBootMediaInfoLib: Add library Thread-Topic: [edk2-platforms][PATCH V2 2/3] BoardModulePkg/FirmwareBootMediaInfoLib: Add library Thread-Index: AQHVetlK7IXkGUi7Fkq/1dT4ofzRKadQVtFA Date: Tue, 8 Oct 2019 07:01:59 +0000 Message-ID: References: <20191004172924.20240-1-michael.a.kubacki@intel.com> <20191004172924.20240-3-michael.a.kubacki@intel.com> In-Reply-To: <20191004172924.20240-3-michael.a.kubacki@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: eric.dong@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Eric Dong > -----Original Message----- > From: Kubacki, Michael A > Sent: Saturday, October 5, 2019 1:29 AM > To: devel@edk2.groups.io > Cc: Dong, Eric ; Gao, Liming > Subject: [edk2-platforms][PATCH V2 2/3] > BoardModulePkg/FirmwareBootMediaInfoLib: Add library >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2229 >=20 > Introduces a new library class FirmwareBootMediaInfoLib that is > used to report the firmware boot media device. A default library > instance is provided that always returns the firmware boot media > is SPI flash. For platforms with other firmware boot media > options, a board-specific instance of this library should be > used instead to provide the correct firmware boot media device > information. >=20 > Cc: Eric Dong > Cc: Liming Gao > Signed-off-by: Michael Kubacki > --- > Platform/Intel/BoardModulePkg/BoardModulePkg.dec > | 3 ++ > Platform/Intel/BoardModulePkg/BoardModulePkg.dsc > | 3 ++ >=20 > Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFir > mwareBootMediaInfoLib.inf | 35 ++++++++++++++++++++ > Platform/Intel/BoardModulePkg/Include/Library/FirmwareBootMediaInfoLib.h > | 26 +++++++++++++++ >=20 > Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFir > mwareBootMediaInfoLib.c | 24 ++++++++++++++ > 5 files changed, 91 insertions(+) >=20 > diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dec > b/Platform/Intel/BoardModulePkg/BoardModulePkg.dec > index 6f13945ca8..f96fb09aa1 100644 > --- a/Platform/Intel/BoardModulePkg/BoardModulePkg.dec > +++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dec > @@ -33,6 +33,9 @@ > ## @libraryclass Provide services to get BIOS ID information. > BiosIdLib|Include/Library/BiosIdLib.h >=20 > + ## @libraryclass Provides a service to determine the firmware boot= media > device. > + FirmwareBootMediaInfoLib|Include/Library/FirmwareBootMediaInfoLib.h > + > [Guids] > ## Include Include/Guid/BiosId.h > gBiosIdGuid =3D { 0xC3E36D09, 0x8294, 0x4b97, { 0xA8, 0x57, 0xD5, 0x28= , 0x8F, > 0xE3, 0x3E, 0x28 } } > diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc > b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc > index 734ead9be8..3d605cf876 100644 > --- a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc > +++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc > @@ -33,6 +33,7 @@ > DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf >=20 > [LibraryClasses.common.PEIM] > + > FirmwareBootMediaLib|IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFi > rmwareBootMediaLib.inf > HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf >=20 > MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAll > ocationLib.inf >=20 > @@ -40,6 +41,7 @@ >=20 > PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/P= ei > ServicesTablePointerLibIdt.inf >=20 > [LibraryClasses.common.DXE_DRIVER] > + > FirmwareBootMediaLib|IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/Dxe > SmmFirmwareBootMediaLib.inf > HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf >=20 > MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemory > AllocationLib.inf >=20 > @@ -77,3 +79,4 @@ > BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.inf > BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.inf >=20 > + > BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFirmwareBootMe > diaInfoLib.inf > diff --git > a/Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFi > rmwareBootMediaInfoLib.inf > b/Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFi > rmwareBootMediaInfoLib.inf > new file mode 100644 > index 0000000000..637aeca2af > --- /dev/null > +++ > b/Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFi > rmwareBootMediaInfoLib.inf > @@ -0,0 +1,35 @@ > +## @file > +# Firmware Boot Media Info Library > +# > +# This library identifies firmware boot media device information used in= the > boot flow for system initialization > +# decisions dependent upon the firmware boot media. > +# > +# This library instance provides a default implementation of the > FirmwareBootMediaInfoLib library class that always > +# returns SPI flash as the boot media device. For any system firmware in > which this is not the case, an instance > +# of this library class should be provided that returns the correct boot= media > for the platform. > +# > +# Copyright (c) 2019, Intel Corporation. All rights reserved.
> +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > + > +[Defines] > + INF_VERSION =3D 0x00010005 > + BASE_NAME =3D PeiFirmwareBootMediaInfoLib > + FILE_GUID =3D 91CC29F5-AEAD-4108-9E91-C8DECDC1C654 > + MODULE_TYPE =3D PEIM > + VERSION_STRING =3D 1.0 > + LIBRARY_CLASS =3D FirmwareBootMediaInfoLib > + > +[Sources] > + PeiFirmwareBootMediaInfoLib.c > + > +[Packages] > + MdePkg/MdePkg.dec > + IntelSiliconPkg/IntelSiliconPkg.dec > + BoardModulePkg/BoardModulePkg.dec > + > +[LibraryClasses] > + BaseLib > + FirmwareBootMediaLib > diff --git > a/Platform/Intel/BoardModulePkg/Include/Library/FirmwareBootMediaInfoLib > .h > b/Platform/Intel/BoardModulePkg/Include/Library/FirmwareBootMediaInfoLib > .h > new file mode 100644 > index 0000000000..b08f21ac74 > --- /dev/null > +++ > b/Platform/Intel/BoardModulePkg/Include/Library/FirmwareBootMediaInfoLib > .h > @@ -0,0 +1,26 @@ > +/** @file > + This library identifies the firmware boot media device. > + > +Copyright (c) 2019, Intel Corporation. All rights reserved.
> +SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef _FIRMWARE_BOOT_MEDIA_INFO_LIB_H_ > +#define _FIRMWARE_BOOT_MEDIA_INFO_LIB_H_ > + > +#include > +#include > + > +/** > + Identifies the firmware boot media type for the current boot. > + > + @retval BOOT_MEDIA_TYPE The boot media type. A value of > FwBootMediaTypeMax indicates the firmware boot media > + information is unavailable. > +**/ > +FW_BOOT_MEDIA_TYPE > +IdentifyFirmwareBootMediaType ( > + VOID > + ); > + > +#endif > diff --git > a/Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFi > rmwareBootMediaInfoLib.c > b/Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFi > rmwareBootMediaInfoLib.c > new file mode 100644 > index 0000000000..0c29d96033 > --- /dev/null > +++ > b/Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFi > rmwareBootMediaInfoLib.c > @@ -0,0 +1,24 @@ > +/** @file > + This library identifies the firmware boot media device. > + > +Copyright (c) 2019, Intel Corporation. All rights reserved.
> +SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include > +#include > + > +/** > + Identifies the firmware boot media type for the current boot. > + > + @retval BOOT_MEDIA_TYPE The boot media type. A value of > FwBootMediaTypeMax indicates the firmware boot media > + information is unavailable. > +**/ > +FW_BOOT_MEDIA_TYPE > +IdentifyFirmwareBootMediaType ( > + VOID > + ) > +{ > + return FwBootMediaSpi; > +} > -- > 2.16.2.windows.1