/** @file
Pch information library.
All function in this library is available for PEI, DXE, and SMM,
But do not support UEFI RUNTIME environment call.
Copyright (c) 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "PchInfoLibPrivate.h"
#include
#include
#include
#include
#include
/**
Return Pch Series
@retval PCH_SERIES Pch Series
**/
PCH_SERIES
PchSeries (
VOID
)
{
return PCH_LP;
}
/**
Return Pch stepping type
@retval PCH_STEPPING Pch stepping type
**/
PCH_STEPPING
PchStepping (
VOID
)
{
return 0;
}
/**
Check if this is TGL PCH generation
@retval TRUE It's TGL PCH
@retval FALSE It's not TGL PCH
**/
BOOLEAN
IsTglPch (
VOID
)
{
return (PchGeneration () == TGL_PCH);
}
/**
Get PCH stepping ASCII string.
Function determines major and minor stepping versions and writes them into a buffer.
The return string is zero terminated
@param [out] Buffer Output buffer of string
@param [in] BufferSize Buffer size.
Must not be less then PCH_STEPPING_STR_LENGTH_MAX
@retval EFI_SUCCESS String copied successfully
@retval EFI_INVALID_PARAMETER The stepping is not supported, or parameters are NULL
@retval EFI_BUFFER_TOO_SMALL Input buffer size is too small
**/
EFI_STATUS
PchGetSteppingStr (
OUT CHAR8 *Buffer,
IN UINT32 BufferSize
)
{
PCH_STEPPING PchStep;
PchStep = PchStepping ();
if ((Buffer == NULL) || (BufferSize == 0)) {
return EFI_INVALID_PARAMETER;
}
if (BufferSize < PCH_STEPPING_STR_LENGTH_MAX) {
return EFI_BUFFER_TOO_SMALL;
}
PchPrintSteppingStr (Buffer, BufferSize, PchStep);
return EFI_SUCCESS;
}
/**
Get Pch Maximum Pcie Controller Number
@retval Pch Maximum Pcie Root Port Number
**/
UINT8
GetPchMaxPcieControllerNum (
VOID
)
{
return GetPchMaxPciePortNum () / PCH_PCIE_CONTROLLER_PORTS;
}
/**
return support status for P2SB PCR 20-bit addressing
@retval TRUE
@retval FALSE
**/
BOOLEAN
IsP2sb20bPcrSupported (
VOID
)
{
return FALSE;
}