summaryrefslogtreecommitdiff
path: root/Board/EM/MeWrapper/Smbios131
diff options
context:
space:
mode:
authorraywu <raywu0301@gmail.com>2018-06-15 00:00:50 +0800
committerraywu <raywu0301@gmail.com>2018-06-15 00:00:50 +0800
commitb7c51c9cf4864df6aabb99a1ae843becd577237c (patch)
treeeebe9b0d0ca03062955223097e57da84dd618b9a /Board/EM/MeWrapper/Smbios131
downloadzprj-b7c51c9cf4864df6aabb99a1ae843becd577237c.tar.xz
init. 1AQQW051HEADmaster
Diffstat (limited to 'Board/EM/MeWrapper/Smbios131')
-rw-r--r--Board/EM/MeWrapper/Smbios131/Smbios131.c553
-rw-r--r--Board/EM/MeWrapper/Smbios131/Smbios131.cif12
-rw-r--r--Board/EM/MeWrapper/Smbios131/Smbios131.dxs72
-rw-r--r--Board/EM/MeWrapper/Smbios131/Smbios131.h176
-rw-r--r--Board/EM/MeWrapper/Smbios131/Smbios131.mak158
-rw-r--r--Board/EM/MeWrapper/Smbios131/Smbios131.sdl33
6 files changed, 1004 insertions, 0 deletions
diff --git a/Board/EM/MeWrapper/Smbios131/Smbios131.c b/Board/EM/MeWrapper/Smbios131/Smbios131.c
new file mode 100644
index 0000000..0b703ac
--- /dev/null
+++ b/Board/EM/MeWrapper/Smbios131/Smbios131.c
@@ -0,0 +1,553 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+//**********************************************************************
+//
+// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/MeWrapper/Smbios131/Smbios131.c 7 3/06/13 4:12a Klzhan $
+//
+// $Revision: 7 $
+//
+// $Date: 3/06/13 4:12a $
+//
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/MeWrapper/Smbios131/Smbios131.c $
+//
+// 7 3/06/13 4:12a Klzhan
+// Spec update : PlatformBrand = 5 means SBA
+//
+// 6 2/18/13 2:25a Klzhan
+// Improvement : Checking SBA Platform.
+//
+// 5 1/25/13 4:27a Klzhan
+// Return EFI_SUCCESS in entrypoint.
+//
+// 4 12/18/12 2:29a Klzhan
+// [TAG] EIP109707
+// [Category] Spec Update
+// [Severity] Important
+// [Description] Update ME RC 0.81
+// [Files] Smbios131.sdl
+// Smbios131.mak
+// Smbios131.c
+// Smbios131.dxs
+// Smbios131.h
+// Smbios131.cif
+//
+// 3 7/02/12 11:38p Klzhan
+// [TAG] EIP94113
+// [Category] Spec Update
+// [Severity] Important
+// [Description] Update ME RC0.6
+// [Files] Smbios131.sdl
+// Smbios131.mak
+// Smbios131.c
+// Smbios131.dxs
+// Smbios131.h
+// Smbios131.cif
+//
+// 2 4/24/12 12:32a Klzhan
+// Update modulepart to latest
+//
+// 1 2/08/12 1:07a Klzhan
+// Initial Check in
+//
+// 6 7/26/11 9:57a Klzhan
+// Create token for some Bios capabilities parameters.
+//
+// 5 7/26/11 8:37a Klzhan
+// [TAG] EIP64542
+// [Category] Improvement
+// [Description] Replace Getvariable by GetNbSetupdata.
+// [Files] Smbios131.sdl
+// Smbios131.mak
+// Smbios131.c
+// Smbios131.dxs
+// Smbios131.h
+// Smbios131.cif
+//
+// 4 7/11/11 5:40a Klzhan
+// Close Event after SMBIOS 131 created.
+//
+// 3 7/08/11 4:23a Klzhan
+// [TAG] EIP64189
+// [Category] Spec Update
+// [Severity] Important
+// [Description] Update ME RC to 0.7
+//
+// 2 5/19/11 4:39a Klzhan
+// Improvement : Fill MEBX version with EFI MEBX.
+//
+// 1 2/25/11 1:40a Klzhan
+// Initial Check-in
+//
+// 2 12/16/10 4:00a Klzhan
+// [TAG] EIP50237
+// [Category] Bug Fix
+// [Severity] Important
+// [Symptom] Txt Support is not been set in SMBIOS type 131
+// [RootCause] SETUP_CPU_FEATURES has been changed.
+// [Solution] Include PlatformCPULib.h
+// [Files] Smbios131.c and Smbios131.h
+//
+// 1 12/03/10 5:09a Klzhan
+// Initial Check-in.
+//
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: Smbios131.c
+//
+// Description: Create SMbios type 131.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#define _SMBIOS_GUID_H_
+#define __EDKII_GLUE_MEMORY_ALLOCATION_LIB_H__
+#define __EDKII_GLUE_BASE_MEMORY_LIB_H__
+
+#include "Smbios131.h"
+#include <Protocol\GlobalNvsArea\GlobalNvsArea.h>
+#include "MePlatformPolicy.h"
+#if EFI_SPECIFICATION_VERSION>0x20000
+#include "SaAccess.h"
+#include "PchAccess.h"
+#else
+#include "Efi.h"
+#include "EfiDriverLib.h"
+#include "SaAccess.h"
+#include "PchAccess.h"
+#include "EdkIIGluePcd.h"
+#include "EdkIIGluePcdPciExpressLib.h"
+#include "EdkIIGlueConfig.h"
+#include "EdkIIGlueIoLib.h"
+#include "EdkIIGluePciExpressLib.h"
+#include "EdkIIGlueUefiLib.h"
+#define __UEFI_HII__H__
+#define __HII_PROTOCOL_H__
+#define _HII_H_
+#define __FORM_CALLBACK_PROTOCOL_H__
+#endif
+#define SETUP_GUID { 0xEC87D643, 0xEBA4, 0x4BB5, 0xA1, 0xE5, 0x3F, 0x3E, 0x36, 0xB2, 0x0D, 0xA9 }
+
+
+#define ME_INFO_SETUP_GUID \
+ {0x78259433, 0x7B6D, 0x4DB3, 0x9A, 0xE8, 0x36, 0xC4, 0xC2, 0xC3, 0xA1, 0x7D}
+
+#include EFI_PROTOCOL_CONSUMER (MebxProtocol)
+
+EFI_GUID gSetupGuid = SETUP_GUID;
+EFI_GUID gMeSetupInfoGuid = ME_INFO_SETUP_GUID;
+EFI_GUID gEfiSmbiosProtocolGuid = EFI_SMBIOS_PROTOCOL_GUID;
+EFI_GUID gEfiEventReadyToBootGuid = EFI_EVENT_GROUP_READY_TO_BOOT;
+EFI_GUID gEfiMeBiosExtensionSetupGuid = EFI_ME_BIOS_EXTENSION_SETUP_GUID;
+CHAR16 gEfiMeBiosExtensionSetupName[] = EFI_ME_BIOS_EXTENSION_SETUP_VARIABLE_NAME;
+EFI_GUID gEfiGlobalVariableGuid = EFI_GLOBAL_VARIABLE_GUID;
+UINT8 METype = 0;
+EFI_EVENT mLegacyBootEvent;
+MEFWCAPS_SKU gMeFwCapsSkuData;
+#if VA_SUPPORT
+EFI_GUID gEfiVaNVMVariableGuid = EFI_VA_NVM_VARIABLE_GUID;
+#endif
+UINT8 TdtWwanSuport = 0;
+EFI_RUNTIME_SERVICES *gRT;
+EFI_BOOT_SERVICES *gBS;
+
+EFI_STATUS
+GetRawImage (
+ IN EFI_GUID *NameGuid,
+ IN OUT VOID **Buffer,
+ IN OUT UINTN *Size
+ )
+/*++
+
+Routine Description:
+
+ Loads binary from RAW section of main firwmare volume
+
+Arguments:
+
+ NameGuid - The guid of binary file
+ Buffer - Returns a pointer to allocated memory. Caller must free it when done.
+ Size - Returns the size of the binary loaded into the buffer.
+
+Returns:
+
+ EFI_NOT_FOUND - Can't found the binary.
+ EFI_LOAD_ERROR - Load fail.
+ EFI_SUCCESS - Load success.
+
+--*/
+{
+ EFI_STATUS Status;
+ UINTN HandleCount;
+ UINTN Index;
+ EFI_FIRMWARE_VOLUME_PROTOCOL *Fv;
+ EFI_HANDLE *HandleBuff;
+ UINT32 AuthenticationStatus;
+
+ Status = gBS->LocateHandleBuffer (
+ ByProtocol,
+ &gEfiFirmwareVolumeProtocolGuid,
+ NULL,
+ &HandleCount,
+ &HandleBuff
+ );
+ if (EFI_ERROR (Status) || HandleCount == 0) {
+ return EFI_NOT_FOUND;
+ }
+ //
+ // Find desired image in all Fvs
+ //
+ for (Index = 0; Index < HandleCount; Index++) {
+ Status = gBS->HandleProtocol (
+ HandleBuff[Index],
+ &gEfiFirmwareVolumeProtocolGuid,
+ &Fv
+ );
+
+ if (EFI_ERROR (Status)) {
+ if (HandleBuff != NULL) {
+ gBS->FreePool (HandleBuff);
+ }
+
+ return EFI_LOAD_ERROR;
+ }
+ //
+ // Try a raw file
+ //
+ Status = Fv->ReadSection (
+ Fv,
+ NameGuid,
+ EFI_SECTION_RAW,
+ 0,
+ Buffer,
+ Size,
+ &AuthenticationStatus
+ );
+
+ if (!EFI_ERROR (Status)) {
+ break;
+ }
+ }
+
+ if (HandleBuff != NULL) {
+ gBS->FreePool (HandleBuff);
+ }
+
+ if (Index >= HandleCount) {
+ return EFI_NOT_FOUND;
+ }
+
+ return EFI_SUCCESS;
+}
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Procedure: UpdateSmbios131Table
+//
+// Description: SMBIOS tables 83 are filled here
+//
+// Input: EFI_EVENT Event,
+// VOID *ParentImageHandle
+//
+// Output: EFI_STATUS
+//
+// Modified:
+//
+// Referrals:
+//
+// Notes:
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+VOID
+MePlatformCapabilities (
+ EFI_MISC_OEM_TYPE_0x83 *Type131
+)
+{
+ ME_INFO_SETUP_DATA MeInfoSetupData;
+ PLATFORM_TYPE_RULE_DATA PlatformTypeDate;
+ EFI_STATUS Status;
+ UINTN DataSize;
+
+ DataSize = sizeof (ME_INFO_SETUP_DATA);
+ Status = gRT->GetVariable (
+ L"MeInfoSetup",
+ &gMeSetupInfoGuid,
+ NULL,
+ &DataSize,
+ &MeInfoSetupData
+ );
+ if (EFI_ERROR(Status)) return ;
+ Type131->MeCapabilities.MeEnabled = 1;
+ Type131->MeCapabilities.MeMajorVer = MeInfoSetupData.MeMajor;
+ Type131->MeCapabilities.MeMinorVer = MeInfoSetupData.MeMinor;
+ Type131->MeCapabilities.MeBuildNo = MeInfoSetupData.MeBuildNo;
+ Type131->MeCapabilities.MeHotFixNo = MeInfoSetupData.MeHotFix;
+ Type131->MeCapabilities.AtSupported = gMeFwCapsSkuData.Fields.IntelAT;
+ Type131->MeCapabilities.IntelKVM = gMeFwCapsSkuData.Fields.KVM;
+ Status = HeciGetPlatformType(&PlatformTypeDate);
+ if (EFI_ERROR(Status)) return ;
+ if (PlatformTypeDate.Fields.PlatformBrand == 1) {
+ Type131->MeCapabilities.IntelAmtFw = 1;
+ Type131->MeCapabilities.LocalWakeupTimer = 1;
+ }
+ if (PlatformTypeDate.Fields.PlatformBrand == 2)
+ Type131->MeCapabilities.IntelAmtFwStandard = 1;
+
+ if (PlatformTypeDate.Fields.PlatformBrand == 5)
+ Type131->MeCapabilities.IntelSmallBusiness = 1;
+
+ METype = (UINT8)PlatformTypeDate.Fields.IntelMeFwImageType;
+}
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Procedure: UpdateSmbios131Table
+//
+// Description: SMBIOS tables 83 are filled here
+//
+// Input: EFI_EVENT Event,
+// VOID *ParentImageHandle
+//
+// Output: EFI_STATUS
+//
+// Modified:
+//
+// Referrals:
+//
+// Notes:
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+EFI_STATUS
+UpdateSmbios131Table(
+ EFI_EVENT Event,
+ VOID *ParentImageHandle
+)
+{
+ EFI_STATUS Status;
+ EFI_MISC_OEM_TYPE_0x83 Data83;
+ EFI_SMBIOS_PROTOCOL *mSmbiosProtocol;
+ UINT64 Ia32FeatureControl;
+ EFI_CPUID_REGISTER CpuidRegs ;
+#if VA_SUPPORT
+ EFI_VA_NVM_VAR VaNVMVar;
+#endif
+
+ mSmbiosProtocol = NULL;
+ Status = gBS->LocateProtocol(
+ &gEfiSmbiosProtocolGuid,
+ NULL,
+ &mSmbiosProtocol
+ );
+ if (EFI_ERROR(Status)) return Status;
+
+ //Clear all data
+ gBS->SetMem (&Data83, sizeof(EFI_MISC_OEM_TYPE_0x83), 0);
+
+// Data83
+
+ Data83.Header.Type = 0x83;
+ Data83.Header.Length = 0x40;
+ Data83.Header.Handle = 0;
+ gBS->CopyMem (
+ Data83.vProSignature,
+ vPro_Signature,
+ sizeof (UINT32)
+ );
+
+ Ia32FeatureControl = EfiReadMsr(EFI_MSR_IA32_FEATURE_CONTROL);
+ EfiCpuid (1, &CpuidRegs) ;
+
+//CPU
+ Data83.CpuCapabilities.VMXState = (UINT32)(RShiftU64(Ia32FeatureControl, 2));
+ Data83.CpuCapabilities.SMXState = (UINT32)(RShiftU64(Ia32FeatureControl, 1));
+
+ if (CpuidRegs.RegEcx & BIT6) {
+ Data83.CpuCapabilities.LtTxtCap = 1;
+ } else {
+ Data83.CpuCapabilities.LtTxtCap = 0;
+ }
+
+ if ((Ia32FeatureControl & TXT_OPT_IN_VMX_AND_SMX_MSR_VALUE) == TXT_OPT_IN_VMX_AND_SMX_MSR_VALUE) {
+ Data83.CpuCapabilities.LtTxtEnabled = 1;
+ } else {
+ Data83.CpuCapabilities.LtTxtEnabled = 0;
+ }
+
+ if (CpuidRegs.RegEcx & BIT5) {
+ Data83.CpuCapabilities.VTxCap = 1;
+ } else {
+ Data83.CpuCapabilities.VTxCap = 0;
+ }
+ Data83.CpuCapabilities.VTxEnabled = (UINT32)(RShiftU64(Ia32FeatureControl, 2));
+
+//Pch
+ Data83.PchCapabilities.FunctionNumber = PCI_FUNCTION_NUMBER_PCH_LPC;
+ Data83.PchCapabilities.DeviceNumber = PCI_DEVICE_NUMBER_PCH_LPC;
+ Data83.PchCapabilities.BusNumber = DEFAULT_PCI_BUS_NUMBER_PCH;
+ Data83.PchCapabilities.DeviceID = PchLpcPciCfg16(R_PCH_LPC_DEVICE_ID);
+ Data83.PchCapabilities.Reserved = 0;
+
+//Me
+//Filled above along with Data82 table
+ MePlatformCapabilities(&Data83);
+
+// MEBX Version
+ // Fill MEBX Version when ME FW is 5MB
+ if(METype == 4)
+ {
+ EFI_MEBX_PROTOCOL *MebxProtocol;
+ Status = gBS->LocateProtocol (&gEfiMebxProtocolGuid, NULL, &MebxProtocol);
+ if (!EFI_ERROR (Status)) {
+ Data83.vMEBX_Major = MebxProtocol->MebxVersion.Major;
+ Data83.vMEBX_Minor = MebxProtocol->MebxVersion.Minor;
+ Data83.vMEBX_HotFix = MebxProtocol->MebxVersion.Hotfix;
+ Data83.vMEBX_Build = MebxProtocol->MebxVersion.Build;
+ } else {
+ Data83.vMEBX_Major = 0;
+ Data83.vMEBX_Minor = 0;
+ Data83.vMEBX_HotFix = 0;
+ Data83.vMEBX_Build = 0;
+ }
+ }
+
+//NetworkDevice
+ Data83.NetworkDevice.FunctionNumber = PCI_FUNCTION_NUMBER_PCH_LAN; //[2:0] PCI Device Function Number of Wired LAN
+ Data83.NetworkDevice.DeviceNumber = PCI_DEVICE_NUMBER_PCH_LAN; //[7:3] PCI Device Device Number of Wired LAN
+ Data83.NetworkDevice.BusNumber = PCI_BUS_NUMBER_PCH_LAN; //[15:8] PCI Device Bus Number of Wired LAN
+ Data83.NetworkDevice.DeviceID = MmPci16( 0, DEFAULT_PCI_BUS_NUMBER_PCH, PCI_DEVICE_NUMBER_PCH_LAN, PCI_FUNCTION_NUMBER_PCH_LAN, R_PCH_LAN_DEVICE_ID );
+
+//BIOS
+ if(SetupSupportItem & BIT3)
+ Data83.BiosCapabilities.VTxSupport = 1;
+
+ if(SetupSupportItem & BIT1)
+ Data83.BiosCapabilities.TxtSupport = 1;
+
+ Data83.BiosCapabilities.Reserved1 = 0;
+ Data83.BiosCapabilities.Reserved2 = 0;
+
+ if(SetupSupportItem & BIT0)
+ Data83.BiosCapabilities.VTdSupport = 1;
+
+ if(SetupSupportItem & BIT2)
+ Data83.BiosCapabilities.MeSupport = 0;
+
+#if VA_SUPPORT
+ //
+ // Set Default Value for VA
+ //
+ Data83.BiosCapabilities.MaxVASupported = 7; //None. Means BIOS do not support VA.
+
+ //
+ // Get VA Info
+ //
+ DataSize = sizeof(EFI_VA_NVM_VAR);
+ Status = gRT->GetVariable (
+ EFI_VA_NVM_VARIABLE_NAME,
+ &gEfiVaNVMVariableGuid,
+ NULL,
+ &DataSize,
+ &VaNVMVar
+ );
+
+ if (!EFI_ERROR(Status)) {
+ if (VaNVMVar.VAVersion == EFI_VA30_VERSION) {
+ Data83.BiosCapabilities.MaxVASupported = 1;
+ } else if (VaNVMVar.VAVersion == EFI_VA26_VERSION) {
+ Data83.BiosCapabilities.MaxVASupported = 0;
+ }
+ }
+#endif
+
+ // Get TDT Info
+ if(Data83.MeCapabilities.AtSupported){
+ Data83.BiosCapabilities.TdtPbaSupport = 1;
+ Data83.BiosCapabilities.TdtWwanSuport = TdtWwanSuport;
+ }
+ Status = mSmbiosProtocol->SmbiosAddStructure((UINT8 *)&Data83, sizeof(EFI_MISC_OEM_TYPE_0x83));
+ gBS->CloseEvent(Event);
+ return Status;
+}
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Procedure: AmtSmbios131EntryPoint
+//
+// Description: iAMT SMBIOS Type 131 driver entry point
+//
+// Input: EFI_HANDLE ImageHandle,
+// EFI_SYSTEM_TABLE *SystemTable
+//
+// Output: EFI_STATUS
+//
+// Modified:
+//
+// Referrals:
+//
+// Notes:
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+EFI_STATUS
+AmtSmbios131EntryPoint(
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+)
+{
+ EFI_STATUS Status;
+ DXE_MBP_DATA_PROTOCOL *mBIOSPayLoad = NULL;
+
+ EfiInitializeDriverLib (ImageHandle, SystemTable);
+
+ Status = HeciGetFwCapsSku(&gMeFwCapsSkuData);
+ if (EFI_ERROR(Status)) return Status;
+ Status = EfiCreateEventReadyToBootEx(
+ EFI_TPL_CALLBACK,
+ UpdateSmbios131Table,
+ (VOID *)&ImageHandle,
+ &mLegacyBootEvent
+ );
+ ASSERT_EFI_ERROR (Status);
+ Status = gBS->LocateProtocol (
+ &gMeBiosPayloadDataProtocolGuid,
+ NULL,
+ &mBIOSPayLoad
+ );
+ if(!EFI_ERROR(Status))
+ {
+#if 0
+ if(mBIOSPayLoad->MeBiosPayload.AtState.flags.WWAN3GPresent &&
+ mBIOSPayLoad->MeBiosPayload.AtState.flags.WWAN3GOOB)
+ TdtWwanSuport = 1;
+#endif
+ }
+ return EFI_SUCCESS;
+}
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//************************************************************************* \ No newline at end of file
diff --git a/Board/EM/MeWrapper/Smbios131/Smbios131.cif b/Board/EM/MeWrapper/Smbios131/Smbios131.cif
new file mode 100644
index 0000000..02aafea
--- /dev/null
+++ b/Board/EM/MeWrapper/Smbios131/Smbios131.cif
@@ -0,0 +1,12 @@
+<component>
+ name = "Smbios131"
+ category = ModulePart
+ LocalRoot = "Board\EM\MeWrapper\Smbios131\"
+ RefName = "Smbios131"
+[files]
+"Smbios131.sdl"
+"Smbios131.mak"
+"Smbios131.c"
+"Smbios131.dxs"
+"Smbios131.h"
+<endComponent>
diff --git a/Board/EM/MeWrapper/Smbios131/Smbios131.dxs b/Board/EM/MeWrapper/Smbios131/Smbios131.dxs
new file mode 100644
index 0000000..8373f04
--- /dev/null
+++ b/Board/EM/MeWrapper/Smbios131/Smbios131.dxs
@@ -0,0 +1,72 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+//**********************************************************************
+//
+// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/MeWrapper/Smbios131/Smbios131.dxs 1 2/08/12 1:07a Klzhan $
+//
+// $Revision: 1 $
+//
+// $Date: 2/08/12 1:07a $
+//
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/MeWrapper/Smbios131/Smbios131.dxs $
+//
+// 1 2/08/12 1:07a Klzhan
+// Initial Check in
+//
+// 1 2/25/11 1:40a Klzhan
+// Initial Check-in
+//
+// 1 12/03/10 5:09a Klzhan
+// Initial Check-in.
+//
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: Smbios131.dxs
+//
+// Description:
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+#include "EfiDepex.h"
+
+#include "Protocol\SmbiosGetFlashDataProtocol.h"
+#include EFI_PROTOCOL_DEFINITION (AmtPlatformPolicy)
+#include EFI_PROTOCOL_DEFINITION (Heci)
+#include EFI_PROTOCOL_DEFINITION (MePlatformPolicy)
+
+DEPENDENCY_START
+ DXE_PLATFORM_ME_POLICY_GUID AND
+ EFI_HECI_PROTOCOL_GUID
+DEPENDENCY_END
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//************************************************************************* \ No newline at end of file
diff --git a/Board/EM/MeWrapper/Smbios131/Smbios131.h b/Board/EM/MeWrapper/Smbios131/Smbios131.h
new file mode 100644
index 0000000..d8ac599
--- /dev/null
+++ b/Board/EM/MeWrapper/Smbios131/Smbios131.h
@@ -0,0 +1,176 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+//**********************************************************************
+//
+// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/MeWrapper/Smbios131/Smbios131.h 1 2/08/12 1:07a Klzhan $
+//
+// $Revision: 1 $
+//
+// $Date: 2/08/12 1:07a $
+//
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/MeWrapper/Smbios131/Smbios131.h $
+//
+// 1 2/08/12 1:07a Klzhan
+// Initial Check in
+//
+// 1 2/25/11 1:40a Klzhan
+// Initial Check-in
+//
+// 2 12/16/10 3:58a Klzhan
+// [TAG] EIP50237
+// [Category] Bug Fix
+// [Severity] Important
+// [Symptom] Txt Support is not been set in SMBIOS type 131
+// [RootCause] SETUP_CPU_FEATURES structure has been changed.
+// [Solution] Include PlatformCPULib.h.
+// [Files] Smbios131.c and Smbios131.h
+//
+// 1 12/03/10 5:09a Klzhan
+// Initial Check-in.
+//
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: Smbios131.h
+//
+// Description: Header file for SMbios131 module.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+#include "Token.h"
+#include <Tiano.h>
+#include <Include\Protocol\SMBios.h>
+#include <Include\Protocol\SmbiosGetFlashDataProtocol.h>
+#include <AmtLib.h>
+#include <MeLib.h>
+#include "CpuFuncs.h"
+
+#include EFI_GUID_DEFINITION (MeBiosExtensionSetup)
+#include EFI_GUID_DEFINITION (GlobalVariable)
+#include EFI_PROTOCOL_DEFINITION (PciIo)
+#include EFI_PROTOCOL_CONSUMER (PciRootBridgeIo)
+#include EFI_PROTOCOL_DEPENDENCY (SaPlatformPolicy)
+#include EFI_PROTOCOL_CONSUMER (Heci)
+#include EFI_PROTOCOL_CONSUMER (TcgService)
+#define MEBX_FILE_GUID \
+ { \
+ 0x7c81c66a, 0x4f11, 0x47ab, 0x82, 0xd3, 0x67, 0xc4, 0xd6, 0x35, 0xae, 0xd1 \
+ }
+#if VA_SUPPORT
+#include EFI_PROTOCOL_DEFINITION(PlatformVaPolicy)
+#endif
+
+#define vPro_Signature "vPro"
+
+#define EFI_MSR_IA32_FEATURE_CONTROL 0x3A
+#define TXT_OPT_IN_VMX_AND_SMX_MSR_VALUE 0xFF03
+#define EFI_VA30_VERSION 0x0300
+#define EFI_VA26_VERSION 0x0206
+
+
+
+
+#define PciMeRegBase PCIEX_BASE_ADDRESS + (UINT32) (22 << 15)
+#define FW_STATUS_REGISTER 0x40
+
+//
+// This is definition for SMBIOS Oem data type 0x81
+//
+#pragma pack (1)
+//
+// This is definition for SMBIOS Oem data type 0x83
+//
+typedef struct {
+ UINT32 VMXState : 1; //[0] VMX state (On/Off)
+ UINT32 SMXState : 1; //[1] SMX state (On/Off)
+ UINT32 LtTxtCap : 1; //[2] LT/TXT capability
+ UINT32 LtTxtEnabled : 1; //[3] LT/TXT Enabled state (Optional for vPro verification)
+ UINT32 VTxCap : 1; //[4] VT-x capability
+ UINT32 VTxEnabled : 1; //[5] VT-x Enabled state (Optional for vPro verification)
+ UINT32 Reserved : 26; //[31:6] Reserved, set to 0
+} CPU_CAP;
+
+typedef struct {
+ UINT32 FunctionNumber : 3; //[2:0] PCI Device Function Number
+ UINT32 DeviceNumber : 5; //[7:3] PCI Device Device Number
+ UINT32 BusNumber : 8; //[15:8] PCI Device Bus Number
+ UINT32 DeviceID : 16; //[31:16] Device Identification Number (DID): This field is the identifier of ICHx PCI device.DID will be set to 0xFF if not found.
+ UINT32 Reserved : 32; //[63:32] Reserved, must set to 0xFF
+} PCH_CAP;
+
+typedef struct {
+ UINT32 FunctionNumber : 3; //[2:0] PCI Device Function Number of Wired LAN
+ UINT32 DeviceNumber : 5; //[7:3] PCI Device Device Number of Wired LAN
+ UINT32 BusNumber : 8; //[15:8] PCI Device Bus Number of Wired LAN
+ UINT32 DeviceID : 16; //[31:16] PCI Device Identifier (DID) of wired NIC. DID will be set to 0xFF if not found.
+ UINT16 Reserved1; //[47:32] Reserved for Wired NIC.
+ UINT32 wFunctionNumber : 3; //[51:48] PCI Device Function Number of Wireless LAN
+ UINT32 wDeviceNumber : 5; //[56:52] PCI Device Device Number of Wireless LAN
+ UINT32 wBusNumber : 8; //[64:57] PCI Device Bus Number of Wireless LAN
+ UINT32 wDeviceID : 16; //[80:65] PCI Device Identifier (DID) of Wireless NIC. DID will be set to 0xFF if not found.
+ UINT16 wReserved1; //[95:81] Reserved for Wireless NIC.
+} NETWORK_DEV;
+
+
+typedef struct {
+ UINT32 Reserved1 : 1; //[0] Reserved, must be set to 0
+ UINT32 VTdSupport : 1; //[1] BIOS supports VT-d in BIOS setup screen (can be editable).
+ UINT32 TxtSupport : 1; //[2] BIOS supports TXT in BIOS setup screen (can be editable).
+ UINT32 Reserved2 : 1; //[3] Reserved, must be set to 0
+ UINT32 MeSupport : 1; //[4] BIOS supports ME in BIOS setup screen (can be editable).
+ UINT32 VTxSupport : 1; //[5] BIOS supports VT-x in BIOS setup screen (can be editable).
+ // The PlaformDataInSpi & MaxVASupported moved from Bit 6 & 7 to 8, 9
+ UINT32 TdtPbaSupport : 1; //[6] BIOS supports VT-d in BIOS setup screen (can be editable).
+ UINT32 TdtWwanSuport : 1; //[7] BIOS supports TXT in BIOS setup screen (can be editable).
+ UINT32 Reserved : 24; //[31:8] Reserved, must set to 0
+} BIOS_CAP;
+
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER Header;
+ CPU_CAP CpuCapabilities;
+ UINT16 vMEBX_Major;
+ UINT16 vMEBX_Minor;
+ UINT16 vMEBX_HotFix;
+ UINT16 vMEBX_Build;
+ PCH_CAP PchCapabilities;
+ ME_CAP MeCapabilities;
+ UINT16 Reserved1[2];
+ NETWORK_DEV NetworkDevice;
+ BIOS_CAP BiosCapabilities;
+ UINT8 vProSignature[4];
+ UINT32 Reserved2;
+ UINT16 Zero; //terminator
+} EFI_MISC_OEM_TYPE_0x83;
+
+#pragma pack ()
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//************************************************************************* \ No newline at end of file
diff --git a/Board/EM/MeWrapper/Smbios131/Smbios131.mak b/Board/EM/MeWrapper/Smbios131/Smbios131.mak
new file mode 100644
index 0000000..90ff37b
--- /dev/null
+++ b/Board/EM/MeWrapper/Smbios131/Smbios131.mak
@@ -0,0 +1,158 @@
+#*************************************************************************
+#*************************************************************************
+#** **
+#** (C)Copyright 1985-2010, American Megatrends, Inc. **
+#** **
+#** All Rights Reserved. **
+#** **
+#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+#** **
+#** Phone: (770)-246-8600 **
+#** **
+#*************************************************************************
+#*************************************************************************
+#**********************************************************************
+#
+# $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/MeWrapper/Smbios131/Smbios131.mak 5 12/18/12 2:29a Klzhan $
+#
+# $Revision: 5 $
+#
+# $Date: 12/18/12 2:29a $
+#
+#**********************************************************************
+# Revision History
+# ----------------
+# $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/MeWrapper/Smbios131/Smbios131.mak $
+#
+# 5 12/18/12 2:29a Klzhan
+# [TAG] EIP109707
+# [Category] Spec Update
+# [Severity] Important
+# [Description] Update ME RC 0.81
+# [Files] Smbios131.sdl
+# Smbios131.mak
+# Smbios131.c
+# Smbios131.dxs
+# Smbios131.h
+# Smbios131.cif
+#
+# 4 7/02/12 11:38p Klzhan
+# [TAG] EIP94113
+# [Category] Spec Update
+# [Severity] Important
+# [Description] Update ME RC0.6
+# [Files] Smbios131.sdl
+# Smbios131.mak
+# Smbios131.c
+# Smbios131.dxs
+# Smbios131.h
+# Smbios131.cif
+#
+# 3 4/24/12 12:32a Klzhan
+# Update modulepart to latest
+#
+# 2 2/23/12 8:57a Klzhan
+# Support New EDK
+#
+# 1 2/08/12 1:07a Klzhan
+# Initial Check in
+#
+# 3 7/26/11 9:57a Klzhan
+# Create token for some Bios capabilities parameters.
+#
+# 2 7/26/11 8:37a Klzhan
+# [TAG] EIP64542
+# [Category] Improvement
+# [Description] Replace Getvariable by GetNbSetupdata.
+# [Files] Smbios131.sdl
+# Smbios131.mak
+# Smbios131.c
+# Smbios131.dxs
+# Smbios131.h
+# Smbios131.cif
+#
+# 1 2/25/11 1:40a Klzhan
+# Initial Check-in
+#
+# 1 12/03/10 5:09a Klzhan
+# Initial Check-in.
+#
+#
+#**********************************************************************
+#
+#<AMI_FHDR_START>
+#----------------------------------------------------------------------------
+#
+# Name: Smbios131.c
+#
+# Description: Create SMbios type 131.
+#
+#----------------------------------------------------------------------------
+#<AMI_FHDR_END>
+# MAK file for the ModulePart:AmtSmbios
+all : AmtSmbios131
+
+$(BUILD_DIR)\Smbios131.mak : $(Smbios131_DIR)\$(@B).cif $(Smbios131_DIR)\$(@B).mak $(BUILD_RULES)
+ $(CIF2MAK) $(Smbios131_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS)
+
+AmtSmbios131 : $(BUILD_DIR)\Smbios131.mak AmtSmbios131Bin
+
+AmtSmbios131_INCLUDES=\
+ $(EdkIIGlueLib_INCLUDES)\
+ $(INTEL_PLATFORM_PROTOCOL_INCLUDES)\
+ /I$(EDK_SOURCE)\Foundation\Efi\Include\
+ $(NB_INCLUDES)\
+ $(ME_INCLUDES)\
+ $(INTEL_PCH_INCLUDES)\
+ $(INTEL_MCH_INCLUDES)\
+ /I$(MePlatformPolicy_DIR)\
+ /I$(PROJECT_DIR)\
+ /IInclude\
+
+AmtSmbios131_LIBS=\
+ $(AmtLibDxe_LIB)\
+ $(MeLibDxe_LIB)\
+ $(MeChipsetDxeLib_LIB)\
+ $(EDKPROTOCOLLIB)\
+ $(EFIDRIVERLIB)\
+ $(CPUIA32LIB)\
+ $(VaProtocolLib_LIB)\
+ $(EdkIIGlueDxeReportStatusCodeLib_LIB)\
+ $(EdkIIGlueDxeDebugLibReportStatusCode_LIB)\
+ $(EdkIIGlueBaseLib_LIB)\
+!IF "$(x64_BUILD)"=="1"
+ $(EdkIIGlueBaseLibX64_LIB)\
+!ELSE
+ $(EdkIIGlueBaseLibIA32_LIB)\
+!ENDIF
+ $(EdkIIGlueDxeMemoryAllocationLib_LIB)\
+ $(EdkIIGlueUefiLib_LIB)\
+ $(IntelPlatformProtocolLib_LIB)\
+ $(PchPlatformDxeLib_LIB)\
+
+AmtSmbios131Bin : $(AmtSmbios131_LIBS)
+ $(MAKE) /$(MAKEFLAGS) $(EDK_DEFAULTS)\
+ /f $(BUILD_DIR)\Smbios131.mak all \
+ NAME=Smbios131 \
+ MAKEFILE=$(BUILD_DIR)\Smbios131.mak \
+ "MY_INCLUDES=$(AmtSmbios131_INCLUDES)" \
+ GUID=2b341c7b-0b32-4a65-9d46-e1b3abd4c25c \
+ ENTRY_POINT=AmtSmbios131EntryPoint \
+ DEPEX1=$(Smbios131_DIR)\Smbios131.dxs \
+ DEPEX1_TYPE=EFI_SECTION_DXE_DEPEX \
+ TYPE=BS_DRIVER \
+ COMPRESS=1
+
+#*************************************************************************
+#*************************************************************************
+#** **
+#** (C)Copyright 1985-2010, American Megatrends, Inc. **
+#** **
+#** All Rights Reserved. **
+#** **
+#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+#** **
+#** Phone: (770)-246-8600 **
+#** **
+#*************************************************************************
+#*************************************************************************
diff --git a/Board/EM/MeWrapper/Smbios131/Smbios131.sdl b/Board/EM/MeWrapper/Smbios131/Smbios131.sdl
new file mode 100644
index 0000000..c57ae1e
--- /dev/null
+++ b/Board/EM/MeWrapper/Smbios131/Smbios131.sdl
@@ -0,0 +1,33 @@
+TOKEN
+ Name = "Smbios131_SUPPORT"
+ Value = "1"
+ Help = "Main switch to enable Smbios type 131 support in Project"
+ TokenType = Boolean
+ TargetMAK = Yes
+ Master = Yes
+End
+
+PATH
+ Name = "Smbios131_DIR"
+ Help = "AMT Smbios file source directory"
+End
+
+MODULE
+ Help = "Includes AmtSmbios.mak to Project"
+ File = "Smbios131.mak"
+End
+
+ELINK
+ Name = "$(BUILD_DIR)\Smbios131.ffs"
+ Parent = "FV_MAIN"
+ InvokeOrder = AfterParent
+End
+
+TOKEN
+ Name = "SetupSupportItem"
+ Value = "0xF"
+ Help = "Set BIOS Setup Item exist or not. Bit0 = Vt-d, Bit1 = Txt, Bit2 = ME, Bit3 = VTx"
+ TokenType = Integer
+ TargetH = Yes
+ Range = "0 - 2"
+End \ No newline at end of file