From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web11.614.1571620426532873774 for ; Sun, 20 Oct 2019 18:13:46 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: chasel.chiu@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Oct 2019 18:13:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,321,1566889200"; d="scan'208";a="222306486" Received: from pgsmsx105.gar.corp.intel.com ([10.221.44.96]) by fmsmga004.fm.intel.com with ESMTP; 20 Oct 2019 18:13:45 -0700 Received: from pgsmsx111.gar.corp.intel.com ([169.254.2.128]) by PGSMSX105.gar.corp.intel.com ([169.254.4.226]) with mapi id 14.03.0439.000; Mon, 21 Oct 2019 09:12:52 +0800 From: "Chiu, Chasel" To: "devel@edk2.groups.io" , "Agyeman, Prince" CC: "Sinha, Ankit" , "Desimone, Nathaniel L" , "Kubacki, Michael A" Subject: Re: [edk2-devel] [edk2-platforms] [PATCH v3 2/4] KabylakeOpenBoardPkg: Add BIOS Info PEIM Thread-Topic: [edk2-devel] [edk2-platforms] [PATCH v3 2/4] KabylakeOpenBoardPkg: Add BIOS Info PEIM Thread-Index: AQHVhUdFNLtR4WiACU2NXOBMAuOq1KdkTXVg Date: Mon, 21 Oct 2019 01:12:52 +0000 Message-ID: <3C3EFB470A303B4AB093197B6777CCEC5050D4EC@PGSMSX111.gar.corp.intel.com> References: <20191018000145.3140-1-prince.agyeman@intel.com> <20191018000145.3140-3-prince.agyeman@intel.com> In-Reply-To: <20191018000145.3140-3-prince.agyeman@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiM2M1MTA5YTAtOWJlMS00NGMyLTgxMmItNWE0OWU3YmNmNDFiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiTWF1QXhCWng3ZXdORU00UmFZT3I3ZlwvQWh3R0UyWUFWc09qTFNldUxsVkZWOFlUWHV0R25veHZoTzhCQWNiZHkifQ== x-ctpclassification: CTP_NT x-originating-ip: [172.30.20.205] MIME-Version: 1.0 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Chasel Chiu > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Agyeman, > Prince > Sent: Friday, October 18, 2019 8:02 AM > To: devel@edk2.groups.io > Cc: Sinha, Ankit ; Desimone, Nathaniel L > ; Kubacki, Michael A > > Subject: [edk2-devel] [edk2-platforms] [PATCH v3 2/4] > KabylakeOpenBoardPkg: Add BIOS Info PEIM >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2210 >=20 > Added BIOS Info PEIM to KabylakeRvp3 and GalagoPro3 to publish the BIOS > info HOB. This PEIM currently publishes the board's microcode region > information. >=20 > Cc: Ankit Sinha > Cc: Nate DeSimone > Cc: Kubacki Michael A >=20 > Signed-off-by: Prince Agyeman > --- > .../KabylakeOpenBoardPkg/BiosInfo/BiosInfo.c | 93 +++++++++++++++++++ > .../BiosInfo/BiosInfo.inf | 49 ++++++++++ > .../GalagoPro3/OpenBoardPkg.dsc | 1 + > .../GalagoPro3/OpenBoardPkg.fdf | 1 + > .../KabylakeRvp3/OpenBoardPkg.dsc | 1 + > .../KabylakeRvp3/OpenBoardPkg.fdf | 1 + > 6 files changed, 146 insertions(+) > create mode 100644 > Platform/Intel/KabylakeOpenBoardPkg/BiosInfo/BiosInfo.c > create mode 100644 > Platform/Intel/KabylakeOpenBoardPkg/BiosInfo/BiosInfo.inf >=20 > diff --git a/Platform/Intel/KabylakeOpenBoardPkg/BiosInfo/BiosInfo.c > b/Platform/Intel/KabylakeOpenBoardPkg/BiosInfo/BiosInfo.c > new file mode 100644 > index 0000000000..578e66149e > --- /dev/null > +++ b/Platform/Intel/KabylakeOpenBoardPkg/BiosInfo/BiosInfo.c > @@ -0,0 +1,93 @@ > +/** @file > + Driver for BIOS Info support. > + > + Copyright (c) 2019, Intel Corporation. All rights reserved.
> + SPDX-License-Identifier: BSD-2-Clause-Patent **/ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#define INDEXPORT_TO_ADDRESS(x) (x) > +#define DATAPORT_TO_ADDRESS(x) ((x) << 16) > +#define PORTWIDTH_TO_ADDRESS(x) ((x) << 32) > +#define PORTBITNUMBER_TO_ADDRESS(x) ((x) << 40) > +#define PORTINDEXNUMBER_TO_ADDRESS(x) ((x) << 48) > + > +// > +// Internal > +// > +#pragma pack (1) > + > +typedef struct { > + BIOS_INFO_HEADER Header; > + BIOS_INFO_STRUCT Entry[1]; > +} BIOS_INFO; > +#pragma pack () > + > +GLOBAL_REMOVE_IF_UNREFERENCED BIOS_INFO mBiosInfo =3D { > + { > + BIOS_INFO_SIGNATURE, > + 1, > + 0, > + }, > + { > + { > + FIT_TYPE_01_MICROCODE, > + BIOS_INFO_STRUCT_ATTRIBUTE_MICROCODE_WHOLE_REGION, > + 0x0100, > + FixedPcdGet32 (PcdFlashMicrocodeFvSize), > + FixedPcdGet32 (PcdFlashMicrocodeFvBase) > + } > + } > +}; > + > +GLOBAL_REMOVE_IF_UNREFERENCED EFI_PEI_PPI_DESCRIPTOR > mBiosInfoPpiList > +=3D { > + EFI_PEI_PPI_DESCRIPTOR_PPI | > EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST, > + &gBiosInfoGuid, > + &mBiosInfo > +}; > + > +/** > + Installs BiosInfo Ppi and builds BiosInfo HOB . > + > + @param FileHandle Handle of the file being invoked. > + @param PeiServices Describes the list of possible PEI Services. > + > + @retval EFI_SUCCESS Install the BiosInfo Ppi and HOB successfully. > + > +**/ > +EFI_STATUS > +EFIAPI > +BiosInfoEntryPoint ( > + IN EFI_PEI_FILE_HANDLE FileHandle, > + IN CONST EFI_PEI_SERVICES **PeiServices > + ) > +{ > + EFI_STATUS Status; > + VOID *HobData; > + > + // > + // Install PPI, so that other PEI module can add dependency. > + // > + Status =3D PeiServicesInstallPpi (&mBiosInfoPpiList); ASSERT_EFI_ERR= OR > + (Status); > + > + // > + // Build hob, so that DXE module can also get the data. > + // > + HobData =3D BuildGuidHob (&gBiosInfoGuid, sizeof (mBiosInfo)); ASSER= T > + (HobData !=3D NULL); if (HobData =3D=3D NULL) { > + return EFI_OUT_OF_RESOURCES; > + } > + CopyMem (HobData, &mBiosInfo, sizeof (mBiosInfo)); > + > + return EFI_SUCCESS; > +} > diff --git a/Platform/Intel/KabylakeOpenBoardPkg/BiosInfo/BiosInfo.inf > b/Platform/Intel/KabylakeOpenBoardPkg/BiosInfo/BiosInfo.inf > new file mode 100644 > index 0000000000..e5e40144a6 > --- /dev/null > +++ b/Platform/Intel/KabylakeOpenBoardPkg/BiosInfo/BiosInfo.inf > @@ -0,0 +1,49 @@ > +### @file > +# Module Information description file for BIOS Info Driver # # > +Copyright (c) 2019, Intel Corporation. All rights reserved.
# > +SPDX-License-Identifier: BSD-2-Clause-Patent ### > + > +[Defines] > + INF_VERSION =3D 0x00010017 > + BASE_NAME =3D BiosInfo > + FILE_GUID =3D > C83BCE0E-6F16-4D3C-8D9F-4D6F5A032929 > + VERSION_STRING =3D 1.0 > + MODULE_TYPE =3D PEIM > + ENTRY_POINT =3D BiosInfoEntryPoint > +# > +# The following information is for reference only and not required by t= he > build tools. > +# > +# VALID_ARCHITECTURES IA32 X64 > +# > + > +[LibraryClasses] > + PeimEntryPoint > + PeiServicesLib > + HobLib > + BaseMemoryLib > + DebugLib > + PcdLib > + > +[Packages] > + MdePkg/MdePkg.dec > + MdeModulePkg/MdeModulePkg.dec > + IntelSiliconPkg/IntelSiliconPkg.dec > + KabylakeSiliconPkg/SiPkg.dec > + KabylakeFspBinPkg/KabylakeFspBinPkg.dec > + BoardModulePkg/BoardModulePkg.dec > + MinPlatformPkg/MinPlatformPkg.dec > + > +[Pcd] > + gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase > ## CONSUMES > + gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize > ## CONSUMES > + > +[Sources] > + BiosInfo.c > + > +[Guids] > + gBiosInfoGuid ## PRODUCES > + > +[Depex] > + TRUE > diff --git > a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc > b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc > index b6f9807e7e..f59248bba4 100644 > --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc > +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc > @@ -298,6 +298,7 @@ > !if gKabylakeOpenBoardPkgTokenSpaceGuid.PcdTbtEnable =3D=3D TRUE > $(PLATFORM_BOARD_PACKAGE)/Features/Tbt/TbtInit/Pei/PeiTbtInit.inf > !endif > + $(PLATFORM_BOARD_PACKAGE)/BiosInfo/BiosInfo.inf >=20 > [Components.X64] > ####################################### > diff --git > a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf > b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf > index c46f7a71e5..80efab1aad 100644 > --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf > +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf > @@ -240,6 +240,7 @@ INF > $(PLATFORM_PACKAGE)/PlatformInit/ReportFv/ReportFvPei.inf > INF > $(PROJECT)/Override/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformI= n > itPei/PlatformInitPreMem.inf > INF IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf > INF > $(PLATFORM_PACKAGE)/PlatformInit/SiliconPolicyPei/SiliconPolicyPeiPreMe > m.inf > +INF $(PLATFORM_BOARD_PACKAGE)/BiosInfo/BiosInfo.inf >=20 > [FV.FvPostMemoryUncompact] > BlockSize =3D $(FLASH_BLOCK_SIZE) > diff --git > a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc > b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc > index b412dc9eec..7e65eeda6f 100644 > --- > a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc > +++ > b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc > @@ -370,6 +370,7 @@ > !if gKabylakeOpenBoardPkgTokenSpaceGuid.PcdTbtEnable =3D=3D TRUE > $(PLATFORM_BOARD_PACKAGE)/Features/Tbt/TbtInit/Pei/PeiTbtInit.inf > !endif > + $(PLATFORM_BOARD_PACKAGE)/BiosInfo/BiosInfo.inf >=20 > [Components.X64] > ####################################### > diff --git > a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf > b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf > index c61b93db84..dbd6f2aa10 100644 > --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf > +++ > b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf > @@ -242,6 +242,7 @@ INF > $(PLATFORM_PACKAGE)/PlatformInit/ReportFv/ReportFvPei.inf > INF > $(PLATFORM_PACKAGE)/PlatformInit/PlatformInitPei/PlatformInitPreMem.inf > INF IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf > INF > $(PLATFORM_PACKAGE)/PlatformInit/SiliconPolicyPei/SiliconPolicyPeiPreMe > m.inf > +INF $(PLATFORM_BOARD_PACKAGE)/BiosInfo/BiosInfo.inf >=20 > [FV.FvPostMemoryUncompact] > BlockSize =3D $(FLASH_BLOCK_SIZE) > -- > 2.19.1.windows.1 >=20 >=20 >=20