Re: [edk2-devel] [edk2-platforms Patch 21/28] Vlv2TbltDevicePkg: Re-enable BIOS ID feature

2019-07-10 Thread Sun, Zailiang
Reviewed-By: Zailiang Sun 

> -Original Message-
> From: Kinney, Michael D
> Sent: Thursday, July 11, 2019 3:05 AM
> To: devel@edk2.groups.io
> Cc: Sun, Zailiang ; Qian, Yi ;
> Gary Lin 
> Subject: [edk2-platforms Patch 21/28] Vlv2TbltDevicePkg: Re-enable BIOS ID
> feature
> 
> 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 
> ---
>  .../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..00
> --- 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
> )$(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;   // 0x
> -} BIOS_ID_STRING;
> -
> -#define MEM_IFWIVER_START   0x7E
> -#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_SUCCESSBIOS 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..00
> --- a/Platform/Intel/Vlv2TbltDevicePkg/Library/BiosIdLib/BiosIdLib.c
> +++ /dev/null
> @@ -1,98 +0,0 @@
> -/*++

[edk2-devel] [edk2-platforms Patch 21/28] Vlv2TbltDevicePkg: Re-enable BIOS ID feature

2019-07-10 Thread Michael D Kinney
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 
---
 .../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..00
--- 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)$(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;   // 0x
-} BIOS_ID_STRING;
-
-#define MEM_IFWIVER_START   0x7E
-#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_SUCCESSBIOS 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..00
--- 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 
-#include 
-
-#include 
-
-/**
-  This function returns the Version & Release Date and Time by getting and 
converting
-  BIOS ID.
-
-  @param BiosVersion  The Bios