public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: devel@edk2.groups.io
Cc: Zailiang Sun <zailiang.sun@intel.com>,
	Yi Qian <yi.qian@intel.com>, Gary Lin <glin@suse.com>
Subject: [edk2-platforms Patch 21/28] Vlv2TbltDevicePkg: Re-enable BIOS ID feature
Date: Wed, 10 Jul 2019 12:05:09 -0700	[thread overview]
Message-ID: <20190710190516.6012-22-michael.d.kinney@intel.com> (raw)
In-Reply-To: <20190710190516.6012-1-michael.d.kinney@intel.com>

Add back BIOSID feature using GenBiosId.py script and
BiosIdLib from the BoardModulePkg.  Remove the VLV2
specific BiosIdLib implementation.

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Cc: Gary Lin <glin@suse.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 .../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/BiosIdLib.h
 delete mode 100644 Platform/Intel/Vlv2TbltDevicePkg/Library/BiosIdLib/BiosIdLib.c
 delete mode 100644 Platform/Intel/Vlv2TbltDevicePkg/Library/BiosIdLib/BiosIdLib.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.<BR>
-
-  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)$(VERSION_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 external 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 conversion.
-  @param[in] 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
-  );
-
-#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 called during runtime
-  or in SMM which should use a RT or SMM library.
-
---*/
-
-#include <PiDxe.h>
-#include <Library/BaseLib.h>
-
-#include <Library/BiosIdLib.h>
-
-/**
-  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 == NULL) && (BiosReleaseDate == NULL) && (BiosReleaseTime == NULL)) {
-    return EFI_INVALID_PARAMETER;
-  }
-
-  if (BiosVersion != NULL) {
-    //
-    // Fill the BiosVersion data from the BIOS ID.
-    //
-    StrCpy (BiosVersion, L"MNW2MAX1.X64.0084.D01");
-  }
-
-  if (BiosReleaseDate != NULL) {
-    //
-    // Fill the build timestamp date from the BIOS ID in the "MM/DD/YY" format.
-    //
-    BiosReleaseDate[0] = L'0';
-    BiosReleaseDate[1] = L'1';
-    BiosReleaseDate[2] = L'/';
-
-    BiosReleaseDate[3] = L'0';
-    BiosReleaseDate[4] = L'1';
-    BiosReleaseDate[5] = L'/';
-
-    //
-    // Add 20 for SMBIOS table
-    // Current Linux kernel will misjudge 09 as year 0, so using 2009 for SMBIOS table
-    //
-    BiosReleaseDate[6] = L'2';
-    BiosReleaseDate[7] = L'0';
-    BiosReleaseDate[8] = L'1';
-    BiosReleaseDate[9] = L'9';
-
-    BiosReleaseDate[10] = L'\0';
-  }
-
-  if (BiosReleaseTime != NULL) {
-
-    //
-    // Fill the build timestamp time from the BIOS ID in the "HH:MM" format.
-    //
-
-    BiosReleaseTime[0] = L'0';
-    BiosReleaseTime[1] = L'0';
-    BiosReleaseTime[2] = L':';
-
-    BiosReleaseTime[3] = L'0';
-    BiosReleaseTime[4] = L'0';
-
-    BiosReleaseTime[5] = L'\0';
-  }
-
-  return  EFI_SUCCESS;
-}
-
diff --git a/Platform/Intel/Vlv2TbltDevicePkg/Library/BiosIdLib/BiosIdLib.inf 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                    = 0x00010005
-  BASE_NAME                      = BiosIdLib
-  FILE_GUID                      = 98546145-64F1-4d2e-814F-6BF963DB7930
-  MODULE_TYPE                    = BASE
-  VERSION_STRING                 = 1.0
-  LIBRARY_CLASS                  = BiosIdLib
-  PI_SPECIFICATION_VERSION       = 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
 
 [LibraryClasses]
   BaseLib
diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkg.fdf b/Platform/Intel/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/StatusCodeHandlerRuntimeDxe.inf
   }
 
+#
+# gBiosIdGuid
+#
+FILE FREEFORM = C3E36D09-8294-4b97-A857-D5288FE33E28 {
+    SECTION RAW = $(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/StatusCodeHandlerRuntimeDxe.inf
   }
 
+#
+# gBiosIdGuid
+#
+FILE FREEFORM = C3E36D09-8294-4b97-A857-D5288FE33E28 {
+    SECTION RAW = $(OUTPUT_DIRECTORY)/$(TARGET)_$(TOOL_CHAIN_TAG)/BiosId.bin
+  }
+
   #
   # EDK II Related Platform codes
   #
diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc b/Platform/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
 
- BiosIdLib|Vlv2TbltDevicePkg/Library/BiosIdLib/BiosIdLib.inf
+ BiosIdLib|BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.inf
  CpuIA32Lib|Vlv2TbltDevicePkg/Library/CpuIA32Lib/CpuIA32Lib.inf
 
   StallSmmLib|Vlv2TbltDevicePkg/Library/StallSmmLib/StallSmmLib.inf
diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc b/Platform/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
 
- BiosIdLib|Vlv2TbltDevicePkg/Library/BiosIdLib/BiosIdLib.inf
+ BiosIdLib|BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.inf
  CpuIA32Lib|Vlv2TbltDevicePkg/Library/CpuIA32Lib/CpuIA32Lib.inf
 
   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
 
- BiosIdLib|Vlv2TbltDevicePkg/Library/BiosIdLib/BiosIdLib.inf
+ BiosIdLib|BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.inf
  CpuIA32Lib|Vlv2TbltDevicePkg/Library/CpuIA32Lib/CpuIA32Lib.inf
 
   StallSmmLib|Vlv2TbltDevicePkg/Library/StallSmmLib/StallSmmLib.inf
diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/PlatformSetupDxe.inf b/Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/PlatformSetupDxe.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
 
 [LibraryClasses]
   BaseLib
diff --git a/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBiosVendorFunction.c b/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBiosVendorFunction.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 = NULL;
-  UINT16                SpaceVer[2]={0x0020,0x0000};
   UINT16                BIOSVersionTemp[100];
 
   ForType0InputData        = (EFI_MISC_BIOS_VENDOR *)RecordData;
@@ -208,49 +202,8 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscBiosVendor)
   TokenToGet = STRING_TOKEN (STR_MISC_BIOS_VERSION);
   Version = SmbiosMiscGetString (TokenToGet);
 
-  ZeroMem (UVerStr, 2*32);
-  ZeroMem (BIOSVersionTemp, 2*100);
+  ZeroMem (BIOSVersionTemp, sizeof (BIOSVersionTemp));
   StrCat (BIOSVersionTemp,Version);
-  Data8 = AllocatePool (SECTOR_SIZE_4KB);
-  ZeroMem (Data8, SECTOR_SIZE_4KB);
-
-  Status = gBS->LocateProtocol (
-                  &gEfiSpiProtocolGuid,
-                  NULL,
-                 (VOID **)&mSpiProtocol
-                 );
-  if (!EFI_ERROR(Status)) {
-    //
-    // Get data form SPI ROM.
-    //
-    Status = FlashRead (
-               MEM_IFWIVER_START,
-               Data8,
-               SECTOR_SIZE_4KB,
-               EnumSpiRegionAll
-               );
-    if (!EFI_ERROR(Status)) {
-      for(LoopIndex = 0; LoopIndex <= SECTOR_SIZE_4KB; LoopIndex++) {
-        IFWIVerStruct = (MANIFEST_OEM_DATA *)(Data8 + LoopIndex);
-        if(IFWIVerStruct->Signature == SIGNATURE_32('$','F','U','D')) {
-          DEBUG ((EFI_D_ERROR, "the IFWI Length is:%d\n", IFWIVerStruct->IFWIVersionLen));
-          if(IFWIVerStruct->IFWIVersionLen < 32) {
-            for(CopyIndex = 0; CopyIndex < IFWIVerStruct->IFWIVersionLen; CopyIndex++) {
-              UVerStr[CopyIndex] = (UINT16)IFWIVerStruct->IFWIVersion[CopyIndex];
-            }
-            UVerStr[CopyIndex] = 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", BIOSVersionTemp));
-          }
-          break;
-        }
-      }
-    }
-  }
-  FreePool(Data8);
-
   VerStrLen = StrLen(BIOSVersionTemp);
   if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {
     return EFI_UNSUPPORTED;
diff --git a/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/SmBiosMiscDxe.inf 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
 
 [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
 
 [LibraryClasses]
   HiiLib
@@ -120,7 +121,6 @@ [Protocols]
   gMemInfoProtocolGuid
   gEfiTdtOperationProtocolGuid
   gDxePchPlatformPolicyProtocolGuid
-  gEfiSpiProtocolGuid
   gEfiSimpleNetworkProtocolGuid
 
 [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 (
 )
 
 echo Ensuring correct build directory is present
+if not exist %WORKSPACE%\Build mkdir %WORKSPACE%\Build
 if "%Arch%"=="IA32" (
+  if not exist %WORKSPACE%\Build\%PLATFORM_NAME%IA32 mkdir %WORKSPACE%\Build\%PLATFORM_NAME%IA32
   set BUILD_PATH=%WORKSPACE%\Build\%PLATFORM_NAME%IA32\%TARGET%_%TOOL_CHAIN_TAG%
 ) else (
+  if not exist %WORKSPACE%\Build\%PLATFORM_NAME% mkdir %WORKSPACE%\Build\%PLATFORM_NAME%
   set BUILD_PATH=%WORKSPACE%\Build\%PLATFORM_NAME%\%TARGET%_%TOOL_CHAIN_TAG%
 )
+if not exist %BUILD_PATH% mkdir %BUILD_PATH%
 
 echo Modifing Conf files for this build...
 :: Remove lines with these tags from target.txt
@@ -234,6 +238,29 @@ echo MAX_CONCURRENT_THREAD_NUMBER = %build_threads%                      >> %WOR
 
 move /Y %WORKSPACE%\Conf\target.txt.tmp %WORKSPACE%\Conf\target.txt >nul
 
+::**********************************************************************
+:: Generate BIOS ID
+::**********************************************************************
+
+echo BOARD_ID       = MNW2MAX >  %BUILD_PATH%/BiosId.env
+echo BOARD_REV      = 1       >> %BUILD_PATH%/BiosId.env
+if "%Arch%"=="IA32" (
+  echo BOARD_EXT      = I32   >> %BUILD_PATH%/BiosId.env
+)
+if "%Arch%"=="X64" (
+  echo BOARD_EXT      = X64   >> %BUILD_PATH%/BiosId.env
+)
+echo VERSION_MAJOR  = 0090    >> %BUILD_PATH%/BiosId.env
+if "%TARGET%"=="DEBUG" (
+  echo BUILD_TYPE     = D     >> %BUILD_PATH%/BiosId.env
+)
+if "%TARGET%"=="RELEASE" (
+  echo BUILD_TYPE     = R     >> %BUILD_PATH%/BiosId.env
+)
+echo VERSION_MINOR  = 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/Vlv2TbltDevicePkg/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
 
 ## Define platform specific environment variables.
+PLATFORM_NAME=Vlv2TbltDevicePkg
 PLATFORM_PACKAGE=Vlv2TbltDevicePkg
 PLATFORM_PKG_PATH=$PLATFORM_PATH/$PLATFORM_PACKAGE
 config_file=$PLATFORM_PKG_PATH/PlatformPkgConfig.dsc
@@ -186,6 +187,51 @@ else
   echo TARGET_ARCH   = IA32 X64                                   >> $WORKSPACE/Conf/target.txt
 fi
 
+
+## Set and Create $BUILD_PATH if necessary
+if [ ! -d ${WORKSPACE}/Build ]; then
+  mkdir ${WORKSPACE}/Build
+fi
+
+if [ $Arch == "IA32" ]; then
+  if [ ! -d ${WORKSPACE}/Build/${PLATFORM_NAME}IA32 ]; then
+    mkdir ${WORKSPACE}/Build/${PLATFORM_NAME}IA32
+  fi
+  BUILD_PATH=${WORKSPACE}/Build/${PLATFORM_NAME}IA32/${TARGET}_${TOOL_CHAIN_TAG}
+else
+  if [ ! -d ${WORKSPACE}/Build/${PLATFORM_NAME} ]; then
+    mkdir ${WORKSPACE}/Build/${PLATFORM_NAME}
+  fi
+  BUILD_PATH=${WORKSPACE}/Build/${PLATFORM_NAME}/${TARGET}_${TOOL_CHAIN_TAG}
+fi
+
+if [ ! -d $BUILD_PATH ]; then
+  mkdir $BUILD_PATH
+fi
+
+##**********************************************************************
+## Generate BIOS ID
+##**********************************************************************
+
+echo BOARD_ID       = MNW2MAX >  $BUILD_PATH/BiosId.env
+echo BOARD_REV      = 1       >> $BUILD_PATH/BiosId.env
+if [ $Arch == "IA32" ]; then
+  echo BOARD_EXT      = I32   >> $BUILD_PATH/BiosId.env
+fi
+if [ $Arch == "X64" ]; then
+  echo BOARD_EXT      = X64   >> $BUILD_PATH/BiosId.env
+fi
+echo VERSION_MAJOR  = 0090    >> $BUILD_PATH/BiosId.env
+if [ $TARGET == "DEBUG" ]; then
+  echo BUILD_TYPE     = D     >> $BUILD_PATH/BiosId.env
+fi
+if [ $TARGET == "RELEASE" ]; then
+  echo BUILD_TYPE     = R     >> $BUILD_PATH/BiosId.env
+fi
+echo VERSION_MINOR  = 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/BiosId.txt
+
 ##**********************************************************************
 ## Build BIOS
 ##**********************************************************************
-- 
2.21.0.windows.1


  parent reply	other threads:[~2019-07-10 19:05 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-10 19:04 [edk2-platforms Patch 00/28] Vlv2TbltDevicePkg: Fix Linux build issues Michael D Kinney
2019-07-10 19:04 ` [edk2-platforms Patch 01/28] Vlv2TbltDevicePkg/Build_IFWI.sh: Add "set -e" to exit on error Michael D Kinney
2019-07-11  4:46   ` Sun, Zailiang
2019-07-12  2:59   ` [edk2-devel] " rebecca
2019-07-10 19:04 ` [edk2-platforms Patch 02/28] Vlv2TbltDevicePkg/Build_IFWI.sh: Change the root directory path Michael D Kinney
2019-07-11  4:47   ` Sun, Zailiang
2019-07-12  3:03   ` [edk2-devel] " rebecca
2019-07-12 16:23     ` Michael D Kinney
2019-07-12 16:32       ` rebecca
2019-07-10 19:04 ` [edk2-platforms Patch 03/28] Vlv2TbltDevicePkg/bld_vlv.sh: Fix the log name Michael D Kinney
2019-07-11  4:47   ` Sun, Zailiang
2019-07-10 19:04 ` [edk2-platforms Patch 04/28] Vlv2TbltDevicePkg/bld_vlv.sh: Update the gcc version detection Michael D Kinney
2019-07-11  4:47   ` Sun, Zailiang
2019-07-10 19:04 ` [edk2-platforms Patch 05/28] Vlv2TbltDevicePkg/bld_vlv.sh: Remove ECP completely Michael D Kinney
2019-07-11  4:47   ` Sun, Zailiang
2019-07-10 19:04 ` [edk2-platforms Patch 06/28] Vlv2TbltDevicePkg/bld_vlv.sh: Update the script to fit edk2-platforms Michael D Kinney
2019-07-11  4:48   ` Sun, Zailiang
2019-07-10 19:04 ` [edk2-platforms Patch 07/28] Vlv2TbltDevicePkg: Add the missing headers to inf files Michael D Kinney
2019-07-11  4:48   ` Sun, Zailiang
2019-07-10 19:04 ` [edk2-platforms Patch 08/28] Vlv2TbltDevicePkg/bld_vlv.sh: Remove BiosId.env completely Michael D Kinney
2019-07-11  4:48   ` Sun, Zailiang
2019-07-10 19:04 ` [edk2-platforms Patch 09/28] Vlv2TbltDevicePkg/bld_vlv.sh: Correct the path to PlatformCapsuleGcc.dsc Michael D Kinney
2019-07-11  4:48   ` Sun, Zailiang
2019-07-10 19:04 ` [edk2-platforms Patch 10/28] Vlv2TbltDevicePkg/bld_vlv.sh: Create Vlv.ROM Michael D Kinney
2019-07-11  4:52   ` Sun, Zailiang
2019-07-11  6:08     ` [edk2-devel] " Gary Lin
2019-07-12 23:42       ` Michael D Kinney
2019-07-13  4:17         ` Sun, Zailiang
2019-07-10 19:04 ` [edk2-platforms Patch 11/28] Vlv2TbltDevicePkg/GenerateCapsule: Fix the bash scripts Michael D Kinney
2019-07-12  2:37   ` Sun, Zailiang
2019-07-10 19:05 ` [edk2-platforms Patch 12/28] Vlv2TbltDevicePkg/AcpiPlatform: Remove a unused variable Michael D Kinney
2019-07-12  2:37   ` Sun, Zailiang
2019-07-10 19:05 ` [edk2-platforms Patch 13/28] Vlv2TbltDevicePkg/AcpiPlatform: Fix the error from InstallAcpiTable Michael D Kinney
2019-07-12  2:37   ` Sun, Zailiang
2019-07-10 19:05 ` [edk2-platforms Patch 14/28] Vlv2TbltDevicePkg/SmBiosMiscDxe: Fix the indentation Michael D Kinney
2019-07-12  2:37   ` Sun, Zailiang
2019-07-10 19:05 ` [edk2-platforms Patch 15/28] Vlv2TbltDevicePkg: Import SD/MMC drivers Michael D Kinney
2019-07-12  2:37   ` [edk2-devel] " Sun, Zailiang
2019-07-10 19:05 ` [edk2-platforms Patch 16/28] Vlv2TbltDevicePkg: Update Linux build scripts Michael D Kinney
2019-07-11  4:55   ` [edk2-devel] " Sun, Zailiang
2019-07-10 19:05 ` [edk2-platforms Patch 17/28] Vlvt2TbltDevicePkg: Fix NULL pointer access in SmbiosMiscDxe Michael D Kinney
2019-07-11  4:53   ` Sun, Zailiang
2019-07-10 19:05 ` [edk2-platforms Patch 18/28] Vlv2TbltDevicePkg/Build_IFWI.sh: Check the WORKSPACE env variable Michael D Kinney
2019-07-12  2:37   ` Sun, Zailiang
2019-07-10 19:05 ` [edk2-platforms Patch 19/28] Vlv2DeviceRefCodePkg: Remove redundant gEfiSpiProtocolGuid Michael D Kinney
2019-07-11  4:53   ` Sun, Zailiang
2019-07-10 19:05 ` [edk2-platforms Patch 20/28] Vlv2TbltDevicePkg: " Michael D Kinney
2019-07-11  4:53   ` Sun, Zailiang
2019-07-10 19:05 ` Michael D Kinney [this message]
2019-07-11  4:54   ` [edk2-platforms Patch 21/28] Vlv2TbltDevicePkg: Re-enable BIOS ID feature Sun, Zailiang
2019-07-10 19:05 ` [edk2-platforms Patch 22/28] Vlv2TbltDevicePkg: Add GCC IA32 build support Michael D Kinney
2019-07-11  4:54   ` Sun, Zailiang
2019-07-10 19:05 ` [edk2-platforms Patch 23/28] Vlv2TbltDevicePkg: Import TlsLib for HTTPS Boot Michael D Kinney
2019-07-12  2:38   ` [edk2-devel] " Sun, Zailiang
2019-07-12  3:34   ` rebecca
2019-07-10 19:05 ` [edk2-platforms Patch 24/28] Vlv2TbltDevicePkg: Reorganize the libraries Michael D Kinney
2019-07-12  2:38   ` Sun, Zailiang
2019-07-10 19:05 ` [edk2-platforms Patch 25/28] Vlv2DeviceRefCodePlg/AcpiTablesPCAT: Fix ASL error Michael D Kinney
2019-07-11  4:54   ` Sun, Zailiang
2019-07-10 19:05 ` [edk2-platforms Patch 26/28] Vlv2TbltDevicePkg: Clean up all build scripts Michael D Kinney
2019-07-11  4:55   ` Sun, Zailiang
2019-07-12  3:39   ` [edk2-devel] " rebecca
2019-07-12 18:16     ` Michael D Kinney
2019-07-10 19:05 ` [edk2-platforms Patch 27/28] Vlv2TbltDevicePkg: Only build capsules for X64 Michael D Kinney
2019-07-11  4:55   ` Sun, Zailiang
2019-07-10 19:05 ` [edk2-platforms Patch 28/28] Vlv2TbltDevicePkg: Update Readme.md for multiple repos Michael D Kinney
2019-07-11  4:55   ` Sun, Zailiang
2019-07-12  2:38 ` [edk2-platforms Patch 00/28] Vlv2TbltDevicePkg: Fix Linux build issues Sun, Zailiang
2019-07-13  0:18 ` [edk2-devel] " Michael D Kinney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190710190516.6012-22-michael.d.kinney@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox