Add GetSocSku/SetSocSku API

This patch added API to Get/SetSocSku. In current code, SBL always
read the PCI register to determine the SKU. It is not efficient.
Since it is used a lot, it is better to have software API to get
this info through a software only method.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This commit is contained in:
Maurice Ma
2021-11-02 10:55:04 -07:00
parent 992d637f27
commit a815fd2e72
2 changed files with 53 additions and 0 deletions
@@ -188,6 +188,7 @@ typedef struct {
UINT32 Signature;
UINT16 PlatformId;
UINT16 PlatformBomId;
UINT32 SocSku;
UINT8 BootMode;
UINT8 LoaderStage;
UINT8 CurrentBootPartition;
@@ -370,6 +371,29 @@ GetPlatformBomId (
VOID
);
/**
This function sets current SOC SKU info.
@param Sku The value of current SOC SKU.
**/
VOID
EFIAPI
SetSocSku (
IN UINT32 Sku
);
/**
This function retrieves current SOC SKU info.
@retval The current SOC SKU.
**/
UINT32
EFIAPI
GetSocSku (
VOID
);
/**
This function sets current debug port index.
@@ -283,6 +283,35 @@ GetPlatformBomId (
return GetLoaderGlobalDataPointer()->PlatformBomId;
}
/**
This function sets current SOC SKU info.
@param Sku The value of current SOC SKU.
**/
VOID
EFIAPI
SetSocSku (
IN UINT32 Sku
)
{
GetLoaderGlobalDataPointer()->SocSku = Sku;
}
/**
This function retrieves current SOC SKU info.
@retval The current SOC SKU.
**/
UINT32
EFIAPI
GetSocSku (
VOID
)
{
return GetLoaderGlobalDataPointer()->SocSku;
}
/**
This function sets current debug port index.