summaryrefslogtreecommitdiff
path: root/Platform/Intel/MinPlatformPkg/Include/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Platform/Intel/MinPlatformPkg/Include/Library')
-rw-r--r--Platform/Intel/MinPlatformPkg/Include/Library/AslUpdateLib.h146
-rw-r--r--Platform/Intel/MinPlatformPkg/Include/Library/BoardAcpiEnableLib.h33
-rw-r--r--Platform/Intel/MinPlatformPkg/Include/Library/BoardAcpiTableLib.h28
-rw-r--r--Platform/Intel/MinPlatformPkg/Include/Library/BoardInitLib.h92
-rw-r--r--Platform/Intel/MinPlatformPkg/Include/Library/FspPolicyInitLib.h30
-rw-r--r--Platform/Intel/MinPlatformPkg/Include/Library/FspPolicyUpdateLib.h30
-rw-r--r--Platform/Intel/MinPlatformPkg/Include/Library/HobVariableLib.h111
-rw-r--r--Platform/Intel/MinPlatformPkg/Include/Library/MultiBoardAcpiSupportLib.h60
-rw-r--r--Platform/Intel/MinPlatformPkg/Include/Library/MultiBoardInitSupportLib.h85
-rw-r--r--Platform/Intel/MinPlatformPkg/Include/Library/PeiLib.h85
-rw-r--r--Platform/Intel/MinPlatformPkg/Include/Library/SecBoardInitLib.h38
-rw-r--r--Platform/Intel/MinPlatformPkg/Include/Library/SpiFlashCommonLib.h104
-rw-r--r--Platform/Intel/MinPlatformPkg/Include/Library/TestPointCheckLib.h219
-rw-r--r--Platform/Intel/MinPlatformPkg/Include/Library/TestPointLib.h225
14 files changed, 1286 insertions, 0 deletions
diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/AslUpdateLib.h b/Platform/Intel/MinPlatformPkg/Include/Library/AslUpdateLib.h
new file mode 100644
index 0000000000..dc76e33557
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Include/Library/AslUpdateLib.h
@@ -0,0 +1,146 @@
+/** @file
+ ASL dynamic update library definitions.
+ This library provides dymanic update to various ASL structures.
+ There may be different libraries for different environments (PEI, BS, RT, SMM).
+ Make sure you meet the requirements for the library (protocol dependencies, use
+ restrictions, etc).
+
+Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _ASL_UPDATE_LIB_H_
+#define _ASL_UPDATE_LIB_H_
+
+//
+// Include files
+//
+#include <IndustryStandard/Acpi.h>
+#include <Protocol/AcpiTable.h>
+#include <Protocol/AcpiSystemDescriptionTable.h>
+
+//
+// AML parsing definitions
+//
+#define AML_RESRC_TEMP_END_TAG 0x0079
+
+//
+// ASL PSS package structure layout
+//
+#pragma pack (1)
+typedef struct {
+ UINT8 NameOp; // 12h ;First opcode is a NameOp.
+ UINT8 PackageLead; // 20h ;First opcode is a NameOp.
+ UINT8 NumEntries; // 06h ;First opcode is a NameOp.
+ UINT8 DwordPrefix1; // 0Ch
+ UINT32 CoreFrequency; // 00h
+ UINT8 DwordPrefix2; // 0Ch
+ UINT32 Power; // 00h
+ UINT8 DwordPrefix3; // 0Ch
+ UINT32 TransLatency; // 00h
+ UINT8 DwordPrefix4; // 0Ch
+ UINT32 BmLatency; // 00h
+ UINT8 DwordPrefix5; // 0Ch
+ UINT32 Control; // 00h
+ UINT8 DwordPrefix6; // 0Ch
+ UINT32 Status; // 00h
+} PSS_PACKAGE_LAYOUT;
+#pragma pack()
+
+/**
+ Initialize the ASL update library state.
+ This must be called prior to invoking other library functions.
+
+
+ @retval EFI_SUCCESS The function completed successfully.
+**/
+EFI_STATUS
+InitializeAslUpdateLib (
+ VOID
+ );
+
+/**
+ This procedure will update immediate value assigned to a Name
+
+ @param[in] AslSignature The signature of Operation Region that we want to update.
+ @param[in] Buffer source of data to be written over original aml
+ @param[in] Length length of data to be overwritten
+
+ @retval EFI_SUCCESS The function completed successfully.
+**/
+EFI_STATUS
+UpdateNameAslCode(
+ IN UINT32 AslSignature,
+ IN VOID *Buffer,
+ IN UINTN Length
+ );
+
+/**
+ This function uses the ACPI support protocol to locate an ACPI table using the .
+ It is really only useful for finding tables that only have a single instance,
+ e.g. FADT, FACS, MADT, etc. It is not good for locating SSDT, etc.
+ Matches are determined by finding the table with ACPI table that has
+ a matching signature and version.
+
+ @param[in] Signature Pointer to an ASCII string containing the Signature to match
+ @param[in, out] Table Updated with a pointer to the table
+ @param[in, out] Handle AcpiSupport protocol table handle for the table found
+ @param[in, out] Version On input, the version of the table desired,
+ on output, the versions the table belongs to
+ @see AcpiSupport protocol for details
+
+ @retval EFI_SUCCESS The function completed successfully.
+**/
+EFI_STATUS
+LocateAcpiTableBySignature (
+ IN UINT32 Signature,
+ IN OUT EFI_ACPI_DESCRIPTION_HEADER **Table,
+ IN OUT UINTN *Handle
+ );
+
+/**
+ This function uses the ACPI support protocol to locate an ACPI SSDT table.
+ The table is located by searching for a matching OEM Table ID field.
+ Partial match searches are supported via the TableIdSize parameter.
+
+ @param[in] TableId Pointer to an ASCII string containing the OEM Table ID from the ACPI table header
+ @param[in] TableIdSize Length of the TableId to match. Table ID are 8 bytes long, this function
+ will consider it a match if the first TableIdSize bytes match
+ @param[in, out] Table Updated with a pointer to the table
+ @param[in, out] Handle AcpiSupport protocol table handle for the table found
+ @param[in, out] Version See AcpiSupport protocol, GetAcpiTable function for use
+
+ @retval EFI_SUCCESS The function completed successfully.
+**/
+EFI_STATUS
+LocateAcpiTableByOemTableId (
+ IN UINT8 *TableId,
+ IN UINT8 TableIdSize,
+ IN OUT EFI_ACPI_DESCRIPTION_HEADER **Table,
+ IN OUT UINTN *Handle
+ );
+
+/**
+ This function calculates and updates an UINT8 checksum.
+
+ @param[in] Buffer Pointer to buffer to checksum
+ @param[in] Size Number of bytes to checksum
+ @param[in] ChecksumOffset Offset to place the checksum result in
+
+ @retval EFI_SUCCESS The function completed successfully.
+**/
+EFI_STATUS
+AcpiChecksum (
+ IN VOID *Buffer,
+ IN UINTN Size,
+ IN UINTN ChecksumOffset
+ );
+
+#endif
diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/BoardAcpiEnableLib.h b/Platform/Intel/MinPlatformPkg/Include/Library/BoardAcpiEnableLib.h
new file mode 100644
index 0000000000..48de84cfed
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Include/Library/BoardAcpiEnableLib.h
@@ -0,0 +1,33 @@
+/** @file
+
+Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _BOARD_ACPI_ENABLE_LIB_H_
+#define _BOARD_ACPI_ENABLE_LIB_H_
+
+#include <Uefi.h>
+#include <IndustryStandard/Acpi.h>
+#include <Protocol/AcpiSystemDescriptionTable.h>
+
+EFI_STATUS
+EFIAPI
+BoardEnableAcpi (
+ IN BOOLEAN EnableSci
+ );
+
+EFI_STATUS
+EFIAPI
+BoardDisableAcpi (
+ IN BOOLEAN DisableSci
+ );
+
+#endif
diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/BoardAcpiTableLib.h b/Platform/Intel/MinPlatformPkg/Include/Library/BoardAcpiTableLib.h
new file mode 100644
index 0000000000..d001393654
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Include/Library/BoardAcpiTableLib.h
@@ -0,0 +1,28 @@
+/** @file
+
+Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _BOARD_ACPI_TABLE_LIB_H_
+#define _BOARD_ACPI_TABLE_LIB_H_
+
+#include <Uefi.h>
+#include <IndustryStandard/Acpi.h>
+#include <Protocol/AcpiSystemDescriptionTable.h>
+
+EFI_STATUS
+EFIAPI
+BoardUpdateAcpiTable (
+ IN OUT EFI_ACPI_COMMON_HEADER *Table,
+ IN OUT EFI_ACPI_TABLE_VERSION *Version
+ );
+
+#endif
diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/BoardInitLib.h b/Platform/Intel/MinPlatformPkg/Include/Library/BoardInitLib.h
new file mode 100644
index 0000000000..db366e387a
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Include/Library/BoardInitLib.h
@@ -0,0 +1,92 @@
+/** @file
+
+Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _BOARD_INIT_LIB_H_
+#define _BOARD_INIT_LIB_H_
+
+#include <PiPei.h>
+#include <Uefi.h>
+
+EFI_STATUS
+EFIAPI
+BoardDetect (
+ VOID
+ );
+
+EFI_STATUS
+EFIAPI
+BoardDebugInit (
+ VOID
+ );
+
+EFI_BOOT_MODE
+EFIAPI
+BoardBootModeDetect (
+ VOID
+ );
+
+EFI_STATUS
+EFIAPI
+BoardInitBeforeMemoryInit (
+ VOID
+ );
+
+EFI_STATUS
+EFIAPI
+BoardInitAfterMemoryInit (
+ VOID
+ );
+
+EFI_STATUS
+EFIAPI
+BoardInitBeforeTempRamExit (
+ VOID
+ );
+
+EFI_STATUS
+EFIAPI
+BoardInitAfterTempRamExit (
+ VOID
+ );
+
+EFI_STATUS
+EFIAPI
+BoardInitBeforeSiliconInit (
+ VOID
+ );
+
+EFI_STATUS
+EFIAPI
+BoardInitAfterSiliconInit (
+ VOID
+ );
+
+EFI_STATUS
+EFIAPI
+BoardInitAfterPciEnumeration (
+ VOID
+ );
+
+EFI_STATUS
+EFIAPI
+BoardInitReadyToBoot (
+ VOID
+ );
+
+EFI_STATUS
+EFIAPI
+BoardInitEndOfFirmware (
+ VOID
+ );
+
+#endif
diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/FspPolicyInitLib.h b/Platform/Intel/MinPlatformPkg/Include/Library/FspPolicyInitLib.h
new file mode 100644
index 0000000000..40330e0113
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Include/Library/FspPolicyInitLib.h
@@ -0,0 +1,30 @@
+/** @file
+ Function prototype of FspPolicyInitLib.
+
+Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _FSP_POLICY_INIT_LIB_H_
+#define _FSP_POLICY_INIT_LIB_H_
+
+VOID
+EFIAPI
+FspmPolicyInit (
+ IN OUT VOID *FspmUpd
+ );
+
+VOID
+EFIAPI
+FspsPolicyInit (
+ IN OUT VOID *FspsUpd
+ );
+
+#endif // _FSP_POLICY_INIT_LIB_H_
diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/FspPolicyUpdateLib.h b/Platform/Intel/MinPlatformPkg/Include/Library/FspPolicyUpdateLib.h
new file mode 100644
index 0000000000..977c4b2052
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Include/Library/FspPolicyUpdateLib.h
@@ -0,0 +1,30 @@
+/** @file
+ Function prototype of FspPolicyUpdateLib.
+
+Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _FSP_POLICY_UPDATE_LIB_H_
+#define _FSP_POLICY_UPDATE_LIB_H_
+
+VOID
+EFIAPI
+FspmPolicyUpdate (
+ IN OUT VOID *FspmUpd
+ );
+
+VOID
+EFIAPI
+FspsPolicyUpdate (
+ IN OUT VOID *FspsUpd
+ );
+
+#endif
diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/HobVariableLib.h b/Platform/Intel/MinPlatformPkg/Include/Library/HobVariableLib.h
new file mode 100644
index 0000000000..8b5e1dc858
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Include/Library/HobVariableLib.h
@@ -0,0 +1,111 @@
+/**@file
+
+Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _HOB_VARIABLE_LIB_H_
+#define _HOB_VARIABLE_LIB_H_
+
+/**
+ This function finds the default data and create GUID hob for it.
+
+ @retval EFI_SUCCESS The matched default data is found.
+ @retval EFI_NOT_FOUND The matched default data is not found.
+ @retval EFI_OUT_OF_RESOURCES No enough resource to create HOB.
+
+**/
+EFI_STATUS
+EFIAPI
+CreateVariableHob (
+ VOID
+ );
+
+/**
+ This function finds the matched default data and create GUID hob for it.
+
+ @param StoreId Specifies the type of defaults to retrieve.
+ @param SkuId Specifies the platform board of defaults to retrieve.
+
+ @retval EFI_SUCCESS The matched default data is found.
+ @retval EFI_NOT_FOUND The matched default data is not found.
+ @retval EFI_OUT_OF_RESOURCES No enough resource to create HOB.
+
+**/
+EFI_STATUS
+EFIAPI
+CreateDefaultVariableHob (
+ IN UINT16 StoreId,
+ IN UINT16 SkuId
+ );
+
+/**
+ Get variable from default variable HOB.
+
+ @param[in] VariableName A Null-terminated string that is the name of the vendor's
+ variable.
+ @param[in] VendorGuid A unique identifier for the vendor.
+ @param[out] Attributes If not NULL, a pointer to the memory location to return the
+ attributes bitmask for the variable.
+ @param[in, out] DataSize On input, the size in bytes of the return Data buffer.
+ On output the size of data returned in Data.
+ @param[out] Data The buffer to return the contents of the variable.
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_NOT_FOUND The variable was not found.
+ @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the result.
+ @retval EFI_INVALID_PARAMETER VariableName is NULL.
+ @retval EFI_INVALID_PARAMETER VendorGuid is NULL.
+ @retval EFI_INVALID_PARAMETER DataSize is NULL.
+ @retval EFI_INVALID_PARAMETER The DataSize is not too small and Data is NULL.
+
+**/
+EFI_STATUS
+EFIAPI
+GetVariableFromHob (
+ IN CHAR16 *VariableName,
+ IN EFI_GUID *VendorGuid,
+ OUT UINT32 *Attributes, OPTIONAL
+ IN OUT UINTN *DataSize,
+ OUT VOID *Data
+ );
+
+/**
+ Set variable to default variable HOB.
+
+ @param[in] VariableName A Null-terminated string that is the name of the vendor's
+ variable.
+ @param[in] VendorGuid A unique identifier for the vendor.
+ @param[in] Attributes If not NULL, a pointer to the memory location to set the
+ attributes bitmask for the variable.
+ @param[in] DataSize On input, the size in bytes of the return Data buffer.
+ On output the size of data returned in Data.
+ @param[in] Data The buffer to return the contents of the variable.
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_NOT_FOUND The variable was not found.
+ @retval EFI_INVALID_PARAMETER VariableName is NULL.
+ @retval EFI_INVALID_PARAMETER VendorGuid is NULL.
+ @retval EFI_INVALID_PARAMETER Attributes is not NULL, but attributes value is 0.
+ @retval EFI_INVALID_PARAMETER DataSize is not equal to the variable data size.
+ @retval EFI_INVALID_PARAMETER The DataSize is equal to the variable data size, but Data is NULL.
+
+**/
+EFI_STATUS
+EFIAPI
+SetVariableToHob (
+ IN CHAR16 *VariableName,
+ IN EFI_GUID *VendorGuid,
+ IN UINT32 *Attributes, OPTIONAL
+ IN UINTN DataSize,
+ IN VOID *Data
+ );
+
+#endif
diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/MultiBoardAcpiSupportLib.h b/Platform/Intel/MinPlatformPkg/Include/Library/MultiBoardAcpiSupportLib.h
new file mode 100644
index 0000000000..15087428e8
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Include/Library/MultiBoardAcpiSupportLib.h
@@ -0,0 +1,60 @@
+/** @file
+
+Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _MULTI_BOARD_ACPI_SUPPORT_LIB_H_
+#define _MULTI_BOARD_ACPI_SUPPORT_LIB_H_
+
+#include <Library/BoardAcpiTableLib.h>
+#include <Library/BoardAcpiEnableLib.h>
+
+typedef
+EFI_STATUS
+(EFIAPI *BOARD_ENABLE_ACPI) (
+ IN BOOLEAN EnableSci
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *BOARD_DISABLE_ACPI) (
+ IN BOOLEAN DisableSci
+ );
+
+typedef struct {
+ BOARD_ENABLE_ACPI BoardEnableAcpi;
+ BOARD_DISABLE_ACPI BoardDisableAcpi;
+} BOARD_ACPI_ENABLE_FUNC;
+
+typedef
+EFI_STATUS
+(EFIAPI *BOARD_UPDATE_ACPI_TABLE) (
+ IN OUT EFI_ACPI_COMMON_HEADER *Table,
+ IN OUT EFI_ACPI_TABLE_VERSION *Version
+ );
+
+typedef struct {
+ BOARD_UPDATE_ACPI_TABLE BoardUpdateAcpiTable;
+} BOARD_ACPI_TABLE_FUNC;
+
+EFI_STATUS
+EFIAPI
+RegisterBoardAcpiEnableFunc (
+ IN BOARD_ACPI_ENABLE_FUNC *BoardAcpiEnableFunc
+ );
+
+EFI_STATUS
+EFIAPI
+RegisterBoardAcpiTableFunc (
+ IN BOARD_ACPI_TABLE_FUNC *BoardAcpiTableFunc
+ );
+
+#endif
diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/MultiBoardInitSupportLib.h b/Platform/Intel/MinPlatformPkg/Include/Library/MultiBoardInitSupportLib.h
new file mode 100644
index 0000000000..c4c36216fe
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Include/Library/MultiBoardInitSupportLib.h
@@ -0,0 +1,85 @@
+/** @file
+
+Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _MULTI_BOARD_INIT_SUPPORT_LIB_H_
+#define _MULTI_BOARD_INIT_SUPPORT_LIB_H_
+
+#include <Library/BoardInitLib.h>
+
+typedef
+EFI_STATUS
+(EFIAPI *BOARD_DETECT) (
+ VOID
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *BOARD_INIT) (
+ VOID
+ );
+
+typedef
+EFI_BOOT_MODE
+(EFIAPI *BOARD_BOOT_MODE_DETECT) (
+ VOID
+ );
+
+typedef struct {
+ BOARD_DETECT BoardDetect;
+} BOARD_DETECT_FUNC;
+
+typedef struct {
+ BOARD_INIT BoardDebugInit;
+ BOARD_BOOT_MODE_DETECT BoardBootModeDetect;
+ BOARD_INIT BoardInitBeforeMemoryInit;
+ BOARD_INIT BoardInitAfterMemoryInit;
+ BOARD_INIT BoardInitBeforeTempRamExit;
+ BOARD_INIT BoardInitAfterTempRamExit;
+} BOARD_PRE_MEM_INIT_FUNC;
+
+typedef struct {
+ BOARD_INIT BoardInitBeforeSiliconInit;
+ BOARD_INIT BoardInitAfterSiliconInit;
+} BOARD_POST_MEM_INIT_FUNC;
+
+typedef struct {
+ BOARD_INIT BoardInitAfterPciEnumeration;
+ BOARD_INIT BoardInitReadyToBoot;
+ BOARD_INIT BoardInitEndOfFirmware;
+} BOARD_NOTIFICATION_INIT_FUNC;
+
+EFI_STATUS
+EFIAPI
+RegisterBoardDetect (
+ IN BOARD_DETECT_FUNC *BoardDetect
+ );
+
+EFI_STATUS
+EFIAPI
+RegisterBoardPreMemInit (
+ IN BOARD_PRE_MEM_INIT_FUNC *BoardPreMemInit
+ );
+
+EFI_STATUS
+EFIAPI
+RegisterBoardPostMemInit (
+ IN BOARD_POST_MEM_INIT_FUNC *BoardPostMemInit
+ );
+
+EFI_STATUS
+EFIAPI
+RegisterBoardNotificationInit (
+ IN BOARD_NOTIFICATION_INIT_FUNC *BoardNotificationInit
+ );
+
+#endif
diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/PeiLib.h b/Platform/Intel/MinPlatformPkg/Include/Library/PeiLib.h
new file mode 100644
index 0000000000..8889f97d59
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Include/Library/PeiLib.h
@@ -0,0 +1,85 @@
+/** @file
+
+Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _PEI_LIB_H_
+#define _PEI_LIB_H_
+
+#include <PiPei.h>
+
+/**
+ Returns the status whether get the variable success. The function retrieves
+ variable through the ReadOnlyVariable2 PPI GetVariable().
+
+ If the *Size is 0, the returned buffer is allocated using AllocatePool().
+ The caller is responsible for freeing this buffer with FreePool().
+
+ If the *Size is non-0, this function just uses caller allocated *Value.
+
+ @param[in] Name The pointer to a Null-terminated Unicode string.
+ @param[in] Guid The pointer to an EFI_GUID structure
+ @param[out] Value The buffer point saved the variable info.
+ @param[out] Size The buffer size of the variable.
+
+ @return EFI_OUT_OF_RESOURCES Allocate buffer failed.
+ @return EFI_SUCCESS Find the specified variable.
+ @return Others Errors Return errors from call to gRT->GetVariable.
+
+**/
+EFI_STATUS
+EFIAPI
+PeiGetVariable (
+ IN CONST CHAR16 *Name,
+ IN CONST EFI_GUID *Guid,
+ OUT VOID **Value,
+ OUT UINTN *Size
+ );
+
+/**
+ Finds the file in any FV and gets file Address and Size
+
+ @param[in] NameGuid File GUID
+ @param[out] Address Pointer to the File Address
+ @param[out] Size Pointer to File Size
+
+ @retval EFI_SUCCESS Successfull in reading the file from any FV
+**/
+EFI_STATUS
+EFIAPI
+PeiGetFfsFromAnyFv (
+ IN CONST EFI_GUID *NameGuid,
+ OUT VOID **Address,
+ OUT UINTN *Size
+ );
+
+/**
+ Finds the section in any FV and gets section Address and Size
+
+ @param[in] NameGuid File GUID
+ @param[in] SectionType The SectionType of Section to be found
+ @param[in] SectionInstance The Instance of Section to be found
+ @param[out] Address Pointer to the section Address
+ @param[out] Size Pointer to section Size
+
+ @retval EFI_SUCCESS Successfull in reading the section from any FV
+**/
+EFI_STATUS
+EFIAPI
+PeiGetSectionFromAnyFv (
+ IN CONST EFI_GUID *NameGuid,
+ IN EFI_SECTION_TYPE SectionType,
+ IN UINTN SectionInstance,
+ OUT VOID **Address,
+ OUT UINTN *Size
+ );
+
+#endif
diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/SecBoardInitLib.h b/Platform/Intel/MinPlatformPkg/Include/Library/SecBoardInitLib.h
new file mode 100644
index 0000000000..9142b14335
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Include/Library/SecBoardInitLib.h
@@ -0,0 +1,38 @@
+/** @file
+
+Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _SEC_BOARD_INIT_LIB_H_
+#define _SEC_BOARD_INIT_LIB_H_
+
+#include <PiPei.h>
+#include <Uefi.h>
+
+/**
+ This is stackless function in 32bit.
+
+ return address - ESP.
+ All other registers can be used.
+**/
+VOID
+EFIAPI
+BoardBeforeTempRamInit (
+ VOID
+ );
+
+EFI_STATUS
+EFIAPI
+BoardAfterTempRamInit (
+ VOID
+ );
+
+#endif
diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/SpiFlashCommonLib.h b/Platform/Intel/MinPlatformPkg/Include/Library/SpiFlashCommonLib.h
new file mode 100644
index 0000000000..12dfaeb440
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Include/Library/SpiFlashCommonLib.h
@@ -0,0 +1,104 @@
+/** @file
+ The header file includes the common header files, defines
+ internal structure and functions used by SpiFlashCommonLib.
+
+Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __SPI_FLASH_COMMON_LIB_H__
+#define __SPI_FLASH_COMMON_LIB_H__
+
+#include <Uefi.h>
+#include <Library/BaseLib.h>
+#include <Library/PcdLib.h>
+#include <Library/DebugLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Library/UefiDriverEntryPoint.h>
+#include <Library/UefiBootServicesTableLib.h>
+
+#define SECTOR_SIZE_4KB 0x1000 // Common 4kBytes sector size
+/**
+ Enable block protection on the Serial Flash device.
+
+ @retval EFI_SUCCESS Opertion is successful.
+ @retval EFI_DEVICE_ERROR If there is any device errors.
+
+**/
+EFI_STATUS
+EFIAPI
+SpiFlashLock (
+ VOID
+ );
+
+/**
+ Read NumBytes bytes of data from the address specified by
+ PAddress into Buffer.
+
+ @param[in] Address The starting physical address of the read.
+ @param[in,out] NumBytes On input, the number of bytes to read. On output, the number
+ of bytes actually read.
+ @param[out] Buffer The destination data buffer for the read.
+
+ @retval EFI_SUCCESS Opertion is successful.
+ @retval EFI_DEVICE_ERROR If there is any device errors.
+
+**/
+EFI_STATUS
+EFIAPI
+SpiFlashRead (
+ IN UINTN Address,
+ IN OUT UINT32 *NumBytes,
+ OUT UINT8 *Buffer
+ );
+
+/**
+ Write NumBytes bytes of data from Buffer to the address specified by
+ PAddresss.
+
+ @param[in] Address The starting physical address of the write.
+ @param[in,out] NumBytes On input, the number of bytes to write. On output,
+ the actual number of bytes written.
+ @param[in] Buffer The source data buffer for the write.
+
+ @retval EFI_SUCCESS Opertion is successful.
+ @retval EFI_DEVICE_ERROR If there is any device errors.
+
+**/
+EFI_STATUS
+EFIAPI
+SpiFlashWrite (
+ IN UINTN Address,
+ IN OUT UINT32 *NumBytes,
+ IN UINT8 *Buffer
+ );
+
+/**
+ Erase the block starting at Address.
+
+ @param[in] Address The starting physical address of the block to be erased.
+ This library assume that caller garantee that the PAddress
+ is at the starting address of this block.
+ @param[in] NumBytes On input, the number of bytes of the logical block to be erased.
+ On output, the actual number of bytes erased.
+
+ @retval EFI_SUCCESS. Opertion is successful.
+ @retval EFI_DEVICE_ERROR If there is any device errors.
+
+**/
+EFI_STATUS
+EFIAPI
+SpiFlashBlockErase (
+ IN UINTN Address,
+ IN UINTN *NumBytes
+ );
+
+#endif
diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/TestPointCheckLib.h b/Platform/Intel/MinPlatformPkg/Include/Library/TestPointCheckLib.h
new file mode 100644
index 0000000000..7caea0a53e
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Include/Library/TestPointCheckLib.h
@@ -0,0 +1,219 @@
+/** @file
+
+Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _TEST_POINT_CHECK_LIB_H_
+#define _TEST_POINT_CHECK_LIB_H_
+
+#include <PiPei.h>
+#include <Uefi.h>
+
+//
+// Below is Test Point Hook Point.
+//
+
+EFI_STATUS
+EFIAPI
+TestPointTempMemoryInitDone (
+ IN VOID *TempRamStart,
+ IN VOID *TempRamEnd
+ );
+
+EFI_STATUS
+EFIAPI
+TestPointDebugInitDone (
+ VOID
+ );
+
+EFI_STATUS
+EFIAPI
+TestPointMemoryDiscovered (
+ VOID
+ );
+
+EFI_STATUS
+EFIAPI
+TestPointEndOfPei (
+ VOID
+ );
+
+EFI_STATUS
+EFIAPI
+TestPointPciEnumerationDone (
+ VOID
+ );
+
+EFI_STATUS
+EFIAPI
+TestPointEndOfDxe (
+ VOID
+ );
+
+EFI_STATUS
+EFIAPI
+TestPointDxeSmmReadyToLock (
+ VOID
+ );
+
+EFI_STATUS
+EFIAPI
+TestPointReadyToBoot (
+ VOID
+ );
+
+EFI_STATUS
+EFIAPI
+TestPointExitBootServices (
+ VOID
+ );
+
+EFI_STATUS
+EFIAPI
+TestPointSmmEndOfDxe (
+ VOID
+ );
+
+EFI_STATUS
+EFIAPI
+TestPointSmmReadyToLock (
+ VOID
+ );
+
+EFI_STATUS
+EFIAPI
+TestPointSmmReadyToBoot (
+ VOID
+ );
+
+EFI_STATUS
+EFIAPI
+TestPointSmmExitBootServices (
+ VOID
+ );
+
+//
+// Below is detail definition for MinPlatform implementation
+//
+
+#define TEST_POINT_IMPLEMENTATION_ID_PLATFORM L"Intel MinPlatform TestPoint"
+
+#define TEST_POINT_FEATURE_SIZE 4
+
+#define TEST_POINT_ERROR L"Error "
+#define TEST_POINT_PLATFORM_TEST_POINT L" Platform TestPoint"
+
+// Byte 0 - SEC
+#define TEST_POINT_TEMP_MEMORY_INIT_DONE L" - Temp Memory Init Done - "
+
+#define TEST_POINT_BYTE0_TEMP_INIT_DONE BIT0
+#define TEST_POINT_BYTE0_TEMP_MEMORY_INIT_DONE_ERROR_CODE_1 L"0x00000001"
+#define TEST_POINT_BYTE0_TEMP_MEMORY_INIT_DONE_ERROR_STRING_1 L"Invalid Temp Ram\r\n"
+
+// Byte 1 - PEI
+#define TEST_POINT_DEBUG_INIT_DONE L" - Debug Init Done - "
+#define TEST_POINT_MEMORY_DISCOVERED L" - Memory Discovered - "
+#define TEST_POINT_END_OF_PEI L" - End Of PEI - "
+
+#define TEST_POINT_BYTE1_DEBUG_INIT_DONE BIT0
+#define TEST_POINT_BYTE1_MEMORY_DISCOVERED BIT1
+#define TEST_POINT_BYTE1_MEMORY_DISCOVERED_ERROR_CODE_1 L"0x01010001"
+#define TEST_POINT_BYTE1_MEMORY_DISCOVERED_ERROR_STRING_1 L"Invalid Memory Resource\r\n"
+#define TEST_POINT_BYTE1_MEMORY_DISCOVERED_ERROR_CODE_2 L"0x01010002"
+#define TEST_POINT_BYTE1_MEMORY_DISCOVERED_ERROR_STRING_2 L"Invalid MTRR Setting\r\n"
+#define TEST_POINT_BYTE1_MEMORY_DISCOVERED_ERROR_CODE_3 L"0x01010002"
+#define TEST_POINT_BYTE1_MEMORY_DISCOVERED_ERROR_STRING_3 L"Invalid SMRAM Resource\r\n"
+#define TEST_POINT_BYTE1_END_OF_PEI BIT2
+#define TEST_POINT_BYTE1_END_OF_PEI_ERROR_CODE_1 L"0x01020001"
+#define TEST_POINT_BYTE1_END_OF_PEI_ERROR_STRING_1 L"Invalid System Resource\r\n"
+#define TEST_POINT_BYTE1_END_OF_PEI_ERROR_CODE_2 L"0x01020002"
+#define TEST_POINT_BYTE1_END_OF_PEI_ERROR_STRING_2 L"Invalid MTRR Setting\r\n"
+#define TEST_POINT_BYTE1_END_OF_PEI_ERROR_CODE_3 L"0x01010003"
+#define TEST_POINT_BYTE1_END_OF_PEI_ERROR_STRING_3 L"Invalid FV Information\r\n"
+
+// Byte 2 - DXE
+#define TEST_POINT_PCI_ENUMERATION_DONE L" - PCI Enumeration Done - "
+#define TEST_POINT_END_OF_DXE L" - End Of DXE - "
+#define TEST_POINT_DXE_SMM_READY_TO_LOCK L" - DXE SMM Ready To Lock - "
+#define TEST_POINT_READY_TO_BOOT L" - Ready To Boot - "
+#define TEST_POINT_EXIT_BOOT_SERVICES L" - Exit Boot Services - "
+
+#define TEST_POINT_BYTE2_PCI_ENUMERATION_DONE BIT0
+#define TEST_POINT_BYTE2_PCI_ENUMERATION_DONE_ERROR_CODE_1 L"0x02010001"
+#define TEST_POINT_BYTE2_PCI_ENUMERATION_DONE_ERROR_STRING_1 L"Invalid PCI Resource\r\n"
+#define TEST_POINT_BYTE2_END_OF_DXE BIT1
+#define TEST_POINT_BYTE2_END_OF_DXE_ERROR_CODE_1 L"0x02020001"
+#define TEST_POINT_BYTE2_END_OF_DXE_ERROR_STRING_1 L"Invalid PCI OROM\r\n"
+#define TEST_POINT_BYTE2_END_OF_DXE_ERROR_CODE_2 L"0x02020002"
+#define TEST_POINT_BYTE2_END_OF_DXE_ERROR_STRING_2 L"Invalid Memory Map\r\n"
+#define TEST_POINT_BYTE2_END_OF_DXE_ERROR_CODE_3 L"0x02020003"
+#define TEST_POINT_BYTE2_END_OF_DXE_ERROR_STRING_3 L"Invalid GCD Map\r\n"
+#define TEST_POINT_BYTE2_END_OF_DXE_ERROR_CODE_4 L"0x02020004"
+#define TEST_POINT_BYTE2_END_OF_DXE_ERROR_STRING_4 L"Invalid Console Variable\r\n"
+#define TEST_POINT_BYTE2_END_OF_DXE_ERROR_CODE_5 L"0x02020005"
+#define TEST_POINT_BYTE2_END_OF_DXE_ERROR_STRING_5 L"Invalid Boot Variable\r\n"
+#define TEST_POINT_BYTE2_DXE_SMM_READY_TO_LOCK BIT2
+#define TEST_POINT_BYTE2_DXE_SMM_READY_TO_LOCK_ERROR_CODE_1 L"0x02040001"
+#define TEST_POINT_BYTE2_DXE_SMM_READY_TO_LOCK_ERROR_STRING_1 L"Invalid SMRAM Information\r\n"
+#define TEST_POINT_BYTE2_READY_TO_BOOT BIT3
+#define TEST_POINT_BYTE2_READY_TO_BOOT_ERROR_CODE_1 L"0x02080001"
+#define TEST_POINT_BYTE2_READY_TO_BOOT_ERROR_STRING_1 L"Invalid Device\r\n"
+#define TEST_POINT_BYTE2_READY_TO_BOOT_ERROR_CODE_2 L"0x02080002"
+#define TEST_POINT_BYTE2_READY_TO_BOOT_ERROR_STRING_2 L"Invalid Memory Type Information\r\n"
+#define TEST_POINT_BYTE2_READY_TO_BOOT_ERROR_CODE_3 L"0x02080003"
+#define TEST_POINT_BYTE2_READY_TO_BOOT_ERROR_STRING_3 L"Invalid UEFI Variable\r\n"
+#define TEST_POINT_BYTE2_READY_TO_BOOT_ERROR_CODE_4 L"0x02080004"
+#define TEST_POINT_BYTE2_READY_TO_BOOT_ERROR_STRING_4 L"Invalid Memory Attribute Table\r\n"
+#define TEST_POINT_BYTE2_READY_TO_BOOT_ERROR_CODE_5 L"0x02080005"
+#define TEST_POINT_BYTE2_READY_TO_BOOT_ERROR_STRING_5 L"Invalid ACPI Table\r\n"
+#define TEST_POINT_BYTE2_READY_TO_BOOT_ERROR_CODE_6 L"0x02080006"
+#define TEST_POINT_BYTE2_READY_TO_BOOT_ERROR_STRING_6 L"Invalid WSMT Table\r\n"
+#define TEST_POINT_BYTE2_READY_TO_BOOT_ERROR_CODE_7 L"0x02080007"
+#define TEST_POINT_BYTE2_READY_TO_BOOT_ERROR_STRING_7 L"Invalid DMAR Table\r\n"
+#define TEST_POINT_BYTE2_READY_TO_BOOT_ERROR_CODE_8 L"0x02080008"
+#define TEST_POINT_BYTE2_READY_TO_BOOT_ERROR_STRING_8 L"Invalid HSTI\r\n"
+#define TEST_POINT_BYTE2_READY_TO_BOOT_ERROR_CODE_9 L"0x02080009"
+#define TEST_POINT_BYTE2_READY_TO_BOOT_ERROR_STRING_9 L"Invalid ESRT\r\n"
+#define TEST_POINT_BYTE2_EXIT_BOOT_SERVICES BIT4
+
+// Byte 3 - SMM
+#define TEST_POINT_SMM_END_OF_DXE L" - SMM End Of DXE - "
+#define TEST_POINT_SMM_READY_TO_LOCK L" - SMM Ready To Lock - "
+#define TEST_POINT_SMM_READY_TO_BOOT L" - SMM Ready To Boot - "
+#define TEST_POINT_SMM_EXIT_BOOT_SERVICES L" - SMM Exit Boot Services - "
+
+#define TEST_POINT_BYTE3_SMM_END_OF_DXE BIT0
+#define TEST_POINT_BYTE3_SMM_END_OF_DXE_ERROR_CODE_1 L"0x03010001"
+#define TEST_POINT_BYTE3_SMM_END_OF_DXE_ERROR_STRING_1 L"Invalid SMM Image\r\n"
+#define TEST_POINT_BYTE3_SMM_READY_TO_LOCK BIT1
+#define TEST_POINT_BYTE2_SMM_READY_TO_LOCK_ERROR_CODE_1 L"0x03020001"
+#define TEST_POINT_BYTE2_SMM_READY_TO_LOCK_ERROR_STRING_1 L"Invalid SMM Memory Attribute Table\r\n"
+#define TEST_POINT_BYTE2_SMM_READY_TO_LOCK_ERROR_CODE_2 L"0x03020002"
+#define TEST_POINT_BYTE2_SMM_READY_TO_LOCK_ERROR_STRING_2 L"Invalid SMRR\r\n"
+#define TEST_POINT_BYTE3_SMM_READY_TO_BOOT BIT2
+#define TEST_POINT_BYTE3_SMM_EXIT_BOOT_SERVICES BIT3
+
+#pragma pack (1)
+
+typedef struct {
+ UINT32 Version;
+ UINT32 Role;
+ CHAR16 ImplementationID[256];
+ UINT32 FeaturesSize;
+ UINT8 FeaturesRequired[TEST_POINT_FEATURE_SIZE];
+ UINT8 FeaturesImplemented[TEST_POINT_FEATURE_SIZE];
+ UINT8 FeaturesVerified[TEST_POINT_FEATURE_SIZE];
+ CHAR16 End;
+} ADAPTER_INFO_PLATFORM_TEST_POINT_STRUCT;
+
+#pragma pack ()
+
+#endif
diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/TestPointLib.h b/Platform/Intel/MinPlatformPkg/Include/Library/TestPointLib.h
new file mode 100644
index 0000000000..49d5f84cb0
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Include/Library/TestPointLib.h
@@ -0,0 +1,225 @@
+/** @file
+
+Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _TEST_POINT_LIB_H_
+#define _TEST_POINT_LIB_H_
+
+#include <PiPei.h>
+#include <Uefi.h>
+
+//
+// Below is Test Point report definition.
+//
+
+//
+// We reuse HSTI stype definition.
+// ADAPTER_INFO_PLATFORM_TEST_POINT is similar to ADAPTER_INFO_PLATFORM_SECURITY.
+//
+
+#define PLATFORM_TEST_POINT_VERSION 0x00000001
+
+#define PLATFORM_TEST_POINT_ROLE_PLATFORM_REFERENCE 0x00000001
+#define PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV 0x00000002
+#define PLATFORM_TEST_POINT_ROLE_IMPLEMENTOR_OEM 0x00000003
+#define PLATFORM_TEST_POINT_ROLE_IMPLEMENTOR_ODM 0x00000004
+
+typedef struct {
+ UINT32 Version;
+ UINT32 Role;
+ CHAR16 ImplementationID[256];
+ UINT32 FeaturesSize;
+//UINT8 FeaturesRequired[];
+//UINT8 FeaturesImplemented[];
+//UINT8 FeaturesVerified[];
+//CHAR16 ErrorString[];
+} ADAPTER_INFO_PLATFORM_TEST_POINT;
+
+//
+// Below is test point report library
+//
+
+/**
+ Publish TestPoint table in AIP protocol.
+
+ One system should have only one PLATFORM_TEST_POINT_ROLE_PLATFORM_REFERENCE.
+
+ If the Role is NOT PLATFORM_TEST_POINT_ROLE_PLATFORM_REFERENCE,
+ FeaturesRequired field will be ignored.
+
+ @param TestPoint TestPoint data
+ @param TestPointSize TestPoint size
+
+ @retval EFI_SUCCESS The TestPoint data is published in AIP protocol.
+ @retval EFI_ALREADY_STARTED There is already TestPoint table with Role and ImplementationID published in system.
+ @retval EFI_VOLUME_CORRUPTED The input TestPoint data is invalid.
+ @retval EFI_OUT_OF_RESOURCES There is not enough system resource to publish TestPoint data in AIP protocol.
+**/
+EFI_STATUS
+EFIAPI
+TestPointLibSetTable (
+ IN VOID *TestPoint,
+ IN UINTN TestPointSize
+ );
+
+/**
+ Search TestPoint table in AIP protocol, and return the data.
+ This API will return the TestPoint table with indicated Role and ImplementationID,
+ NULL ImplementationID means to find the first TestPoint table with indicated Role.
+
+ @param Role Role of TestPoint data.
+ @param ImplementationID ImplementationID of TestPoint data.
+ NULL means find the first one match Role.
+ @param TestPoint TestPoint data. This buffer is allocated by callee, and it
+ is the responsibility of the caller to free it after
+ using it.
+ @param TestPointSize TestPoint size
+
+ @retval EFI_SUCCESS The TestPoint data in AIP protocol is returned.
+ @retval EFI_NOT_FOUND There is not TestPoint table with the Role and ImplementationID published in system.
+**/
+EFI_STATUS
+EFIAPI
+TestPointLibGetTable (
+ IN UINT32 Role,
+ IN CHAR16 *ImplementationID OPTIONAL,
+ OUT VOID **TestPoint,
+ OUT UINTN *TestPointSize
+ );
+
+/**
+ Set FeaturesVerified in published TestPoint table.
+ This API will update the TestPoint table with indicated Role and ImplementationID,
+ NULL ImplementationID means to find the first TestPoint table with indicated Role.
+
+ @param Role Role of TestPoint data.
+ @param ImplementationID ImplementationID of TestPoint data.
+ NULL means find the first one match Role.
+ @param ByteIndex Byte index of FeaturesVerified of TestPoint data.
+ @param BitMask Bit mask of FeaturesVerified of TestPoint data.
+
+ @retval EFI_SUCCESS The FeaturesVerified of TestPoint data updated in AIP protocol.
+ @retval EFI_NOT_STARTED There is not TestPoint table with the Role and ImplementationID published in system.
+ @retval EFI_UNSUPPORTED The ByteIndex is invalid.
+**/
+EFI_STATUS
+EFIAPI
+TestPointLibSetFeaturesVerified (
+ IN UINT32 Role,
+ IN CHAR16 *ImplementationID, OPTIONAL
+ IN UINT32 ByteIndex,
+ IN UINT8 BitMask
+ );
+
+/**
+ Clear FeaturesVerified in published TestPoint table.
+ This API will update the TestPoint table with indicated Role and ImplementationID,
+ NULL ImplementationID means to find the first TestPoint table with indicated Role.
+
+ @param Role Role of TestPoint data.
+ @param ImplementationID ImplementationID of TestPoint data.
+ NULL means find the first one match Role.
+ @param ByteIndex Byte index of FeaturesVerified of TestPoint data.
+ @param BitMask Bit mask of FeaturesVerified of TestPoint data.
+
+ @retval EFI_SUCCESS The FeaturesVerified of TestPoint data updated in AIP protocol.
+ @retval EFI_NOT_STARTED There is not TestPoint table with the Role and ImplementationID published in system.
+ @retval EFI_UNSUPPORTED The ByteIndex is invalid.
+**/
+EFI_STATUS
+EFIAPI
+TestPointLibClearFeaturesVerified (
+ IN UINT32 Role,
+ IN CHAR16 *ImplementationID, OPTIONAL
+ IN UINT32 ByteIndex,
+ IN UINT8 BitMask
+ );
+
+/**
+ Append ErrorString in published TestPoint table.
+ This API will update the TestPoint table with indicated Role and ImplementationID,
+ NULL ImplementationID means to find the first TestPoint table with indicated Role.
+
+ @param Role Role of TestPoint data.
+ @param ImplementationID ImplementationID of TestPoint data.
+ NULL means find the first one match Role.
+ @param ErrorString ErrorString of TestPoint data.
+
+ @retval EFI_SUCCESS The ErrorString of TestPoint data is updated in AIP protocol.
+ @retval EFI_NOT_STARTED There is not TestPoint table with the Role and ImplementationID published in system.
+ @retval EFI_OUT_OF_RESOURCES There is not enough system resource to update ErrorString.
+**/
+EFI_STATUS
+EFIAPI
+TestPointLibAppendErrorString (
+ IN UINT32 Role,
+ IN CHAR16 *ImplementationID, OPTIONAL
+ IN CHAR16 *ErrorString
+ );
+
+/**
+ Set a new ErrorString in published TestPoint table.
+ This API will update the TestPoint table with indicated Role and ImplementationID,
+ NULL ImplementationID means to find the first TestPoint table with indicated Role.
+
+ @param Role Role of TestPoint data.
+ @param ImplementationID ImplementationID of TestPoint data.
+ NULL means find the first one match Role.
+ @param ErrorString ErrorString of TestPoint data.
+
+ @retval EFI_SUCCESS The ErrorString of TestPoint data is updated in AIP protocol.
+ @retval EFI_NOT_STARTED There is not TestPoint table with the Role and ImplementationID published in system.
+ @retval EFI_OUT_OF_RESOURCES There is not enough system resource to update ErrorString.
+**/
+EFI_STATUS
+EFIAPI
+TestPointLibSetErrorString (
+ IN UINT32 Role,
+ IN CHAR16 *ImplementationID, OPTIONAL
+ IN CHAR16 *ErrorString
+ );
+
+//
+// TEST POINT SMM Communication command
+//
+#define SMI_HANDLER_TEST_POINT_COMMAND_GET_INFO 0x1
+#define SMI_HANDLER_TEST_POINT_COMMAND_GET_DATA_BY_OFFSET 0x2
+
+typedef struct {
+ UINT32 Command;
+ UINT32 DataLength;
+ UINT64 ReturnStatus;
+} SMI_HANDLER_TEST_POINT_PARAMETER_HEADER;
+
+typedef struct {
+ SMI_HANDLER_TEST_POINT_PARAMETER_HEADER Header;
+ UINT64 DataSize;
+} SMI_HANDLER_TEST_POINT_PARAMETER_GET_INFO;
+
+typedef struct {
+ SMI_HANDLER_TEST_POINT_PARAMETER_HEADER Header;
+ //
+ // On input, data buffer size.
+ // On output, actual data buffer size copied.
+ //
+ UINT64 DataSize;
+ PHYSICAL_ADDRESS DataBuffer;
+ //
+ // On input, data buffer offset to copy.
+ // On output, next time data buffer offset to copy.
+ //
+ UINT64 DataOffset;
+} SMI_HANDLER_TEST_POINT_PARAMETER_GET_DATA_BY_OFFSET;
+
+extern EFI_GUID gAdapterInfoPlatformTestPointGuid;
+
+#endif