From nobody Tue Apr 23 06:16:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+43517+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43517+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1562785524; cv=none; d=zoho.com; s=zohoarc; b=GdJRa2I+qiUAfe8tOtexivnNq30FhpTQYUV/RsUXvuX2d1ZC8ZGDv4xYGp1PRrtigAwVxi5y+uoNX+VoorVGQEHwx6NZrgi8yl1+hVTHF0xPCndRPygPhCbYtxulBluTMCe0Cgahb2hP7SFf+aBRFiNjQ6F/4VwlegYgizwKxBQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562785524; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=3BXjr51TYbcBPbNfSD66qOVNhQY7m/koE8UuDvhDfMM=; b=P2vNlpMPEasqeLJL/dwz6A6NNGMNAt2rJiazwPS2tSdfVacvALmKIOks0+cTBTwh32zuQPJJ7yd9tIeSSTozLhPwHLH9xkP7a2rMgwu2q91AD3hpK9Ke7j4y+vIpy1l4cv5ESrx0/EV551YGn1aOThfGA1AWQrmz+keyv/ieKsQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43517+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1562785524560460.59664259437784; Wed, 10 Jul 2019 12:05:24 -0700 (PDT) Return-Path: X-Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by groups.io with SMTP; Wed, 10 Jul 2019 12:05:22 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jul 2019 12:05:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,475,1557212400"; d="scan'208";a="171008214" X-Received: from mdkinney-mobl2.amr.corp.intel.com ([10.241.98.74]) by orsmga006.jf.intel.com with ESMTP; 10 Jul 2019 12:05:20 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Zailiang Sun , Yi Qian , Gary Lin Subject: [edk2-devel] [edk2-platforms Patch 21/28] Vlv2TbltDevicePkg: Re-enable BIOS ID feature Date: Wed, 10 Jul 2019 12:05:09 -0700 Message-Id: <20190710190516.6012-22-michael.d.kinney@intel.com> In-Reply-To: <20190710190516.6012-1-michael.d.kinney@intel.com> References: <20190710190516.6012-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,michael.d.kinney@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1562785524; bh=ABn2MvC9etRntki8PB/MKbYCAafqeSKxpWBPnrp89vg=; h=Cc:Date:From:Reply-To:Subject:To; b=IS350LkYP0vdRouUXyIz9NVuNO/+94gtirS+zgcv3atCuOgIKSlEotfX+Q8iHvlZZ+q Lw9HhmnUytzJ3FOfAdAGda99K3rJGxfVeHReE7bz+iU0Kw5GkyxyegIv8OROv8gtHa4bA UvKs0gJXRhG6khVVT+3bTGw8ZFs4FgNeO3M= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Add back BIOSID feature using GenBiosId.py script and BiosIdLib from the BoardModulePkg. Remove the VLV2 specific BiosIdLib implementation. Cc: Zailiang Sun Cc: Yi Qian Cc: Gary Lin Signed-off-by: Michael D Kinney Reviewed-By: Zailiang Sun --- .../Include/Library/BiosIdLib.h | 86 ---------------- .../Library/BiosIdLib/BiosIdLib.c | 98 ------------------- .../Library/BiosIdLib/BiosIdLib.inf | 33 ------- .../PlatformDxe/PlatformDxe.inf | 5 +- .../Intel/Vlv2TbltDevicePkg/PlatformPkg.fdf | 7 ++ .../Vlv2TbltDevicePkg/PlatformPkgGcc.fdf | 7 ++ .../Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc | 2 +- .../Vlv2TbltDevicePkg/PlatformPkgIA32.dsc | 2 +- .../Vlv2TbltDevicePkg/PlatformPkgX64.dsc | 2 +- .../PlatformSetupDxe/PlatformSetupDxe.inf | 3 +- .../SmBiosMiscDxe/MiscBiosVendorFunction.c | 49 +--------- .../SmBiosMiscDxe/SmBiosMiscDxe.inf | 8 +- Platform/Intel/Vlv2TbltDevicePkg/bld_vlv.bat | 27 +++++ Platform/Intel/Vlv2TbltDevicePkg/bld_vlv.sh | 46 +++++++++ 14 files changed, 100 insertions(+), 275 deletions(-) delete mode 100644 Platform/Intel/Vlv2TbltDevicePkg/Include/Library/BiosId= Lib.h delete mode 100644 Platform/Intel/Vlv2TbltDevicePkg/Library/BiosIdLib/Bios= IdLib.c delete mode 100644 Platform/Intel/Vlv2TbltDevicePkg/Library/BiosIdLib/Bios= IdLib.inf diff --git a/Platform/Intel/Vlv2TbltDevicePkg/Include/Library/BiosIdLib.h b= /Platform/Intel/Vlv2TbltDevicePkg/Include/Library/BiosIdLib.h deleted file mode 100644 index bd08c9a80f..0000000000 --- a/Platform/Intel/Vlv2TbltDevicePkg/Include/Library/BiosIdLib.h +++ /dev/null @@ -1,86 +0,0 @@ -/*++ - - Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
- - SPDX-License-Identifier: BSD-2-Clause-Patent - -Module Name: - - BiosIdLib.h - -Abstract: - - BIOS ID library definitions. - - This library provides functions to get BIOS ID, VERSION, DATE and TIME - ---*/ - -#ifndef _BIOS_ID_LIB_H_ -#define _BIOS_ID_LIB_H_ - -// -// BIOS ID string format: -// -// $(BOARD_ID)$(BOARD_REV).$(OEM_ID).$(VERSION_MAJOR).$(BUILD_TYPE)$(VERSI= ON_MINOR).YYMMDDHHMM -// -// Example: "TRFTCRB1.86C.0008.D03.0506081529" -// -#pragma pack(1) - -typedef struct { - CHAR16 BoardId[7]; // "TRFTCRB" - CHAR16 BoardRev; // "1" - CHAR16 Dot1; // "." - CHAR16 OemId[3]; // "86C" - CHAR16 Dot2; // "." - CHAR16 VersionMajor[4]; // "0008" - CHAR16 Dot3; // "." - CHAR16 BuildType; // "D" - CHAR16 VersionMinor[2]; // "03" - CHAR16 Dot4; // "." - CHAR16 TimeStamp[10]; // "YYMMDDHHMM" - CHAR16 NullTerminator; // 0x0000 -} BIOS_ID_STRING; - -#define MEM_IFWIVER_START 0x7E0000 -#define MEM_IFWIVER_LENGTH 0x1000 - -typedef struct _MANIFEST_OEM_DATA{ - UINT32 Signature; - unsigned char FillNull[0x39]; - UINT32 IFWIVersionLen; - unsigned char IFWIVersion[32]; -}MANIFEST_OEM_DATA; - -// -// A signature precedes the BIOS ID string in the FV to enable search by e= xternal tools. -// -typedef struct { - UINT8 Signature[8]; // "$IBIOSI$" - BIOS_ID_STRING BiosIdString; // "TRFTCRB1.86C.0008.D03.0506081529" -} BIOS_ID_IMAGE; - -#pragma pack() - -/** - This function returns the Version & Release Date and Time by getting and= converting - BIOS ID. - - @param[in] BiosVersion The Bios Version out of the conversion. - @param[in] BiosReleaseDate The Bios Release Date out of the conversi= on. - @param[in] BiosReleaseTime The Bios Release Time out of the conversi= on. - - @retval EFI_SUCCESS BIOS Version & Release Date and Time have= been got successfully. - @retval EFI_NOT_FOUND BiosId image is not found, and no paramet= er will be modified. - @retval EFI_INVALID_PARAMETER All the parameters are NULL. - -**/ -EFI_STATUS -GetBiosVersionDateTime ( - OUT CHAR16 *BiosVersion, OPTIONAL - OUT CHAR16 *BiosReleaseDate, OPTIONAL - OUT CHAR16 *BiosReleaseTime OPTIONAL - ); - -#endif diff --git a/Platform/Intel/Vlv2TbltDevicePkg/Library/BiosIdLib/BiosIdLib.c= b/Platform/Intel/Vlv2TbltDevicePkg/Library/BiosIdLib/BiosIdLib.c deleted file mode 100644 index f6ab37313c..0000000000 --- a/Platform/Intel/Vlv2TbltDevicePkg/Library/BiosIdLib/BiosIdLib.c +++ /dev/null @@ -1,98 +0,0 @@ -/*++ - -Copyright (c) 2011 - 2019, Intel Corporation. All rights reserved - - SPDX-License-Identifier: BSD-2-Clause-Patent - -Module Name: - - BiosIdLib.c - -Abstract: - - Boot service DXE BIOS ID library implementation. - - These functions in this file can be called during DXE and cannot be call= ed during runtime - or in SMM which should use a RT or SMM library. - ---*/ - -#include -#include - -#include - -/** - This function returns the Version & Release Date and Time by getting and= converting - BIOS ID. - - @param BiosVersion The Bios Version out of the conversion. - @param BiosReleaseDate The Bios Release Date out of the conversion. - @param BiosReleaseTime - The Bios Release Time out of the conversion. - - @retval EFI_SUCCESS - BIOS Version & Release Date and Time have been got= successfully. - @retval EFI_NOT_FOUND - BiosId image is not found, and no parameter will= be modified. - @retval EFI_INVALID_PARAMETER - All the parameters are NULL. - -**/ -EFI_STATUS -GetBiosVersionDateTime ( - OUT CHAR16 *BiosVersion, OPTIONAL - OUT CHAR16 *BiosReleaseDate, OPTIONAL - OUT CHAR16 *BiosReleaseTime OPTIONAL - ) -{ - if ((BiosVersion =3D=3D NULL) && (BiosReleaseDate =3D=3D NULL) && (BiosR= eleaseTime =3D=3D NULL)) { - return EFI_INVALID_PARAMETER; - } - - if (BiosVersion !=3D NULL) { - // - // Fill the BiosVersion data from the BIOS ID. - // - StrCpy (BiosVersion, L"MNW2MAX1.X64.0084.D01"); - } - - if (BiosReleaseDate !=3D NULL) { - // - // Fill the build timestamp date from the BIOS ID in the "MM/DD/YY" fo= rmat. - // - BiosReleaseDate[0] =3D L'0'; - BiosReleaseDate[1] =3D L'1'; - BiosReleaseDate[2] =3D L'/'; - - BiosReleaseDate[3] =3D L'0'; - BiosReleaseDate[4] =3D L'1'; - BiosReleaseDate[5] =3D L'/'; - - // - // Add 20 for SMBIOS table - // Current Linux kernel will misjudge 09 as year 0, so using 2009 for = SMBIOS table - // - BiosReleaseDate[6] =3D L'2'; - BiosReleaseDate[7] =3D L'0'; - BiosReleaseDate[8] =3D L'1'; - BiosReleaseDate[9] =3D L'9'; - - BiosReleaseDate[10] =3D L'\0'; - } - - if (BiosReleaseTime !=3D NULL) { - - // - // Fill the build timestamp time from the BIOS ID in the "HH:MM" forma= t. - // - - BiosReleaseTime[0] =3D L'0'; - BiosReleaseTime[1] =3D L'0'; - BiosReleaseTime[2] =3D L':'; - - BiosReleaseTime[3] =3D L'0'; - BiosReleaseTime[4] =3D L'0'; - - BiosReleaseTime[5] =3D L'\0'; - } - - return EFI_SUCCESS; -} - diff --git a/Platform/Intel/Vlv2TbltDevicePkg/Library/BiosIdLib/BiosIdLib.i= nf b/Platform/Intel/Vlv2TbltDevicePkg/Library/BiosIdLib/BiosIdLib.inf deleted file mode 100644 index 0d38d73ada..0000000000 --- a/Platform/Intel/Vlv2TbltDevicePkg/Library/BiosIdLib/BiosIdLib.inf +++ /dev/null @@ -1,33 +0,0 @@ -#/*++ -# -# Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -# Module Name: -# -# BiosIdLib.inf -# -# Abstract: -# -# Component description file for BIOS ID library -# -#--*/ -[Defines] - INF_VERSION =3D 0x00010005 - BASE_NAME =3D BiosIdLib - FILE_GUID =3D 98546145-64F1-4d2e-814F-6BF963DB7930 - MODULE_TYPE =3D BASE - VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D BiosIdLib - PI_SPECIFICATION_VERSION =3D 0x0001000A - -[Sources] - BiosIdLib.c - -[Packages] - MdePkg/MdePkg.dec - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - Vlv2DeviceRefCodePkg/Vlv2DeviceRefCodePkg.dec - Vlv2TbltDevicePkg/PlatformPkg.dec diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformDxe/PlatformDxe.inf b= /Platform/Intel/Vlv2TbltDevicePkg/PlatformDxe/PlatformDxe.inf index 9fee691365..88c9b36cb1 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformDxe/PlatformDxe.inf +++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformDxe/PlatformDxe.inf @@ -48,10 +48,11 @@ [sources.common] [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec - Vlv2TbltDevicePkg/PlatformPkg.dec - Vlv2DeviceRefCodePkg/Vlv2DeviceRefCodePkg.dec SecurityPkg/SecurityPkg.dec CryptoPkg/CryptoPkg.dec + BoardModulePkg/BoardModulePkg.dec + Vlv2TbltDevicePkg/PlatformPkg.dec + Vlv2DeviceRefCodePkg/Vlv2DeviceRefCodePkg.dec =20 [LibraryClasses] BaseLib diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkg.fdf b/Platform/In= tel/Vlv2TbltDevicePkg/PlatformPkg.fdf index c538fe4a06..dd4550dd88 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkg.fdf +++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkg.fdf @@ -382,6 +382,13 @@ [FV.FVMAIN] INF MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandl= erRuntimeDxe.inf } =20 +# +# gBiosIdGuid +# +FILE FREEFORM =3D C3E36D09-8294-4b97-A857-D5288FE33E28 { + SECTION RAW =3D $(OUTPUT_DIRECTORY)/$(TARGET)_$(TOOL_CHAIN_TAG)/BiosId= .bin + } + # # EDK II Related Platform codes # diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgGcc.fdf b/Platform= /Intel/Vlv2TbltDevicePkg/PlatformPkgGcc.fdf index bd9d415939..b6e8e40582 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgGcc.fdf +++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgGcc.fdf @@ -331,6 +331,13 @@ [FV.FVMAIN] INF MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandl= erRuntimeDxe.inf } =20 +# +# gBiosIdGuid +# +FILE FREEFORM =3D C3E36D09-8294-4b97-A857-D5288FE33E28 { + SECTION RAW =3D $(OUTPUT_DIRECTORY)/$(TARGET)_$(TOOL_CHAIN_TAG)/BiosId= .bin + } + # # EDK II Related Platform codes # diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc b/Platf= orm/Intel/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc index 6317bc1342..26c1caad94 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc +++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc @@ -221,7 +221,7 @@ [LibraryClasses.common] OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf !endif =20 - BiosIdLib|Vlv2TbltDevicePkg/Library/BiosIdLib/BiosIdLib.inf + BiosIdLib|BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.inf CpuIA32Lib|Vlv2TbltDevicePkg/Library/CpuIA32Lib/CpuIA32Lib.inf =20 StallSmmLib|Vlv2TbltDevicePkg/Library/StallSmmLib/StallSmmLib.inf diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc b/Platfor= m/Intel/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc index 8f69bb47dd..dc6d8b1b26 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc +++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc @@ -219,7 +219,7 @@ [LibraryClasses.common] OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf !endif =20 - BiosIdLib|Vlv2TbltDevicePkg/Library/BiosIdLib/BiosIdLib.inf + BiosIdLib|BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.inf CpuIA32Lib|Vlv2TbltDevicePkg/Library/CpuIA32Lib/CpuIA32Lib.inf =20 StallSmmLib|Vlv2TbltDevicePkg/Library/StallSmmLib/StallSmmLib.inf diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgX64.dsc b/Platform= /Intel/Vlv2TbltDevicePkg/PlatformPkgX64.dsc index d146321750..cbc87aa9be 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgX64.dsc +++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgX64.dsc @@ -221,7 +221,7 @@ [LibraryClasses.common] OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf !endif =20 - BiosIdLib|Vlv2TbltDevicePkg/Library/BiosIdLib/BiosIdLib.inf + BiosIdLib|BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.inf CpuIA32Lib|Vlv2TbltDevicePkg/Library/CpuIA32Lib/CpuIA32Lib.inf =20 StallSmmLib|Vlv2TbltDevicePkg/Library/StallSmmLib/StallSmmLib.inf diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/PlatformSetu= pDxe.inf b/Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/PlatformSetupD= xe.inf index 85e8b1e8d6..8ff246041d 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/PlatformSetupDxe.inf +++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/PlatformSetupDxe.inf @@ -60,9 +60,10 @@ [Sources] [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec + SecurityPkg/SecurityPkg.dec + BoardModulePkg/BoardModulePkg.dec Vlv2TbltDevicePkg/PlatformPkg.dec Vlv2DeviceRefCodePkg/Vlv2DeviceRefCodePkg.dec #for PchAccess.h - SecurityPkg/SecurityPkg.dec =20 [LibraryClasses] BaseLib diff --git a/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBiosVendorF= unction.c b/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBiosVendorFu= nction.c index fb4fa820a5..0fbd5ac0bd 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBiosVendorFunction= .c +++ b/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBiosVendorFunction= .c @@ -163,12 +163,6 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscBiosVendor) SMBIOS_TABLE_TYPE0 *SmbiosRecord; EFI_SMBIOS_HANDLE SmbiosHandle; EFI_MISC_BIOS_VENDOR *ForType0InputData; - UINT16 UVerStr[32]; - UINTN LoopIndex; - UINTN CopyIndex; - MANIFEST_OEM_DATA *IFWIVerStruct; - UINT8 *Data8 =3D NULL; - UINT16 SpaceVer[2]=3D{0x0020,0x0000}; UINT16 BIOSVersionTemp[100]; =20 ForType0InputData =3D (EFI_MISC_BIOS_VENDOR *)RecordData; @@ -208,49 +202,8 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscBiosVendor) TokenToGet =3D STRING_TOKEN (STR_MISC_BIOS_VERSION); Version =3D SmbiosMiscGetString (TokenToGet); =20 - ZeroMem (UVerStr, 2*32); - ZeroMem (BIOSVersionTemp, 2*100); + ZeroMem (BIOSVersionTemp, sizeof (BIOSVersionTemp)); StrCat (BIOSVersionTemp,Version); - Data8 =3D AllocatePool (SECTOR_SIZE_4KB); - ZeroMem (Data8, SECTOR_SIZE_4KB); - - Status =3D gBS->LocateProtocol ( - &gEfiSpiProtocolGuid, - NULL, - (VOID **)&mSpiProtocol - ); - if (!EFI_ERROR(Status)) { - // - // Get data form SPI ROM. - // - Status =3D FlashRead ( - MEM_IFWIVER_START, - Data8, - SECTOR_SIZE_4KB, - EnumSpiRegionAll - ); - if (!EFI_ERROR(Status)) { - for(LoopIndex =3D 0; LoopIndex <=3D SECTOR_SIZE_4KB; LoopIndex++) { - IFWIVerStruct =3D (MANIFEST_OEM_DATA *)(Data8 + LoopIndex); - if(IFWIVerStruct->Signature =3D=3D SIGNATURE_32('$','F','U','D')) { - DEBUG ((EFI_D_ERROR, "the IFWI Length is:%d\n", IFWIVerStruct->I= FWIVersionLen)); - if(IFWIVerStruct->IFWIVersionLen < 32) { - for(CopyIndex =3D 0; CopyIndex < IFWIVerStruct->IFWIVersionLen= ; CopyIndex++) { - UVerStr[CopyIndex] =3D (UINT16)IFWIVerStruct->IFWIVersion[Co= pyIndex]; - } - UVerStr[CopyIndex] =3D 0x0000; - DEBUG ((EFI_D_ERROR, "The IFWI Version is :%s,the IFWI Length = is:%d\n", UVerStr,IFWIVerStruct->IFWIVersionLen)); - StrCat(BIOSVersionTemp,SpaceVer); - StrCat(BIOSVersionTemp,UVerStr); - DEBUG ((EFI_D_ERROR, "The BIOS and IFWI Version is :%s\n", BIO= SVersionTemp)); - } - break; - } - } - } - } - FreePool(Data8); - VerStrLen =3D StrLen(BIOSVersionTemp); if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) { return EFI_UNSUPPORTED; diff --git a/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/SmBiosMiscDxe.i= nf b/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/SmBiosMiscDxe.inf index 92b51b1743..016fb53b18 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/SmBiosMiscDxe.inf +++ b/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/SmBiosMiscDxe.inf @@ -81,12 +81,13 @@ [Sources] MiscMemoryDeviceFunction.c =20 [Packages] - MdeModulePkg/MdeModulePkg.dec - Vlv2TbltDevicePkg/PlatformPkg.dec MdePkg/MdePkg.dec - Vlv2DeviceRefCodePkg/Vlv2DeviceRefCodePkg.dec + MdeModulePkg/MdeModulePkg.dec NetworkPkg/NetworkPkg.dec UefiCpuPkg/UefiCpuPkg.dec + BoardModulePkg/BoardModulePkg.dec + Vlv2TbltDevicePkg/PlatformPkg.dec + Vlv2DeviceRefCodePkg/Vlv2DeviceRefCodePkg.dec =20 [LibraryClasses] HiiLib @@ -120,7 +121,6 @@ [Protocols] gMemInfoProtocolGuid gEfiTdtOperationProtocolGuid gDxePchPlatformPolicyProtocolGuid - gEfiSpiProtocolGuid gEfiSimpleNetworkProtocolGuid =20 [Pcd] diff --git a/Platform/Intel/Vlv2TbltDevicePkg/bld_vlv.bat b/Platform/Intel/= Vlv2TbltDevicePkg/bld_vlv.bat index 5cae78bb6d..ffd6722582 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/bld_vlv.bat +++ b/Platform/Intel/Vlv2TbltDevicePkg/bld_vlv.bat @@ -207,11 +207,15 @@ if defined VS140COMNTOOLS ( ) =20 echo Ensuring correct build directory is present +if not exist %WORKSPACE%\Build mkdir %WORKSPACE%\Build if "%Arch%"=3D=3D"IA32" ( + if not exist %WORKSPACE%\Build\%PLATFORM_NAME%IA32 mkdir %WORKSPACE%\Bui= ld\%PLATFORM_NAME%IA32 set BUILD_PATH=3D%WORKSPACE%\Build\%PLATFORM_NAME%IA32\%TARGET%_%TOOL_CH= AIN_TAG% ) else ( + if not exist %WORKSPACE%\Build\%PLATFORM_NAME% mkdir %WORKSPACE%\Build\%= PLATFORM_NAME% set BUILD_PATH=3D%WORKSPACE%\Build\%PLATFORM_NAME%\%TARGET%_%TOOL_CHAIN_= TAG% ) +if not exist %BUILD_PATH% mkdir %BUILD_PATH% =20 echo Modifing Conf files for this build... :: Remove lines with these tags from target.txt @@ -234,6 +238,29 @@ echo MAX_CONCURRENT_THREAD_NUMBER =3D %build_threads% = >> %WOR =20 move /Y %WORKSPACE%\Conf\target.txt.tmp %WORKSPACE%\Conf\target.txt >nul =20 +::********************************************************************** +:: Generate BIOS ID +::********************************************************************** + +echo BOARD_ID =3D MNW2MAX > %BUILD_PATH%/BiosId.env +echo BOARD_REV =3D 1 >> %BUILD_PATH%/BiosId.env +if "%Arch%"=3D=3D"IA32" ( + echo BOARD_EXT =3D I32 >> %BUILD_PATH%/BiosId.env +) +if "%Arch%"=3D=3D"X64" ( + echo BOARD_EXT =3D X64 >> %BUILD_PATH%/BiosId.env +) +echo VERSION_MAJOR =3D 0090 >> %BUILD_PATH%/BiosId.env +if "%TARGET%"=3D=3D"DEBUG" ( + echo BUILD_TYPE =3D D >> %BUILD_PATH%/BiosId.env +) +if "%TARGET%"=3D=3D"RELEASE" ( + echo BUILD_TYPE =3D R >> %BUILD_PATH%/BiosId.env +) +echo VERSION_MINOR =3D 01 >> %BUILD_PATH%/BiosId.env + +%WORKSPACE%\edk2-platforms\Platform\Intel\Tools\GenBiosId\GenBiosId.py -i = %BUILD_PATH%/BiosId.env -o %BUILD_PATH%/BiosId.bin -ot %BUILD_PATH%/BiosId.= txt + ::********************************************************************** :: Build BIOS ::********************************************************************** diff --git a/Platform/Intel/Vlv2TbltDevicePkg/bld_vlv.sh b/Platform/Intel/V= lv2TbltDevicePkg/bld_vlv.sh index aac8534677..03fa062310 100755 --- a/Platform/Intel/Vlv2TbltDevicePkg/bld_vlv.sh +++ b/Platform/Intel/Vlv2TbltDevicePkg/bld_vlv.sh @@ -66,6 +66,7 @@ cd $CORE_PATH make -C BaseTools =20 ## Define platform specific environment variables. +PLATFORM_NAME=3DVlv2TbltDevicePkg PLATFORM_PACKAGE=3DVlv2TbltDevicePkg PLATFORM_PKG_PATH=3D$PLATFORM_PATH/$PLATFORM_PACKAGE config_file=3D$PLATFORM_PKG_PATH/PlatformPkgConfig.dsc @@ -186,6 +187,51 @@ else echo TARGET_ARCH =3D IA32 X64 >> $WO= RKSPACE/Conf/target.txt fi =20 + +## Set and Create $BUILD_PATH if necessary +if [ ! -d ${WORKSPACE}/Build ]; then + mkdir ${WORKSPACE}/Build +fi + +if [ $Arch =3D=3D "IA32" ]; then + if [ ! -d ${WORKSPACE}/Build/${PLATFORM_NAME}IA32 ]; then + mkdir ${WORKSPACE}/Build/${PLATFORM_NAME}IA32 + fi + BUILD_PATH=3D${WORKSPACE}/Build/${PLATFORM_NAME}IA32/${TARGET}_${TOOL_CH= AIN_TAG} +else + if [ ! -d ${WORKSPACE}/Build/${PLATFORM_NAME} ]; then + mkdir ${WORKSPACE}/Build/${PLATFORM_NAME} + fi + BUILD_PATH=3D${WORKSPACE}/Build/${PLATFORM_NAME}/${TARGET}_${TOOL_CHAIN_= TAG} +fi + +if [ ! -d $BUILD_PATH ]; then + mkdir $BUILD_PATH +fi + +##********************************************************************** +## Generate BIOS ID +##********************************************************************** + +echo BOARD_ID =3D MNW2MAX > $BUILD_PATH/BiosId.env +echo BOARD_REV =3D 1 >> $BUILD_PATH/BiosId.env +if [ $Arch =3D=3D "IA32" ]; then + echo BOARD_EXT =3D I32 >> $BUILD_PATH/BiosId.env +fi +if [ $Arch =3D=3D "X64" ]; then + echo BOARD_EXT =3D X64 >> $BUILD_PATH/BiosId.env +fi +echo VERSION_MAJOR =3D 0090 >> $BUILD_PATH/BiosId.env +if [ $TARGET =3D=3D "DEBUG" ]; then + echo BUILD_TYPE =3D D >> $BUILD_PATH/BiosId.env +fi +if [ $TARGET =3D=3D "RELEASE" ]; then + echo BUILD_TYPE =3D R >> $BUILD_PATH/BiosId.env +fi +echo VERSION_MINOR =3D 01 >> $BUILD_PATH/BiosId.env + +python $WORKSPACE/edk2-platforms/Platform/Intel/Tools/GenBiosId/GenBiosId.= py -i $BUILD_PATH/BiosId.env -o $BUILD_PATH/BiosId.bin -ot $BUILD_PATH/Bios= Id.txt + ##********************************************************************** ## Build BIOS ##********************************************************************** --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#43517): https://edk2.groups.io/g/devel/message/43517 Mute This Topic: https://groups.io/mt/32419750/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-