From b7c51c9cf4864df6aabb99a1ae843becd577237c Mon Sep 17 00:00:00 2001 From: raywu Date: Fri, 15 Jun 2018 00:00:50 +0800 Subject: init. 1AQQW051 --- Board/EM/Platform/AcpiAslWrap/AcpiAslWrap.cif | 12 + Board/EM/Platform/AcpiAslWrap/AcpiAslWrap.sdl | 50 + Board/EM/Platform/AcpiAslWrap/PlatformDock.asl | 47 + Board/EM/Platform/AcpiAslWrap/PlatformEC.asl | 206 ++ Board/EM/Platform/AcpiAslWrap/PlatformExternal.asl | 69 + Board/EM/Platform/AcpiAslWrap/PlatformPS2Wake.asl | 47 + Board/EM/Platform/AcpiIntelRC.h | 64 + Board/EM/Platform/AcpiPlatform.c | 3285 ++++++++++++++++++++ Board/EM/Platform/AcpiPlatform.cif | 44 + Board/EM/Platform/AcpiPlatform.dxs | 53 + Board/EM/Platform/AcpiPlatform.h | 240 ++ Board/EM/Platform/AcpiPlatform.mak | 170 + Board/EM/Platform/AcpiPlatform.sd | 1877 +++++++++++ Board/EM/Platform/AcpiPlatform.sdl | 483 +++ Board/EM/Platform/AcpiPlatform.uni | Bin 0 -> 45840 bytes Board/EM/Platform/AcpiPlatformCspLib.c | 150 + Board/EM/Platform/AcpiPlatformPei.c | 231 ++ Board/EM/Platform/AcpiPlatformPei.dxs | 50 + Board/EM/Platform/AcpiPlatformSmi.c | 247 ++ Board/EM/Platform/AcpiPlatformSmi.dxs | 61 + .../EM/Platform/EfiCombineImage/EfiCombineImage.c | 223 ++ .../Platform/EfiCombineImage/EfiCombineImage.cif | 10 + .../Platform/EfiCombineImage/EfiCombineImage.mak | 105 + .../Platform/EfiCombineImage/EfiCombineImage.sdl | 203 ++ .../EM/Platform/FirmwareVerInfo/FirmwareVerInfo.c | 218 ++ .../Platform/FirmwareVerInfo/FirmwareVerInfo.cif | 11 + .../Platform/FirmwareVerInfo/FirmwareVerInfo.dxs | 50 + .../Platform/FirmwareVerInfo/FirmwareVerInfo.mak | 29 + .../Platform/FirmwareVerInfo/FirmwareVerInfo.sdl | 80 + Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.c | 512 +++ Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.cif | 11 + Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.dxs | 47 + Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.mak | 55 + Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.sdl | 68 + Board/EM/Platform/GenAcpiTable.exe | Bin 0 -> 76088 bytes Board/EM/Platform/Include/IntelPlatformInclude.cif | 10 + Board/EM/Platform/Include/IntelPlatformInclude.sdl | 15 + Board/EM/Platform/Include/Ppi/IntelPlatformPpi.cif | 9 + Board/EM/Platform/Include/Ppi/IntelPlatformPpi.sdl | 15 + Board/EM/Platform/Include/Ppi/TcgPeiDone.h | 43 + .../IntelRefVerDisplay/IntelRefVerDisplay.cif | 12 + .../IntelRefVerDisplay/IntelRefVerDisplay.mak | 105 + .../IntelRefVerDisplay/IntelRefVerDisplay.sd | 159 + .../IntelRefVerDisplay/IntelRefVerDisplay.sdl | 36 + .../IntelRefVerDisplay/IntelRefVerDisplay.uni | Bin 0 -> 10168 bytes .../Platform/IntelRefVerDisplay/IntelRefVerSetup.c | 261 ++ .../EM/Platform/Library/Dxe/DxeKscLib/DxeKscLib.c | 288 ++ .../Platform/Library/Dxe/DxeKscLib/DxeKscLib.cif | 11 + .../Platform/Library/Dxe/DxeKscLib/DxeKscLib.mak | 65 + .../Platform/Library/Dxe/DxeKscLib/DxeKscLib.sdl | 40 + Board/EM/Platform/Library/Dxe/DxeKscLib/KscLib.h | 260 ++ .../Platform/Library/IntelPlatformProtocolLib.cif | 13 + .../Platform/Library/IntelPlatformProtocolLib.mak | 64 + .../Platform/Library/IntelPlatformProtocolLib.sdl | 47 + .../Library/Protocol/GlobalNvsArea/GlobalNvsArea.c | 37 + .../Library/Protocol/GlobalNvsArea/GlobalNvsArea.h | 535 ++++ Board/EM/Platform/PlatformInfo/PlatformInfo.c | 166 + Board/EM/Platform/PlatformInfo/PlatformInfo.cif | 12 + Board/EM/Platform/PlatformInfo/PlatformInfo.dxs | 59 + Board/EM/Platform/PlatformInfo/PlatformInfo.h | 74 + Board/EM/Platform/PlatformInfo/PlatformInfo.mak | 82 + Board/EM/Platform/PlatformInfo/PlatformInfo.sdl | 93 + Board/EM/Platform/PlatformSetup.h | 101 + .../Platform/PlatformSetupInfo/PlatformSetupInfo.c | 866 ++++++ .../PlatformSetupInfo/PlatformSetupInfo.cif | 13 + .../Platform/PlatformSetupInfo/PlatformSetupInfo.h | 150 + .../PlatformSetupInfo/PlatformSetupInfo.mak | 82 + .../PlatformSetupInfo/PlatformSetupInfo.sd | 300 ++ .../PlatformSetupInfo/PlatformSetupInfo.sdl | 38 + .../PlatformSetupInfo/PlatformSetupInfo.uni | Bin 0 -> 20440 bytes Board/EM/Platform/ReleaseNotes.chm | Bin 0 -> 252673 bytes .../Platform/SMBIOSUpdateData/SMBIOSUpdateData.c | 731 +++++ .../Platform/SMBIOSUpdateData/SMBIOSUpdateData.cif | 12 + .../Platform/SMBIOSUpdateData/SMBIOSUpdateData.dxs | 49 + .../Platform/SMBIOSUpdateData/SMBIOSUpdateData.mak | 77 + .../Platform/SMBIOSUpdateData/SMBIOSUpdateData.sdl | 24 + .../SMBIOSUpdateData/SmbiosUpdateDataProtocol.h | 100 + Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.asl | 52 + Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.cif | 10 + Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.mak | 80 + Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.sdl | 31 + Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.asl | 180 ++ Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.cif | 10 + Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.mak | 80 + Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.sdl | 32 + Board/EM/Platform/iasl.exe | Bin 0 -> 693248 bytes 86 files changed, 14537 insertions(+) create mode 100644 Board/EM/Platform/AcpiAslWrap/AcpiAslWrap.cif create mode 100644 Board/EM/Platform/AcpiAslWrap/AcpiAslWrap.sdl create mode 100644 Board/EM/Platform/AcpiAslWrap/PlatformDock.asl create mode 100644 Board/EM/Platform/AcpiAslWrap/PlatformEC.asl create mode 100644 Board/EM/Platform/AcpiAslWrap/PlatformExternal.asl create mode 100644 Board/EM/Platform/AcpiAslWrap/PlatformPS2Wake.asl create mode 100644 Board/EM/Platform/AcpiIntelRC.h create mode 100644 Board/EM/Platform/AcpiPlatform.c create mode 100644 Board/EM/Platform/AcpiPlatform.cif create mode 100644 Board/EM/Platform/AcpiPlatform.dxs create mode 100644 Board/EM/Platform/AcpiPlatform.h create mode 100644 Board/EM/Platform/AcpiPlatform.mak create mode 100644 Board/EM/Platform/AcpiPlatform.sd create mode 100644 Board/EM/Platform/AcpiPlatform.sdl create mode 100644 Board/EM/Platform/AcpiPlatform.uni create mode 100644 Board/EM/Platform/AcpiPlatformCspLib.c create mode 100644 Board/EM/Platform/AcpiPlatformPei.c create mode 100644 Board/EM/Platform/AcpiPlatformPei.dxs create mode 100644 Board/EM/Platform/AcpiPlatformSmi.c create mode 100644 Board/EM/Platform/AcpiPlatformSmi.dxs create mode 100644 Board/EM/Platform/EfiCombineImage/EfiCombineImage.c create mode 100644 Board/EM/Platform/EfiCombineImage/EfiCombineImage.cif create mode 100644 Board/EM/Platform/EfiCombineImage/EfiCombineImage.mak create mode 100644 Board/EM/Platform/EfiCombineImage/EfiCombineImage.sdl create mode 100644 Board/EM/Platform/FirmwareVerInfo/FirmwareVerInfo.c create mode 100644 Board/EM/Platform/FirmwareVerInfo/FirmwareVerInfo.cif create mode 100644 Board/EM/Platform/FirmwareVerInfo/FirmwareVerInfo.dxs create mode 100644 Board/EM/Platform/FirmwareVerInfo/FirmwareVerInfo.mak create mode 100644 Board/EM/Platform/FirmwareVerInfo/FirmwareVerInfo.sdl create mode 100644 Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.c create mode 100644 Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.cif create mode 100644 Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.dxs create mode 100644 Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.mak create mode 100644 Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.sdl create mode 100644 Board/EM/Platform/GenAcpiTable.exe create mode 100644 Board/EM/Platform/Include/IntelPlatformInclude.cif create mode 100644 Board/EM/Platform/Include/IntelPlatformInclude.sdl create mode 100644 Board/EM/Platform/Include/Ppi/IntelPlatformPpi.cif create mode 100644 Board/EM/Platform/Include/Ppi/IntelPlatformPpi.sdl create mode 100644 Board/EM/Platform/Include/Ppi/TcgPeiDone.h create mode 100644 Board/EM/Platform/IntelRefVerDisplay/IntelRefVerDisplay.cif create mode 100644 Board/EM/Platform/IntelRefVerDisplay/IntelRefVerDisplay.mak create mode 100644 Board/EM/Platform/IntelRefVerDisplay/IntelRefVerDisplay.sd create mode 100644 Board/EM/Platform/IntelRefVerDisplay/IntelRefVerDisplay.sdl create mode 100644 Board/EM/Platform/IntelRefVerDisplay/IntelRefVerDisplay.uni create mode 100644 Board/EM/Platform/IntelRefVerDisplay/IntelRefVerSetup.c create mode 100644 Board/EM/Platform/Library/Dxe/DxeKscLib/DxeKscLib.c create mode 100644 Board/EM/Platform/Library/Dxe/DxeKscLib/DxeKscLib.cif create mode 100644 Board/EM/Platform/Library/Dxe/DxeKscLib/DxeKscLib.mak create mode 100644 Board/EM/Platform/Library/Dxe/DxeKscLib/DxeKscLib.sdl create mode 100644 Board/EM/Platform/Library/Dxe/DxeKscLib/KscLib.h create mode 100644 Board/EM/Platform/Library/IntelPlatformProtocolLib.cif create mode 100644 Board/EM/Platform/Library/IntelPlatformProtocolLib.mak create mode 100644 Board/EM/Platform/Library/IntelPlatformProtocolLib.sdl create mode 100644 Board/EM/Platform/Library/Protocol/GlobalNvsArea/GlobalNvsArea.c create mode 100644 Board/EM/Platform/Library/Protocol/GlobalNvsArea/GlobalNvsArea.h create mode 100644 Board/EM/Platform/PlatformInfo/PlatformInfo.c create mode 100644 Board/EM/Platform/PlatformInfo/PlatformInfo.cif create mode 100644 Board/EM/Platform/PlatformInfo/PlatformInfo.dxs create mode 100644 Board/EM/Platform/PlatformInfo/PlatformInfo.h create mode 100644 Board/EM/Platform/PlatformInfo/PlatformInfo.mak create mode 100644 Board/EM/Platform/PlatformInfo/PlatformInfo.sdl create mode 100644 Board/EM/Platform/PlatformSetup.h create mode 100644 Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.c create mode 100644 Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.cif create mode 100644 Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.h create mode 100644 Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.mak create mode 100644 Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.sd create mode 100644 Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.sdl create mode 100644 Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.uni create mode 100644 Board/EM/Platform/ReleaseNotes.chm create mode 100644 Board/EM/Platform/SMBIOSUpdateData/SMBIOSUpdateData.c create mode 100644 Board/EM/Platform/SMBIOSUpdateData/SMBIOSUpdateData.cif create mode 100644 Board/EM/Platform/SMBIOSUpdateData/SMBIOSUpdateData.dxs create mode 100644 Board/EM/Platform/SMBIOSUpdateData/SMBIOSUpdateData.mak create mode 100644 Board/EM/Platform/SMBIOSUpdateData/SMBIOSUpdateData.sdl create mode 100644 Board/EM/Platform/SMBIOSUpdateData/SmbiosUpdateDataProtocol.h create mode 100644 Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.asl create mode 100644 Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.cif create mode 100644 Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.mak create mode 100644 Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.sdl create mode 100644 Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.asl create mode 100644 Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.cif create mode 100644 Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.mak create mode 100644 Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.sdl create mode 100644 Board/EM/Platform/iasl.exe (limited to 'Board/EM/Platform') diff --git a/Board/EM/Platform/AcpiAslWrap/AcpiAslWrap.cif b/Board/EM/Platform/AcpiAslWrap/AcpiAslWrap.cif new file mode 100644 index 0000000..5cd5058 --- /dev/null +++ b/Board/EM/Platform/AcpiAslWrap/AcpiAslWrap.cif @@ -0,0 +1,12 @@ + + name = "AcpiAslWrap" + category = ModulePart + LocalRoot = "Board\EM\Platform\AcpiAslWrap\" + RefName = "AcpiAslWrap" +[files] +"AcpiAslWrap.sdl" +"PlatformPS2Wake.asl" +"PlatformEC.asl" +"PlatformDock.asl" +"PlatformExternal.asl" + diff --git a/Board/EM/Platform/AcpiAslWrap/AcpiAslWrap.sdl b/Board/EM/Platform/AcpiAslWrap/AcpiAslWrap.sdl new file mode 100644 index 0000000..1040bc2 --- /dev/null +++ b/Board/EM/Platform/AcpiAslWrap/AcpiAslWrap.sdl @@ -0,0 +1,50 @@ +TOKEN + Name = "AcpiAslWrap_SUPPORT" + Value = "1" + Help = "Main switch to enable Ref code AcpiAsl Wrap support in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + TargetH = Yes + Master = Yes +End + +PATH + Name = "AcpiAslWrap_DIR" +End + +ELINK + Name = "/I$(AcpiAslWrap_DIR)" + Parent = "ACPI_PLATFORM_INCLUDES" + InvokeOrder = AfterParent +End + +#ELINK +# Name = "$(AcpiAslWrap_DIR)\PlatformPS2Wake.ASL" +# Parent = "INTEL_GENERIC_ASL" +# Token = "CRB_SIO_SUPPORT" "=" "0" +# InvokeOrder = AfterParent +#End + +ELINK + Name = "$(AcpiAslWrap_DIR)\PlatformEC.asl" + Parent = "INTEL_EC_ASL" + Token = "PlatformAcpiTables_SUPPORT" "=" "1" + InvokeOrder = AfterParent +End + +ELINK + Name = "$(AcpiAslWrap_DIR)\PlatformDock.asl" + Parent = "INTEL_GENERIC_ASL" + InvokeOrder = AfterParent + Token = "FACP_FLAG_DCK_CAP" "=" "0" + Token = "CRB_EC_SUPPORT" "=" "1" +End + + +ELINK + Name = "$(AcpiAslWrap_DIR)\PlatformExternal.asl" + Parent = "INTEL_GENERIC_ASL" + InvokeOrder = AfterParent + Priority = 10 +End diff --git a/Board/EM/Platform/AcpiAslWrap/PlatformDock.asl b/Board/EM/Platform/AcpiAslWrap/PlatformDock.asl new file mode 100644 index 0000000..32558c7 --- /dev/null +++ b/Board/EM/Platform/AcpiAslWrap/PlatformDock.asl @@ -0,0 +1,47 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// +// +// Name: PlatformDock.asl +// +// +//************************************************************************* + +Device (\_SB.PCI0.DOCK) +{ + Name(_HID, "ABCD0000") + Name(_CID, EISAID("PNP0C15")) + Name(_UID,2) + Method(_STA) + { + Return(0x00) + } + +} + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Board/EM/Platform/AcpiAslWrap/PlatformEC.asl b/Board/EM/Platform/AcpiAslWrap/PlatformEC.asl new file mode 100644 index 0000000..3823368 --- /dev/null +++ b/Board/EM/Platform/AcpiAslWrap/PlatformEC.asl @@ -0,0 +1,206 @@ +/**************************************************************************; +;* *; +;* Intel Confidential *; +;* *; +;* Intel Corporation - ACPI Reference Code for the Sandy Bridge *; +;* Family of Customer Reference Boards. *; +;* *; +;* *; +;* Copyright (c) 1999 - 2010 Intel Corporation. All rights reserved *; +;* This software and associated documentation (if any) is furnished *; +;* under a license and may only be used or copied in accordance *; +;* with the terms of the license. Except as permitted by such *; +;* license, no part of this software or documentation may be *; +;* reproduced, stored in a retrieval system, or transmitted in any *; +;* form or by any means without the express written consent of *; +;* Intel Corporation. *; +;* *; +;* *; +;**************************************************************************/ +/*++ + This file contains a 'Sample Driver' and is licensed as such + under the terms of your license agreement with Intel or your + vendor. This file may be modified by the user, subject to + the additional terms of the license agreement +--*/ + +Scope(\_SB.PCI0.LPCB) +{ + +Device(H_EC) // Hitachi Embedded Controller +{ + Name(_HID, EISAID("PNP0C09")) + + Name(_UID,1) + + Method(_STA) + { + Store(3, \_SB.PCI0.GFX0.CLID) + Return(0x00) //Hide device + } + + Name(B1CC, 0) + Name(B1ST, 0) + Name(B2CC, 0) + Name(B2ST, 0) + Name(CFAN, 0) + Name(CMDR, 0) + Name(DOCK, 0) + Name(EJET, 0) + Name(MCAP, 0) + Name(PLMX, 0) + Name(PECH, 0) + Name(PECL, 0) + Name(PENV, 0) + Name(PINV, 0) + Name(PPSH, 0) + Name(PPSL, 0) + Name(PSTP, 0) + Name(RPWR, 0) + Name(LIDS, 0) + Name(LSTE, 0) + Name(SLPC, 0) + Name(VPWR, 0) + Name(WTMS, 0) + Name(AWT2, 0) + Name(AWT1, 0) + Name(AWT0, 0) + Name(DLED, 0) + Name(IBT1, 0) + Name(ECAV, Zero) // OS Bug Checks if EC OpRegion accessed before Embedded Controller Driver loaded + Name(SPT2, 0) + Name(PB10, 0) + + // ECRD (Embedded Read Method) + // + // Handle all commands sent to EC by BIOS + // + // Arguments: (1) + // Arg0 - Object to Read + // Return Value: + // Read Value + // + Method(ECRD,1,Serialized, 0, IntObj, FieldUnitObj) + { + Return(DeRefOf(Arg0)) + } + + // ECWT (Embedded Write Method) + // + // Handle all commands sent to EC by BIOS + // + // Arguments: (2) + // Arg0 - Value to Write + // Arg1 - Object to Write to + // + Method(ECWT,2,Serialized,,,{IntObj, FieldUnitObj}) + { + Store(Arg0,Arg1) + } + + + Method(ECMD,1,Serialized) // Handle all commands sent to EC by BIOS + { + If (\ECON) + { + While(\_SB.PCI0.LPCB.H_EC.CMDR){Stall(20)} + Store(Arg0, \_SB.PCI0.LPCB.H_EC.CMDR) + } + } + + Device(BAT0) + { + Name(_HID,EISAID("PNP0C0A")) + + Name(_UID,0) + + Method(_STA,0) + { + Return(0) // Hide device + } + } + + // Real battery code + // + Scope(\) + { + // these fields come from the Global NVS area + Field(GNVS,AnyAcc,Lock,Preserve) + { + Offset(30), // Battery Support Registers: + BNUM, 8, // (30) Battery Number Present + Offset(32), + B1SC, 8, // (32) Battery 1 Stored Capacity + Offset(35), + B1SS, 8, // (35) Battery 1 Stored Status + } + } // end Scope(\) + + Device(BAT1) + { + Name(_HID,EISAID("PNP0C0A")) + + Name(_UID,1) + + Method(_STA,0) + { + Return(0) // Hide device + } + } + + Scope(\) + { + // these fields come from the Global NVS area + Field(GNVS,AnyAcc,Lock,Preserve) + { + Offset(33), + B2SC, 8, // (33) Battery 2 Stored Capacity + Offset(36), + B2SS, 8 // (36) Battery 2 Stored Status + } + } // end Scope(\) + Device(BAT2) + { + Name(_HID,EISAID("PNP0C0A")) + + Name(_UID,2) + + Method(_STA,0) + { + Return(0) // Hide device + } + } + + } +}// end scope Scope(\_SB.PCI0.LPCB) + // System Bus + +Device (\_SB.PCI0.DOCK) +{ + Name(_HID, "ABCD0000") + Name(_CID, EISAID("PNP0C15")) + Name(_UID,2) + Method(_STA) + { + Return(0x00) + } + +} +Scope(\_SB) +{ + + // Define a Lid Switch. + + Device(LID0) + { + Name(_HID,EISAID("PNP0C0D")) + + Method(_STA) + { + Return(0x00) + } + + } +}//end scope _SB + + diff --git a/Board/EM/Platform/AcpiAslWrap/PlatformExternal.asl b/Board/EM/Platform/AcpiAslWrap/PlatformExternal.asl new file mode 100644 index 0000000..b83720e --- /dev/null +++ b/Board/EM/Platform/AcpiAslWrap/PlatformExternal.asl @@ -0,0 +1,69 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// +// +// Name: PlatformExternal.asl +// +// +//************************************************************************* + +#if !defined(ASL_Remove_SaSsdt_Data_To_Dsdt) || (ASL_Remove_SaSsdt_Data_To_Dsdt == 0) +External(LHIH) +External(LLOW) +External(IGDS) +External(LIDS) +External(BRTL) +External(ALSE) +External(GSMI) +External(\_SB.PCI0.GFX0.ALSI) +External(\_SB.PCI0.GFX0.CDCK) +External(\_SB.PCI0.GFX0.CBLV) +External(\_SB.PCI0.GFX0.GSSE) +External(\_SB.PCI0.PEG0, DeviceObj) +External(\_SB.PCI0.PEG0.PEGP, DeviceObj) +External(\_SB.PCI0.PEG1, DeviceObj) +External(\_SB.PCI0.PEG2, DeviceObj) +External(\_SB.PCI0.GFX0.DD1F, DeviceObj) +External(\_SB.PCI0.GFX0.GDCK, MethodObj) +External(\_SB.PCI0.GFX0.GHDS, MethodObj) +External(\_SB.PCI0.GFX0.AINT, MethodObj) +External(\_SB.PCI0.GFX0.GLID, MethodObj) +External(\_SB.PCI0.GFX0.GSCI, MethodObj) +#endif +External(\_PR.CPU0, DeviceObj) +External(\_PR.CPU0._PSS, MethodObj) +External(\_PR.CPU0._PPC, IntObj) +#if !defined(ASL_EC_SUPPORT) || (ASL_EC_SUPPORT == 0) +#if !defined(ASL_Remove_SaSsdt_Data_To_Dsdt) || (ASL_Remove_SaSsdt_Data_To_Dsdt == 0) +External(\_SB.PCI0.GFX0.CLID) +External(\_SB.PCI0.GFX0.IUEH, MethodObj) +#endif +External(\_SB.IETM, DeviceObj) +#endif // ASL_EC_SUPPORT + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Board/EM/Platform/AcpiAslWrap/PlatformPS2Wake.asl b/Board/EM/Platform/AcpiAslWrap/PlatformPS2Wake.asl new file mode 100644 index 0000000..7f71d5f --- /dev/null +++ b/Board/EM/Platform/AcpiAslWrap/PlatformPS2Wake.asl @@ -0,0 +1,47 @@ +/**************************************************************************; +;* *; +;* Intel Confidential *; +;* *; +;* Intel Corporation - ACPI Reference Code for the Sandy Bridge *; +;* Family of Customer Reference Boards. *; +;* *; +;* *; +;* Copyright (c) 1999 - 2010 Intel Corporation. All rights reserved *; +;* This software and associated documentation (if any) is furnished *; +;* under a license and may only be used or copied in accordance *; +;* with the terms of the license. Except as permitted by such *; +;* license, no part of this software or documentation may be *; +;* reproduced, stored in a retrieval system, or transmitted in any *; +;* form or by any means without the express written consent of *; +;* Intel Corporation. *; +;* *; +;* *; +;**************************************************************************/ +/*++ + This file contains a 'Sample Driver' and is licensed as such + under the terms of your license agreement with Intel or your + vendor. This file may be modified by the user, subject to + the additional terms of the license agreement +--*/ + +Scope(\_SB) +{ + Device(PWRB) + { + Name(_HID,EISAID("PNP0C0C")) + + // GPI14 = GPE30 = Waketime SCI. The PRW isn't working when + // placed in any of the logical locations ( PS2K, PS2M, + // H_EC ), so a Power Button Device was created specifically + // for the WAKETIME_SCI PRW. + + Name(_PRW, Package(){30,4}) + + Method(_STA) + { + Return(0x0F) + } + }//end device PWRB +}//end scope _SB + + diff --git a/Board/EM/Platform/AcpiIntelRC.h b/Board/EM/Platform/AcpiIntelRC.h new file mode 100644 index 0000000..72de447 --- /dev/null +++ b/Board/EM/Platform/AcpiIntelRC.h @@ -0,0 +1,64 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/AcpiIntelRC.h 1 2/09/12 12:31a Yurenlai $ +// +// $Revision: 1 $ +// +// $Date: 2/09/12 12:31a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/AcpiIntelRC.h $ +// +// 1 2/09/12 12:31a Yurenlai +// Initial check in. +// +//************************************************************************* +//************************************************************************* +// +// +// Name: AcpiIntelRC.h +// +// Description: AcpiPlatform header file, Change ASL name +// +// +//************************************************************************* + +#ifndef __ACPIINTELRC_H__ +#define __ACPIINTELRC_H__ + +// Change name "SBRG" to "LPCB" for Intel RC +#define SBRG LPCB + + +#endif + + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + + diff --git a/Board/EM/Platform/AcpiPlatform.c b/Board/EM/Platform/AcpiPlatform.c new file mode 100644 index 0000000..19b8d21 --- /dev/null +++ b/Board/EM/Platform/AcpiPlatform.c @@ -0,0 +1,3285 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Board/EM/Platform/AcpiPlatform.c 4 4/19/16 7:43a Chienhsieh $ +// +// $Revision: 4 $ +// +// $Date: 4/19/16 7:43a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Board/EM/Platform/AcpiPlatform.c $ +// +// 4 4/19/16 7:43a Chienhsieh +// +// 34 7/11/14 4:00a Joshchou +// [TAG] None +// [Category] Improvement +// [Description] Support Debug Port Table. +// [Files] AcpiPlatform.c +// AcpiPlatform.h +// AcpiPlatform.cif +// +// 33 5/15/14 3:14a Joshchou +// [TAG] EIP167036 +// [Category] Improvement +// [Description] review the attributes of variable. +// [Files] AcpiPlatform.c +// AcpiPlatform.h +// AcpiPlatform.sd +// AcpiPlatform.cif +// +// 32 4/23/14 4:21a Joshchou +// +// 31 9/27/13 10:43a Joshchou +// [TAG] EIP137454 +// [Category] New Feature +// [Description] Follow Intel sample code to add LPIT table. +// +// 30 9/18/13 8:00a Joshchou +// [TAG] None +// [Category] Improvement +// [Description] Fix the CppCheck error. +// +// 29 9/18/13 6:25a Joshchou +// [TAG] EIP136411 +// [Category] Improvement +// [Description] Support MWAIT LPI State Descriptor[1]. +// +// 28 7/19/13 2:57a Alanlin +// [TAG] None +// [Category] Important +// [Severity] Important +// [Description] Fixed the system may hang up when DEBUG_MODE is ON. +// While trying to use SetAcpiTable to create LPIT table, reture status is +// EFI_INVALID_PARAMETER. +// [Files] AcpiPlatform.c +// +// 27 7/16/13 5:58a Alanlin +// [TAG] EIP125350 +// [Category] Normal +// [Severity] Normal +// [Description] System BIOS Support for the Hardware Button for Windows* +// 8.1 - Rev.0.5 +// [Files] AcpiPlatform.c, AcpiPlatform.sd, AcpiPlatform.uni +// +// [TAG] EIP127540 +// [Category] Normal +// [Severity] Normal +// [Description] Windows* 8.1 Micro-PEP (uPEP) ASL Support Version 0.5 +// [Files] AcpiPlatform.c, AcpiPlatform.h +// +// 26 7/15/13 5:32a Alanlin +// [TAG] EIP129086 +// [Category] Important +// [Severity] Important +// [Description] Update Shark Bay Client ACPI Reference Code Beta Version +// 1.6.1 +// +// 25 6/28/13 5:22a Alanlin +// [TAG] None +// [Category] Important +// [Severity] Important +// [Description] Fixed that Processors device are disappeared under OS +// device manager. +// [Files] AcpiPlatform.c, AcpiPlatform.h +// +// 24 6/04/13 10:18a Alanlin +// [TAG] None +// [Category] Improvement +// [Severity] Normal +// [Description] Follow Intel CRB BIOS v126 to set default configuraton +// setting of RTD3 devices. +// [Files] AcpiPlatform.c, AcpiPlatform.sd, AcpiPlatform.uni +// +// 23 3/26/13 9:30a Alanlin +// [TAG] EIP119125 +// [Category] Important +// [Severity] Important +// [Description] Update Shark Bay Client ACPI Reference Code Beta Version +// 1.3.1 +// +// 22 3/15/13 6:59a Alanlin +// [TAG] None +// [Category] Normal +// [Severity] Normal +// [Description] Add a "Remove_SaSsdt_Data_To_Dsdt" token, it can remove +// related Sa Ssdt acpi data to Dsdt. +// [Files] PlatformExternal.asl, Acpiplatform.c, EC.asl, GloblNvs.asl, +// Gpe.asl, Video.asl. +// +// 21 2/21/13 1:16a Alanlin +// [TAG] EIP114876 +// [Category] Normal +// [Severity] Normal +// [Description] To close Readytoboot event-function : CallbackBootScript +// +// 20 2/15/13 1:12a Alanlin +// [TAG] EIP114919 +// [Category] Important +// [Severity] Important +// [Description] Update Shark Bay Client ACPI Reference Code Beta Version +// 1.1.0 +// +// 19 1/28/13 11:13p Alanlin +// [TAG] EIP113555 +// [Category] Important +// [Severity] Important +// [Description] Update Shark Bay Client ACPI Reference Code Beta Version +// 1.0.0 +// +// 18 1/18/13 3:57a Alanlin +// +// 17 1/15/13 5:46a Alanlin +// [TAG] None +// [Category] Normal +// [Severity] Normal +// [Description] Add setup item and setting for DPTF +// [Files] Acpiplatform.c, Acpiplatform.sd, Acpiplatform.uni, +// PlatformSetup.h +// +// 16 12/18/12 11:02p Alanlin +// [TAG] EIP107188 +// [Category] Important +// [Severity] Important +// [Description] USB 3.0 port can't work when RTD3 is Enabled in setup +// menu. +// [Files] Acpiplatform.c, Acpiplatform.mak, Acpiplatform.sd, +// Acpiplatform.uni. +// +// 15 11/26/12 6:04a Alanlin +// [TAG] None +// [Category] Improvement +// [Severity] Normal +// [Description] Include Rtd3FFRD.asl for Haswell - FFRD SKU Board. +// BRRtd3.asl for Haswell - Basking Ridge Board. +// [Files] SsdtRtd3.cif, SsdtRtd3.sdl, Rtd3FFRD.asl, BRRtd3.asl, +// Acpiplatform.c +// +// [TAG] None +// [Category] Improvement +// [Severity] Important +// [Description] Fixed the system has blue screen when RTD3 is Enabled. +// [Files] SsdtZpOdd.sdl, Acpiplatform.c +// +// 14 11/20/12 7:08a Alanlin +// [TAG] None +// [Category] New Feature +// [Severity] Important +// [Description] SensorHub SSDT acpi table support +// [Files] Acpiplatform.c, Acpiplatform.cif, Acpiplatform.h, +// SsdtSensorHub.asl, SsdtSensorHub.mak, SsdtSensorHub.sdl +// +// [TAG] None +// [Category] Important +// [Severity] Important +// [Description] Update Shark Bay Client ACPI Reference Code Beta Version +// 0.8.0 +// +// 13 11/09/12 5:17a Alanlin +// [TAG] None +// [Category] New Feature +// [Severity] Important +// [Description] ZpOdd SSDT acpi table support +// [Files] Acpiplatform.c, Acpiplatform.cif, Acpiplatform.h, +// Acpiplatform.sd, Acpiplatform.uni +// +// 12 10/31/12 4:38a Alanlin +// [TAG] None +// [Category] Improvement +// [Severity] Normal +// [Description] Fine tune Platform Board Information. +// +// [TAG] None +// [Category] New Feature +// [Severity] Normal +// [Description] Support Acpi Debug SSDT. +// +// [TAG] None +// [Category] Improvement +// [Severity] Normal +// [Description] Removed all SaGlobalNvsArea Structure, move to SA module +// to initial. +// +// 11 10/15/12 11:40a Alanlin +// [TAG] None +// [Category] Improvement +// [Severity] Important +// [Description] Updated for RC 0.7.1 +// +// 10 9/12/12 7:20a Yurenlai +// [TAG] None +// [Category] Improvement +// [Severity] Important +// [Description] Remove AOAC for Intel Smart Connect Technology module. +// [Files] GlobalNvsArea.h, GloblNvs.asl +// +// 9 8/31/12 4:47a Yurenlai +// [TAG] None +// [Category] Improvement +// [Severity] Important +// [Description] Update Board ID for Haswell platform. +// [Files] AcpiPlatform.c, AcpiPlatform.sdl, PlatformInfo.sdl, +// AcpiAsl.sdl +// +// [TAG] None +// [Category] Improvement +// [Severity] Important +// [Description] Implement Runtime D3. +// [Files] AcpiPlatform.c, AcpiPlatform.cif, AcpiPlatform.h, +// AcpiPlatform.sd, AcpiPlatform.sdl, AcpiPlatform.uni, GlobalNvsArea.h, +// SsdtRtd3.cif, SsdtRtd3.mak, Ult0Rtd3.asl, SsdtRtd3.sdl +// +// 8 8/14/12 9:19a Yurenlai +// [TAG] None +// [Category] Improvement +// [Description] Remove useless Dppm policy. +// [Files] AcpiPlatform.c +// +// 7 7/27/12 5:11a Yurenlai +// [TAG] None +// [Category] Improvement +// [Description] Create DPTF and CPPC setup item. +// [Files] AcpiPlatform.c, AcpiPlatform.sd, AcpiPlatform.uni, +// PlatformSetup.h +// +// 6 7/03/12 1:28a Yurenlai +// [TAG] None +// [Category] Improvement +// [Description] Update Shark Bay Client ACPI Reference Code Alpha 2 +// 0.6.0. +// [Files] ReferenceCode\AcpiTables\*.*, GlobalNvsArea.h, +// AcpiPlatform.c, PlatformInfo.c, PlatformEC.asl +// +// 5 4/25/12 1:28p Yurenlai +// [TAG] None +// [Category] Improvement +// [Description] Initilize ACPI DXE Platform Policy. +// [Files] AcpiPlatform.c, AcpiPlatform.mak +// +// 3 4/05/12 7:46a Yurenlai +// [TAG] None +// [Category] Improvement +// [Severity] Important +// [Description] Fixed building error for Intel System Agent +// Label:"4.6.5.3_Intel_SA-RC_055_004". +// [Files] PlatformSetupInfo.c, PlatformSetupInfo.mak, +// AcpiPlatform.c, PlatformInfo.c +// +// 1 2/09/12 12:30a Yurenlai +// Initial check in. +// +//************************************************************************* +// +//--------------------------------------------------------------------------- +// +// Name: AcpiPlatform.c +// +// Description: Installs EFI_GLOBAL_NVS_AREA_PROTOCOL_GUID +// +//--------------------------------------------------------------------------- +// +#include +#include +#include +#include +#include +#include +///#include "CPUCspLib.h" +//#include "EfiCommonLib.h" +//#include "CpuFuncs.h" +///#include "Cpu.h" +//#include +#include +#include +#include +#include +#include +#include +#if CRB_EC_SUPPORT == 1 +#include +#endif +#include +#include + +#ifndef PPM_C3 +#define PPM_C3 0x8 +#endif + +#ifndef FADT_C3_LATENCY +#define FADT_C3_LATENCY 57 +#endif + +EFI_GUID gEfiGlobalNvsAreaProtocolGuid = EFI_GLOBAL_NVS_AREA_PROTOCOL_GUID; +EFI_GUID gEfiGlobalSaNvsAreaProtocolGuid = EFI_GLOBAL_SANVS_AREA_PROTOCOL_GUID; +EFI_GUID gPlatformInfoProtocolGuid = EFI_PLATFORM_INFO_PROTOCOL_GUID; +EFI_GUID gSetupGuid = SETUP_GUID; +#if defined PTID_SUPPORT && PTID_SUPPORT +EFI_GUID gAcpiPtidFfsTableStorageGuid = PTID_FFS_TABLE_STORAGE_GUID; +#endif +#if defined IntelRMT_SUPPORT && IntelRMT_SUPPORT +EFI_GUID gAcpiIRMTFfsTableStorageGuid = IRMT_FFS_TABLE_STORAGE_GUID; +#endif +#if defined RTD3_SUPPORT && RTD3_SUPPORT +EFI_GUID gAcpiRtd3FfsTableGuid = RTD3_FFS_TABLE_GUID; +#endif +#if defined ACPIDEBUG_SUPPORT && ACPIDEBUG_SUPPORT +EFI_GUID gAcpiDebugFfsTableGuid = ACPIDEBUG_FFS_TABLE_GUID; +#endif +#if defined ZPODD_SUPPORT && ZPODD_SUPPORT +EFI_GUID gAcpiZpOddFfsTableGuid = ZPODD_FFS_TABLE_GUID; +#endif +#if defined INTELSENSORHUB_SUPPORT && INTELSENSORHUB_SUPPORT +EFI_GUID gAcpiIntelSensorHubFfsTableGuid = INTELSENSORHUB_FFS_TABLE_GUID; +#endif +#if defined LPIT_SUPPORT && LPIT_SUPPORT +EFI_GUID gAcpiLpitGuid = LPIT_GUID; +#endif + +EFI_GLOBAL_NVS_AREA_PROTOCOL mGlobalNvsArea; +SYSTEM_AGENT_GLOBAL_NVS_AREA_PROTOCOL gSaGlobalNvsArea; + +VOID *GetDSDTTable (); +EFI_ACPI_SUPPORT_PROTOCOL *gEfiAcpiSupport = 0; +PLATFORM_INFO_PROTOCOL *gPlatformInfoProtocol; +VOID CallbackBootScript(IN EFI_EVENT Event, IN VOID *Context); +EFI_EVENT gEvtBootScript; +static SETUP_DATA *gSetupData = NULL; + +VOID DsdtTableUpdate (PACPI_HDR DsdtTable); +//VOID DsdtTableUpdate1 (PACPI_HDR DsdtTable); +VOID LoadDbgpTable(); + +#if defined LPIT_SUPPORT && LPIT_SUPPORT +VOID LoadLpitTable (); +#endif +#if defined PTID_SUPPORT && PTID_SUPPORT +VOID LoadSsdtPtidTable (); +EFI_STATUS LocateSupportProtocol (IN EFI_GUID *Protocol,OUT VOID **Instance,IN BOOLEAN Type ); +#endif +#if defined IntelRMT_SUPPORT && IntelRMT_SUPPORT +VOID LoadSsdtIRMTTable (); +EFI_STATUS LocateIRMTSupportProtocol (IN EFI_GUID *Protocol,OUT VOID **Instance,IN BOOLEAN Type ); +#endif +#if defined RTD3_SUPPORT && RTD3_SUPPORT +VOID LoadSsdtRtd3Table (); +EFI_STATUS LocateRTD3SupportProtocol (IN EFI_GUID *Protocol,OUT VOID **Instance,IN BOOLEAN Type ); +#endif +#if defined ACPIDEBUG_SUPPORT && ACPIDEBUG_SUPPORT +VOID LoadSsdtAcpiDebugTable (); +EFI_STATUS LocateAcpiDebugSupportProtocol (IN EFI_GUID *Protocol,OUT VOID **Instance,IN BOOLEAN Type ); +#define AcpiDebugBufferSize 0x10000 // 64k buffer data +#define ACPI_DEBUG_STR "INTEL ACPI DEBUG" +#define AML_NAME_OP 0x08 +#if defined ZPODD_SUPPORT && ZPODD_SUPPORT +VOID LoadSsdtZpOddTable (); +EFI_STATUS LocateZPODDSupportProtocol (IN EFI_GUID *Protocol,OUT VOID **Instance,IN BOOLEAN Type ); +#endif +#if defined INTELSENSORHUB_SUPPORT && INTELSENSORHUB_SUPPORT +VOID LoadSsdtIntelSensorHubTable (); +EFI_STATUS LocateIntelSensorHubSupportProtocol (IN EFI_GUID *Protocol,OUT VOID **Instance,IN BOOLEAN Type ); +#endif + +// +// ASL NAME structure +// +#pragma pack(1) +typedef struct { + UINT8 NameOp; // Byte [0]=0x08:NameOp. + UINT32 NameString; // Byte [4:1]=Name of object. + UINT8 DWordPrefix; // Byte [5]=0x0C:DWord Prefix. + UINT32 Value; // 0 ; Value of named object. +} NAME_LAYOUT; +#pragma pack() +#endif + +#include +#include +EFI_GUID gAcpiPlatformPolicyProtocolGuid = ACPI_PLATFORM_POLICY_PROTOCOL_GUID; + +// Protocols that are installed +ACPI_PLATFORM_POLICY_PROTOCOL mAcpiPlatformPolicyProtocol = { 0 }; +EFI_ACPI_INFO_PROTOCOL mAcpiInfoProtocol = { 0 }; + +// +//---------------------------------------------------------------------------- +// +// Procedure: CheckPlatformSupportRtD3 +// +// Description: Check if platform support RtD3 +// +// Input: None +// +// Output: None +//---------------------------------------------------------------------------- +// +BOOLEAN CheckPlatformSupportRtD3 () +{ + BOOLEAN RtD3Supported; + PCH_SERIES PchSeries = GetPchSeries(); + + RtD3Supported = FALSE; + if (IS_SA_DEVICE_ID_MOBILE (READ_PCI16_NB (R_SA_MC_DEVICE_ID))) { + if (PchSeries == PchLp) { + RtD3Supported = TRUE; + } + } + + return RtD3Supported; +} + +// +//---------------------------------------------------------------------------- +// +// Procedure: CheckPlatformSupportCPPC +// +// Description: Check if platform support CPPC +// +// Input: None +// +// Output: None +//---------------------------------------------------------------------------- +// +BOOLEAN CheckPlatformSupportCPPC () +{ + BOOLEAN CPPCSupported; + + if (!(IS_SA_DEVICE_ID_MOBILE (READ_PCI16_NB (R_SA_MC_DEVICE_ID)))) { + CPPCSupported = FALSE; + } else { + CPPCSupported = TRUE; + } + + return CPPCSupported; +} + +// +//---------------------------------------------------------------------------- +// +// Procedure: InstallAcpiDxePlatformPolicy +// +// Description: Initilize ACPI DXE Platform Policy. +// +// Input: None +// +// Output: None +//---------------------------------------------------------------------------- +// +EFI_STATUS InstallAcpiDxePlatformPolicy (IN UINT32 SetupAttributes) +{ + EFI_STATUS Status; + EFI_HANDLE Handle; + SETUP_PLATFORM_DATA SetupPlatformData; + + /// + /// Initialize the EFI Driver Library + /// + mAcpiPlatformPolicyProtocol.Revision = ACPI_PLATFORM_POLICY_PROTOCOL_REVISION_1; + mAcpiPlatformPolicyProtocol.BoardId = gPlatformInfoProtocol->BoardId; + + mAcpiPlatformPolicyProtocol.EnableDptf = 0; + mAcpiPlatformPolicyProtocol.EnableCppc = 0; + mAcpiPlatformPolicyProtocol.EnableCppcPlatformSCI = 0; + + TRACE((TRACE_ALWAYS, "InstallAcpiDxePlatformPolicy setup variable attributes = %x \n", SetupAttributes)); + + SetupPlatformData.PlatformSupportCppc = 0; + SetupPlatformData.PlatformSupportRtD3 = 0; + +#if ACPIDEBUG_SUPPORT + if (gSetupData != NULL) { + mAcpiPlatformPolicyProtocol.EnableAcpiDebug = gSetupData->AcpiDebugSupport; + } +#endif + +#if RTD3_SUPPORT + if (!CheckPlatformSupportRtD3()) { + mAcpiPlatformPolicyProtocol.EnableRtD3 = 0; + } else if (gSetupData != NULL) { + SetupPlatformData.PlatformSupportRtD3 = 1; + mAcpiPlatformPolicyProtocol.EnableRtD3 = gSetupData->Rtd3Support; + } +#endif + +#if Dptf_SUPPORT + if (gSetupData != NULL) { + mAcpiPlatformPolicyProtocol.EnableDptf = gSetupData->EnableDptf; + if(gSetupData->EnableDptf==1){ + if (gSetupData->EnableSaDevice==1){ + gSetupData->SaDevice4=1; + } + else{ + gSetupData->SaDevice4=0; + } + gSetupData->ThermalDeviceEnable=gSetupData->EnablePchDevice; + } + + Status = pRS->SetVariable ( + L"Setup", + &gSetupGuid, + SetupAttributes, + sizeof(SETUP_DATA), + gSetupData + ); + } +#endif + +#if CPPC_SUPPORT + if (!CheckPlatformSupportCPPC()) { + mAcpiPlatformPolicyProtocol.EnableCppc = 0; + mAcpiPlatformPolicyProtocol.EnableCppcPlatformSCI = 0; + } else if (gSetupData != NULL) { + SetupPlatformData.PlatformSupportCppc = 1; + mAcpiPlatformPolicyProtocol.EnableCppc = gSetupData->EnableCppc; + mAcpiPlatformPolicyProtocol.EnableCppcPlatformSCI = gSetupData->EnableCppcPlatformSCI; + } +#endif + + TRACE((TRACE_ALWAYS, "SetupPlatformData.PlatformSupportCppc = %x \n", SetupPlatformData.PlatformSupportCppc)); + TRACE((TRACE_ALWAYS, "SetupPlatformData.PlatformSupportRtD3 = %x \n", SetupPlatformData.PlatformSupportRtD3)); + + Status = pRS->SetVariable ( + L"SetupPlatformData", + &gSetupGuid, + EFI_VARIABLE_BOOTSERVICE_ACCESS, + sizeof (SETUP_PLATFORM_DATA), + &SetupPlatformData + ); + TRACE((TRACE_ALWAYS, "SetVariable SetupPlatformData Status = %r \n", Status)); + + Handle = NULL; + Status = pBS->InstallMultipleProtocolInterfaces ( + &Handle, + &gAcpiPlatformPolicyProtocolGuid, + &mAcpiPlatformPolicyProtocol, + NULL + ); + ASSERT_EFI_ERROR (Status); + + /// + /// Install ACPI_INFO_PROTOCOL + /// + mAcpiInfoProtocol.Revision = ACPI_INFO_PROTOCOL_REVISION_1; + /// + /// RCVersion[32:0] is the release number. + /// For example: + /// Acpi Framework 0.5.0 should be 00 05 00 00 (0x00050000) + /// + mAcpiInfoProtocol.RCVersion = ACPI_RC_VERSION; + + Handle = NULL; + Status = pBS->InstallMultipleProtocolInterfaces ( + &Handle, + &gEfiAcpiInfoProtocolGuid, + &mAcpiInfoProtocol, + NULL + ); + + + return Status; + +} + + +//********************************************************************** +// +// +// Procedure: AcpiPlatformInit +// +// Description: +// +// Input: +// +// Output: +// EFI_STATUS +// +// Modified: +// +// Referrals: +// +// Notes: +// Here is the control flow of this function: +// +// +//********************************************************************** +EFI_STATUS +AcpiPlatformInit ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + EFI_GUID gAcpiSupportGuid = EFI_ACPI_SUPPORT_GUID; + PACPI_HDR DsdtTable; + UINT32 Length; + UINT8 *ptr; + UINT32 RegEax, RegEbx, RegEcx, RegEdx; + ASL_OBJ_INFO ObjInfo; + MSR_REGISTER MsrCoreThreadCount; +#if CRB_EC_SUPPORT == 1 + UINT8 PortDataOut = 0; +#endif + UINT8 ECSmbusThermalReportingEnabled = 0; + UINT8 ECSMBusMsgLenth = 0; + UINT8 ECSMBusPECEnabled = 0; + NB_SETUP_DATA *NbSetupData = NULL; + SB_SETUP_DATA *SbSetupData = NULL; + UINTN VariableSize = NULL; + UINT16 McDeviceId; + UINT8 USBRTD3 = 0; + PCH_SERIES PchSeries = GetPchSeries(); + UINT32 SetupAttributes = 0; + + InitAmiLib(ImageHandle,SystemTable); + + Status = pBS->AllocatePool (EfiACPIMemoryNVS, + sizeof (EFI_GLOBAL_NVS_AREA), + &mGlobalNvsArea.Area); + ASSERT_EFI_ERROR (Status); + pBS->SetMem (mGlobalNvsArea.Area, sizeof (EFI_GLOBAL_NVS_AREA), 0); + +#if defined Remove_SaSsdt_Data_To_Dsdt && Remove_SaSsdt_Data_To_Dsdt + Status = pBS->AllocatePool (EfiACPIMemoryNVS, + sizeof (SYSTEM_AGENT_GLOBAL_NVS_AREA), + &gSaGlobalNvsArea.Area); + ASSERT_EFI_ERROR (Status); + pBS->SetMem (gSaGlobalNvsArea.Area, sizeof (SYSTEM_AGENT_GLOBAL_NVS_AREA), 0); +#endif + // + // mGlobalNvsArea.Area has the address of GNVS in ACPI NVS area + // update this as GNVS opRegion field of GNVS area in DSDT. + // + Status = pBS->LocateProtocol(&gAcpiSupportGuid, NULL, &gEfiAcpiSupport); + ASSERT_EFI_ERROR (Status); + + // Read MC device ID + McDeviceId = READ_PCI16_NB(R_SA_MC_DEVICE_ID); + + DsdtTable = GetDSDTTable(); + if (DsdtTable) { + Length = DsdtTable->Length - sizeof(ACPI_HDR); + ptr = (UINT8*)DsdtTable + sizeof(ACPI_HDR); + Status = GetAslObj(ptr, Length, "GNVS", otOpReg, &ObjInfo); + ASSERT_EFI_ERROR (Status); + + ptr = (UINT8*)ObjInfo.DataStart; + *(UINT32*)(ptr + 2) = (UINT32)(UINTN)mGlobalNvsArea.Area; + *(UINT16*)(ptr + 2 + 5) = sizeof (EFI_GLOBAL_NVS_AREA); + TRACE((TRACE_ALWAYS, "ACPI Global NVS Ptr=0x%X, Length=0x%X\n", (UINT32)(UINTN) mGlobalNvsArea.Area, sizeof (EFI_GLOBAL_NVS_AREA))); + +#if defined Remove_SaSsdt_Data_To_Dsdt && Remove_SaSsdt_Data_To_Dsdt + Length = DsdtTable->Length - sizeof(ACPI_HDR); + ptr = (UINT8*)DsdtTable + sizeof(ACPI_HDR); + Status = GetAslObj(ptr, Length, "SANV", otOpReg, &ObjInfo); + ASSERT_EFI_ERROR (Status); + + ptr = (UINT8*)ObjInfo.DataStart; + *(UINT32*)(ptr + 2) = (UINT32)(UINTN)gSaGlobalNvsArea.Area; + *(UINT16*)(ptr + 2 + 5) = sizeof (SYSTEM_AGENT_GLOBAL_NVS_AREA); + TRACE((TRACE_ALWAYS, "ACPI Global SA NVS Ptr=0x%X, Length=0x%X\n", (UINT32)(UINTN) gSaGlobalNvsArea.Area, sizeof (SYSTEM_AGENT_GLOBAL_NVS_AREA))); +#endif + + if(!IS_SA_DEVICE_ID_MOBILE(McDeviceId)) { + DsdtTableUpdate (DsdtTable); // This DsdtTable update is for non-Mobile platform. + } + } + + LoadDbgpTable(); + +#if defined LPIT_SUPPORT && LPIT_SUPPORT + if (PchSeries == PchLp) { + LoadLpitTable(); + } +#endif + + Status = pBS->LocateProtocol(&gPlatformInfoProtocolGuid, NULL, &gPlatformInfoProtocol); + ASSERT_EFI_ERROR (Status); + + // Update the PlatformFlavor + mGlobalNvsArea.Area->PlatformFlavor = gPlatformInfoProtocol->PlatformFlavor; + + // Update the Platform Board ID + mGlobalNvsArea.Area->BoardId = gPlatformInfoProtocol->BoardId; + + // Update the Board Revision + mGlobalNvsArea.Area->BoardRev = gPlatformInfoProtocol->BoardRev; + + // Initialize AMI Setup Data + Status = GetEfiVariable( + L"Setup", + &gSetupGuid, + &SetupAttributes, + &VariableSize, + &gSetupData + ); + + // Initilize ACPI DXE Platform Policy + Status = InstallAcpiDxePlatformPolicy (SetupAttributes); + ASSERT_EFI_ERROR(Status); + +#if LOW_POWER_S0_IDLE_CAPABLE == 1 + mGlobalNvsArea.Area->LowPowerS0Idle = 0; + if (LOW_POWER_S0_IDLE_CAPABLE) { + if (gSetupData->AcpiLowPowerS0Idle == 1) { + mGlobalNvsArea.Area->LowPowerS0Idle = 1; + mGlobalNvsArea.Area->PB1E = gSetupData->PowerButton10SecOVR | BIT3; //Bit3: Slate/Laptop Mode Flag, 0: Slate, 1: Laptop + mGlobalNvsArea.Area->PEPC = mGlobalNvsArea.Area->PEPC | gSetupData->LowPowerIdleSATA; + mGlobalNvsArea.Area->ECNO = gSetupData->EcNotification; + mGlobalNvsArea.Area->ECDB = gSetupData->EcCSDebugLight; + mGlobalNvsArea.Area->SHSB = gSetupData->SensorStandby; + mGlobalNvsArea.Area->PL1LimitCS = gSetupData->CSPL1Limit; + mGlobalNvsArea.Area->PL1LimitCSValue = gSetupData->CSPL1Value; + } + } +#endif + + if (mGlobalNvsArea.Area->LowPowerS0Idle == 0) { +// DsdtTableUpdate1 (DsdtTable); + } // mGlobalNvsArea.Area->LowPowerS0Idle = 0 + + + if (EFI_ERROR (Status)) { + mGlobalNvsArea.Area->NativePCIESupport = 0; + } else { + mGlobalNvsArea.Area->NativePCIESupport = gSetupData->PciExpNative; + } + +#if Dptf_SUPPORT + mGlobalNvsArea.Area->EnableDptfDevice = gSetupData->EnableDptf; + if (gSetupData->EnableDptf) { + mGlobalNvsArea.Area->EnableSaDevice = gSetupData->EnableSaDevice; + mGlobalNvsArea.Area->ActiveThermalTripPointSA = gSetupData->ActiveThermalTripPointSa; + mGlobalNvsArea.Area->PassiveThermalTripPointSA = gSetupData->PassiveThermalTripPointSa; + mGlobalNvsArea.Area->CriticalThermalTripPointSA = gSetupData->CriticalThermalTripPointSa; + mGlobalNvsArea.Area->HotThermalTripPointSA = gSetupData->HotThermalTripPointSa; + + mGlobalNvsArea.Area->EnablePchDevice = gSetupData->EnablePchDevice; + mGlobalNvsArea.Area->ActiveThermalTripPointPCH = gSetupData->ActiveThermalTripPointPch; + mGlobalNvsArea.Area->PassiveThermalTripPointPCH = gSetupData->PassiveThermalTripPointPch; + mGlobalNvsArea.Area->CriticalThermalTripPointPCH = gSetupData->CriticalThermalTripPointPch; + mGlobalNvsArea.Area->HotThermalTripPointPCH = gSetupData->HotThermalTripPointPch; + + mGlobalNvsArea.Area->EnableMemoryDevice = gSetupData->EnableMemDevice; + mGlobalNvsArea.Area->ActiveThermalTripPointTMEM = gSetupData->ActiveThermalTripPointMem; + mGlobalNvsArea.Area->PassiveThermalTripPointTMEM = gSetupData->PassiveThermalTripPointMem; + mGlobalNvsArea.Area->CriticalThermalTripPointTMEM = gSetupData->CriticalThermalTripPointMem; + mGlobalNvsArea.Area->HotThermalTripPointTMEM = gSetupData->HotThermalTripPointMem; + + mGlobalNvsArea.Area->EnableAmbientDevice = gSetupData->EnableAmbientDevice; + mGlobalNvsArea.Area->ActiveThermalTripPointAmbient = gSetupData->ActiveThermalTripPointAmbient; + mGlobalNvsArea.Area->PassiveThermalTripPointAmbient = gSetupData->PassiveThermalTripPointAmbient; + mGlobalNvsArea.Area->CriticalThermalTripPointAmbient = gSetupData->CriticalThermalTripPointAmbient; + mGlobalNvsArea.Area->HotThermalTripPointAmbient = gSetupData->HotThermalTripPointAmbient; + + mGlobalNvsArea.Area->EnableSkinDevice = gSetupData->EnableSkinDevice; + mGlobalNvsArea.Area->ActiveThermalTripPointSkin = gSetupData->ActiveThermalTripPointSkin; + mGlobalNvsArea.Area->PassiveThermalTripPointSkin = gSetupData->PassiveThermalTripPointSkin; + mGlobalNvsArea.Area->CriticalThermalTripPointSkin = gSetupData->CriticalThermalTripPointSkin; + mGlobalNvsArea.Area->HotThermalTripPointSkin = gSetupData->HotThermalTripPointSkin; + + mGlobalNvsArea.Area->EnableExhaustFanDevice = gSetupData->EnableExhaustDevice; + mGlobalNvsArea.Area->ActiveThermalTripPointExhaustFan = gSetupData->ActiveThermalTripPointExhaust; + mGlobalNvsArea.Area->PassiveThermalTripPointExhaustFan = gSetupData->PassiveThermalTripPointExhaust; + mGlobalNvsArea.Area->CriticalThermalTripPointExhaustFan = gSetupData->CriticalThermalTripPointExhaust; + mGlobalNvsArea.Area->HotThermalTripPointExhaustFan = gSetupData->HotThermalTripPointExhaust; + + mGlobalNvsArea.Area->EnableVRDevice = gSetupData->EnableVRDevice; + mGlobalNvsArea.Area->ActiveThermalTripPointVR = gSetupData->ActiveThermalTripPointVR; + mGlobalNvsArea.Area->PassiveThermalTripPointVR = gSetupData->PassiveThermalTripPointVR; + mGlobalNvsArea.Area->CriticalThermalTripPointVR = gSetupData->CriticalThermalTripPointVR; + mGlobalNvsArea.Area->HotThermalTripPointVR = gSetupData->HotThermalTripPointVR; + + mGlobalNvsArea.Area->PpccStepSize = gSetupData->PpccStepSize; + mGlobalNvsArea.Area->LPOEnable = gSetupData->LPOEnable; + mGlobalNvsArea.Area->LPOStartPState = gSetupData->LPOStartPState; + mGlobalNvsArea.Area->LPOStepSize = gSetupData->LPOStepSize; + mGlobalNvsArea.Area->LPOPowerControlSetting = gSetupData->LPOPowerControl; + mGlobalNvsArea.Area->LPOPerformanceControlSetting = gSetupData->LPOPerformanceControl; + mGlobalNvsArea.Area->EnableCtdpPolicy = gSetupData->EnableCTDP; + mGlobalNvsArea.Area->EnableLpmPolicy = gSetupData->EnableLPM; + mGlobalNvsArea.Area->CurrentLowPowerMode = gSetupData->LPMSetting; + mGlobalNvsArea.Area->EnableFan1Device = gSetupData->Fan1Device; + mGlobalNvsArea.Area->EnableFan2Device = gSetupData->Fan2Device; + mGlobalNvsArea.Area->EnableDisplayParticipant = gSetupData->DisplayParticipant; + mGlobalNvsArea.Area->EnablePowerDevice = gSetupData->PowerParticipant; + mGlobalNvsArea.Area->EnablePowerPolicy = gSetupData->PowerPolicy; + mGlobalNvsArea.Area->EnableActivePolicy = gSetupData->ActivePolicy; + mGlobalNvsArea.Area->EnablePassivePolicy = gSetupData->PassivePolicy; + mGlobalNvsArea.Area->EnableCriticalPolicy = gSetupData->CriticalPolicy; + mGlobalNvsArea.Area->EnableCoolingModePolicy = gSetupData->CoolingModePolicy; + mGlobalNvsArea.Area->EnableCurrentExecutionUnit = 1; + mGlobalNvsArea.Area->TargetGfxFreq = 400; + mGlobalNvsArea.Area->TrtRevision = gSetupData->TrtRevision; + } +#endif + + Status = pBS->AllocatePool (EfiBootServicesData, sizeof(NB_SETUP_DATA), (VOID **)&NbSetupData); + GetNbSetupData( pRS, NbSetupData, FALSE ); + Status = pBS->AllocatePool (EfiBootServicesData, sizeof(SB_SETUP_DATA), (VOID **)&SbSetupData); + GetSbSetupData( pRS, SbSetupData, FALSE ); + + mGlobalNvsArea.Area->NFCEnable = SbSetupData->NFCE; + + mGlobalNvsArea.Area->Ac0TripPoint = SbSetupData->Ac0TripPoint; + mGlobalNvsArea.Area->Ac0FanSpeed = SbSetupData->Ac0FanSpeed; + mGlobalNvsArea.Area->Ac1TripPoint = SbSetupData->Ac1TripPoint; + mGlobalNvsArea.Area->Ac1FanSpeed = SbSetupData->Ac1FanSpeed; + + mGlobalNvsArea.Area->PassiveThermalTripPoint = SbSetupData->PassiveThermalTripPoint; + mGlobalNvsArea.Area->PassiveTc1Value = SbSetupData->PassiveTc1Value; + mGlobalNvsArea.Area->PassiveTc2Value = SbSetupData->PassiveTc2Value; + mGlobalNvsArea.Area->PassiveTspValue = SbSetupData->PassiveTspValue; + mGlobalNvsArea.Area->CriticalThermalTripPoint = SbSetupData->CriticalThermalTripPoint; + +#if CRB_EC_SUPPORT == 1 + if(IS_SA_DEVICE_ID_MOBILE(McDeviceId)) { + mGlobalNvsArea.Area->EcAvailable = 1; + mGlobalNvsArea.Area->IUBE = 1; + mGlobalNvsArea.Area->IUCE = 1; + mGlobalNvsArea.Area->IUDE = 1; + } +#endif + +#if defined ACPIDEBUG_SUPPORT && ACPIDEBUG_SUPPORT + if (gSetupData->AcpiDebugSupport){ + LoadSsdtAcpiDebugTable(); + } +#endif + +#if defined PTID_SUPPORT && PTID_SUPPORT + mGlobalNvsArea.Area->PeciAccessMethod = gSetupData->PeciAccessMethod; + if (gSetupData->PtidSupport){ + LoadSsdtPtidTable(); + } +#endif + +#if defined IntelRMT_SUPPORT && IntelRMT_SUPPORT + if (gSetupData->IRMTSupport){ + LoadSsdtIRMTTable(); + mGlobalNvsArea.Area->INSC = (gSetupData->IRMTHWNotification << 1) | (gSetupData->IRMTState); + } +#endif + +#if defined INTELSENSORHUB_SUPPORT && INTELSENSORHUB_SUPPORT + LoadSsdtIntelSensorHubTable(); +#endif + +#if defined ZPODD_SUPPORT && ZPODD_SUPPORT + LoadSsdtZpOddTable(); +#endif + +#if defined RTD3_SUPPORT && RTD3_SUPPORT + mGlobalNvsArea.Area->Rtd3Support = gSetupData->Rtd3Support; + mGlobalNvsArea.Area->VRSD = gSetupData->VRStaggeringDelay; + mGlobalNvsArea.Area->VRRD = gSetupData->VRRampUpDelay; + mGlobalNvsArea.Area->Rtd3P0dl = gSetupData->Rtd3P0dl; + mGlobalNvsArea.Area->Rtd3P3dl = gSetupData->Rtd3P3dl; + mGlobalNvsArea.Area->AUDD = gSetupData->Rtd3Audio; + mGlobalNvsArea.Area->DSPD = gSetupData->Rtd3ADSP; + mGlobalNvsArea.Area->I20D = gSetupData->Rtd3I2C0; + mGlobalNvsArea.Area->IC0D = gSetupData->Rtd3SensorHub; + mGlobalNvsArea.Area->I21D = gSetupData->Rtd3I2C1; + mGlobalNvsArea.Area->IC1S = gSetupData->Rtd3I2C1PS0; + mGlobalNvsArea.Area->IC1D = gSetupData->Rtd3TouchPanel; + + mGlobalNvsArea.Area->PepDevice = (gSetupData->PepSata << 1) | (gSetupData->PepGfx); + mGlobalNvsArea.Area->PSCP = gSetupData->PCapping; + + if (gSetupData->XhciP0 == 1){ + USBRTD3 = 1; + }else if (gSetupData->XhciP0 == 2){ + USBRTD3 = 2; + } + if (gSetupData->XhciP1 == 1){ + USBRTD3 += 0x10; + }else if (gSetupData->XhciP1 == 2){ + USBRTD3 += 0x20; + } + mGlobalNvsArea.Area->UsbPowerResourceTest = USBRTD3; + mGlobalNvsArea.Area->RIC0 = gSetupData->RIC0; + mGlobalNvsArea.Area->RCG0 = 0; + if (gSetupData->RTD3ZPODD){ + mGlobalNvsArea.Area->RCG0 = mGlobalNvsArea.Area->RCG0 | BIT0; + } + if (gSetupData->RTD3USBCamera){ + mGlobalNvsArea.Area->RCG0 = mGlobalNvsArea.Area->RCG0 | BIT1; + } + if (gSetupData->RTD3MiniSataPort3 == 1){ + mGlobalNvsArea.Area->RCG0 = mGlobalNvsArea.Area->RCG0 | BIT2; + }else if (gSetupData->RTD3MiniSataPort3 == 2){ + mGlobalNvsArea.Area->RCG0 = mGlobalNvsArea.Area->RCG0 | BIT3; + } + + mGlobalNvsArea.Area->RWAG = gSetupData->RTD3WaGpio; + + if (gSetupData->Rtd3Support){ + LoadSsdtRtd3Table(); + } // (gSetupData->Rtd3Support) +#endif + +#if defined iME_SUPPORT && iME_SUPPORT + ECSmbusThermalReportingEnabled = SbSetupData->TrEnabled; + ECSMBusMsgLenth = SbSetupData->SMBusECMsgLen; + ECSMBusPECEnabled = SbSetupData->SMBusECMsgPEC; +#else +#if CRB_EC_SUPPORT == 1 + ECSmbusThermalReportingEnabled = 0x0; + ECSMBusMsgLenth = 0x0; + ECSMBusPECEnabled = 0x0; +#endif +#endif + + + // Enable TS-on-DIMM if present and enabled in SETUP, update NVS for use by DPPM code. +#if defined (iME_SUPPORT) && (iME_SUPPORT==1) +#if (DIMM_SLOT_NUM == 2) + if (SbSetupData->TrSmbusConfig > 0) { +#endif + +#if (DIMM_SLOT_NUM == 4) + if((SbSetupData->TsOnDimm1) || (SbSetupData->TsOnDimm2) || \ + (SbSetupData->TsOnDimm3) || (SbSetupData->TsOnDimm4)) { +#endif + mGlobalNvsArea.Area->TsOnDimmEnabled = PCH_DEVICE_ENABLE; + } else { + mGlobalNvsArea.Area->TsOnDimmEnabled = PCH_DEVICE_DISABLE; + } + +#else + mGlobalNvsArea.Area->TsOnDimmEnabled = PCH_DEVICE_DISABLE; +#endif + +#if CRB_EC_SUPPORT == 1 + if (mGlobalNvsArea.Area->EcAvailable) { + // Locate KSC protocol. + Status = InitializeKscLib (); + + if (Status == EFI_SUCCESS) { + + if(ECSmbusThermalReportingEnabled) { + + // SMBus Message length + Status = SendKscCommand (KSC_C_PCH_SMBUS_MSG_LENGTH); + if(Status == EFI_SUCCESS) { + SendKscData(ECSMBusMsgLenth); + } + // EC SMBus Packet Error Checking Enable (PEC) cmd + if(ECSMBusPECEnabled) { + SendKscCommand (KSC_C_PCH_SMBUS_PEC_EN); + }else { + SendKscCommand (KSC_C_PCH_SMBUS_PEC_DIS); + } + + if (mGlobalNvsArea.Area->TsOnDimmEnabled) { + SendKscCommand (KSC_TS_ON_DIMM_EN); // TS-on-DIMM thermal monitoring enable command + } else { + SendKscCommand (KSC_TS_ON_DIMM_DIS); // TS-on-DIMM thermal monitoring Disable command + } + + SendKscCommand (KSC_EC_PCH_SMBUS_EN); // EC PCH SMBus thermal monitoring Enable cmd + }else { + + SendKscCommand (KSC_EC_PCH_SMBUS_DIS); // EC PCH SMBus thermal monitoring Disable cmd + } + + } + } +#endif + // Platform Thermal code end + + //Get platform cpuid + CPULib_CpuID(1, &RegEax, &RegEbx, &RegEcx, &RegEdx); + mGlobalNvsArea.Area->PlatformCpuId = (RegEax & 0x0FFFFF); + + // + // Nehalem MSR 0x35 CORE_THREAD_COUNT + // [31:16] - total number of enabled cores in the package + // [15:0] - total number of enabled threads in the package + // + MsrCoreThreadCount.Qword = ReadMsr (EFI_MSR_CORE_THREAD_COUNT); + + // + // ThreadCount : Number of Enabled Threads + // + mGlobalNvsArea.Area->ThreadCount = MsrCoreThreadCount.Bytes.FirstByte; + + // HPLL VCO = MCHBAR + C0Fh [2:0] + //SNB_TODO mGlobalNvsArea.Area->IgdHpllVco + //-jeff mGlobalNvsArea.Area->IgdHpllVco = READ_MEM8_MCH(0xC0F) & 0x07; // 189 HPLL VCO + + mGlobalNvsArea.Area->ApicEnable = 1; + mGlobalNvsArea.Area->EmaEnable = 0; +//For mobile platform, the number of batteries is updated by EC.asl + mGlobalNvsArea.Area->NumberOfBatteries = 0; + mGlobalNvsArea.Area->BatteryCapacity0 = 100; + mGlobalNvsArea.Area->BatteryStatus0 = 84; + mGlobalNvsArea.Area->SmscComPort = 1; + mGlobalNvsArea.Area->IdeMode = 0; + + // Set default power state to AC. + // For mobile, EC.ASL, will update with current power state. + mGlobalNvsArea.Area->PowerState = 1; + mGlobalNvsArea.Area->PcieDockStatus = 0; + +#if CRB_EC_SUPPORT == 1 + if (mGlobalNvsArea.Area->EcAvailable) { + // Initialize KSC library for later KSC Access + Status = InitializeKscLib (); + if (Status == EFI_SUCCESS) { + + // Call KSC lib to get PCIe dock status + PortDataOut = 0; + Status = SendKscCommand (KSC_C_DOCK_STATUS); + if (Status == EFI_SUCCESS) { + Status = ReceiveKscData (&PortDataOut); + } + + // + // the bit0 is PCIe Dock Status, 1 = docked + // + mGlobalNvsArea.Area->PcieDockStatus = (PortDataOut & 1); + } + } +#endif + + // Configure USB Sideband Deferring feature for ACPI + if (mGlobalNvsArea.Area->BoardId == BoardIdGraysReef){ + mGlobalNvsArea.Area->HostAlertVector1 = 0x1F; // GPIO 15 for GPE _L1F + mGlobalNvsArea.Area->HostAlertVector2 = 0x1B; // GPIO 11 for GPE _L1B + } + else{ + mGlobalNvsArea.Area->HostAlertVector1 = 0xFF; // dummy value to signal no USB SBD support + mGlobalNvsArea.Area->HostAlertVector2 = 0xFF; // dummy value to signal no USB SBD support + } + + mGlobalNvsArea.Area->Revision = GLOBAL_NVS_AREA_REVISION_1; + + Status = pBS->InstallMultipleProtocolInterfaces (&ImageHandle, + &gEfiGlobalNvsAreaProtocolGuid, + &mGlobalNvsArea, + NULL); + +#if defined Remove_SaSsdt_Data_To_Dsdt && Remove_SaSsdt_Data_To_Dsdt + Status = pBS->InstallMultipleProtocolInterfaces (&ImageHandle, + &gEfiGlobalSaNvsAreaProtocolGuid, + &gSaGlobalNvsArea, + NULL); +#endif + + Status = CreateReadyToBootEvent( + TPL_CALLBACK, + CallbackBootScript, + NULL, + &gEvtBootScript + ); + + + pBS->FreePool(NbSetupData); + pBS->FreePool(SbSetupData); + + return EFI_SUCCESS; +} + +// +//---------------------------------------------------------------------------- +// +// Procedure: CallbackBootScript +// +// This function will be called when ReadyToBoot event will be signaled and +// will update related Platform information to global NVS area. +// +// +// Input: Event - Event of callback +// Context - Context of callback. +// +// Output: None +//---------------------------------------------------------------------------- +// +//********************************************************************** +VOID CallbackBootScript ( + IN EFI_EVENT Event, + IN VOID *Context ) +{ + UINT32 ThermalBaseB = 0; + UINT32 PchFdRegSave = 0; + UINT16 OLD_IAPC_BOOT_ARCH; + PFACP_20 FadtPointer; + INTN Index; + PACPI_HDR Table; + EFI_ACPI_TABLE_VERSION Version; + UINTN TableHandle; + EFI_STATUS Status; + UINTN VariableSize = NULL; + SETUP_DATA *SetupData = NULL; + UINT8 Buffer8; + + // + // Update TBARB and TBARBH if configured by DPPM + // + PchFdRegSave = READ_MEM32_RCRB(R_PCH_RCRB_FUNC_DIS); + RESET_MEM32_RCRB(R_PCH_RCRB_FUNC_DIS, B_PCH_RCRB_FUNC_DIS_THERMAL); + ThermalBaseB = READ_PCI32(THERMAL_BUS, THERMAL_DEV, THERMAL_FUN, R_PCH_THERMAL_TBARB) & B_PCH_THERMAL_TBARB_MASK; + WRITE_MEM32_RCRB(R_PCH_RCRB_FUNC_DIS, PchFdRegSave); + + if ((ThermalBaseB != 0) && (ThermalBaseB != B_PCH_THERMAL_TBARB_MASK)) { + mGlobalNvsArea.Area->TBARB = (UINT32) ThermalBaseB; + mGlobalNvsArea.Area->TBARBH = (UINT32) 0; + } else { + mGlobalNvsArea.Area->TBARB = (UINT32) 0; + mGlobalNvsArea.Area->TBARBH = (UINT32) 0; + } + + // Initialize AMI Setup Data + Status = GetEfiVariable( + L"Setup", + &gSetupGuid, + NULL, + &VariableSize, + &SetupData + ); + + Index = 0; + do { + Status = gEfiAcpiSupport->GetAcpiTable(gEfiAcpiSupport, + Index, + &Table, + &Version, + &TableHandle); + + if (Status == EFI_NOT_FOUND) { + break; + } + if (Table->Signature == FACP_SIG) { + FadtPointer = (PFACP_20) Table; + if (mGlobalNvsArea.Area->PpmFlags & PPM_C3) { + FadtPointer->P_LVL3_LAT = FADT_C3_LATENCY; + } + OLD_IAPC_BOOT_ARCH = FadtPointer->IAPC_BOOT_ARCH; + // + // if Native ASPM is disabled, set FACP table to skip Native ASPM + // + if ((SetupData->PciExpNative == 0)|| (SetupData->NativeAspmEnable == 0x0)) { + FadtPointer->IAPC_BOOT_ARCH |= 0x10; + } + + //if (FadtPointer->IAPC_BOOT_ARCH != OLD_IAPC_BOOT_ARCH) { + if ((FadtPointer->IAPC_BOOT_ARCH != OLD_IAPC_BOOT_ARCH) || (mGlobalNvsArea.Area->PpmFlags & PPM_C3)) { + Status = gEfiAcpiSupport->SetAcpiTable (gEfiAcpiSupport, Table, TRUE, Version, &TableHandle); + ASSERT_EFI_ERROR (Status); + } + pBS->FreePool (Table); + } + Index++; + } while (1); + + + if (READ_PCI32(SATA_BUS, SATA_DEV, SATA_FUN, PCI_VID) != 0xffffffff) { + Buffer8 = READ_PCI8(SATA_BUS, SATA_DEV, SATA_FUN, SATA_REG_PCS + 1 ); + mGlobalNvsArea.Area->SPST = (Buffer8 & BIT0 ); + mGlobalNvsArea.Area->SPST = mGlobalNvsArea.Area->SPST | (Buffer8 & BIT1); + mGlobalNvsArea.Area->SPST = mGlobalNvsArea.Area->SPST | (Buffer8 & BIT2); + mGlobalNvsArea.Area->SPST = mGlobalNvsArea.Area->SPST | (Buffer8 & BIT3); + + } + + // Kill the Event + pBS->CloseEvent(Event); +} + +VOID LoadDbgpTable() +{ + EFI_STATUS Status = EFI_SUCCESS; + EFI_ACPI_DEBUG_PORT_DESCRIPTION_TABLE *DBGP; + EFI_ACPI_SUPPORT_PROTOCOL *As; + UINT8 OemId[6] = CONVERT_TO_STRING(T_ACPI_OEM_ID); + UINT8 OemTblId[8] = \ + CONVERT_TO_STRING(T_ACPI_OEM_TBL_ID); + UINTN mDbgpTblHandle; + + + Status = pBS->LocateProtocol(&gEfiAcpiSupportGuid, NULL, &As); + DBGP = MallocZ(sizeof(EFI_ACPI_DEBUG_PORT_DESCRIPTION_TABLE)); + ASSERT(DBGP); + if (DBGP) { + // Fill Table header; + DBGP->Header.Signature = EFI_ACPI_3_0_DEBUG_PORT_TABLE_SIGNATURE; + DBGP->Header.Length = sizeof(EFI_ACPI_DEBUG_PORT_DESCRIPTION_TABLE); + DBGP->Header.Revision = EFI_ACPI_DBGP_TABLE_REVISION; + DBGP->Header.Checksum = 0; + MemCpy(&(DBGP->Header.OemId[0]), OemId, 6); + MemCpy(&(DBGP->Header.OemTblId[0]), OemTblId, 8); + DBGP->Header.OemRev = EFI_ACPI_OEM_DBGP_REVISION; + DBGP->Header.CreatorId = EFI_ACPI_CREATOR_ID; + DBGP->Header.CreatorRev = CORE_REVISION; + // Fill DBGP Fields + DBGP->BaseAddress.AddressSpaceId = 1; + DBGP->BaseAddress.RegisterBitWidth = 8; + DBGP->BaseAddress.RegisterBitOffset = 0; + DBGP->BaseAddress.Reserved = 0; + DBGP->BaseAddress.Address = 0x3F8; + + // Add table + mDbgpTblHandle = 0; + Status = As->SetAcpiTable( As, \ + DBGP, \ + TRUE, \ + EFI_ACPI_TABLE_VERSION_ALL, \ + &mDbgpTblHandle ); + TRACE((-1,"ACPISupport.SetAcpiTable() = %r \n", Status)); + ASSERT_EFI_ERROR(Status); + + // Free memory used for table image + pBS->FreePool(DBGP); + } + +} + +#if defined LPIT_SUPPORT && LPIT_SUPPORT +VOID LoadLpitTable() +{ + EFI_STATUS Status; + EFI_HANDLE *HandleBuffer; + UINTN NumberOfHandles; + UINTN Index; + EFI_FIRMWARE_VOLUME_PROTOCOL *FwVol; + INTN Instance; + EFI_ACPI_COMMON_HEADER *Table; + UINTN Size; + EFI_FV_FILETYPE FileType; + EFI_FV_FILE_ATTRIBUTES Attributes; + UINT32 FvStatus; + UINTN TableHandle; + EFI_ACPI_TABLE_VERSION Version; + EFI_ACPI_DESCRIPTION_HEADER *TableHeader; + EFI_ACPI_TABLE_PROTOCOL *AcpiTable; + BOOLEAN LoadTable; + + + FwVol = NULL; + Table = NULL; + // + // Locate FV protocol. + // + + Status = pBS->LocateHandleBuffer ( + ByProtocol, + &gEfiFirmwareVolumeProtocolGuid, + NULL, + &NumberOfHandles, + &HandleBuffer + ); + ASSERT_EFI_ERROR (Status); + + // + // Look for FV with ACPI storage file + // + for (Index = 0; Index < NumberOfHandles; Index++) { + + // + // Get the protocol on this handle + // This should not fail because of LocateHandleBuffer + // + Status = pBS->HandleProtocol ( + HandleBuffer[Index], + &gEfiFirmwareVolumeProtocolGuid, + &FwVol + ); + ASSERT_EFI_ERROR (Status); + + // + // See if it has the ACPI storage file + // + Size = 0; + FvStatus = 0; + Status = FwVol->ReadFile ( + FwVol, + &gAcpiLpitGuid, + NULL, + &Size, + &FileType, + &Attributes, + &FvStatus + ); + // + // If we found it, then we are done + // + + if (Status == EFI_SUCCESS) { + break; + } + } + // + // Our exit status is determined by the success of the previous operations + // If the protocol was found, Instance already points to it. + // + // + // Free any allocated buffers + // + pBS->FreePool (HandleBuffer); + + // + // Sanity check that we found our data file + // + ASSERT (FwVol); + + // + // By default, a table belongs in all ACPI table versions published. + // + Version = EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0; + + // + // Find the Table protocol + // + Status = pBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID **)&AcpiTable); + ASSERT_EFI_ERROR (Status); + + + + // + // Read tables from the storage file. + // + Instance = 0; + + while (Status == EFI_SUCCESS) { + // + // Read the ACPI tables + // + Status = FwVol->ReadSection ( + FwVol, + &gAcpiLpitGuid, + EFI_SECTION_RAW, + Instance, + &Table, + &Size, + &FvStatus + ); + + if (!EFI_ERROR (Status)) { + + LoadTable = FALSE; + TableHeader = (EFI_ACPI_DESCRIPTION_HEADER *) Table; + /// + /// Check the Signature ID to modify the table + /// + if (!LoadTable) { + switch (((EFI_ACPI_DESCRIPTION_HEADER *) TableHeader)->Signature) { + + case 0x5449504c: //EFI_ACPI_LOW_POWER_IDLE_TABLE_SIGNATURE + LoadTable = TRUE; + //LpitAcpiTable = (EFI_ACPI_DESCRIPTION_HEADER *) Table; + //LpitTableUpdate (LpitAcpiTable, &Version); + break; + + default: + break; + } + } + /// + /// Update the LPIT table in the ACPI tables. + /// + if (LoadTable) { + TableHandle = 0; + Status = AcpiTable->InstallAcpiTable ( + AcpiTable, + Table, + Table->Length, + &TableHandle + ); + ASSERT_EFI_ERROR (Status); + } + + // + // Increment the instance + // + Instance++; + Table = NULL; + } + } +} +#endif + +#if defined PTID_SUPPORT && PTID_SUPPORT +VOID LoadSsdtPtidTable() +{ + EFI_STATUS Status; + EFI_HANDLE *HandleBuffer; + UINTN NumberOfHandles; + UINTN Index; + EFI_FIRMWARE_VOLUME_PROTOCOL *FwVol; + EFI_ACPI_SUPPORT_PROTOCOL *AcpiSupport; + INTN Instance; + EFI_ACPI_COMMON_HEADER *Table; + UINTN Size; + EFI_FV_FILETYPE FileType; + EFI_FV_FILE_ATTRIBUTES Attributes; + UINT32 FvStatus; + ACPI_HDR *TableHeader; + UINTN TableHandle; + EFI_ACPI_TABLE_VERSION Version; + + + AcpiSupport = NULL; + FwVol = NULL; + Table = NULL; + + // + // Locate FV protocol. + // + + Status = pBS->LocateHandleBuffer ( + ByProtocol, + &gEfiFirmwareVolumeProtocolGuid, + NULL, + &NumberOfHandles, + &HandleBuffer + ); + ASSERT_EFI_ERROR (Status); + + // + // Look for FV with ACPI storage file + // + for (Index = 0; Index < NumberOfHandles; Index++) { + + // + // Get the protocol on this handle + // This should not fail because of LocateHandleBuffer + // + Status = pBS->HandleProtocol ( + HandleBuffer[Index], + &gEfiFirmwareVolumeProtocolGuid, + &FwVol + ); + ASSERT_EFI_ERROR (Status); + + // + // See if it has the ACPI storage file + // + Size = 0; + FvStatus = 0; + Status = FwVol->ReadFile ( + FwVol, + &gAcpiPtidFfsTableStorageGuid, + NULL, + &Size, + &FileType, + &Attributes, + &FvStatus + ); + + // + // If we found it, then we are done + // + + if (Status == EFI_SUCCESS) { + break; + } + } + // + // Our exit status is determined by the success of the previous operations + // If the protocol was found, Instance already points to it. + // + // + // Free any allocated buffers + // + pBS->FreePool (HandleBuffer); + + // + // Sanity check that we found our data file + // + ASSERT (FwVol); + + // + // By default, a table belongs in all ACPI table versions published. + // + Version = EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0; + + // + // Find the AcpiSupport protocol + // + Status = LocateSupportProtocol ( + &gEfiAcpiSupportGuid, + &AcpiSupport, + FALSE + ); + ASSERT_EFI_ERROR (Status); + + // + // Read tables from the storage file. + // + Instance = 0; + + while (Status == EFI_SUCCESS) { + // + // Read the ACPI tables + // + Status = FwVol->ReadSection ( + FwVol, + &gAcpiPtidFfsTableStorageGuid, + EFI_SECTION_RAW, + Instance, + &Table, + &Size, + &FvStatus + ); + + if (!EFI_ERROR (Status)) { + // + // This should be a PTID SSDT table + // + TableHeader = (ACPI_HDR *) Table; + if (MemCmp (&TableHeader->OemTblId, "PtidDevc", 8) == 0) { + // + // This is PTID SSDT. We load the table + // + TableHandle = 0; + Status = AcpiSupport->SetAcpiTable ( + AcpiSupport, + Table, + TRUE, + Version, + &TableHandle + ); + ASSERT_EFI_ERROR (Status); + } + + // + // Increment the instance + // + Instance++; + Table = NULL; + } + } + Status = AcpiSupport->PublishTables ( + AcpiSupport, + (EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0) + ); + ASSERT_EFI_ERROR (Status); +} + +EFI_STATUS +LocateSupportProtocol ( + IN EFI_GUID *Protocol, + OUT VOID **Instance, + IN BOOLEAN Type + ) +/*++ + +Routine Description: + + Locate the first instance of a protocol. If the protocol requested is an + FV protocol, then it will return the first FV that contains the ACPI table + storage file. + +Arguments: + + Protocol The protocol to find. + Instance Return pointer to the first instance of the protocol + Type TRUE if the desired protocol is a FV protocol + +Returns: + + EFI_SUCCESS The function completed successfully. + EFI_NOT_FOUND The protocol could not be located. + EFI_OUT_OF_RESOURCES There are not enough resources to find the protocol. + +--*/ +{ + EFI_STATUS Status; + EFI_HANDLE *HandleBuffer; + UINTN NumberOfHandles; + EFI_FV_FILETYPE FileType; + UINT32 FvStatus; + EFI_FV_FILE_ATTRIBUTES Attributes; + UINTN Size; + UINTN i; + + FvStatus = 0; + // + // Locate protocol. + // + Status = pBS->LocateHandleBuffer ( + ByProtocol, + Protocol, + NULL, + &NumberOfHandles, + &HandleBuffer + ); + if (EFI_ERROR (Status)) { + // + // Defined errors at this time are not found and out of resources. + // + return Status; + } + // + // Looking for FV with ACPI storage file + // + for (i = 0; i < NumberOfHandles; i++) { + // + // Get the protocol on this handle + // This should not fail because of LocateHandleBuffer + // + Status = pBS->HandleProtocol ( + HandleBuffer[i], + Protocol, + Instance + ); + ASSERT (!EFI_ERROR (Status)); + + if (!Type) { + // + // Not looking for the FV protocol, so find the first instance of the + // protocol. There should not be any errors because our handle buffer + // should always contain at least one or LocateHandleBuffer would have + // returned not found. + // + break; + } + + // + // See if it has the ACPI storage file + // + Status = ((EFI_FIRMWARE_VOLUME_PROTOCOL *) (*Instance))->ReadFile ( + *Instance, + &gAcpiPtidFfsTableStorageGuid, + NULL, + &Size, + &FileType, + &Attributes, + &FvStatus + ); + + // + // If we found it, then we are done + // + if (Status == EFI_SUCCESS) { + break; + } + } + + // + // Our exit status is determined by the success of the previous operations + // If the protocol was found, Instance already points to it. + // + + // + // Free any allocated buffers + // + pBS->FreePool (HandleBuffer); + + return Status; +} +#endif + +#if defined IntelRMT_SUPPORT && IntelRMT_SUPPORT +VOID LoadSsdtIRMTTable() +{ + EFI_STATUS Status; + EFI_HANDLE *HandleBuffer; + UINTN NumberOfHandles; + UINTN Index; + EFI_FIRMWARE_VOLUME_PROTOCOL *FwVol; + EFI_ACPI_SUPPORT_PROTOCOL *AcpiSupport; + INTN Instance; + EFI_ACPI_COMMON_HEADER *Table; + UINTN Size; + EFI_FV_FILETYPE FileType; + EFI_FV_FILE_ATTRIBUTES Attributes; + UINT32 FvStatus; + ACPI_HDR *TableHeader; + UINTN TableHandle; + EFI_ACPI_TABLE_VERSION Version; + + + AcpiSupport = NULL; + FwVol = NULL; + Table = NULL; + + // + // Locate FV protocol. + // + + Status = pBS->LocateHandleBuffer ( + ByProtocol, + &gEfiFirmwareVolumeProtocolGuid, + NULL, + &NumberOfHandles, + &HandleBuffer + ); + ASSERT_EFI_ERROR (Status); + + // + // Look for FV with ACPI storage file + // + for (Index = 0; Index < NumberOfHandles; Index++) { + + // + // Get the protocol on this handle + // This should not fail because of LocateHandleBuffer + // + Status = pBS->HandleProtocol ( + HandleBuffer[Index], + &gEfiFirmwareVolumeProtocolGuid, + &FwVol + ); + ASSERT_EFI_ERROR (Status); + + // + // See if it has the ACPI storage file + // + Size = 0; + FvStatus = 0; + Status = FwVol->ReadFile ( + FwVol, + &gAcpiIRMTFfsTableStorageGuid, + NULL, + &Size, + &FileType, + &Attributes, + &FvStatus + ); + + // + // If we found it, then we are done + // + + if (Status == EFI_SUCCESS) { + break; + } + } + // + // Our exit status is determined by the success of the previous operations + // If the protocol was found, Instance already points to it. + // + // + // Free any allocated buffers + // + pBS->FreePool (HandleBuffer); + + // + // Sanity check that we found our data file + // + ASSERT (FwVol); + + // + // By default, a table belongs in all ACPI table versions published. + // + Version = EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0; + + // + // Find the AcpiSupport protocol + // + Status = LocateIRMTSupportProtocol ( + &gEfiAcpiSupportGuid, + &AcpiSupport, + FALSE + ); + ASSERT_EFI_ERROR (Status); + + // + // Read tables from the storage file. + // + Instance = 0; + + while (Status == EFI_SUCCESS) { + // + // Read the ACPI tables + // + Status = FwVol->ReadSection ( + FwVol, + &gAcpiIRMTFfsTableStorageGuid, + EFI_SECTION_RAW, + Instance, + &Table, + &Size, + &FvStatus + ); + + if (!EFI_ERROR (Status)) { + // + // This should be a PTID SSDT table + // + TableHeader = (ACPI_HDR *) Table; + if (MemCmp (&TableHeader->OemTblId, "IntelRMT", 8) == 0) { + // + // This is Intel RMT SSDT. We load the table + // + TableHandle = 0; + Status = AcpiSupport->SetAcpiTable ( + AcpiSupport, + Table, + TRUE, + Version, + &TableHandle + ); + ASSERT_EFI_ERROR (Status); + } + + // + // Increment the instance + // + Instance++; + Table = NULL; + } + } + Status = AcpiSupport->PublishTables ( + AcpiSupport, + (EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0) + ); + ASSERT_EFI_ERROR (Status); +} + +EFI_STATUS +LocateIRMTSupportProtocol ( + IN EFI_GUID *Protocol, + OUT VOID **Instance, + IN BOOLEAN Type + ) +/*++ + +Routine Description: + + Locate the first instance of a protocol. If the protocol requested is an + FV protocol, then it will return the first FV that contains the ACPI table + storage file. + +Arguments: + + Protocol The protocol to find. + Instance Return pointer to the first instance of the protocol + Type TRUE if the desired protocol is a FV protocol + +Returns: + + EFI_SUCCESS The function completed successfully. + EFI_NOT_FOUND The protocol could not be located. + EFI_OUT_OF_RESOURCES There are not enough resources to find the protocol. + +--*/ +{ + EFI_STATUS Status; + EFI_HANDLE *HandleBuffer; + UINTN NumberOfHandles; + EFI_FV_FILETYPE FileType; + UINT32 FvStatus; + EFI_FV_FILE_ATTRIBUTES Attributes; + UINTN Size; + UINTN i; + + FvStatus = 0; + // + // Locate protocol. + // + Status = pBS->LocateHandleBuffer ( + ByProtocol, + Protocol, + NULL, + &NumberOfHandles, + &HandleBuffer + ); + if (EFI_ERROR (Status)) { + // + // Defined errors at this time are not found and out of resources. + // + return Status; + } + // + // Looking for FV with ACPI storage file + // + for (i = 0; i < NumberOfHandles; i++) { + // + // Get the protocol on this handle + // This should not fail because of LocateHandleBuffer + // + Status = pBS->HandleProtocol ( + HandleBuffer[i], + Protocol, + Instance + ); + ASSERT (!EFI_ERROR (Status)); + + if (!Type) { + // + // Not looking for the FV protocol, so find the first instance of the + // protocol. There should not be any errors because our handle buffer + // should always contain at least one or LocateHandleBuffer would have + // returned not found. + // + break; + } + + // + // See if it has the ACPI storage file + // + Status = ((EFI_FIRMWARE_VOLUME_PROTOCOL *) (*Instance))->ReadFile ( + *Instance, + &gAcpiPtidFfsTableStorageGuid, + NULL, + &Size, + &FileType, + &Attributes, + &FvStatus + ); + + // + // If we found it, then we are done + // + if (Status == EFI_SUCCESS) { + break; + } + } + + // + // Our exit status is determined by the success of the previous operations + // If the protocol was found, Instance already points to it. + // + + // + // Free any allocated buffers + // + pBS->FreePool (HandleBuffer); + + return Status; +} +#endif + + +#if defined INTELSENSORHUB_SUPPORT && INTELSENSORHUB_SUPPORT +VOID LoadSsdtIntelSensorHubTable() +{ + EFI_STATUS Status; + EFI_HANDLE *HandleBuffer; + UINTN NumberOfHandles; + UINTN Index; + EFI_FIRMWARE_VOLUME_PROTOCOL *FwVol; + EFI_ACPI_SUPPORT_PROTOCOL *AcpiSupport; + INTN Instance; + EFI_ACPI_COMMON_HEADER *Table; + UINTN Size; + EFI_FV_FILETYPE FileType; + EFI_FV_FILE_ATTRIBUTES Attributes; + UINT32 FvStatus; + ACPI_HDR *TableHeader; + UINTN TableHandle; + EFI_ACPI_TABLE_VERSION Version; + + + AcpiSupport = NULL; + FwVol = NULL; + Table = NULL; + + // + // Locate FV protocol. + // + + Status = pBS->LocateHandleBuffer ( + ByProtocol, + &gEfiFirmwareVolumeProtocolGuid, + NULL, + &NumberOfHandles, + &HandleBuffer + ); + ASSERT_EFI_ERROR (Status); + + // + // Look for FV with ACPI storage file + // + for (Index = 0; Index < NumberOfHandles; Index++) { + + // + // Get the protocol on this handle + // This should not fail because of LocateHandleBuffer + // + Status = pBS->HandleProtocol ( + HandleBuffer[Index], + &gEfiFirmwareVolumeProtocolGuid, + &FwVol + ); + ASSERT_EFI_ERROR (Status); + + // + // See if it has the ACPI storage file + // + Size = 0; + FvStatus = 0; + Status = FwVol->ReadFile ( + FwVol, + &gAcpiIntelSensorHubFfsTableGuid, + NULL, + &Size, + &FileType, + &Attributes, + &FvStatus + ); + + // + // If we found it, then we are done + // + + if (Status == EFI_SUCCESS) { + break; + } + } + // + // Our exit status is determined by the success of the previous operations + // If the protocol was found, Instance already points to it. + // + // + // Free any allocated buffers + // + pBS->FreePool (HandleBuffer); + + // + // Sanity check that we found our data file + // + ASSERT (FwVol); + + // + // By default, a table belongs in all ACPI table versions published. + // + Version = EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0; + + // + // Find the AcpiSupport protocol + // + Status = LocateIntelSensorHubSupportProtocol ( + &gEfiAcpiSupportGuid, + &AcpiSupport, + FALSE + ); + ASSERT_EFI_ERROR (Status); + + // + // Read tables from the storage file. + // + Instance = 0; + + while (Status == EFI_SUCCESS) { + // + // Read the ACPI tables + // + Status = FwVol->ReadSection ( + FwVol, + &gAcpiIntelSensorHubFfsTableGuid, + EFI_SECTION_RAW, + Instance, + &Table, + &Size, + &FvStatus + ); + + if (!EFI_ERROR (Status)) { + // + // This should be a PTID SSDT table + // + TableHeader = (ACPI_HDR *) Table; + if (MemCmp (&TableHeader->OemTblId, "sensrhub", 8) == 0) { + // + // This is PTID SSDT. We load the table + // + TableHandle = 0; + Status = AcpiSupport->SetAcpiTable ( + AcpiSupport, + Table, + TRUE, + Version, + &TableHandle + ); + ASSERT_EFI_ERROR (Status); + } + + // + // Increment the instance + // + Instance++; + Table = NULL; + } + } + Status = AcpiSupport->PublishTables ( + AcpiSupport, + (EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0) + ); + ASSERT_EFI_ERROR (Status); +} + +EFI_STATUS +LocateIntelSensorHubSupportProtocol ( + IN EFI_GUID *Protocol, + OUT VOID **Instance, + IN BOOLEAN Type + ) +/*++ + +Routine Description: + + Locate the first instance of a protocol. If the protocol requested is an + FV protocol, then it will return the first FV that contains the ACPI table + storage file. + +Arguments: + + Protocol The protocol to find. + Instance Return pointer to the first instance of the protocol + Type TRUE if the desired protocol is a FV protocol + +Returns: + + EFI_SUCCESS The function completed successfully. + EFI_NOT_FOUND The protocol could not be located. + EFI_OUT_OF_RESOURCES There are not enough resources to find the protocol. + +--*/ +{ + EFI_STATUS Status; + EFI_HANDLE *HandleBuffer; + UINTN NumberOfHandles; + EFI_FV_FILETYPE FileType; + UINT32 FvStatus; + EFI_FV_FILE_ATTRIBUTES Attributes; + UINTN Size; + UINTN i; + + FvStatus = 0; + // + // Locate protocol. + // + Status = pBS->LocateHandleBuffer ( + ByProtocol, + Protocol, + NULL, + &NumberOfHandles, + &HandleBuffer + ); + if (EFI_ERROR (Status)) { + // + // Defined errors at this time are not found and out of resources. + // + return Status; + } + // + // Looking for FV with ACPI storage file + // + for (i = 0; i < NumberOfHandles; i++) { + // + // Get the protocol on this handle + // This should not fail because of LocateHandleBuffer + // + Status = pBS->HandleProtocol ( + HandleBuffer[i], + Protocol, + Instance + ); + ASSERT (!EFI_ERROR (Status)); + + if (!Type) { + // + // Not looking for the FV protocol, so find the first instance of the + // protocol. There should not be any errors because our handle buffer + // should always contain at least one or LocateHandleBuffer would have + // returned not found. + // + break; + } + + // + // See if it has the ACPI storage file + // + Status = ((EFI_FIRMWARE_VOLUME_PROTOCOL *) (*Instance))->ReadFile ( + *Instance, + &gAcpiIntelSensorHubFfsTableGuid, + NULL, + &Size, + &FileType, + &Attributes, + &FvStatus + ); + + // + // If we found it, then we are done + // + if (Status == EFI_SUCCESS) { + break; + } + } + + // + // Our exit status is determined by the success of the previous operations + // If the protocol was found, Instance already points to it. + // + + // + // Free any allocated buffers + // + pBS->FreePool (HandleBuffer); + + return Status; +} + +#endif + +#if defined ZPODD_SUPPORT && ZPODD_SUPPORT +VOID LoadSsdtZpOddTable() +{ + EFI_STATUS Status; + EFI_HANDLE *HandleBuffer; + UINTN NumberOfHandles; + UINTN Index; + EFI_FIRMWARE_VOLUME_PROTOCOL *FwVol; + EFI_ACPI_SUPPORT_PROTOCOL *AcpiSupport; + INTN Instance; + EFI_ACPI_COMMON_HEADER *Table; + UINTN Size; + EFI_FV_FILETYPE FileType; + EFI_FV_FILE_ATTRIBUTES Attributes; + UINT32 FvStatus; + ACPI_HDR *TableHeader; + UINTN TableHandle; + EFI_ACPI_TABLE_VERSION Version; + BOOLEAN LoadTable; + PCH_SERIES PchSeries = GetPchSeries(); + + + AcpiSupport = NULL; + FwVol = NULL; + Table = NULL; + + // + // Locate FV protocol. + // + + Status = pBS->LocateHandleBuffer ( + ByProtocol, + &gEfiFirmwareVolumeProtocolGuid, + NULL, + &NumberOfHandles, + &HandleBuffer + ); + ASSERT_EFI_ERROR (Status); + + // + // Look for FV with ACPI storage file + // + for (Index = 0; Index < NumberOfHandles; Index++) { + + // + // Get the protocol on this handle + // This should not fail because of LocateHandleBuffer + // + Status = pBS->HandleProtocol ( + HandleBuffer[Index], + &gEfiFirmwareVolumeProtocolGuid, + &FwVol + ); + ASSERT_EFI_ERROR (Status); + + // + // See if it has the ACPI storage file + // + Size = 0; + FvStatus = 0; + Status = FwVol->ReadFile ( + FwVol, + &gAcpiZpOddFfsTableGuid, + NULL, + &Size, + &FileType, + &Attributes, + &FvStatus + ); + + // + // If we found it, then we are done + // + + if (Status == EFI_SUCCESS) { + break; + } + } + // + // Our exit status is determined by the success of the previous operations + // If the protocol was found, Instance already points to it. + // + // + // Free any allocated buffers + // + pBS->FreePool (HandleBuffer); + + // + // Sanity check that we found our data file + // + ASSERT (FwVol); + + // + // By default, a table belongs in all ACPI table versions published. + // + Version = EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0; + + // + // Find the AcpiSupport protocol + // + Status = LocateZPODDSupportProtocol ( + &gEfiAcpiSupportGuid, + &AcpiSupport, + FALSE + ); + ASSERT_EFI_ERROR (Status); + + // + // Read tables from the storage file. + // + Instance = 0; + + while (Status == EFI_SUCCESS) { + // + // Read the ACPI tables + // + Status = FwVol->ReadSection ( + FwVol, + &gAcpiZpOddFfsTableGuid, + EFI_SECTION_RAW, + Instance, + &Table, + &Size, + &FvStatus + ); + + if (!EFI_ERROR (Status)) { + // + // This should be a ZPODD SSDT table + // + LoadTable = FALSE; + TableHeader = (ACPI_HDR *) Table; +#if defined STD_ZPODD_SUPPORT && STD_ZPODD_SUPPORT + if ((MemCmp (&TableHeader->OemTblId, "zpodd", 8) == 0) && (PchSeries == PchH)){ + LoadTable = TRUE; + } +#endif +#if defined ULT_ZPODD_SUPPORT && ULT_ZPODD_SUPPORT + if ((MemCmp (&TableHeader->OemTblId, "zpoddult", 8) == 0) && (PchSeries == PchLp)) { + LoadTable = TRUE; + } +#endif + // + // This is ZPODD SSDT. We load the table + // + if (LoadTable) { + TableHandle = 0; + Status = AcpiSupport->SetAcpiTable ( + AcpiSupport, + Table, + TRUE, + Version, + &TableHandle + ); + ASSERT_EFI_ERROR (Status); + Status = AcpiSupport->PublishTables ( + AcpiSupport, + (EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0) + ); + ASSERT_EFI_ERROR (Status); + } + + // + // Increment the instance + // + Instance++; + Table = NULL; + } + } +} + +EFI_STATUS +LocateZPODDSupportProtocol ( + IN EFI_GUID *Protocol, + OUT VOID **Instance, + IN BOOLEAN Type + ) +/*++ + +Routine Description: + + Locate the first instance of a protocol. If the protocol requested is an + FV protocol, then it will return the first FV that contains the ACPI table + storage file. + +Arguments: + + Protocol The protocol to find. + Instance Return pointer to the first instance of the protocol + Type TRUE if the desired protocol is a FV protocol + +Returns: + + EFI_SUCCESS The function completed successfully. + EFI_NOT_FOUND The protocol could not be located. + EFI_OUT_OF_RESOURCES There are not enough resources to find the protocol. + +--*/ +{ + EFI_STATUS Status; + EFI_HANDLE *HandleBuffer; + UINTN NumberOfHandles; + EFI_FV_FILETYPE FileType; + UINT32 FvStatus; + EFI_FV_FILE_ATTRIBUTES Attributes; + UINTN Size; + UINTN i; + + FvStatus = 0; + // + // Locate protocol. + // + Status = pBS->LocateHandleBuffer ( + ByProtocol, + Protocol, + NULL, + &NumberOfHandles, + &HandleBuffer + ); + if (EFI_ERROR (Status)) { + // + // Defined errors at this time are not found and out of resources. + // + return Status; + } + // + // Looking for FV with ACPI storage file + // + for (i = 0; i < NumberOfHandles; i++) { + // + // Get the protocol on this handle + // This should not fail because of LocateHandleBuffer + // + Status = pBS->HandleProtocol ( + HandleBuffer[i], + Protocol, + Instance + ); + ASSERT (!EFI_ERROR (Status)); + + if (!Type) { + // + // Not looking for the FV protocol, so find the first instance of the + // protocol. There should not be any errors because our handle buffer + // should always contain at least one or LocateHandleBuffer would have + // returned not found. + // + break; + } + + // + // See if it has the ACPI storage file + // + Status = ((EFI_FIRMWARE_VOLUME_PROTOCOL *) (*Instance))->ReadFile ( + *Instance, + &gAcpiZpOddFfsTableGuid, + NULL, + &Size, + &FileType, + &Attributes, + &FvStatus + ); + + // + // If we found it, then we are done + // + if (Status == EFI_SUCCESS) { + break; + } + } + + // + // Our exit status is determined by the success of the previous operations + // If the protocol was found, Instance already points to it. + // + + // + // Free any allocated buffers + // + pBS->FreePool (HandleBuffer); + + return Status; +} + +#endif + +#if defined (RTD3_SUPPORT) && (RTD3_SUPPORT==1) +VOID LoadSsdtRtd3Table() +{ + EFI_STATUS Status; + EFI_HANDLE *HandleBuffer; + UINTN NumberOfHandles; + UINTN Index; + EFI_FIRMWARE_VOLUME_PROTOCOL *FwVol; + EFI_ACPI_SUPPORT_PROTOCOL *AcpiSupport; + INTN Instance; + EFI_ACPI_COMMON_HEADER *Table; + UINTN Size; + EFI_FV_FILETYPE FileType; + EFI_FV_FILE_ATTRIBUTES Attributes; + UINT32 FvStatus; + ACPI_HDR *TableHeader; + UINTN TableHandle; + EFI_ACPI_TABLE_VERSION Version; + + + AcpiSupport = NULL; + FwVol = NULL; + Table = NULL; + + // + // Locate FV protocol. + // + + Status = pBS->LocateHandleBuffer ( + ByProtocol, + &gEfiFirmwareVolumeProtocolGuid, + NULL, + &NumberOfHandles, + &HandleBuffer + ); + ASSERT_EFI_ERROR (Status); + + // + // Look for FV with ACPI RTD3 file + // + for (Index = 0; Index < NumberOfHandles; Index++) { + + // + // Get the protocol on this handle + // This should not fail because of LocateHandleBuffer + // + Status = pBS->HandleProtocol ( + HandleBuffer[Index], + &gEfiFirmwareVolumeProtocolGuid, + &FwVol + ); + ASSERT_EFI_ERROR (Status); + + // + // See if it has the ACPI RTD3 file + // + Size = 0; + FvStatus = 0; + Status = FwVol->ReadFile ( + FwVol, + &gAcpiRtd3FfsTableGuid, + NULL, + &Size, + &FileType, + &Attributes, + &FvStatus + ); + + // + // If we found it, then we are done + // + + if (Status == EFI_SUCCESS) { + break; + } + } + // + // Our exit status is determined by the success of the previous operations + // If the protocol was found, Instance already points to it. + // + // + // Free any allocated buffers + // + pBS->FreePool (HandleBuffer); + + // + // Sanity check that we found our data file + // + ASSERT (FwVol); + + // + // By default, a table belongs in all ACPI table versions published. + // + Version = EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0; + + // + // Find the AcpiSupport protocol + // + Status = LocateRTD3SupportProtocol ( + &gEfiAcpiSupportGuid, + &AcpiSupport, + FALSE + ); + ASSERT_EFI_ERROR (Status); + + // + // Read tables from the RTD3 file. + // + Instance = 0; + + while (Status == EFI_SUCCESS) { + // + // Read the ACPI tables + // + Status = FwVol->ReadSection ( + FwVol, + &gAcpiRtd3FfsTableGuid, + EFI_SECTION_RAW, + Instance, + &Table, + &Size, + &FvStatus + ); + + if (!EFI_ERROR (Status)) { + // + // This should be a RTD3 SSDT table + // + TableHeader = (ACPI_HDR *) Table; +#if ULT0RTD3_SUPPORT + if (MemCmp (&TableHeader->OemTblId, "Ult0Rtd3", 8) == 0) { +#endif +#if BRRTD3_SUPPORT + if (MemCmp (&TableHeader->OemTblId, "BR0_Rtd3", 8) == 0) { +#endif +#if RTD3FFRD_SUPPORT + if (MemCmp (&TableHeader->OemTblId, "HSW-FFRD", 8) == 0) { +#endif + // + // This is RTD3 SSDT. We load the table + // + TableHandle = 0; + Status = AcpiSupport->SetAcpiTable ( + AcpiSupport, + Table, + TRUE, + Version, + &TableHandle + ); + ASSERT_EFI_ERROR (Status); + } + + // + // Increment the instance + // + Instance++; + Table = NULL; + } + } + Status = AcpiSupport->PublishTables ( + AcpiSupport, + (EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0) + ); + ASSERT_EFI_ERROR (Status); +} + +EFI_STATUS +LocateRTD3SupportProtocol ( + IN EFI_GUID *Protocol, + OUT VOID **Instance, + IN BOOLEAN Type + ) +/*++ + +Routine Description: + + Locate the first instance of a protocol. If the protocol requested is an + FV protocol, then it will return the first FV that contains the ACPI table + storage file. + +Arguments: + + Protocol The protocol to find. + Instance Return pointer to the first instance of the protocol + Type TRUE if the desired protocol is a FV protocol + +Returns: + + EFI_SUCCESS The function completed successfully. + EFI_NOT_FOUND The protocol could not be located. + EFI_OUT_OF_RESOURCES There are not enough resources to find the protocol. + +--*/ +{ + EFI_STATUS Status; + EFI_HANDLE *HandleBuffer; + UINTN NumberOfHandles; + EFI_FV_FILETYPE FileType; + UINT32 FvStatus; + EFI_FV_FILE_ATTRIBUTES Attributes; + UINTN Size; + UINTN i; + + FvStatus = 0; + // + // Locate protocol. + // + Status = pBS->LocateHandleBuffer ( + ByProtocol, + Protocol, + NULL, + &NumberOfHandles, + &HandleBuffer + ); + if (EFI_ERROR (Status)) { + // + // Defined errors at this time are not found and out of resources. + // + return Status; + } + // + // Looking for FV with ACPI storage file + // + for (i = 0; i < NumberOfHandles; i++) { + // + // Get the protocol on this handle + // This should not fail because of LocateHandleBuffer + // + Status = pBS->HandleProtocol ( + HandleBuffer[i], + Protocol, + Instance + ); + ASSERT (!EFI_ERROR (Status)); + + if (!Type) { + // + // Not looking for the FV protocol, so find the first instance of the + // protocol. There should not be any errors because our handle buffer + // should always contain at least one or LocateHandleBuffer would have + // returned not found. + // + break; + } + + // + // See if it has the ACPI RTD3 file + // + Status = ((EFI_FIRMWARE_VOLUME_PROTOCOL *) (*Instance))->ReadFile ( + *Instance, + &gAcpiRtd3FfsTableGuid, + NULL, + &Size, + &FileType, + &Attributes, + &FvStatus + ); + + // + // If we found it, then we are done + // + if (Status == EFI_SUCCESS) { + break; + } + } + + // + // Our exit status is determined by the success of the previous operations + // If the protocol was found, Instance already points to it. + // + + // + // Free any allocated buffers + // + pBS->FreePool (HandleBuffer); + + return Status; +} +#endif + +#if defined ACPIDEBUG_SUPPORT && ACPIDEBUG_SUPPORT +VOID LoadSsdtAcpiDebugTable() +{ + EFI_STATUS Status; + EFI_HANDLE *HandleBuffer; + UINTN NumberOfHandles; + UINTN Index; + EFI_FIRMWARE_VOLUME_PROTOCOL *FwVol; + EFI_ACPI_SUPPORT_PROTOCOL *AcpiSupport; + INTN Instance; + EFI_ACPI_COMMON_HEADER *Table; + UINTN Size; + EFI_FV_FILETYPE FileType; + EFI_FV_FILE_ATTRIBUTES Attributes; + UINT32 FvStatus; + ACPI_HDR *TableHeader; + UINTN TableHandle; + EFI_ACPI_TABLE_VERSION Version; + EFI_PHYSICAL_ADDRESS BaseAddressMem = 0; + UINT32 BufferIndex; + UINT32 BufferEnd; + UINT8 *CurrPtr; + UINT32 *Signature; + NAME_LAYOUT *NamePtr; + UINT8 UpdateCounter; + + + AcpiSupport = NULL; + FwVol = NULL; + Table = NULL; + + // + // Reserve 64kb buffer of system memory to store Acpi Debug data. + // + BaseAddressMem = 0xFFFFFFFF; + Status = pBS->AllocatePages ( + AllocateMaxAddress, + EfiReservedMemoryType, + EFI_SIZE_TO_PAGES (AcpiDebugBufferSize), + &BaseAddressMem + ); + ASSERT_EFI_ERROR(Status); + + BufferIndex = (UINT32) BaseAddressMem; + BufferEnd = BufferIndex + AcpiDebugBufferSize; + // + // Clear the 64kb buffer + // + pBS->SetMem ((VOID *)(UINTN)BaseAddressMem, AcpiDebugBufferSize, 0x78); + // + // Write a signature to the first line of the buffer, "INTEL ACPI DEBUG". + // + pBS->CopyMem ((VOID *)(UINTN)BufferIndex, ACPI_DEBUG_STR, sizeof(ACPI_DEBUG_STR) - 1); + // + // leave the Index after the signature + // + BufferIndex += sizeof(ACPI_DEBUG_STR) - 1; + TRACE((TRACE_ALWAYS, "ACPI Debug address =0x%08X\n", BaseAddressMem)); + + // + // Locate FV protocol. + // + + Status = pBS->LocateHandleBuffer ( + ByProtocol, + &gEfiFirmwareVolumeProtocolGuid, + NULL, + &NumberOfHandles, + &HandleBuffer + ); + ASSERT_EFI_ERROR (Status); + + // + // Look for FV with ACPIDebug file + // + for (Index = 0; Index < NumberOfHandles; Index++) { + + // + // Get the protocol on this handle + // This should not fail because of LocateHandleBuffer + // + Status = pBS->HandleProtocol ( + HandleBuffer[Index], + &gEfiFirmwareVolumeProtocolGuid, + &FwVol + ); + ASSERT_EFI_ERROR (Status); + + // + // See if it has the ACPI Debug file + // + Size = 0; + FvStatus = 0; + Status = FwVol->ReadFile ( + FwVol, + &gAcpiDebugFfsTableGuid, + NULL, + &Size, + &FileType, + &Attributes, + &FvStatus + ); + + // + // If we found it, then we are done + // + + if (Status == EFI_SUCCESS) { + break; + } + } + // + // Our exit status is determined by the success of the previous operations + // If the protocol was found, Instance already points to it. + // + // + // Free any allocated buffers + // + pBS->FreePool (HandleBuffer); + + // + // Sanity check that we found our data file + // + ASSERT (FwVol); + + // + // By default, a table belongs in all ACPI table versions published. + // + Version = EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0; + + // + // Find the AcpiSupport protocol + // + Status = LocateAcpiDebugSupportProtocol ( + &gEfiAcpiSupportGuid, + &AcpiSupport, + FALSE + ); + ASSERT_EFI_ERROR (Status); + + // + // Read tables from the AcpiDebug file. + // + Instance = 0; + + while (Status == EFI_SUCCESS) { + // + // Read the ACPI tables + // + Status = FwVol->ReadSection ( + FwVol, + &gAcpiDebugFfsTableGuid, + EFI_SECTION_RAW, + Instance, + &Table, + &Size, + &FvStatus + ); + + if (!EFI_ERROR (Status)) { + // + // This should be a AcpiDebug SSDT table + // + TableHeader = (ACPI_HDR *) Table; + if (MemCmp (&TableHeader->OemTblId, "ADebTabl", 8) == 0) { + // + // Patch some pointers for the ASL code before loading the SSDT. + // + UpdateCounter = 1; + for (CurrPtr = (UINT8 *) TableHeader; CurrPtr <= ((UINT8 *) TableHeader + TableHeader->Length), UpdateCounter < 4; CurrPtr++) { + Signature = (UINT32 *) (CurrPtr + 1); + // + // patch DPTR (address of Acpi debug memory buffer) + // + if ((*CurrPtr == AML_NAME_OP) && *Signature == EFI_SIGNATURE_32 ('D', 'P', 'T', 'R')) { + NamePtr = (NAME_LAYOUT *) CurrPtr; + NamePtr->Value = (UINT32) BaseAddressMem; + UpdateCounter++; + } + // + // patch EPTR (end of Acpi debug memory buffer) + // + if ((*CurrPtr == AML_NAME_OP) && *Signature == EFI_SIGNATURE_32 ('E', 'P', 'T', 'R')) { + NamePtr = (NAME_LAYOUT *) CurrPtr; + NamePtr->Value = (UINT32) BufferEnd; + UpdateCounter++; + } + // + // patch CPTR (used as an index that starts after the buffer signature) + // + if ((*CurrPtr == AML_NAME_OP) && *Signature == EFI_SIGNATURE_32 ('C', 'P', 'T', 'R')) { + NamePtr = (NAME_LAYOUT *) CurrPtr; + NamePtr->Value = (UINT32) BufferIndex; + UpdateCounter++; + } + } + // + // This is AcpiDebug SSDT. We load the table + // + TableHandle = 0; + Status = AcpiSupport->SetAcpiTable ( + AcpiSupport, + Table, + TRUE, + Version, + &TableHandle + ); + ASSERT_EFI_ERROR (Status); + } + + // + // Increment the instance + // + Instance++; + Table = NULL; + } + } + Status = AcpiSupport->PublishTables ( + AcpiSupport, + (EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0) + ); + ASSERT_EFI_ERROR (Status); +} + +EFI_STATUS +LocateAcpiDebugSupportProtocol ( + IN EFI_GUID *Protocol, + OUT VOID **Instance, + IN BOOLEAN Type + ) +/*++ + +Routine Description: + + Locate the first instance of a protocol. If the protocol requested is an + FV protocol, then it will return the first FV that contains the ACPI table + storage file. + +Arguments: + + Protocol The protocol to find. + Instance Return pointer to the first instance of the protocol + Type TRUE if the desired protocol is a FV protocol + +Returns: + + EFI_SUCCESS The function completed successfully. + EFI_NOT_FOUND The protocol could not be located. + EFI_OUT_OF_RESOURCES There are not enough resources to find the protocol. + +--*/ +{ + EFI_STATUS Status; + EFI_HANDLE *HandleBuffer; + UINTN NumberOfHandles; + EFI_FV_FILETYPE FileType; + UINT32 FvStatus; + EFI_FV_FILE_ATTRIBUTES Attributes; + UINTN Size; + UINTN i; + + FvStatus = 0; + // + // Locate protocol. + // + Status = pBS->LocateHandleBuffer ( + ByProtocol, + Protocol, + NULL, + &NumberOfHandles, + &HandleBuffer + ); + if (EFI_ERROR (Status)) { + // + // Defined errors at this time are not found and out of resources. + // + return Status; + } + // + // Looking for FV with ACPI storage file + // + for (i = 0; i < NumberOfHandles; i++) { + // + // Get the protocol on this handle + // This should not fail because of LocateHandleBuffer + // + Status = pBS->HandleProtocol ( + HandleBuffer[i], + Protocol, + Instance + ); + ASSERT (!EFI_ERROR (Status)); + + if (!Type) { + // + // Not looking for the FV protocol, so find the first instance of the + // protocol. There should not be any errors because our handle buffer + // should always contain at least one or LocateHandleBuffer would have + // returned not found. + // + break; + } + + // + // See if it has the ACPI RTD3 file + // + Status = ((EFI_FIRMWARE_VOLUME_PROTOCOL *) (*Instance))->ReadFile ( + *Instance, + &gAcpiDebugFfsTableGuid, + NULL, + &Size, + &FileType, + &Attributes, + &FvStatus + ); + + // + // If we found it, then we are done + // + if (Status == EFI_SUCCESS) { + break; + } + } + + // + // Our exit status is determined by the success of the previous operations + // If the protocol was found, Instance already points to it. + // + + // + // Free any allocated buffers + // + pBS->FreePool (HandleBuffer); + + return Status; +} +#endif + +VOID *GetDSDTTable () +{ + INTN Index; + PACPI_HDR Table; + EFI_ACPI_TABLE_VERSION Version; + UINTN Handle; + EFI_STATUS Status; + + for (Index = 0;;++Index) { + Status = gEfiAcpiSupport->GetAcpiTable(gEfiAcpiSupport, + Index, + &Table, + &Version, + &Handle); + if (EFI_ERROR(Status)) return 0; + if (((PACPI_HDR)Table)->Signature == FACP_SIG) return(VOID*)(UINTN)((PFACP32)Table)->DSDT; + + } +} + +VOID +DsdtTableUpdate ( + PACPI_HDR DsdtTable + ) +/*++ + + Routine Description: + + Update the DSDT table + + Arguments: + + DsdtTable - The table points to DSDT table. + + Returns: + + None + +--*/ +{ + UINT8 *CurrPtr; + UINT8 *DsdtPointer; + UINT32 *Signature; + UINT8 *Operation; + // + // Loop through the ASL looking for values that we must fix up. + // + CurrPtr = (UINT8 *) DsdtTable; + for (DsdtPointer = CurrPtr; + DsdtPointer <= (CurrPtr + ((EFI_ACPI_COMMON_HEADER *) CurrPtr)->Length); + DsdtPointer++ + ) { + Signature = (UINT32 *) DsdtPointer; + // + // SNB_TODO + // SV Boards need it? + // + + // + // Desktop specific update can be put here. + // + switch (*Signature) { + // + // GPIO14 is not used on desktop, so related stuff should be removed in DSDT. + // + case (EFI_SIGNATURE_32 ('_', 'P', 'R', 'W')): + // + // Check if the next object to signature is the NAME of PWRB device. + // + Operation = DsdtPointer - 1; + if ((*Operation == AML_NAME_OP) && (*(DsdtPointer + 8) == 0x1E)) { + // + // Rename _PRW (unrecognized name so OS will ignore) + // + *DsdtPointer = 'O'; + } + break; + case (EFI_SIGNATURE_32 ('_', 'L', '1', 'E')): + // + // Rename _L1E method (unrecognized method so OS will ignore) + // + *DsdtPointer = 'O'; + break; + default: + break; + } + } + return; +} + +/* +VOID +DsdtTableUpdate1 ( + PACPI_HDR DsdtTable + ) +{ + UINT8 *CurrPtr; + UINT8 *DsdtPointer; + UINT32 *Signature, *Signature1; + + CurrPtr = (UINT8 *) DsdtTable; + + for (DsdtPointer = CurrPtr; + DsdtPointer <= (CurrPtr + ((EFI_ACPI_COMMON_HEADER *) CurrPtr)->Length); + DsdtPointer++ + ) { + Signature = (UINT32 *) (DsdtPointer + 3); + Signature1 = (UINT32 *) (DsdtPointer + 14); + // + if ((*DsdtPointer == AML_EXT_OP) && + (*(DsdtPointer + 1)== AML_EXT_PROCESSOR_OP) && + (*(Signature1 ) == EFI_SIGNATURE_32 ('_', 'D', 'E', 'P')) + ) { + switch(*Signature){ + case (EFI_SIGNATURE_32 ('C', 'P', 'U', '0')): + case (EFI_SIGNATURE_32 ('C', 'P', 'U', '1')): + case (EFI_SIGNATURE_32 ('C', 'P', 'U', '2')): + case (EFI_SIGNATURE_32 ('C', 'P', 'U', '3')): + case (EFI_SIGNATURE_32 ('C', 'P', 'U', '4')): + case (EFI_SIGNATURE_32 ('C', 'P', 'U', '5')): + case (EFI_SIGNATURE_32 ('C', 'P', 'U', '6')): + case (EFI_SIGNATURE_32 ('C', 'P', 'U', '7')): + + TRACE((-1, "Processor CPU0 Point at 0x%08X\n", DsdtPointer)); + *(DsdtPointer + 14) = 'X'; + break; + default: + break; + }// end switch + + } + + } + return; +} +*/ + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Board/EM/Platform/AcpiPlatform.cif b/Board/EM/Platform/AcpiPlatform.cif new file mode 100644 index 0000000..32c45ab --- /dev/null +++ b/Board/EM/Platform/AcpiPlatform.cif @@ -0,0 +1,44 @@ + + name = "Platform" + category = eModule + LocalRoot = "Board\EM\Platform" + RefName = "AcpiPlatform" +[files] +"ReleaseNotes.chm" +"AcpiPlatform.sdl" +"AcpiPlatformPei.c" +"AcpiPlatformPei.dxs" +"AcpiPlatform.c" +"AcpiPlatformCspLib.c" +"AcpiPlatform.dxs" +"AcpiPlatformSmi.c" +"AcpiPlatformSmi.dxs" +"AcpiPlatform.mak" +"AcpiPlatform.h" +"AcpiPlatform.sd" +"AcpiPlatform.uni" +"PlatformSetup.h" +"AcpiIntelRC.h" +"iasl.exe" +"GenAcpiTable.exe" +[parts] +"PlatformInfo" +"AcpiAsl" +"AcpiFvi" +"SsdtAcpiDebug" +"SsdtPtid" +"SsdtRtd3" +"SsdtZpOdd" +"SsdtSensorHub" +"AcpiProtocolLib" +"SMBIOSUpdateData" +"IntelPlatformInclude" +"IntelPlatformProtocolLib" +"IntelRefVerDisplay" +"PlatformSetupInfo" +"FvOnFv2Thunk" +"FirmwareVerInfo" +"EfiCombineImage" +"lpit" +"SsdtIRMT" + diff --git a/Board/EM/Platform/AcpiPlatform.dxs b/Board/EM/Platform/AcpiPlatform.dxs new file mode 100644 index 0000000..350b726 --- /dev/null +++ b/Board/EM/Platform/AcpiPlatform.dxs @@ -0,0 +1,53 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/AcpiPlatform.dxs 1 2/09/12 12:30a Yurenlai $ +// +// $Revision: 1 $ +// +// $Date: 2/09/12 12:30a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/AcpiPlatform.dxs $ +// +// 1 2/09/12 12:30a Yurenlai +// Initial check in. +// +//************************************************************************* + +#include +#include +#include + +DEPENDENCY_START + EFI_CPU_IO_PROTOCOL_GUID AND + EFI_ACPI_SUPPORT_GUID AND + EFI_PLATFORM_INFO_PROTOCOL_GUID +DEPENDENCY_END + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Board/EM/Platform/AcpiPlatform.h b/Board/EM/Platform/AcpiPlatform.h new file mode 100644 index 0000000..aa722b8 --- /dev/null +++ b/Board/EM/Platform/AcpiPlatform.h @@ -0,0 +1,240 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/AcpiPlatform.h 12 7/11/14 4:00a Joshchou $ +// +// $Revision: 12 $ +// +// $Date: 7/11/14 4:00a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/AcpiPlatform.h $ +// +// 12 7/11/14 4:00a Joshchou +// [TAG] None +// [Category] Improvement +// [Description] Support Debug Port Table. +// [Files] AcpiPlatform.c +// AcpiPlatform.h +// AcpiPlatform.cif +// +// 11 4/23/14 4:21a Joshchou +// +// 10 9/27/13 10:43a Joshchou +// [TAG] EIP137454 +// [Category] New Feature +// [Description] Follow Intel sample code to add LPIT table. +// +// 9 9/18/13 6:26a Joshchou +// [TAG] EIP136411 +// [Category] Improvement +// [Description] Support MWAIT LPI State Descriptor[1]. +// +// 8 7/16/13 6:00a Alanlin +// [TAG] EIP127540 +// [Category] Normal +// [Severity] Normal +// [Description] Windows* 8.1 Micro-PEP (uPEP) ASL Support Version 0.5 +// [Files] AcpiPlatform.c, AcpiPlatform.h +// +// 7 6/28/13 5:22a Alanlin +// [TAG] None +// [Category] Important +// [Severity] Important +// [Description] Fixed that Processors device are disappeared under OS +// device manager. +// [Files] AcpiPlatform.c, AcpiPlatform.h +// +// 6 11/20/12 7:08a Alanlin +// [TAG] None +// [Category] New Feature +// [Severity] Important +// [Description] SensorHub SSDT acpi table support +// [Files] Acpiplatform.c, Acpiplatform.cif, Acpiplatform.h, +// SsdtSensorHub.asl, SsdtSensorHub.mak, SsdtSensorHub.sdl +// +// [TAG] None +// [Category] Important +// [Severity] Important +// [Description] Update Shark Bay Client ACPI Reference Code Beta Version +// 0.8.0 +// +// 5 11/09/12 5:18a Alanlin +// [TAG] None +// [Category] New Feature +// [Severity] Important +// [Description] ZpOdd SSDT acpi table support +// [Files] Acpiplatform.c, Acpiplatform.cif, Acpiplatform.h, +// Acpiplatform.sd, Acpiplatform.uni +// +// 4 10/31/12 4:40a Alanlin +// [TAG] None +// [Category] New Feature +// [Severity] Normal +// [Description] Support Acpi Debug SSDT. +// +// 3 9/12/12 7:21a Yurenlai +// [TAG] None +// [Category] Improvement +// [Severity] Important +// [Description] Remove AOAC for Intel Smart Connect Technology module. +// [Files] GlobalNvsArea.h, GloblNvs.asl +// +// 2 8/31/12 4:48a Yurenlai +// [TAG] None +// [Category] Improvement +// [Severity] Important +// [Description] Implement Runtime D3. +// [Files] AcpiPlatform.c, AcpiPlatform.cif, AcpiPlatform.h, +// AcpiPlatform.sd, AcpiPlatform.sdl, AcpiPlatform.uni, GlobalNvsArea.h, +// SsdtRtd3.cif, SsdtRtd3.mak, Ult0Rtd3.asl, SsdtRtd3.sdl +// +// 1 2/09/12 12:30a Yurenlai +// Initial check in. +// +//************************************************************************* +// +// +// Name: AcpiPlatform.h +// +// Description: AcpiPlatform header file, define all the AcpiPlatform module +// specific equates and structures in this file. +// +// +//************************************************************************* + +#define EFI_MSR_IA32_PLATFORM_ID 0x17 +#define EFI_MSR_IA32_CR_PIC_MSG_CONTROL 0x2e +#define EFI_MSR_CORE_THREAD_COUNT 0x35 +#define EFI_MSR_IA32_FEATURE_CONTROL 0x3a + +#define AML_NAME_OP 0x08 +#define AML_EXT_OP 0x5b +#define AML_EXT_DEVICE_OP 0x82 +#define AML_EXT_PROCESSOR_OP 0x83 +#define AML_NOOP_OP 0xa3 + +#define PCH_SMBUS_ENABLE_PEC 0x1 + +//-jeff For EDK +// Common table header, this prefaces all ACPI tables, including FACS, but +// excluding the RSD PTR structure + +#ifndef EFI_SIGNATURE_16 +#define EFI_SIGNATURE_16(A, B) ((A) | (B << 8)) +#endif + +#ifndef EFI_SIGNATURE_32 +#define EFI_SIGNATURE_32(A, B, C, D) (EFI_SIGNATURE_16 (A, B) | (EFI_SIGNATURE_16 (C, D) << 16)) +#endif + +// +// ACPI table information used to initialize tables. +// +#define EFI_ACPI_3_0_DEBUG_PORT_TABLE_SIGNATURE EFI_SIGNATURE_32('D', 'B', 'G', 'P') +#define EFI_ACPI_DBGP_TABLE_REVISION 0x01 +#define EFI_ACPI_OEM_DBGP_REVISION 0x00000000 +#define EFI_ACPI_CREATOR_ID 0x5446534D // "MSFT" +#define EFI_ACPI_CREATOR_REVISION 0x00000005F + +typedef struct { + UINT32 Signature; + UINT32 Length; +} EFI_ACPI_COMMON_HEADER; + +typedef struct +{ + UINT32 Signature; + UINT32 Length; + UINT8 Revision; + UINT8 Checksum; + UINT8 OemId[6]; + UINT64 OemTableId; + UINT32 OemRevision; + UINT32 CreatorId; + UINT32 CreatorRevision; +} EFI_ACPI_DESCRIPTION_HEADER; + + +#pragma pack(1) +typedef union _MSR_REGISTER { + UINT64 Qword; + + struct _DWORDS { + UINT32 Low; + UINT32 High; + } Dwords; + + struct _BYTES { + UINT8 FirstByte; + UINT8 SecondByte; + UINT8 ThirdByte; + UINT8 FouthByte; + UINT8 FifthByte; + UINT8 SixthByte; + UINT8 SeventhByte; + UINT8 EighthByte; + } Bytes; + +} MSR_REGISTER; + +/// +/// ACPI 2.0 Generic Address Space definition +/// +typedef struct _EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE{ + UINT8 AddressSpaceId; + UINT8 RegisterBitWidth; + UINT8 RegisterBitOffset; + UINT8 Reserved; + UINT64 Address; +} EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE; + +typedef struct { + ACPI_HDR Header; + UINT8 InterfaceType; + UINT8 Reserved_37[3]; + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE BaseAddress; +} EFI_ACPI_DEBUG_PORT_DESCRIPTION_TABLE; + + +#define PTID_FFS_TABLE_STORAGE_GUID \ + { 0x95DFCAE5, 0xBB28, 0x4d6b, 0xB1, 0xE2, 0x3A, 0xF3, 0xA6, 0xBF, 0x43, 0x4F } +#define RTD3_FFS_TABLE_GUID \ + { 0x7FFC3536, 0x0A8A, 0x448B, 0x95, 0xF4, 0x39, 0xF5, 0xB9, 0xF0, 0x9A, 0xDD } +#define ACPIDEBUG_FFS_TABLE_GUID \ + { 0x94AB6AED, 0x9719, 0x48ef, 0x83, 0x1C, 0x2E, 0x9C, 0x29, 0x75, 0x8C, 0x33 } +#define ZPODD_FFS_TABLE_GUID \ + { 0xE42A76A1, 0xD4B3, 0x4c26, 0xA1, 0xBB, 0x84, 0xA3, 0x50, 0x2A, 0x77, 0x9F } +#define INTELSENSORHUB_FFS_TABLE_GUID \ + { 0xA3201EEC, 0x1612, 0x4577, 0x89, 0x24, 0xCB, 0x32, 0xD5, 0x42, 0xD2, 0x2C } +#define IRMT_FFS_TABLE_STORAGE_GUID \ + { 0xCE2007C7, 0xB389, 0x49c5, 0x84, 0xE3, 0xDB, 0x36, 0xA1, 0xF0, 0x99, 0x3B } +#pragma pack() + + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Board/EM/Platform/AcpiPlatform.mak b/Board/EM/Platform/AcpiPlatform.mak new file mode 100644 index 0000000..632eeb4 --- /dev/null +++ b/Board/EM/Platform/AcpiPlatform.mak @@ -0,0 +1,170 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2011, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* + +#************************************************************************* +# $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/AcpiPlatform.mak 5 12/18/12 11:03p Alanlin $ +# +# $Revision: 5 $ +# +# $Date: 12/18/12 11:03p $ +#************************************************************************* +# Revision History +# ---------------- +# $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/AcpiPlatform.mak $ +# +# 5 12/18/12 11:03p Alanlin +# [TAG] EIP107188 +# [Category] Important +# [Severity] Important +# [Description] USB 3.0 port can't work when RTD3 is Enabled in setup +# menu. +# [Files] Acpiplatform.c, Acpiplatform.mak, Acpiplatform.sd, +# Acpiplatform.uni. +# +# 4 10/15/12 11:41a Alanlin +# [TAG] None +# [Category] Spec Update +# [Severity] Important +# [Description] Updated for RC 0.7.1 +# +# 3 4/25/12 1:28p Yurenlai +# [TAG] None +# [Category] Improvement +# [Description] Initilize ACPI DXE Platform Policy. +# [Files] AcpiPlatform.c, AcpiPlatform.mak +# +# 1 2/09/12 12:30a Yurenlai +# Initial check in. +# +#************************************************************************* +# +# +# Name: AcpiPlatform.mak +# +# Description: This make file builds AcpiPlatform module PEI & DXE and SMI +# components and link them to respective binary +# +# +#************************************************************************* + +all : AcpiPlatformPei AcpiPlatform AcpiPlatformSmi + +#--------------------------------------------------------------------------- +# Generic AcpiPlatform dependencies +#--------------------------------------------------------------------------- + +$(BUILD_DIR)\AcpiPlatform.mak : $(AcpiPlatform_DIR)\AcpiPlatform.cif $(BUILD_RULES) + $(CIF2MAK) $(AcpiPlatform_DIR)\AcpiPlatform.cif $(CIF2MAK_DEFAULTS) + +#---------------------------------------------------------------------------- +# Add files into CSP Library +#---------------------------------------------------------------------------- +AMI_CSP_LIB_LIBRARY_PATH = $(AMI_CSP_LIB_LIBRARY_PATH);$(AcpiPlatform_DIR) + +AMI_CSP_LIB_OBJS = $(AMI_CSP_LIB_OBJS) \ +$(BUILD_DIR)\AcpiPlatformCspLib.obj + +{$(AcpiPlatform_DIR)}.c{$(BUILD_DIR)}.obj:: + $(CC) $(CFLAGS) /I $(AcpiPlatform_DIR) /Fo$(BUILD_DIR)\ $< + +$(BUILD_DIR)\AcpiPlatformCspLib.obj : $(AcpiPlatform_DIR)\AcpiPlatformCspLib.c + +CORE_DXEBin: $(AMICSPLib) + +#--------------------------------------------------------------------------- +# Create AcpiPlatform PEI Component +#--------------------------------------------------------------------------- +AcpiPlatformPei : $(BUILD_DIR)\AcpiPlatform.mak AcpiPlatformPeiBin + +AcpiPlatformPeiBin : $(AMIPEILIB) $(AMICSPLib) + $(MAKE) /$(MAKEFLAGS) $(BUILD_DEFAULTS)\ + /f $(BUILD_DIR)\AcpiPlatform.mak all\ + NAME=AcpiPlatformPei\ + MAKEFILE=$(BUILD_DIR)\AcpiPlatform.mak \ + "CFLAGS=$(CFLAGS)"\ + OBJECTS="$(AcpiPlatformPei_OBJECTS)" \ + GUID=333BB2A3-4F20-4c8b-AC38-0672D74315F8\ + ENTRY_POINT=AcpiPlatformPeiInit \ + TYPE=PEIM \ + DEPEX1=$(AcpiPlatform_DIR)\AcpiPlatformPei.DXS DEPEX1_TYPE=EFI_SECTION_PEI_DEPEX \ + COMPRESS=0 + +#{333BB2A3-4F20-4c8b-AC38-0672D74315F8} +#DEFINE_GUID(<>, +#0x333bb2a3, 0x4f20, 0x4c8b, 0xac, 0x38, 0x6, 0x72, 0xd7, 0x43, 0x15, 0xf8); +#--------------------------------------------------------------------------- +# Create AcpiPlatform DXE Component +#--------------------------------------------------------------------------- +AcpiPlatform: $(BUILD_DIR)\AcpiPlatform.mak AcpiPlatformBin + +AcpiPlatformBin : $(AMIDXELIB) $(AMICSPLib) $(DxeKscLib_LIB) $(AcpiProtocolLib_LIB) $(INTEL_SA_PROTOCOL_LIB) + $(MAKE) /$(MAKEFLAGS) $(BUILD_DEFAULTS)\ + /f $(BUILD_DIR)\AcpiPlatform.mak all\ + GUID=8B5FBABD-F51F-4942-BF16-16AAA38AE52B\ + "MY_INCLUDES=$(INTEL_PLATFORM_PROTOCOL_INCLUDES) $(INTEL_PCH_INCLUDES) $(ACPI_PLATFORM_INCLUDES) $(AcpiProtocolLib_INCLUDES) $(PLATFORM_INFO_INCLUDES) $(DxeKscLib_INCLUDES) $(DPPM_DIR_INCLUDES) /I $(INTEL_SA_PROTOCOL_LIB_DIR)"\ + ENTRY_POINT=AcpiPlatformInit\ + OBJECTS="$(AcpiPlatform_OBJECTS)" \ + TYPE=BS_DRIVER \ + DEPEX1=$(AcpiPlatform_DIR)\AcpiPlatform.dxs\ + DEPEX1_TYPE=EFI_SECTION_DXE_DEPEX\ + COMPRESS=1 + +#---------------------------------------------------------------------------- +# Create AcpiPlatform SMI Component +#---------------------------------------------------------------------------- +AcpiPlatformSmi : $(BUILD_DIR)\AcpiPlatform.mak AcpiPlatformSmiBin + +AcpiPlatformSmiBin : $(AMICSPLib) $(AMIDXELIB) + $(MAKE) /$(MAKEFLAGS) $(BUILD_DEFAULTS)\ + /f $(BUILD_DIR)\AcpiPlatform.mak all\ + NAME=AcpiPlatformSmi\ + MAKEFILE=$(BUILD_DIR)\AcpiPlatform.mak \ + OBJECTS="$(AcpiPlatformSmi_OBJECTS)" \ + GUID=DFD8D5CC-5AED-4820-A2B6-5C55E4E640EF \ + ENTRY_POINT=InitializeAcpiPlatformSMISmm \ + "CFLAGS=$(CFLAGS) $(ACPI_PLATFORM_INCLUDES) $(PLATFORM_INFO_INCLUDES) $(SB_INCLUDES)"\ + "EXT_HEADERS=$(BUILD_DIR)\token.h"\ + TYPE=BS_DRIVER \ + DEPEX1=$(AcpiPlatform_DIR)\AcpiPlatformSmi.DXS DEPEX1_TYPE=EFI_SECTION_DXE_DEPEX \ + COMPRESS=1 + +#{DFD8D5CC-5AED-4820-A2B6-5C55E4E640EF} +#DEFINE_GUID(<>, +#0xdfd8d5cc, 0x5aed, 0x4820, 0xa2, 0xb6, 0x5c, 0x55, 0xe4, 0xe6, 0x40, 0xef); + +#--------------------------------------------------------------------------- +# Create IgdOpRegion Setup Screens +#--------------------------------------------------------------------------- +SetupSdbs : $(BUILD_DIR)\AcpiPlatform.mak AcpiPlatformSDB + + +AcpiPlatformSDB : + $(MAKE) /$(MAKEFLAGS) $(BUILD_DEFAULTS)\ + /f $(BUILD_DIR)\AcpiPlatform.mak all \ + TYPE=SDB NAME=AcpiPlatform STRING_CONSUMERS=$(AcpiPlatform_DIR)\AcpiPlatform.sd + + +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2011, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* diff --git a/Board/EM/Platform/AcpiPlatform.sd b/Board/EM/Platform/AcpiPlatform.sd new file mode 100644 index 0000000..1439c7f --- /dev/null +++ b/Board/EM/Platform/AcpiPlatform.sd @@ -0,0 +1,1877 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/AcpiPlatform.sd 16 5/15/14 3:14a Joshchou $ +// +// $Revision: 16 $ +// +// $Date: 5/15/14 3:14a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/AcpiPlatform.sd $ +// +// 16 5/15/14 3:14a Joshchou +// [TAG] EIP167036 +// [Category] Improvement +// [Description] review the attributes of variable. +// [Files] AcpiPlatform.c +// AcpiPlatform.h +// AcpiPlatform.sd +// AcpiPlatform.cif +// +// 15 4/23/14 4:21a Joshchou +// +// 14 7/16/13 5:59a Alanlin +// [TAG] EIP125350 +// [Category] Normal +// [Severity] Normal +// [Description] System BIOS Support for the Hardware Button for Windows* +// 8.1 - Rev.0.5 +// [Files] AcpiPlatform.c, AcpiPlatform.sd, AcpiPlatform.uni +// +// 13 6/04/13 10:19a Alanlin +// [TAG] None +// [Category] Improvement +// [Severity] Normal +// [Description] Follow Intel CRB BIOS v126 to set default configuraton +// setting of RTD3 devices. +// [Files] AcpiPlatform.c, AcpiPlatform.sd, AcpiPlatform.uni +// +// 12 4/24/13 7:03a Alanlin +// [TAG] None +// [Category] Normal +// [Severity] Normal +// [Description] Change "Native PCIE Enable" and "Native ASPM" to Enabled +// as default. +// [Files] AcpiPlatform.sd +// +// 11 3/26/13 9:31a Alanlin +// [TAG] EIP119125 +// [Category] Important +// [Severity] Important +// [Description] Update Shark Bay Client ACPI Reference Code Beta Version +// 1.3.1 +// +// 10 2/15/13 1:13a Alanlin +// [TAG] EIP114919 +// [Category] Important +// [Severity] Important +// [Description] Update Shark Bay Client ACPI Reference Code Beta Version +// 1.1.0 +// +// 9 2/01/13 3:14a Alanlin +// [TAG] None +// [Category] Important +// [Severity] Important +// [Description] Fixed that DPPM-06 test item can't be passed. +// [Files] Acpiplatform.sd. +// +// 8 1/28/13 11:14p Alanlin +// [TAG] EIP113555 +// [Category] Important +// [Severity] Important +// [Description] Update Shark Bay Client ACPI Reference Code Beta Version +// 1.0.0 +// +// 7 1/15/13 5:46a Alanlin +// [TAG] None +// [Category] Normal +// [Severity] Normal +// [Description] Add setup item and setting for DPTF +// [Files] Acpiplatform.c, Acpiplatform.sd, Acpiplatform.uni, +// PlatformSetup.h +// +// 6 12/18/12 11:04p Alanlin +// [TAG] EIP107188 +// [Category] Important +// [Severity] Important +// [Description] USB 3.0 port can't work when RTD3 is Enabled in setup +// menu. +// [Files] Acpiplatform.c, Acpiplatform.mak, Acpiplatform.sd, +// Acpiplatform.uni. +// +// 5 11/09/12 5:18a Alanlin +// [TAG] None +// [Category] New Feature +// [Severity] Important +// [Description] ZpOdd SSDT acpi table support +// [Files] Acpiplatform.c, Acpiplatform.cif, Acpiplatform.h, +// Acpiplatform.sd, Acpiplatform.uni +// +// 4 10/31/12 4:41a Alanlin +// [TAG] None +// [Category] New Feature +// [Severity] Normal +// [Description] Support Acpi Debug SSDT. +// +// 3 8/31/12 4:48a Yurenlai +// [TAG] None +// [Category] Improvement +// [Severity] Important +// [Description] Implement Runtime D3. +// [Files] AcpiPlatform.c, AcpiPlatform.cif, AcpiPlatform.h, +// AcpiPlatform.sd, AcpiPlatform.sdl, AcpiPlatform.uni, GlobalNvsArea.h, +// SsdtRtd3.cif, SsdtRtd3.mak, Ult0Rtd3.asl, SsdtRtd3.sdl +// +// 2 7/27/12 5:11a Yurenlai +// [TAG] None +// [Category] Improvement +// [Description] Create DPTF and CPPC setup item. +// [Files] AcpiPlatform.c, AcpiPlatform.sd, AcpiPlatform.uni, +// PlatformSetup.h +// +// 1 2/09/12 12:31a Yurenlai +// Initial check in. +// +//************************************************************************* +// +// +// Name: AcpiPlatform.sd +// +// Description: AcpiPlatform Form Template +// +// +//************************************************************************* + +#ifdef SETUP_DATA_DEFINITION +//--------------------------------------------------------------------------- +// Put NVRAM data definitions here. +// For example: UINT8 Data1; +// These definitions will be converted by the build process +// to a definitions of SETUP_DATA fields. +//--------------------------------------------------------------------------- +#if ACPIDEBUG_SUPPORT + UINT8 AcpiDebugSupport; +#endif // ACPIDEBUG_SUPPORT +#if RTD3_SUPPORT + UINT8 Rtd3Support; + UINT16 VRStaggeringDelay; + UINT16 VRRampUpDelay; + UINT8 Rtd3P0dl; + UINT8 Rtd3P3dl; + UINT16 Rtd3Audio; + UINT16 Rtd3ADSP; + UINT16 Rtd3I2C0; + UINT16 Rtd3SensorHub; + UINT16 Rtd3I2C1; + UINT16 Rtd3I2C1PS0; + UINT16 Rtd3TouchPanel; + UINT8 PepGfx; + UINT8 PepSata; + UINT8 PCapping; + UINT8 XhciP0; + UINT8 XhciP1; + UINT8 RIC0; + UINT8 RTD3ZPODD; + UINT8 RTD3USBCamera; + UINT8 RTD3MiniSataPort3; + UINT8 RTD3WaGpio; +#endif // RTD3_SUPPORT + UINT8 PciExpNative; + UINT8 NativeAspmEnable; +#if PTID_SUPPORT + UINT8 PtidSupport; + UINT8 PeciAccessMethod; +#endif // PTID_SUPPORT +#if LOW_POWER_S0_IDLE_CAPABLE + UINT8 PowerButton10SecOVR; + UINT16 LowPowerIdleSATA; + UINT8 EcNotification; + UINT8 EcCSDebugLight; + UINT8 SensorStandby; + UINT8 CSPL1Limit; + UINT16 CSPL1Value; +#endif // LOW_POWER_S0_IDLE_CAPABLE +#if CPPC_SUPPORT + UINT8 EnableCppc; + UINT8 EnableCppcPlatformSCI; +#endif // CPPC_SUPPORT +#if Dptf_SUPPORT + UINT8 EnableDptf; + UINT8 EnableSaDevice; + UINT8 ActiveThermalTripPointSa; + UINT8 PassiveThermalTripPointSa; + UINT8 CriticalThermalTripPointSa; + UINT8 HotThermalTripPointSa; + UINT8 EnablePchDevice; + UINT8 ActiveThermalTripPointPch; + UINT8 PassiveThermalTripPointPch; + UINT8 CriticalThermalTripPointPch; + UINT8 HotThermalTripPointPch; + UINT8 EnableMemDevice; + UINT8 ActiveThermalTripPointMem; + UINT8 PassiveThermalTripPointMem; + UINT8 CriticalThermalTripPointMem; + UINT8 HotThermalTripPointMem; + UINT8 EnableAmbientDevice; + UINT8 ActiveThermalTripPointAmbient; + UINT8 PassiveThermalTripPointAmbient; + UINT8 CriticalThermalTripPointAmbient; + UINT8 HotThermalTripPointAmbient; + UINT8 EnableSkinDevice; + UINT8 ActiveThermalTripPointSkin; + UINT8 PassiveThermalTripPointSkin; + UINT8 CriticalThermalTripPointSkin; + UINT8 HotThermalTripPointSkin; + UINT8 EnableExhaustDevice; + UINT8 ActiveThermalTripPointExhaust; + UINT8 PassiveThermalTripPointExhaust; + UINT8 CriticalThermalTripPointExhaust; + UINT8 HotThermalTripPointExhaust; + UINT8 EnableVRDevice; + UINT8 ActiveThermalTripPointVR; + UINT8 PassiveThermalTripPointVR; + UINT8 CriticalThermalTripPointVR; + UINT8 HotThermalTripPointVR; + UINT32 PpccStepSize; + UINT8 LPOEnable; + UINT8 LPOStartPState; + UINT8 LPOStepSize; + UINT8 LPOPowerControl; + UINT8 LPOPerformanceControl; + UINT8 EnableCTDP; + UINT8 EnableLPM; + UINT8 LPMSetting; + UINT8 Fan1Device; + UINT8 Fan2Device; + UINT8 DisplayParticipant; + UINT8 PowerParticipant; + UINT8 PowerPolicy; + UINT8 ActivePolicy; + UINT8 PassivePolicy; + UINT8 CriticalPolicy; + UINT8 CoolingModePolicy; + UINT8 TrtRevision; +#endif // Dptf_SUPPORT +#if IntelRMT_SUPPORT + UINT8 IRMTSupport; + UINT8 IRMTState; + UINT8 IRMTHWNotification; +#endif // IntelRMT_SUPPORT +#endif // SETUP_DATA_DEFINITION + +#ifdef FORM_SET_TYPEDEF + #include "PlatformSetup.h" +#endif + +#if defined(VFRCOMPILE) && !defined(CONTROLS_ARE_DEFINED) +#define CONTROL_DEFINITION +#endif +//--------------------------------------------------------------------------- + +//--------------------------------------------------------------------------- +#ifdef CONTROL_DEFINITION + +#if ACPIDEBUG_SUPPORT +#define ACPI_ONEOF_ACPIDEBUGSUPPORT\ + oneof varid = SETUP_DATA.AcpiDebugSupport,\ + prompt = STRING_TOKEN(STR_ACPIDEBUG_PROMPT),\ + help = STRING_TOKEN(STR_ACPIDEBUG_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED, key = 0;\ + endoneof; +#endif // ACPIDEBUG_SUPPORT + +#if RTD3_SUPPORT +#define ACPI_ONEOF_RTD3SUPPORT\ + oneof varid = SETUP_DATA.Rtd3Support,\ + prompt = STRING_TOKEN(STR_RTD3_PROMPT),\ + help = STRING_TOKEN(STR_RTD3_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define ACPI_ONEOF_VRSTAGGERINGDELAY\ + numeric varid = SETUP_DATA.VRStaggeringDelay,\ + prompt = STRING_TOKEN (STR_VRSTAGGERINGDELAY_PROMPT),\ + help = STRING_TOKEN (STR_VRSTAGGERINGDELAY_HELP),\ + flags = RESET_REQUIRED,\ + minimum = 0,\ + maximum = 100,\ + step = 1,\ + default = 10,\ + option text = STRING_TOKEN (STR_VRSTAGGERINGDELAY_PROMPT), value = 10, flags = MANUFACTURING; \ + endnumeric; + +#define ACPI_ONEOF_VRRAMPUPDELAY\ + numeric varid = SETUP_DATA.VRRampUpDelay,\ + prompt = STRING_TOKEN (STR_VRRAMPUPDELAY_PROMPT),\ + help = STRING_TOKEN (STR_VRRAMPUPDELAY_HELP),\ + flags = RESET_REQUIRED,\ + minimum = 0,\ + maximum = 100,\ + step = 1,\ + default = 16,\ + option text = STRING_TOKEN (STR_VRRAMPUPDELAY_PROMPT), value = 16, flags = MANUFACTURING; \ + endnumeric; + +#define ACPI_ONEOF_RTD3P0DL\ + numeric varid = SETUP_DATA.Rtd3P0dl,\ + prompt = STRING_TOKEN (STR_RTD3P0DL_PROMPT),\ + help = STRING_TOKEN (STR_RTD3P0DL_HELP),\ + flags = RESET_REQUIRED,\ + minimum = 0,\ + maximum = 100,\ + step = 1,\ + default = 100,\ + option text = STRING_TOKEN (STR_RTD3P0DL_PROMPT), value = 100, flags = MANUFACTURING; \ + endnumeric; + +#define ACPI_ONEOF_RTD3P3DL\ + numeric varid = SETUP_DATA.Rtd3P3dl,\ + prompt = STRING_TOKEN (STR_RTD3P3DL_PROMPT),\ + help = STRING_TOKEN (STR_RTD3P3DL_HELP),\ + flags = RESET_REQUIRED,\ + minimum = 0,\ + maximum = 10,\ + step = 1,\ + default = 10,\ + option text = STRING_TOKEN (STR_RTD3P3DL_PROMPT), value = 10, flags = MANUFACTURING; \ + endnumeric; + +#define ACPI_ONEOF_RTD3AUDIO\ + numeric varid = SETUP_DATA.Rtd3Audio,\ + prompt = STRING_TOKEN (STR_RTD3AUDIO_PROMPT),\ + help = STRING_TOKEN (STR_RTD3AUDIO_HELP),\ + flags = RESET_REQUIRED,\ + minimum = 0,\ + maximum = 1000,\ + step = 1,\ + default = 200,\ + option text = STRING_TOKEN (STR_RTD3AUDIO_PROMPT), value = 200, flags = MANUFACTURING; \ + endnumeric; + +#define ACPI_ONEOF_RTD3ADSP\ + numeric varid = SETUP_DATA.Rtd3ADSP,\ + prompt = STRING_TOKEN (STR_RTD3ADSP_PROMPT),\ + help = STRING_TOKEN (STR_RTD3ADSP_HELP),\ + flags = RESET_REQUIRED,\ + minimum = 0,\ + maximum = 1000,\ + step = 1,\ + default = 200,\ + option text = STRING_TOKEN (STR_RTD3ADSP_PROMPT), value = 200, flags = MANUFACTURING; \ + endnumeric; + +#define ACPI_ONEOF_RTD3I2C0\ + numeric varid = SETUP_DATA.Rtd3I2C0,\ + prompt = STRING_TOKEN (STR_RTD3I2C0_PROMPT),\ + help = STRING_TOKEN (STR_RTD3I2C0_HELP),\ + flags = RESET_REQUIRED,\ + minimum = 0,\ + maximum = 1000,\ + step = 1,\ + default = 0,\ + option text = STRING_TOKEN (STR_RTD3I2C0_PROMPT), value = 0, flags = MANUFACTURING; \ + endnumeric; + +#define ACPI_ONEOF_RTD3SENSORHUB\ + numeric varid = SETUP_DATA.Rtd3SensorHub,\ + prompt = STRING_TOKEN (STR_RTD3SENSORHUB_PROMPT),\ + help = STRING_TOKEN (STR_RTD3SENSORHUB_HELP),\ + flags = RESET_REQUIRED,\ + minimum = 0,\ + maximum = 1000,\ + step = 1,\ + default = 68,\ + option text = STRING_TOKEN (STR_RTD3SENSORHUB_PROMPT), value = 68, flags = MANUFACTURING; \ + endnumeric; + +#define ACPI_ONEOF_RTD3I2C1\ + numeric varid = SETUP_DATA.Rtd3I2C1,\ + prompt = STRING_TOKEN (STR_RTD3I2C1_PROMPT),\ + help = STRING_TOKEN (STR_RTD3I2C1_HELP),\ + flags = RESET_REQUIRED,\ + minimum = 0,\ + maximum = 1000,\ + step = 1,\ + default = 0,\ + option text = STRING_TOKEN (STR_RTD3I2C1_PROMPT), value = 0, flags = MANUFACTURING; \ + endnumeric; + +#define ACPI_ONEOF_RTD3I2C1PS0\ + numeric varid = SETUP_DATA.Rtd3I2C1PS0,\ + prompt = STRING_TOKEN (STR_RTD3I2C1PS0_PROMPT),\ + help = STRING_TOKEN (STR_RTD3I2C1PS0_HELP),\ + flags = RESET_REQUIRED,\ + minimum = 0,\ + maximum = 1000,\ + step = 1,\ + default = 68,\ + option text = STRING_TOKEN (STR_RTD3I2C1PS0_PROMPT), value = 68, flags = MANUFACTURING; \ + endnumeric; + +#define ACPI_ONEOF_RTD3TOUCHPANEL\ + numeric varid = SETUP_DATA.Rtd3TouchPanel,\ + prompt = STRING_TOKEN (STR_RTD3TOUCHPANEL_PROMPT),\ + help = STRING_TOKEN (STR_RTD3TOUCHPANEL_HELP),\ + flags = RESET_REQUIRED,\ + minimum = 0,\ + maximum = 1000,\ + step = 1,\ + default = 68,\ + option text = STRING_TOKEN (STR_RTD3TOUCHPANEL_PROMPT), value = 68, flags = MANUFACTURING; \ + endnumeric; + +#define ACPI_ONEOF_PEPGFX\ + oneof varid = SETUP_DATA.PepGfx,\ + prompt = STRING_TOKEN(STR_PEPGFX_PROMPT),\ + help = STRING_TOKEN(STR_PEPGFX_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + endoneof; + +#define ACPI_ONEOF_PEPSATA\ + oneof varid = SETUP_DATA.PepSata,\ + prompt = STRING_TOKEN(STR_PEPSATA_PROMPT),\ + help = STRING_TOKEN(STR_PEPSATA_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define ACPI_ONEOF_PCAPPING\ + oneof varid = SETUP_DATA.PCapping,\ + prompt = STRING_TOKEN(STR_PCAPPING_PROMPT),\ + help = STRING_TOKEN(STR_PCAPPING_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define ACPI_ONEOF_XHCIP0\ + oneof varid = SETUP_DATA.XhciP0,\ + prompt = STRING_TOKEN(STR_XHCIP0_PROMPT),\ + help = STRING_TOKEN(STR_XHCIP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN(STR_HIGHSPEED), value = 1, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_SUPERSPEED), value = 2, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define ACPI_ONEOF_XHCIP1\ + oneof varid = SETUP_DATA.XhciP1,\ + prompt = STRING_TOKEN(STR_XHCIP1_PROMPT),\ + help = STRING_TOKEN(STR_XHCIP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN(STR_HIGHSPEED), value = 1, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_SUPERSPEED), value = 2, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define ACPI_ONEOF_RIC0\ + oneof varid = SETUP_DATA.RIC0,\ + prompt = STRING_TOKEN(STR_RIC0_PROMPT),\ + help = STRING_TOKEN(STR_RIC0_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + endoneof; + +#define ACPI_ONEOF_RTD3ZPODD\ + oneof varid = SETUP_DATA.RTD3ZPODD,\ + prompt = STRING_TOKEN(STR_RTD3_ZPODD_PROMPT),\ + help = STRING_TOKEN(STR_RTD3_ZPODD_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define ACPI_ONEOF_RTD3USBCamera\ + oneof varid = SETUP_DATA.RTD3USBCamera,\ + prompt = STRING_TOKEN(STR_RTD3_USBCAMERA_PROMPT),\ + help = STRING_TOKEN(STR_RTD3_USBCAMERA_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define ACPI_ONEOF_RTD3MiniSataPort3\ + oneof varid = SETUP_DATA.RTD3MiniSataPort3,\ + prompt = STRING_TOKEN(STR_RTD3_MINISATAPORT3_PROMPT),\ + help = STRING_TOKEN(STR_RTD3_MINISATAPORT3_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN(STR_1_5_DK), value = 1, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_3_3_DK), value = 2, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define ACPI_ONEOF_RTD3WAGPIO\ + oneof varid = SETUP_DATA.RTD3WaGpio,\ + prompt = STRING_TOKEN(STR_RTD3_RTD3WAGPIO_PROMPT),\ + help = STRING_TOKEN(STR_RTD3_RTD3WAGPIO_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN(STR_SLOT_1), value = 1, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_SLOT_6), value = 6, flags = RESET_REQUIRED, key = 0;\ + endoneof; +#endif // RTD3_SUPPORT + +#define ACPI_ONEOF_PCIEXPNATIVE\ + oneof varid = SETUP_DATA.PciExpNative,\ + prompt = STRING_TOKEN(STR_ACPI_PCIE_NATIVE_PROMPT),\ + help = STRING_TOKEN(STR_ACPI_PCIE_NATIVE_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED, key = 0;\ + endoneof; + +#define ACPI_ONEOF_NATIVEASPMENABLE\ + oneof varid = SETUP_DATA.NativeAspmEnable,\ + prompt = STRING_TOKEN(STR_NATIVE_ASPM_PROMPT),\ + help = STRING_TOKEN(STR_NATIVE_ASPM_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED, key = 0;\ + endoneof; + +#if PTID_SUPPORT +#define ACPI_ONEOF_PTIDSUPPORT\ + checkbox varid = SETUP_DATA.PtidSupport,\ + prompt = STRING_TOKEN(STR_PTID_PROMPT),\ + help = STRING_TOKEN(STR_PTID_HELP),\ + flags = 0 | RESET_REQUIRED | MANUFACTURING,\ + key = 0,\ + endcheckbox; + +#define ACPI_ONEOF_PECIACCESSMETHOD\ + oneof varid = SETUP_DATA.PeciAccessMethod,\ + prompt = STRING_TOKEN(STR_PECI_ACCESS_PROMPT),\ + help = STRING_TOKEN(STR_PECI_ACCESS_HELP),\ + option text = STRING_TOKEN(STR_PECI_ACCESS_IO), value = 0, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN(STR_PECI_ACCESS_ACPI), value = 1, flags = RESET_REQUIRED, key = 0;\ + endoneof; +#endif // PTID_SUPPORT + +#if IntelRMT_SUPPORT +#define ACPI_ONEOF_IRMTSUPPORT\ + oneof varid = SETUP_DATA.IRMTSupport,\ + prompt = STRING_TOKEN(STR_IRMT_PROMPT),\ + help = STRING_TOKEN(STR_IRMT_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define ACPI_ONEOF_IRMTSTATE\ + oneof varid = SETUP_DATA.IRMTState,\ + prompt = STRING_TOKEN(STR_IRMT_STATE_PROMPT),\ + help = STRING_TOKEN(STR_IRMT_STATE_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define ACPI_ONEOF_IRMTHW\ + oneof varid = SETUP_DATA.IRMTHWNotification,\ + prompt = STRING_TOKEN(STR_IRMT_HW_PROMPT),\ + help = STRING_TOKEN(STR_IRMT_HW_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#endif // IntelRMT_SUPPORT + +#if LOW_POWER_S0_IDLE_CAPABLE +#define ACPI_ONEOF_POWERBUTTON10SECOVR\ + oneof varid = SETUP_DATA.PowerButton10SecOVR,\ + prompt = STRING_TOKEN(STR_POWERBUTTON10SECOVR_PROMPT),\ + help = STRING_TOKEN(STR_POWERBUTTON10SECOVR_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define ACPI_ONEOF_LOWPOWERIDLESATA\ + oneof varid = SETUP_DATA.LowPowerIdleSATA,\ + prompt = STRING_TOKEN(STR_LOWPOWERIDLESATA_PROMPT),\ + help = STRING_TOKEN(STR_LOWPOWERIDLESATA_HELP),\ + option text = STRING_TOKEN(STR_NOCONSTRAINT), value = 0, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN(STR_SATAPORTS), value = 1, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_SATACONTROLLER), value = 2, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define ACPI_ONEOF_ECNOTIFICATION\ + oneof varid = SETUP_DATA.EcNotification,\ + prompt = STRING_TOKEN(STR_ECNOTIFICATION_PROMPT),\ + help = STRING_TOKEN(STR_ECNOTIFICATION_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED , key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + endoneof; + +#define ACPI_ONEOF_ECCSDEBUGLIGHT\ + oneof varid = SETUP_DATA.EcCSDebugLight,\ + prompt = STRING_TOKEN(STR_ECCSDEBUGLIGHT_PROMPT),\ + help = STRING_TOKEN(STR_ECCSDEBUGLIGHT_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define ACPI_ONEOF_SENSORSTANDBY\ + oneof varid = SETUP_DATA.SensorStandby,\ + prompt = STRING_TOKEN(STR_SENSORSTANDBY_PROMPT),\ + help = STRING_TOKEN(STR_SENSORSTANDBY_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define ACPI_ONEOF_CSPL1LIMIT\ + oneof varid = SETUP_DATA.CSPL1Limit,\ + prompt = STRING_TOKEN(STR_CSPL1LIMIT_PROMPT),\ + help = STRING_TOKEN(STR_CSPL1LIMIT_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define ACPI_ONEOF_CSPL1VALUE\ + numeric varid = SETUP_DATA.CSPL1Value,\ + prompt = STRING_TOKEN (STR_CSPL1VALUE_PROMPT),\ + help = STRING_TOKEN (STR_CSPL1VALUE_HELP),\ + flags = RESET_REQUIRED,\ + minimum = 3000,\ + maximum = 20000,\ + step = 1,\ + default = 4500,\ + option text = STRING_TOKEN (STR_CSPL1VALUE_PROMPT), value = 4500, flags = MANUFACTURING; \ + endnumeric; +#endif // LOW_POWER_S0_IDLE_CAPABLE + + +//=======================================================================// +// CPPC // +//=======================================================================// +#if CPPC_SUPPORT +#define CPPC_ONEOF_ENABLECPPC\ + oneof varid = SETUP_DATA.EnableCppc,\ + prompt = STRING_TOKEN(STR_ENABLE_CPPC_PROMPT),\ + help = STRING_TOKEN(STR_ENABLE_CPPC_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define CPPC_ONEOF_CPPCSCI\ + oneof varid = SETUP_DATA.EnableCppcPlatformSCI,\ + prompt = STRING_TOKEN(STR_ENABLE_CPPC_SCI_PROMPT),\ + help = STRING_TOKEN(STR_ENABLE_CPPC_SCI_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED, key = 0;\ + endoneof; +#endif // CPPC_SUPPORT + +//=======================================================================// +// DPTF // +//=======================================================================// +#if Dptf_SUPPORT +#define DPTF_ONEOF_ENABLEDPTF\ + oneof varid = SETUP_DATA.EnableDptf,\ + prompt = STRING_TOKEN(STR_ENABLE_DPTF_PROMPT),\ + help = STRING_TOKEN(STR_ENABLE_DPTF_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +// Processor Thermal Device +#define DPTF_ONEOF_ENABLESA\ + oneof varid = SETUP_DATA.EnableSaDevice,\ + prompt = STRING_TOKEN(STR_DPTF_SA_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_SA_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_DPTF_ENABLE_SA_TD), value = 1, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_DPTF_ENABLE_CPU_TD), value = 2, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_ATTPOINT_SA\ + oneof varid = SETUP_DATA.ActiveThermalTripPointSa,\ + prompt = STRING_TOKEN(STR_DPTF_ATTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_ATTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_PTTPOINT_SA\ + oneof varid = SETUP_DATA.PassiveThermalTripPointSa,\ + prompt = STRING_TOKEN(STR_DPTF_PTTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_PTTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_CTTPOINT_SA\ + oneof varid = SETUP_DATA.CriticalThermalTripPointSa,\ + prompt = STRING_TOKEN(STR_DPTF_CTTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_CTTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_HTTPOINT_SA\ + oneof varid = SETUP_DATA.HotThermalTripPointSa,\ + prompt = STRING_TOKEN(STR_DPTF_HTTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_HTTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +// Pch Thermal Device +#define DPTF_ONEOF_ENABLEPCH\ + oneof varid = SETUP_DATA.EnablePchDevice,\ + prompt = STRING_TOKEN(STR_DPTF_PCH_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_PCH_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + endoneof; + +#define DPTF_ONEOF_ATTPOINT_PCH\ + oneof varid = SETUP_DATA.ActiveThermalTripPointPch,\ + prompt = STRING_TOKEN(STR_DPTF_ATTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_ATTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_PTTPOINT_PCH\ + oneof varid = SETUP_DATA.PassiveThermalTripPointPch,\ + prompt = STRING_TOKEN(STR_DPTF_PTTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_PTTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_CTTPOINT_PCH\ + oneof varid = SETUP_DATA.CriticalThermalTripPointPch,\ + prompt = STRING_TOKEN(STR_DPTF_CTTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_CTTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_HTTPOINT_PCH\ + oneof varid = SETUP_DATA.HotThermalTripPointPch,\ + prompt = STRING_TOKEN(STR_DPTF_HTTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_HTTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +// Memory Thermal Device +#define DPTF_ONEOF_ENABLEMEM\ + oneof varid = SETUP_DATA.EnableMemDevice,\ + prompt = STRING_TOKEN(STR_DPTF_MEM_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_MEM_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + endoneof; + +#define DPTF_ONEOF_ATTPOINT_MEM\ + oneof varid = SETUP_DATA.ActiveThermalTripPointMem,\ + prompt = STRING_TOKEN(STR_DPTF_ATTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_ATTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_PTTPOINT_MEM\ + oneof varid = SETUP_DATA.PassiveThermalTripPointMem,\ + prompt = STRING_TOKEN(STR_DPTF_PTTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_PTTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_CTTPOINT_MEM\ + oneof varid = SETUP_DATA.CriticalThermalTripPointMem,\ + prompt = STRING_TOKEN(STR_DPTF_CTTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_CTTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_HTTPOINT_MEM\ + oneof varid = SETUP_DATA.HotThermalTripPointMem,\ + prompt = STRING_TOKEN(STR_DPTF_HTTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_HTTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +// Ambient Thermal Device +#define DPTF_ONEOF_ENABLEAMBIENT\ + oneof varid = SETUP_DATA.EnableAmbientDevice,\ + prompt = STRING_TOKEN(STR_DPTF_AMBIENT_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_AMBIENT_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + endoneof; + +#define DPTF_ONEOF_ATTPOINT_AMBIENT\ + oneof varid = SETUP_DATA.ActiveThermalTripPointAmbient,\ + prompt = STRING_TOKEN(STR_DPTF_ATTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_ATTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_PTTPOINT_AMBIENT\ + oneof varid = SETUP_DATA.PassiveThermalTripPointAmbient,\ + prompt = STRING_TOKEN(STR_DPTF_PTTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_PTTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_CTTPOINT_AMBIENT\ + oneof varid = SETUP_DATA.CriticalThermalTripPointAmbient,\ + prompt = STRING_TOKEN(STR_DPTF_CTTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_CTTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_HTTPOINT_AMBIENT\ + oneof varid = SETUP_DATA.HotThermalTripPointAmbient,\ + prompt = STRING_TOKEN(STR_DPTF_HTTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_HTTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +// Skin Thermal Device +#define DPTF_ONEOF_ENABLESKIN\ + oneof varid = SETUP_DATA.EnableSkinDevice,\ + prompt = STRING_TOKEN(STR_DPTF_SKIN_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_SKIN_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + endoneof; + +#define DPTF_ONEOF_ATTPOINT_SKIN\ + oneof varid = SETUP_DATA.ActiveThermalTripPointSkin,\ + prompt = STRING_TOKEN(STR_DPTF_ATTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_ATTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_PTTPOINT_SKIN\ + oneof varid = SETUP_DATA.PassiveThermalTripPointSkin,\ + prompt = STRING_TOKEN(STR_DPTF_PTTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_PTTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_CTTPOINT_SKIN\ + oneof varid = SETUP_DATA.CriticalThermalTripPointSkin,\ + prompt = STRING_TOKEN(STR_DPTF_CTTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_CTTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_HTTPOINT_SKIN\ + oneof varid = SETUP_DATA.HotThermalTripPointSkin,\ + prompt = STRING_TOKEN(STR_DPTF_HTTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_HTTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +// Exhaust Thermal Device +#define DPTF_ONEOF_ENABLEEXHAUST\ + oneof varid = SETUP_DATA.EnableExhaustDevice,\ + prompt = STRING_TOKEN(STR_DPTF_EXHAUST_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_EXHAUST_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + endoneof; + +#define DPTF_ONEOF_ATTPOINT_EXHAUST\ + oneof varid = SETUP_DATA.ActiveThermalTripPointExhaust,\ + prompt = STRING_TOKEN(STR_DPTF_ATTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_ATTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_PTTPOINT_EXHAUST\ + oneof varid = SETUP_DATA.PassiveThermalTripPointExhaust,\ + prompt = STRING_TOKEN(STR_DPTF_PTTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_PTTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_CTTPOINT_EXHAUST\ + oneof varid = SETUP_DATA.CriticalThermalTripPointExhaust,\ + prompt = STRING_TOKEN(STR_DPTF_CTTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_CTTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_HTTPOINT_EXHAUST\ + oneof varid = SETUP_DATA.HotThermalTripPointExhaust,\ + prompt = STRING_TOKEN(STR_DPTF_HTTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_HTTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +// VR Thermal Device +#define DPTF_ONEOF_ENABLEVR\ + oneof varid = SETUP_DATA.EnableVRDevice,\ + prompt = STRING_TOKEN(STR_DPTF_VR_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_VR_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + endoneof; + +#define DPTF_ONEOF_ATTPOINT_VR\ + oneof varid = SETUP_DATA.ActiveThermalTripPointVR,\ + prompt = STRING_TOKEN(STR_DPTF_ATTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_ATTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_PTTPOINT_VR\ + oneof varid = SETUP_DATA.PassiveThermalTripPointVR,\ + prompt = STRING_TOKEN(STR_DPTF_PTTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_PTTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_CTTPOINT_VR\ + oneof varid = SETUP_DATA.CriticalThermalTripPointVR,\ + prompt = STRING_TOKEN(STR_DPTF_CTTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_CTTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_HTTPOINT_VR\ + oneof varid = SETUP_DATA.HotThermalTripPointVR,\ + prompt = STRING_TOKEN(STR_DPTF_HTTP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_HTTP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 127, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_15_C), value = 15, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_23_C), value = 23, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_31_C), value = 31, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_39_C), value = 39, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_47_C), value = 47, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_55_C), value = 55, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_63_C), value = 63, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_71_C), value = 71, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_79_C), value = 79, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_87_C), value = 87, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_95_C), value = 95, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN (STR_103_C), value = 103, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_111_C), value = 111, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN (STR_119_C), value = 119, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_PPCC_STEPSIZE\ + oneof varid = SETUP_DATA.PpccStepSize,\ + prompt = STRING_TOKEN(STR_DPTF_PPCC_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_PPCC_HELP),\ + option text = STRING_TOKEN(STR_05_W), value = 500, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_10_W), value = 1000, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN(STR_15_W), value = 1500, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_20_W), value = 2000, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_LPO_ENABLE\ + oneof varid = SETUP_DATA.LPOEnable,\ + prompt = STRING_TOKEN(STR_DPTF_LPO_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_LPO_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + endoneof; + +#define DPTF_ONEOF_LPOPSTATE\ + numeric varid = SETUP_DATA.LPOStartPState,\ + prompt = STRING_TOKEN (STR_DPTF_LPOPSTATE_SEL),\ + help = STRING_TOKEN (STR_DPTF_LPOPSTATE_SEL_HELP),\ + flags = RESET_REQUIRED,\ + minimum = 0,\ + maximum = 16,\ + step = 1,\ + default = 16,\ + option text = STRING_TOKEN (STR_DPTF_LPOPSTATE_SEL), value = 16, flags = MANUFACTURING;\ + endnumeric; + +#define DPTF_ONEOF_LPOSIZE\ + numeric varid = SETUP_DATA.LPOStepSize,\ + prompt = STRING_TOKEN (STR_DPTF_LPOSIZE_SEL),\ + help = STRING_TOKEN (STR_DPTF_LPOSIZE_SEL_HELP),\ + flags = RESET_REQUIRED,\ + minimum = 0,\ + maximum = 100,\ + step = 1,\ + default = 50,\ + option text = STRING_TOKEN (STR_DPTF_LPOSIZE_SEL), value = 1, flags = MANUFACTURING;\ + endnumeric; + +#define DPTF_ONEOF_LPO_POW\ + oneof varid = SETUP_DATA.LPOPowerControl,\ + prompt = STRING_TOKEN(STR_DPTF_LPOPOW_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_LPOPOW_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_SMT_OFFLINING), value = 1, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN(STR_CORE_OFFLINING), value = 2, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_LPO_PER\ + oneof varid = SETUP_DATA.LPOPerformanceControl,\ + prompt = STRING_TOKEN(STR_DPTF_LPOPER_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_LPOPER_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_SMT_OFFLINING), value = 1, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_CORE_OFFLINING), value = 2, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + endoneof; + +#define DPTF_ONEOF_CTDP_ENABLE\ + oneof varid = SETUP_DATA.EnableCTDP,\ + prompt = STRING_TOKEN(STR_DPTF_CTDP_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_CTDP_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_LPM_ENABLE\ + oneof varid = SETUP_DATA.EnableLPM,\ + prompt = STRING_TOKEN(STR_DPTF_LPM_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_LPM_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + endoneof; + +#define DPTF_ONEOF_LPM_SETTING\ + oneof varid = SETUP_DATA.LPMSetting,\ + prompt = STRING_TOKEN(STR_DPTF_LPM_SETTING_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_LPM_SETTING_HELP),\ + option text = STRING_TOKEN(STR_LPM_DISABLED), value = 0, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN(STR_LPM_ENABLED), value = 1, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_LPM_APPLI_SPEC), value = 2, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_LPM_USE_OS), value = 3, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_FAN1\ + oneof varid = SETUP_DATA.Fan1Device,\ + prompt = STRING_TOKEN(STR_DPTF_FAN1_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_FAN1_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + endoneof; + +#define DPTF_ONEOF_FAN2\ + oneof varid = SETUP_DATA.Fan2Device,\ + prompt = STRING_TOKEN(STR_DPTF_FAN2_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_FAN2_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + endoneof; + +#define DPTF_ONEOF_DISPLAY_PARTICIPANT\ + oneof varid = SETUP_DATA.DisplayParticipant,\ + prompt = STRING_TOKEN(STR_DPTF_DISPLAY_PARTICIPANT_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_DISPLAY_PARTICIPANT_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_POWER_PARTICIPANT\ + oneof varid = SETUP_DATA.PowerParticipant,\ + prompt = STRING_TOKEN(STR_DPTF_POWER_PARTICIPANT_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_POWER_PARTICIPANT_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_POWER_POLICY\ + oneof varid = SETUP_DATA.PowerPolicy,\ + prompt = STRING_TOKEN(STR_DPTF_POWER_POLICY_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_POWER_POLICY_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED, key = 0;\ + endoneof; + +#define DPTF_ONEOF_ACTIVE_POLICY\ + oneof varid = SETUP_DATA.ActivePolicy,\ + prompt = STRING_TOKEN(STR_DPTF_ACTIVE_POLICY_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_ACTIVE_POLICY_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + endoneof; + +#define DPTF_ONEOF_PASSIVE_POLICY\ + oneof varid = SETUP_DATA.PassivePolicy,\ + prompt = STRING_TOKEN(STR_DPTF_PASSIVE_POLICY_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_PASSIVE_POLICY_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + endoneof; + +#define DPTF_ONEOF_CRITICAL_POLICY\ + oneof varid = SETUP_DATA.CriticalPolicy,\ + prompt = STRING_TOKEN(STR_DPTF_CRITICAL_POLICY_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_CRITICAL_POLICY_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + endoneof; + +#define DPTF_ONEOF_COOLING_POLICY\ + oneof varid = SETUP_DATA.CoolingModePolicy,\ + prompt = STRING_TOKEN(STR_DPTF_COOLING_POLICY_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_COOLING_POLICY_HELP),\ + option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + endoneof; + +#define DPTF_ONEOF_TRT_REVISION\ + oneof varid = SETUP_DATA.TrtRevision,\ + prompt = STRING_TOKEN(STR_DPTF_TRT_PROMPT),\ + help = STRING_TOKEN(STR_DPTF_TRT_HELP),\ + option text = STRING_TOKEN(STR_TRT_TRADITIONAL), value = 0, flags = RESET_REQUIRED, key = 0;\ + option text = STRING_TOKEN(STR_TRT_PRIORITY), value = 1, flags = RESET_REQUIRED | DEFAULT | MANUFACTURING, key = 0;\ + endoneof; + +#endif // Dptf_SUPPORT + +#endif // CONTROL_DEFINITION +//--------------------------------------------------------------------------- + +//--------------------------------------------------------------------------- +#ifdef CONTROLS_WITH_DEFAULTS +#if ACPIDEBUG_SUPPORT + ACPI_ONEOF_ACPIDEBUGSUPPORT +#endif // ACPIDEBUG_SUPPORT +#if RTD3_SUPPORT + ACPI_ONEOF_RTD3SUPPORT + ACPI_ONEOF_VRSTAGGERINGDELAY + ACPI_ONEOF_VRRAMPUPDELAY + ACPI_ONEOF_RTD3P0DL + ACPI_ONEOF_RTD3P3DL + ACPI_ONEOF_RTD3AUDIO + ACPI_ONEOF_RTD3ADSP + ACPI_ONEOF_RTD3I2C0 + ACPI_ONEOF_RTD3SENSORHUB + ACPI_ONEOF_RTD3I2C1 + ACPI_ONEOF_RTD3I2C1PS0 + ACPI_ONEOF_RTD3TOUCHPANEL + ACPI_ONEOF_PEPGFX + ACPI_ONEOF_PEPSATA + ACPI_ONEOF_PCAPPING + ACPI_ONEOF_XHCIP0 + ACPI_ONEOF_XHCIP1 + ACPI_ONEOF_RIC0 + ACPI_ONEOF_RTD3ZPODD + ACPI_ONEOF_RTD3USBCamera + ACPI_ONEOF_RTD3MiniSataPort3 + ACPI_ONEOF_RTD3WAGPIO +#endif // RTD3_SUPPORT + ACPI_ONEOF_PCIEXPNATIVE + ACPI_ONEOF_NATIVEASPMENABLE +#if PTID_SUPPORT + ACPI_ONEOF_PTIDSUPPORT + ACPI_ONEOF_PECIACCESSMETHOD +#endif // PTID_SUPPORT +#if IntelRMT_SUPPORT + ACPI_ONEOF_IRMTSUPPORT + ACPI_ONEOF_IRMTSTATE + ACPI_ONEOF_IRMTHW +#endif // IntelRMT_SUPPORT +#if LOW_POWER_S0_IDLE_CAPABLE + ACPI_ONEOF_POWERBUTTON10SECOVR + ACPI_ONEOF_LOWPOWERIDLESATA + ACPI_ONEOF_ECNOTIFICATION + ACPI_ONEOF_ECCSDEBUGLIGHT + ACPI_ONEOF_SENSORSTANDBY + ACPI_ONEOF_CSPL1LIMIT + ACPI_ONEOF_CSPL1VALUE +#endif // LOW_POWER_S0_IDLE_CAPABLE +#if CPPC_SUPPORT + CPPC_ONEOF_ENABLECPPC + CPPC_ONEOF_CPPCSCI +#endif // CPPC_SUPPORT +#if Dptf_SUPPORT + DPTF_ONEOF_ENABLEDPTF + DPTF_ONEOF_ENABLESA + DPTF_ONEOF_ATTPOINT_SA + DPTF_ONEOF_PTTPOINT_SA + DPTF_ONEOF_CTTPOINT_SA + DPTF_ONEOF_HTTPOINT_SA + DPTF_ONEOF_ENABLEPCH + DPTF_ONEOF_ATTPOINT_PCH + DPTF_ONEOF_PTTPOINT_PCH + DPTF_ONEOF_CTTPOINT_PCH + DPTF_ONEOF_HTTPOINT_PCH + DPTF_ONEOF_ENABLEMEM + DPTF_ONEOF_ATTPOINT_MEM + DPTF_ONEOF_PTTPOINT_MEM + DPTF_ONEOF_CTTPOINT_MEM + DPTF_ONEOF_HTTPOINT_MEM + DPTF_ONEOF_ENABLEAMBIENT + DPTF_ONEOF_ATTPOINT_AMBIENT + DPTF_ONEOF_PTTPOINT_AMBIENT + DPTF_ONEOF_CTTPOINT_AMBIENT + DPTF_ONEOF_HTTPOINT_AMBIENT + DPTF_ONEOF_ENABLESKIN + DPTF_ONEOF_ATTPOINT_SKIN + DPTF_ONEOF_PTTPOINT_SKIN + DPTF_ONEOF_CTTPOINT_SKIN + DPTF_ONEOF_HTTPOINT_SKIN + DPTF_ONEOF_ENABLEEXHAUST + DPTF_ONEOF_ATTPOINT_EXHAUST + DPTF_ONEOF_PTTPOINT_EXHAUST + DPTF_ONEOF_CTTPOINT_EXHAUST + DPTF_ONEOF_HTTPOINT_EXHAUST + DPTF_ONEOF_ENABLEVR + DPTF_ONEOF_ATTPOINT_VR + DPTF_ONEOF_PTTPOINT_VR + DPTF_ONEOF_CTTPOINT_VR + DPTF_ONEOF_HTTPOINT_VR + DPTF_ONEOF_PPCC_STEPSIZE + DPTF_ONEOF_LPO_ENABLE + DPTF_ONEOF_LPOPSTATE + DPTF_ONEOF_LPOSIZE + DPTF_ONEOF_LPO_POW + DPTF_ONEOF_LPO_PER + DPTF_ONEOF_CTDP_ENABLE + DPTF_ONEOF_LPM_ENABLE + DPTF_ONEOF_LPM_SETTING + DPTF_ONEOF_FAN1 + DPTF_ONEOF_FAN2 + DPTF_ONEOF_DISPLAY_PARTICIPANT + DPTF_ONEOF_POWER_PARTICIPANT + DPTF_ONEOF_POWER_POLICY + DPTF_ONEOF_ACTIVE_POLICY + DPTF_ONEOF_PASSIVE_POLICY + DPTF_ONEOF_CRITICAL_POLICY + DPTF_ONEOF_COOLING_POLICY + DPTF_ONEOF_TRT_REVISION +#endif // Dptf_SUPPORT + +#endif // CONTROLS_WITH_DEFAULTS +//--------------------------------------------------------------------------- +// ADVANCED - AcpiPlatform Configuration Form +//--------------------------------------------------------------------------- +#ifdef ADVANCED_FORM_SET + + #ifndef SUPPRESS_GRAYOUT_ENDIF //old Core + #define SUPPRESS_GRAYOUT_ENDIF endif; + #endif + + #ifdef FORM_SET_ITEM + // Define controls to be added to the main page of the formset + #endif + + #ifdef FORM_SET_GOTO + // Define goto commands for the forms defined in this file + goto ACPIPLATFORM_FORM_ID, + prompt = STRING_TOKEN(STR_ACPIPLATFORM_FORM), + help = STRING_TOKEN(STR_ACPIPLATFORM_FORM_HELP); + #endif + + #ifdef FORM_SET_FORM + // Define forms + form formid = AUTO_ID(ACPIPLATFORM_FORM_ID), + title = STRING_TOKEN(STR_ACPIPLATFORM_FORM); + + SUBTITLE(STRING_TOKEN(STR_ACPIPLATFORM_FORM)) + SEPARATOR + +#if SB_SETUP_SUPPORT + suppressif ideqval SETUP_DATA.PcieRootPortEn[0] == 0; +#endif + ACPI_ONEOF_PCIEXPNATIVE +#if SB_SETUP_SUPPORT + endif; +#endif + + suppressif ideqval SETUP_DATA.PciExpNative == 0; + ACPI_ONEOF_NATIVEASPMENABLE + endif; + + SEPARATOR + +#if ACPIDEBUG_SUPPORT + ACPI_ONEOF_ACPIDEBUGSUPPORT +#endif + +#if RTD3_SUPPORT + suppressif ideqval SETUP_PLATFORM_DATA.PlatformSupportRtD3 == 0; + ACPI_ONEOF_RTD3SUPPORT + suppressif ideqval SETUP_DATA.Rtd3Support == 0; + ACPI_ONEOF_VRSTAGGERINGDELAY + ACPI_ONEOF_VRRAMPUPDELAY + ACPI_ONEOF_RTD3P0DL + ACPI_ONEOF_RTD3P3DL +// ACPI_ONEOF_RTD3AUDIO + ACPI_ONEOF_RTD3ADSP + ACPI_ONEOF_RTD3I2C0 + ACPI_ONEOF_RTD3SENSORHUB + ACPI_ONEOF_RTD3I2C1 + ACPI_ONEOF_RTD3I2C1PS0 + ACPI_ONEOF_RTD3TOUCHPANEL + ACPI_ONEOF_PEPGFX + ACPI_ONEOF_PEPSATA + ACPI_ONEOF_PCAPPING + ACPI_ONEOF_XHCIP0 + ACPI_ONEOF_XHCIP1 + ACPI_ONEOF_RIC0 + ACPI_ONEOF_RTD3ZPODD + ACPI_ONEOF_RTD3USBCamera + ACPI_ONEOF_RTD3MiniSataPort3 + ACPI_ONEOF_RTD3WAGPIO + endif; + endif; +#endif + +#if PTID_SUPPORT + ACPI_ONEOF_PTIDSUPPORT + ACPI_ONEOF_PECIACCESSMETHOD +#endif + +#if IntelRMT_SUPPORT + ACPI_ONEOF_IRMTSUPPORT + suppressif ideqval SETUP_DATA.IRMTSupport == 0; + ACPI_ONEOF_IRMTSTATE + ACPI_ONEOF_IRMTHW + endif; +#endif + +#if LOW_POWER_S0_IDLE_CAPABLE + suppressif ideqval SETUP_PLATFORM_DATA.PlatformSupportRtD3 == 0; + suppressif ideqval SETUP_DATA.AcpiLowPowerS0Idle == 0; + ACPI_ONEOF_POWERBUTTON10SECOVR + ACPI_ONEOF_LOWPOWERIDLESATA + ACPI_ONEOF_ECNOTIFICATION + ACPI_ONEOF_ECCSDEBUGLIGHT + ACPI_ONEOF_SENSORSTANDBY + ACPI_ONEOF_CSPL1LIMIT + suppressif ideqval SETUP_DATA.CSPL1Limit == 0; + ACPI_ONEOF_CSPL1VALUE + endif; + endif; + endif; +#endif + +#if CPPC_SUPPORT + suppressif ideqval SETUP_PLATFORM_DATA.PlatformSupportCppc == 0; + CPPC_ONEOF_ENABLECPPC + suppressif ideqval SETUP_DATA.EnableCppc == 0; + CPPC_ONEOF_CPPCSCI + endif; + endif; +#endif + + SEPARATOR + +#if Dptf_SUPPORT + goto DPTF_FORM_ID, + prompt = STRING_TOKEN (STR_DPTF_CONFIG_FORM_TITLE), + help = STRING_TOKEN (STR_DPTF_CONFIG_FORM_HELP); +#endif + + endform; // Platform_FORM_ID + + #endif // FORM_SET_FORM + +#if Dptf_SUPPORT +//---------------------------------------------------------------------------- +// PLATFORM - DPTF Form +//---------------------------------------------------------------------------- + #ifdef FORM_SET_FORM + + #ifndef DPTF_FORM_SETUP + #define DPTF_FORM_SETUP + + form formid = AUTO_ID(DPTF_FORM_ID), + title = STRING_TOKEN (STR_DPTF_CONFIG_FORM_TITLE); + + SUBTITLE(STRING_TOKEN(STR_DPTF_CONFIG_FORM_TITLE)) + SEPARATOR + + DPTF_ONEOF_ENABLEDPTF + + suppressif ideqval SETUP_DATA.EnableDptf == 0; + DPTF_ONEOF_ENABLESA + suppressif ideqval SETUP_DATA.EnableSaDevice == 0; + DPTF_ONEOF_ATTPOINT_SA + DPTF_ONEOF_PTTPOINT_SA + DPTF_ONEOF_CTTPOINT_SA + DPTF_ONEOF_HTTPOINT_SA + DPTF_ONEOF_PPCC_STEPSIZE + DPTF_ONEOF_LPO_ENABLE + DPTF_ONEOF_LPOPSTATE + DPTF_ONEOF_LPOSIZE + DPTF_ONEOF_LPO_POW + DPTF_ONEOF_LPO_PER + + suppressif ideqval SETUP_CPU_FEATURES.cTDPAvailable == 0; + DPTF_ONEOF_CTDP_ENABLE + endif; + + suppressif ideqval SETUP_DATA.AcpiLowPowerS0Idle == 0; + DPTF_ONEOF_LPM_ENABLE + suppressif ideqval SETUP_DATA.EnableLPM == 0; + DPTF_ONEOF_LPM_SETTING + endif; + endif; + + endif; + DPTF_ONEOF_ENABLEPCH + suppressif ideqval SETUP_DATA.EnablePchDevice == 0; + DPTF_ONEOF_ATTPOINT_PCH + DPTF_ONEOF_PTTPOINT_PCH + DPTF_ONEOF_CTTPOINT_PCH + DPTF_ONEOF_HTTPOINT_PCH + endif; + DPTF_ONEOF_ENABLEMEM + suppressif ideqval SETUP_DATA.EnableMemDevice == 0; + DPTF_ONEOF_ATTPOINT_MEM + DPTF_ONEOF_PTTPOINT_MEM + DPTF_ONEOF_CTTPOINT_MEM + DPTF_ONEOF_HTTPOINT_MEM + endif; + DPTF_ONEOF_FAN1 + DPTF_ONEOF_FAN2 + DPTF_ONEOF_ENABLEAMBIENT + suppressif ideqval SETUP_DATA.EnableAmbientDevice == 0; + DPTF_ONEOF_ATTPOINT_AMBIENT + DPTF_ONEOF_PTTPOINT_AMBIENT + DPTF_ONEOF_CTTPOINT_AMBIENT + DPTF_ONEOF_HTTPOINT_AMBIENT + endif; + DPTF_ONEOF_ENABLESKIN + suppressif ideqval SETUP_DATA.EnableSkinDevice == 0; + DPTF_ONEOF_ATTPOINT_SKIN + DPTF_ONEOF_PTTPOINT_SKIN + DPTF_ONEOF_CTTPOINT_SKIN + DPTF_ONEOF_HTTPOINT_SKIN + endif; + DPTF_ONEOF_ENABLEEXHAUST + suppressif ideqval SETUP_DATA.EnableExhaustDevice == 0; + DPTF_ONEOF_ATTPOINT_EXHAUST + DPTF_ONEOF_PTTPOINT_EXHAUST + DPTF_ONEOF_CTTPOINT_EXHAUST + DPTF_ONEOF_HTTPOINT_EXHAUST + endif; + DPTF_ONEOF_ENABLEVR + suppressif ideqval SETUP_DATA.EnableVRDevice == 0; + DPTF_ONEOF_ATTPOINT_VR + DPTF_ONEOF_PTTPOINT_VR + DPTF_ONEOF_CTTPOINT_VR + DPTF_ONEOF_HTTPOINT_VR + endif; + DPTF_ONEOF_DISPLAY_PARTICIPANT + DPTF_ONEOF_POWER_PARTICIPANT + suppressif ideqval SETUP_DATA.PowerParticipant == 0; + DPTF_ONEOF_POWER_POLICY + endif; + + SEPARATOR + + goto DPTF_POLICY_FORM_ID, + prompt = STRING_TOKEN (STR_DPTF_POLICY_FORM_TITLE), + help = STRING_TOKEN (STR_DPTF_POLICY_FORM_HELP); + + endif; // suppressif ideqval SETUP_DATA.EnableDptf == 0; + + endform; // DPTF + #endif // DPTF_FORM_SETUP + #endif // FORM_SET_FORM +//---------------------------------------------------------------------------- +// PLATFORM - DPTF Policy Form +//---------------------------------------------------------------------------- + #ifdef FORM_SET_FORM + + #ifndef DPTF_POLICY_FORM_SETUP + #define DPTF_POLICY_FORM_SETUP + + form formid = AUTO_ID(DPTF_POLICY_FORM_ID), + title = STRING_TOKEN (STR_DPTF_POLICY_FORM_TITLE); + + SUBTITLE(STRING_TOKEN(STR_DPTF_POLICY_FORM_TITLE)) + SEPARATOR + + DPTF_ONEOF_ACTIVE_POLICY + DPTF_ONEOF_PASSIVE_POLICY + suppressif ideqval SETUP_DATA.PassivePolicy == 0; + DPTF_ONEOF_TRT_REVISION + endif; + DPTF_ONEOF_CRITICAL_POLICY + DPTF_ONEOF_COOLING_POLICY + + endform; // DPTF_POLICY + #endif // DPTF_POLICY_FORM_SETUP + #endif // FORM_SET_FORM +#endif // Dptf_SUPPORT + +#endif // ADVANCED_FORM_SET + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Board/EM/Platform/AcpiPlatform.sdl b/Board/EM/Platform/AcpiPlatform.sdl new file mode 100644 index 0000000..ec473b6 --- /dev/null +++ b/Board/EM/Platform/AcpiPlatform.sdl @@ -0,0 +1,483 @@ +TOKEN + Name = "ACPIPLATFORM_SUPPORT" + Value = "1" + Help = "Main switch to enable PLATFORM support in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes +End + +TOKEN + Name = "S3_Power_Reduction_SUPPORT" + Value = "0" + Help = "Main switch to enable PLATFORM support in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes +End + +TOKEN + Name = "=== Platform Flavor Definition ======" + Help = "Define Platform Flavor Tokens: Mobile, Desktop etc" + TokenType = Expression +End + +TOKEN + Name = "Desktop_Platform" + Value = "0" + Help = "This is a tag for MB/DT platform decision. DON NOT CHANGE IT!" + TokenType = Integer + TargetMAK = Yes + TargetH = Yes + Lock = Yes +End + +TOKEN + Name = "Mobile_Platform" + Value = "1" + Help = "This is a tag for MB/DT platform decision. DON NOT CHANGE IT!" + TokenType = Integer + TargetMAK = Yes + TargetH = Yes + Lock = Yes +End + +TOKEN + Name = "UpServer_Platform" + Value = "2" + Help = "Platform Flavor UP Server" + TokenType = Integer + TargetMAK = Yes + TargetH = Yes + Lock = Yes +End + +TOKEN + Name = "FlavorMobile" + Value = "1" + Help = "Platform Flavor Mobile" + TokenType = Integer + TargetMAK = Yes + TargetH = Yes +End + +TOKEN + Name = "FMBL" + Value = "$(FlavorMobile)" + Help = "Platform Flavor - Mobile flavor for ASL code." + TokenType = Integer + TargetASL = Yes +End + +TOKEN + Name = "FlavorDesktop" + Value = "2" + Help = "Platform Flavor Desktop" + TokenType = Integer + TargetMAK = Yes + TargetH = Yes +End + +TOKEN + Name = "FDTP" + Value = "$(FlavorDesktop)" + Help = "Platform Flavor - Desktop flavor for ASL code." + TokenType = Integer + TargetASL = Yes +End + +TOKEN + Name = "FlavorUpServer" + Value = "3" + Help = "Platform Flavor UP Server" + TokenType = Integer + TargetMAK = Yes + TargetH = Yes +End + +TOKEN + Name = "FUPS" + Value = "$(FlavorUpServer)" + Help = "Platform Flavor - UP Server flavor for ASL code." + TokenType = Integer + TargetASL = Yes +End + +TOKEN + Name = "FlavorWorkStation" + Value = "4" + Help = "Platform Flavor UP Server" + TokenType = Integer + TargetMAK = Yes + TargetH = Yes +End + +TOKEN + Name = "FUWS" + Value = "$(FlavorWorkStation)" + Help = "Platform Flavor - WorkStation flavor for ASL code." + TokenType = Integer + TargetASL = Yes +End + +TOKEN + Name = "FlavorPlatformMax" + Value = "5" + Help = "Platform Flavor Max: This is the last entry for Platform Flavor!" + TokenType = Integer + TargetMAK = Yes + TargetH = Yes +End + +TOKEN + Name = "=== Board ID Definition ======" + Help = "Define Board ID Tokens: Shark Bay etc." + TokenType = Expression +End + +TOKEN + Name = "BoardIdGraysReef" + Value = "0x01" + Help = "Haswell - Grays Reef" + TokenType = Integer + TargetMAK = Yes + TargetH = Yes +End + +TOKEN + Name = "BGR" + Value = "$(BoardIdGraysReef)" + Help = "Haswell - Grays Reef Board ID for ASL codee." + TokenType = Integer + TargetASL = Yes +End + +TOKEN + Name = "BoardIdFlatheadRock" + Value = "0x02" + Help = "Haswell - Flathead Rock" + TokenType = Integer + TargetMAK = Yes + TargetH = Yes +End + +TOKEN + Name = "BFR" + Value = "$(BoardIdFlatheadRock)" + Help = "Haswell - Flathead Rock Board ID for ASL codee." + TokenType = Integer + TargetASL = Yes +End + +TOKEN + Name = "BoardIdBaskingRidge" + Value = "0x03" + Help = "Haswell - Basking Ridge" + TokenType = Integer + TargetMAK = Yes + TargetH = Yes +End + +TOKEN + Name = "BBR" + Value = "$(BoardIdBaskingRidge)" + Help = "Haswell - Basking Ridge Board ID for ASL codee." + TokenType = Integer + TargetASL = Yes +End + +TOKEN + Name = "BoardIdWalnutCanyon" + Value = "0x04" + Help = "Haswell - Walnut Canyon" + TokenType = Integer + TargetMAK = Yes + TargetH = Yes +End + +TOKEN + Name = "BWC" + Value = "$(BoardIdWalnutCanyon)" + Help = "Haswell - Walnut Canyon Board ID for ASL codee." + TokenType = Integer + TargetASL = Yes +End + +TOKEN + Name = "BoardIdhiteTipMountain1" + Value = "0x20" + Help = "Haswell - WhiteTip Mountain1" + TokenType = Integer + TargetMAK = Yes + TargetH = Yes +End + +TOKEN + Name = "BWT1" + Value = "$(BoardIdhiteTipMountain1)" + Help = "Haswell - WhiteTip Mountain1 Board ID for ASL code." + TokenType = Integer + TargetASL = Yes + Range = "16-bit IO register" +End + +TOKEN + Name = "BoardIdSawtoothPeak" + Value = "0x24" + Help = "Haswell - Sawtooth Peak" + TokenType = Integer + TargetMAK = Yes + TargetH = Yes +End + +TOKEN + Name = "BSPC" + Value = "$(BoardIdSawtoothPeak)" + Help = "Haswell - Sawtooth Peak Board ID for ASL code." + TokenType = Integer + TargetASL = Yes + Range = "16-bit IO register" +End + +TOKEN + Name = "BoardIdFlatheadCreek" + Value = "0x100" + Help = "Haswell - Flathead Creek" + TokenType = Integer + TargetMAK = Yes + TargetH = Yes +End + +TOKEN + Name = "BFHC" + Value = "$(BoardIdFlatheadCreek)" + Help = "Haswell - Flathead Creek Board ID for ASL code." + TokenType = Integer + TargetASL = Yes + Range = "16-bit IO register" +End + +TOKEN + Name = " " + TokenType = Integer +End + +TOKEN + Name = "DeviceID1" + Value = "0x100" + Help = "Value for CRT Display" + TokenType = Integer + TargetH = Yes +End + +TOKEN + Name = "DeviceID2" + Value = "0x400" + Help = "Value for Internal/Integrated Digital Flat Panel" + TokenType = Integer + TargetH = Yes +End + +TOKEN + Name = "DeviceID3" + Value = "0x300" + Help = "Value for Digital Display 1" + TokenType = Integer + TargetH = Yes +End + +TOKEN + Name = "DeviceID4" + Value = "0x301" + Help = "Value for Digital Display 2" + TokenType = Integer + TargetH = Yes +End + +TOKEN + Name = "DeviceID5" + Value = "0x302" + Help = "Value for Digital Display 3" + TokenType = Integer + TargetH = Yes +End + +TOKEN + Name = "DeviceID6" + Value = "0x303" + Help = "Value for Digital Display 4" + TokenType = Integer + TargetH = Yes +End + +TOKEN + Name = "DeviceID7" + Value = "0x304" + Help = "Value for Digital Display 5" + TokenType = Integer + TargetH = Yes +End + +TOKEN + Name = "DeviceID8" + Value = "0x305" + Help = "Value for Digital Display 6" + TokenType = Integer + TargetH = Yes +End + +TOKEN + Name = "ValidDeviceIDs" + Value = "0x08" + Help = "Number of Valid Video Device Ids" + TokenType = Integer + TargetH = Yes +End + +PATH + Name = "AcpiPlatform_DIR" +End + +MODULE + Help = "Includes AcpiPlatform.mak to Project" + File = "AcpiPlatform.mak" +End + +TOKEN + Name = "ACPIPLATFORM_ASL_COMPILER" + Value = "$(AcpiPlatform_DIR)\iasl.exe" + Help = "ASL Optimizing Compiler version 20120711-32 [Jul 11 2012]" + TokenType = Expression + TargetMAK = Yes +End + +TOKEN + Name = "ACPI_ASL_COMPILER" + Value = "$(AcpiPlatform_DIR)\iasl.exe" + Help = "ASL Optimizing Compiler version 20120711-32 [Jul 11 2012]" + TokenType = Expression + TargetMAK = Yes +End + +TOKEN + Name = "GENACPI" + Value = "$(AcpiPlatform_DIR)\GenAcpiTable" + TokenType = Expression + TargetMAK = Yes +End + +ELINK + Name = "$(BUILD_DIR)\AcpiPlatformPei.ffs" + Parent = "$(BUILD_DIR)\SBPEI.ffs" + InvokeOrder = AfterParent + Token = "S3_Power_Reduction_SUPPORT" "=" "1" +End + +ELINK + Name = "$(BUILD_DIR)\AcpiPlatform.ffs" + Parent = "FV_MAIN" + InvokeOrder = AfterParent +End + +ELINK + Name = "$(BUILD_DIR)\AcpiPlatformSmi.ffs" + Parent = "FV_MAIN" + InvokeOrder = AfterParent + Token = "S3_Power_Reduction_SUPPORT" "=" "1" +End + +ELINK + Name = "$(BUILD_DIR)\AcpiPlatform.sdb" + Parent = "SETUP_SDBS" + Priority = 40 + InvokeOrder = AfterParent +End + +ELINK + Name = "$(AcpiPlatform_DIR)\AcpiPlatform.sd" + Parent = "SETUP_DEFINITIONS" + Priority = 40 + InvokeOrder = AfterParent +End + +ELINK + Name = "AcpiPlatformPei_OBJECTS" + InvokeOrder = ReplaceParent +End + +ELINK + Name = "AcpiPlatform_OBJECTS" + InvokeOrder = ReplaceParent +End + +ELINK + Name = "SignalExitPmAuthProtocolEvent," + Parent = "SignalAllDriversConnectedEvent," + InvokeOrder = BeforeParent +End + +ELINK + Name = "SignalExitPmAuthProtocolEvent," + Parent = "BeforeConnectFastBootDeviceHook" + Token = "FAST_BOOT_SUPPORT" "=" "1" + InvokeOrder = AfterParent +End + +ELINK + Name = "AcpiPlatformSmi_OBJECTS" + InvokeOrder = ReplaceParent +End + +ELINK + Name = "$(BUILD_DIR)\$(AcpiPlatform_DIR)\AcpiPlatformPei.obj" + Parent = "AcpiPlatformPei_OBJECTS" + InvokeOrder = AfterParent +End + +ELINK + Name = "$(BUILD_DIR)\$(AcpiPlatform_DIR)\AcpiPlatform.obj" + Parent = "AcpiPlatform_OBJECTS" + InvokeOrder = AfterParent +End + +ELINK + Name = "$(BUILD_DIR)\$(NB_BOARD_DIR)\GetSetupData.obj" + Parent = "AcpiPlatform_OBJECTS" + InvokeOrder = AfterParent +End + +ELINK + Name = "$(BUILD_DIR)\$(SB_BOARD_DIR)\GetSetupData.obj" + Parent = "AcpiPlatform_OBJECTS" + InvokeOrder = AfterParent +End + +ELINK + Name = "$(BUILD_DIR)\$(AcpiPlatform_DIR)\AcpiPlatformSmi.obj" + Parent = "AcpiPlatformSmi_OBJECTS" + InvokeOrder = AfterParent +End + +ELINK + Name = "ACPI_PLATFORM_INCLUDES" + InvokeOrder = ReplaceParent +End + +ELINK + Name = "/I $(AcpiPlatform_DIR)" + Parent = "ACPI_PLATFORM_INCLUDES" + InvokeOrder = AfterParent +End + +ELINK + Name = "/I $(AcpiPlatform_DIR)\Library" + Parent = "ACPI_PLATFORM_INCLUDES" + InvokeOrder = AfterParent +End + +ELINK + Name = "/FI$(AcpiPlatform_DIR)\AcpiIntelRC.h" + Parent = "ASLPREPROCESS_FLAG" + InvokeOrder = AfterParent +End \ No newline at end of file diff --git a/Board/EM/Platform/AcpiPlatform.uni b/Board/EM/Platform/AcpiPlatform.uni new file mode 100644 index 0000000..5222520 Binary files /dev/null and b/Board/EM/Platform/AcpiPlatform.uni differ diff --git a/Board/EM/Platform/AcpiPlatformCspLib.c b/Board/EM/Platform/AcpiPlatformCspLib.c new file mode 100644 index 0000000..f31aa87 --- /dev/null +++ b/Board/EM/Platform/AcpiPlatformCspLib.c @@ -0,0 +1,150 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/AcpiPlatformCspLib.c 1 2/09/12 12:30a Yurenlai $ +// +// $Revision: 1 $ +// +// $Date: 2/09/12 12:30a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/AcpiPlatformCspLib.c $ +// +// 1 2/09/12 12:30a Yurenlai +// Initial check in. +// +//************************************************************************* + +// +//---------------------------------------------------------------------------- +// +// Name: AcpiPlatformCspLib.c +// +// Description: This file will be build in CSP LIB +// +//---------------------------------------------------------------------------- +// + +//---------------------------------------------------------------------------- +// Include(s) +//---------------------------------------------------------------------------- + +#include +#include +#include + +// Produced Protocols +#if FAST_BOOT_SUPPORT +#include +#endif + +// Consumed Protocols + +//---------------------------------------------------------------------------- +// Constant, Macro and Type Definition(s) +//---------------------------------------------------------------------------- +// Constant Definition(s) + + +// Macro Definition(s) + +#define EXIT_PM_AUTH_PROTOCOL_GUID \ + { \ + 0xd088a413, 0xa70, 0x4217, 0xba, 0x55, 0x9a, 0x3c, 0xb6, 0x5c, 0x41, 0xb3 \ + } +// Type Definition(s) + +// Function Prototype(s) + +//---------------------------------------------------------------------------- +// Variable and External Declaration(s) +//---------------------------------------------------------------------------- +// Variable Declaration(s) + + +// GUID Definition(s) +EFI_GUID gExitPmAuthProtocolGuid = EXIT_PM_AUTH_PROTOCOL_GUID; + +//---------------------------------------------------------------------------- +// +//---------------------------------------------------------------------------- +// Procedure: AcpiPlatformSignalProtocolEvent +// +// Description: Internal function that installs/uninstall protocol +// with a specified GUID and NULL interface. +// Such protocols can be used as event signaling mechanism. +// +// Input: ProtocolGuid Pointer to the protocol GUID +// +// Output: None +// +//---------------------------------------------------------------------------- +// +VOID AcpiPlatformSignalProtocolEvent(IN EFI_GUID *ProtocolGuid){ + EFI_HANDLE Handle = NULL; + pBS->InstallProtocolInterface ( + &Handle, ProtocolGuid, EFI_NATIVE_INTERFACE, NULL + ); + pBS->UninstallProtocolInterface ( + Handle, ProtocolGuid, NULL + ); +} + +// +//---------------------------------------------------------------------------- +// +// Procedure: SignalExitPmAuthProtocolEvent +// +// Description: The elink will signal gExitPmAuthProtocolGuid Event. +// +// Parameters: VOID +// +// +// Returns: None +// +//---------------------------------------------------------------------------- +// + +VOID SignalExitPmAuthProtocolEvent(VOID){ +#if FAST_BOOT_SUPPORT + EFI_STATUS Status; + AMI_FAST_BOOT_PROTOCOL *FastBootProtocol = NULL; + + Status = pBS->LocateProtocol(&AmiFastBootProtocolGuid, NULL, &FastBootProtocol); + + if (EFI_ERROR(Status)) { + // Signaling gExitPmAuthProtocolGuid Event before AmiFastBootProtocolGuid is + // installed to avoid this event signaled twice. + AcpiPlatformSignalProtocolEvent(&gExitPmAuthProtocolGuid); + } +#else + // Signaling gExitPmAuthProtocolGuid Event + AcpiPlatformSignalProtocolEvent(&gExitPmAuthProtocolGuid); +#endif +} +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Board/EM/Platform/AcpiPlatformPei.c b/Board/EM/Platform/AcpiPlatformPei.c new file mode 100644 index 0000000..6c9eb0b --- /dev/null +++ b/Board/EM/Platform/AcpiPlatformPei.c @@ -0,0 +1,231 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/AcpiPlatformPei.c 1 2/09/12 12:30a Yurenlai $ +// +// $Revision: 1 $ +// +// $Date: 2/09/12 12:30a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/AcpiPlatformPei.c $ +// +// 1 2/09/12 12:30a Yurenlai +// Initial check in. +// +//************************************************************************* +// +//--------------------------------------------------------------------------- +// +// Name: ACPIPLATFORM.C +// +// Description: Installs EFI_GLOBAL_NVS_AREA_PROTOCOL_GUID +// +//--------------------------------------------------------------------------- +// + +#include +#include +#include +#include +#include +#include +//#include +#include + +#define MC_MMIO_CSHRDDR3CTL 0x1E8 +#define MC_RESET_CONTROL 0x05C +#define IMC_DEV 3 +#define IMC_FUNC 0 + +//********************************************************************** +// +// +// Procedure: AcpiPlatformPeiInit +// +// Description: +// +// Input: +// +// Output: +// EFI_STATUS +// +// Modified: +// +// Referrals: +// +// Notes: +// Here is the control flow of this function: +// +// +//********************************************************************** +EFI_STATUS +AcpiPlatformPeiInit ( + IN EFI_FFS_FILE_HEADER *FfsHeader, + IN EFI_PEI_SERVICES **PeiServices + ) +{ +/* + EFI_STATUS Status ; + UINT32 Buffer32; + EFI_BOOT_MODE BootMode; + EFI_PEI_STALL_PPI *StallPpi; + EFI_GUID StallPpiGuid = EFI_PEI_STALL_PPI_GUID; + + UINT32 RegEAX, RegEBX, RegECX, RegEDX; + UINT8 MaxBusNumber; + EFI_PEI_PCI_CFG_PPI *PciCfg; + + // Determine boot mode + Status = (*PeiServices)->GetBootMode(PeiServices, &BootMode); + ASSERT_PEI_ERROR(PeiServices, Status); + +//Config GPIO, CRB use GPIO46 as output and drive it to logic high for S5/S0 boot path + + Buffer32 = IoRead32(GPIO_BASE_ADDRESS + ICH_GPIO_USE_SEL2); // GPIO USE Select 2 Register + Buffer32 |= 0x00004000; + IoWrite32(GPIO_BASE_ADDRESS + ICH_GPIO_USE_SEL2, Buffer32); // Singal used as a GPIO + + Buffer32 = IoRead32(GPIO_BASE_ADDRESS + ICH_GPIO_IO_SEL2); // GPIO Input/Output Select 2 Register + Buffer32 &= 0xFFFFBFFF; + IoWrite32(GPIO_BASE_ADDRESS + ICH_GPIO_IO_SEL2, Buffer32); // Program GPIO as a Output + + if(BootMode == BOOT_WITH_FULL_CONFIGURATION || BootMode == BOOT_ON_S5_RESUME){ + Buffer32 = IoRead32(GPIO_BASE_ADDRESS + ICH_GPIO_GP_LVL2); // GPIO Level Select 2 Register + Buffer32 |= 0x00004000; + IoWrite32(GPIO_BASE_ADDRESS + ICH_GPIO_GP_LVL2, Buffer32); // Program GPIO level drive to logic high + + } // BootMode == BOOT_WITH_FULL_CONFIGURATION || BootMode == BOOT_ON_S5_RESUME + + + if(BootMode == BOOT_ON_S3_RESUME){ + // Locate PPI stall service + Status = (**PeiServices).LocatePpi(PeiServices, + &StallPpiGuid, + 0, + NULL, + &StallPpi); + + ASSERT_PEI_ERROR (PeiServices, Status); + + CPULib_CpuID(1, &RegEAX, &RegEBX, &RegECX, &RegEDX); + + if (((RegEAX & CPUID_FULL_FAMILY_MODEL) == CPUID_FULL_FAMILY_MODEL_DALES) || + ((RegEAX & CPUID_FULL_FAMILY_MODEL) == CPUID_FULL_FAMILY_MODEL_DALES_32NM)) { + // Write MCHBAR + 0x1E8[2:0] = '110' to de-assert DDR_RESET#, + // this should be followed by a write to MCHBAR + 0x1E8[2:0] = '100' + // to maintain the state of the DDR_RESET# signal for future accesses to this register. + Mmio32(MCH_BASE_ADDRESS, MC_MMIO_CSHRDDR3CTL) &= ~(BIT2|BIT1|BIT0); + Mmio32(MCH_BASE_ADDRESS, MC_MMIO_CSHRDDR3CTL) |= (BIT2|BIT1); + Mmio32(MCH_BASE_ADDRESS, MC_MMIO_CSHRDDR3CTL) &= ~(BIT2|BIT1|BIT0); + Mmio32(MCH_BASE_ADDRESS, MC_MMIO_CSHRDDR3CTL) |= (BIT2); + + // + // wait 50ms delay + // + StallPpi->Stall(PeiServices, + StallPpi, + 50000); + + //Drive GPIO 46 high + + // + // Set GP_LVL2 Register + // + Buffer32 = IoRead32(GPIO_BASE_ADDRESS + ICH_GPIO_GP_LVL2); // GPIO Level Select 2 Register + Buffer32 |= 0x00004000; + IoWrite32(GPIO_BASE_ADDRESS + ICH_GPIO_GP_LVL2, Buffer32); // Program GPIO level drive to logic high + + } else if ((RegEAX & CPUID_FULL_FAMILY_MODEL) == CPUID_FULL_FAMILY_MODEL_FIELDS) { + // + // Set BIOS_RESET_ENABLE in MC_RESET_CONTROL register + // + + // + // EFI_PCIEXBAR MSR 0x300 - BIT3 | BIT2 | BIT1 + // + PciCfg = (*PeiServices)->PciCfg; + + switch ((((UINT8)ReadMsr(0x300)) & (0xE)) >> 1) + { + default: + case 0x00: + MaxBusNumber = 0xFF; + break; + + case 0x07: + MaxBusNumber = 0x7F; + break; + + case 0x06: + MaxBusNumber = 0x3F; + break; + } + + PciCfg->Read( + PeiServices, + PciCfg, + EfiPeiPciCfgWidthUint32, + PEI_PCI_CFG_ADDRESS(MaxBusNumber, 3, 0, MC_RESET_CONTROL), + &Buffer32); + + Buffer32 |= (BIT0); + + PciCfg->Write( + PeiServices, + PciCfg, + EfiPeiPciCfgWidthUint32, + PEI_PCI_CFG_ADDRESS(MaxBusNumber, 3, 0, MC_RESET_CONTROL), + &Buffer32); + + // MmPci16(MaxBusNumber, IMC_DEV, IMC_FUNC, MC_RESET_CONTROL) |= (BIT0); + + // + // wait 50ms delay + // + StallPpi->Stall(PeiServices, + StallPpi, + 50000); + + //Drive GPIO 46 high + + // + // Set GP_LVL2 Register + // + Buffer32 = IoRead32(GPIO_BASE_ADDRESS + ICH_GPIO_GP_LVL2); // GPIO Level Select 2 Register + Buffer32 |= 0x00004000; + IoWrite32(GPIO_BASE_ADDRESS + ICH_GPIO_GP_LVL2, Buffer32); // Program GPIO level drive to logic high + } + + } // BootMode == BOOT_ON_S3_RESUME +*/ + return EFI_SUCCESS; +} + + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Board/EM/Platform/AcpiPlatformPei.dxs b/Board/EM/Platform/AcpiPlatformPei.dxs new file mode 100644 index 0000000..306a2ff --- /dev/null +++ b/Board/EM/Platform/AcpiPlatformPei.dxs @@ -0,0 +1,50 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/AcpiPlatformPei.dxs 1 2/09/12 12:30a Yurenlai $ +// +// $Revision: 1 $ +// +// $Date: 2/09/12 12:30a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/AcpiPlatformPei.dxs $ +// +// 1 2/09/12 12:30a Yurenlai +// Initial check in. +// +//************************************************************************* +#include "PPI\ReadOnlyVariable.h" +#include "PPI\Stall.h" + +DEPENDENCY_START + EFI_PEI_READ_ONLY_VARIABLE_PPI_GUID AND + EFI_PEI_STALL_PPI_GUID +DEPENDENCY_END + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Board/EM/Platform/AcpiPlatformSmi.c b/Board/EM/Platform/AcpiPlatformSmi.c new file mode 100644 index 0000000..af9e1ad --- /dev/null +++ b/Board/EM/Platform/AcpiPlatformSmi.c @@ -0,0 +1,247 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/AcpiPlatformSmi.c 1 2/09/12 12:30a Yurenlai $ +// +// $Revision: 1 $ +// +// $Date: 2/09/12 12:30a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/AcpiPlatformSmi.c $ +// +// 1 2/09/12 12:30a Yurenlai +// Initial check in. +// +//************************************************************************* + +// +//---------------------------------------------------------------------------- +// +// Name: AcpiPlatformSmi.c +// +// Description: This file contains code for all AcpiPlatform SMI events +// +//---------------------------------------------------------------------------- +// + +//---------------------------------------------------------------------------- +// Include(s) +//---------------------------------------------------------------------------- + +#include +#include +#include +#include "SmmChildDispatch.h" + +// Produced Protocols + +// Consumed Protocols +#include + +//---------------------------------------------------------------------------- +// Constant, Macro and Type Definition(s) +//---------------------------------------------------------------------------- +// Constant Definition(s) + + +// Macro Definition(s) + +// Type Definition(s) + +// Function Prototype(s) + +//---------------------------------------------------------------------------- +// Variable and External Declaration(s) +//---------------------------------------------------------------------------- +// Variable Declaration(s) + + +// GUID Definition(s) + +EFI_GUID gEfiSmmBaseProtocolGuid = EFI_SMM_BASE_PROTOCOL_GUID; +EFI_GUID gSxDispatchProtocolGuid = EFI_SMM_SX_DISPATCH_PROTOCOL_GUID; + + + +// +//---------------------------------------------------------------------------- +// +// Procedure: S3PowerReductionFunction +// +// Description: Driving GPIO46 Output to low +// +// Input: None +// +// Output: None +// +//---------------------------------------------------------------------------- +// + +VOID S3PowerReductionFunction(VOID) +{ + // UINT32 Buffer32; + + // Buffer32 = IoRead32(GPIO_BASE_ADDRESS + ICH_GPIO_GP_LVL2); // GPIO Level Select 2 Register + // Buffer32 &= 0xFFFFBFFF; +// IoWrite32(GPIO_BASE_ADDRESS + ICH_GPIO_GP_LVL2, Buffer32); // Program GPIO level drive to logic high + +} + +// +//---------------------------------------------------------------------------- +// +// Procedure: AcpiPlatformSxSmiHandler +// +// Description: This is a AcpiPlatform Sx SMI Handler for Calpella Platform. +// +// Input: DispatchHandle - EFI Handle +// DispatchContext - Pointer to the EFI_SMM_SX_DISPATCH_CONTEXT +// +// Output: None +// +//---------------------------------------------------------------------------- +// + +VOID AcpiPlatformSxSmiHandler( + IN EFI_HANDLE DispatchHandle, + IN EFI_SMM_SX_DISPATCH_CONTEXT *DispatchContext) +{ + if (DispatchContext->Type == SxS3) + S3PowerReductionFunction(); + +} + +// +//---------------------------------------------------------------------------- +// +// Procedure: InSmmFunction +// +// Description: Installs AcpiPlatform SMM Child Dispatcher Handler. +// +// Parameters: ImageHandle - Image handle +// *SystemTable - Pointer to the system table +// +// Returns: EFI_STATUS +// +// Modified: +// +// Referrals: +// +// Notes: +// +//---------------------------------------------------------------------------- +// + +EFI_STATUS InSmmFunction ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable ) +{ + EFI_STATUS Status; + EFI_HANDLE Handle; + EFI_SMM_BASE_PROTOCOL *SmmBaseProtocol; + // Sx SMI + EFI_SMM_SX_DISPATCH_PROTOCOL *pSxDispatch; + EFI_SMM_SX_DISPATCH_CONTEXT SxS1Context = {SxS1, SxEntry}; + EFI_SMM_SX_DISPATCH_CONTEXT SxS3Context = {SxS3, SxEntry}; + EFI_SMM_SX_DISPATCH_CONTEXT SxS4Context = {SxS4, SxEntry}; + EFI_SMM_SX_DISPATCH_CONTEXT SxS5Context = {SxS5, SxEntry}; + + Status = pBS->LocateProtocol( &gEfiSmmBaseProtocolGuid, \ + NULL, \ + &SmmBaseProtocol ); + if (EFI_ERROR(Status)) return Status; + + // Local SMI Procotol + Status = pBS->LocateProtocol( + &gSxDispatchProtocolGuid, + NULL, + &pSxDispatch); + if (EFI_ERROR(Status)) + pSxDispatch = NULL; + + // Register SMIs + if (pSxDispatch != NULL) + { + Status = pSxDispatch->Register( + pSxDispatch, + AcpiPlatformSxSmiHandler, + &SxS1Context, + &Handle); + + Status = pSxDispatch->Register( + pSxDispatch, + AcpiPlatformSxSmiHandler, + &SxS3Context, + &Handle); + + Status = pSxDispatch->Register( + pSxDispatch, + AcpiPlatformSxSmiHandler, + &SxS4Context, + &Handle); + + Status = pSxDispatch->Register( + pSxDispatch, + AcpiPlatformSxSmiHandler, + &SxS5Context, + &Handle); + } + + + + return EFI_SUCCESS; + +} + +// +//---------------------------------------------------------------------------- +// +// Procedure: InitializeAcpiPlatformSMISmm +// +// Description: Installs AcpiPlatform SMM Child Dispatcher Handler. +// +// Parameters: ImageHandle - Image handle +// *SystemTable - Pointer to the system table +// +// Returns: EFI_STATUS +// +//---------------------------------------------------------------------------- +// + +EFI_STATUS InitializeAcpiPlatformSMISmm ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable ) +{ + + InitAmiLib(ImageHandle, SystemTable); + + return InitSmmHandler(ImageHandle, SystemTable, InSmmFunction, NULL); +} + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Board/EM/Platform/AcpiPlatformSmi.dxs b/Board/EM/Platform/AcpiPlatformSmi.dxs new file mode 100644 index 0000000..a7eeaf0 --- /dev/null +++ b/Board/EM/Platform/AcpiPlatformSmi.dxs @@ -0,0 +1,61 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/AcpiPlatformSmi.dxs 1 2/09/12 12:30a Yurenlai $ +// +// $Revision: 1 $ +// +// $Date: 2/09/12 12:30a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/AcpiPlatformSmi.dxs $ +// +// 1 2/09/12 12:30a Yurenlai +// Initial check in. +// +//************************************************************************* + +// +//---------------------------------------------------------------------------- +// +// Name: AcpiPlatformSmi.DXS +// +// Description: This file is the dependency file for the AcpiPlatform SMI driver. +// +//---------------------------------------------------------------------------- +// + +#include +#include + +DEPENDENCY_START + EFI_BOOT_SCRIPT_SAVE_GUID AND + EFI_SMM_SW_DISPATCH_PROTOCOL_GUID +DEPENDENCY_END + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Board/EM/Platform/EfiCombineImage/EfiCombineImage.c b/Board/EM/Platform/EfiCombineImage/EfiCombineImage.c new file mode 100644 index 0000000..34dd321 --- /dev/null +++ b/Board/EM/Platform/EfiCombineImage/EfiCombineImage.c @@ -0,0 +1,223 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2012, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/EfiCombineImage/EfiCombineImage.c 1 12/18/12 11:10p Alanlin $ +// +// $Revision: 1 $ +// +// $Date: 12/18/12 11:10p $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/EfiCombineImage/EfiCombineImage.c $ +// +// 1 12/18/12 11:10p Alanlin +// +// +//************************************************************************* +// +// +// Name: +// +// Description: +// +// +//************************************************************************* + +// Include(s) + +#include "Efi.h" +#include "token.h" +#include +#include +#include +#include +#include +#include + +// Constant Definition(s) + +// Macro Definition(s) + +// Type Definition(s) + +// Function Prototype(s) + + +// Variable Declaration(s) + +// GUID Definition(s) +#if (PI_SPECIFICATION_VERSION < 0x00010000) +EFI_GUID gFvProtocolGuid = EFI_FIRMWARE_VOLUME_PROTOCOL_GUID; +#else +EFI_GUID gFvProtocolGuid = EFI_FIRMWARE_VOLUME2_PROTOCOL_GUID; +#endif + +#if NVidia_Optimus_dGPU == 1 +EFI_GUID gEfiCombineImageGuid = NVidia_dGPU_HEADER_GUID; +#endif +#if AMD_PX_CHELSEA_dGPU == 1 +EFI_GUID gEfiCombineImageGuid1 = AMD_CHELSEA_HEADER_GUID; +#endif +#if AMD_PX_THAMES_dGPU == 1 +EFI_GUID gEfiCombineImageGuid2 = AMD_THAMES_HEADER_GUID; +#endif + +// Protocol Definition(s) + +// External Declaration(s) + +// Function Definition(s) + + +// +//---------------------------------------------------------------------------- +// Name: GetEfiCombineImage +// +// Description: None. +// +// Input: None. +// +// Output: None. +// +// Notes: None. +// +//---------------------------------------------------------------------------- +// + +EFI_STATUS GetEfiCombineImage ( + IN PCI_DEV_INFO *Device, + OUT VOID *RomImage, + OUT UINT64 RomSize +) +{ + EFI_STATUS Status; + UINTN FvProtocolCount; + EFI_HANDLE *FvHandles = NULL; +#if (PI_SPECIFICATION_VERSION < 0x00010000) + EFI_FIRMWARE_VOLUME_PROTOCOL *Fv; +#else + EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv; +#endif + UINTN Index; + UINT32 AuthenticationStatus; + UINT8 *Buffer = NULL; + UINTN BufferSize; + + Status = pBS->LocateHandleBuffer ( + ByProtocol, + &gFvProtocolGuid, + NULL, + &FvProtocolCount, + &FvHandles + ); + if (!EFI_ERROR (Status)) { + for (Index = 0; Index < FvProtocolCount; Index++) { + Status = pBS->HandleProtocol ( + FvHandles[Index], + &gFvProtocolGuid, + (VOID **) &Fv + ); + if (!EFI_ERROR (Status)) { + + switch (Device->DevVenId.DevId) + { +#if NVidia_Optimus_dGPU == 1 + case NVidia_dGPU_DID : + Status = Fv->ReadSection( + Fv,&gEfiCombineImageGuid, + EFI_SECTION_RAW,0, + &Buffer,&BufferSize, + &AuthenticationStatus + ); + break; +#endif + +#if AMD_PX_CHELSEA_dGPU == 1 + case AMD_CHELSEA_DID : + Status = Fv->ReadSection( + Fv,&gEfiCombineImageGuid1, + EFI_SECTION_RAW,0, + &Buffer,&BufferSize, + &AuthenticationStatus + ); + break; +#endif + +#if AMD_PX_THAMES_dGPU == 1 + case AMD_THAMES_DID : + Status = Fv->ReadSection( + Fv,&gEfiCombineImageGuid2, + EFI_SECTION_RAW,0, + &Buffer,&BufferSize, + &AuthenticationStatus + ); + break; +#endif + default : + break; + } + + if (!EFI_ERROR (Status)) { + if(Device->PciIo.RomImage != NULL) { + pBS->FreePool (Device->PciIo.RomImage); + Device->PciIo.RomImage = NULL; + Device->PciIo.RomSize = 0; + } + //Check if Embeded Op ROM is valid... + if(*((UINT16*)Buffer)!=PCI_OPT_ROM_SIG) Status=EFI_NOT_FOUND; + else{ + //Allocate buffer for ROM Image. + Device->PciIo.RomImage = Malloc (BufferSize); + if(Device->PciIo.RomImage == NULL) Status = EFI_OUT_OF_RESOURCES; + else { + MemCpy (Device->PciIo.RomImage, Buffer, BufferSize); + Device->PciIo.RomSize = BufferSize; + Device->Capab |= (EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE + EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM); + Device->Attrib |= (EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE + EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM); + Status = EFI_SUCCESS; + } + } + break; + } + } + } + } + else { + Status = EFI_NOT_FOUND; + } + + if (FvHandles != NULL) { + pBS->FreePool (FvHandles); + FvHandles = NULL; + } + + return Status; +} + + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2012, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Board/EM/Platform/EfiCombineImage/EfiCombineImage.cif b/Board/EM/Platform/EfiCombineImage/EfiCombineImage.cif new file mode 100644 index 0000000..3debf25 --- /dev/null +++ b/Board/EM/Platform/EfiCombineImage/EfiCombineImage.cif @@ -0,0 +1,10 @@ + + name = "EFI Combine Image" + category = ModulePart + LocalRoot = "Board\EM\Platform\EfiCombineImage\" + RefName = "EfiCombineImage" +[files] +"EfiCombineImage.sdl" +"EfiCombineImage.mak" +"EfiCombineImage.c" + diff --git a/Board/EM/Platform/EfiCombineImage/EfiCombineImage.mak b/Board/EM/Platform/EfiCombineImage/EfiCombineImage.mak new file mode 100644 index 0000000..a95b067 --- /dev/null +++ b/Board/EM/Platform/EfiCombineImage/EfiCombineImage.mak @@ -0,0 +1,105 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2012, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* + +#************************************************************************* +# $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/EfiCombineImage/EfiCombineImage.mak 1 12/18/12 11:10p Alanlin $ +# +# $Revision: 1 $ +# +# $Date: 12/18/12 11:10p $ +#************************************************************************* +# Revision History +# ---------------- +# $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/EfiCombineImage/EfiCombineImage.mak $ +# +# 1 12/18/12 11:10p Alanlin +# +# +#************************************************************************* +# +# +# Name: +# +# Description: +# +# +#************************************************************************* +all : EfiCombineImage EfiCombineImage1 EfiCombineImage2 + +EfiCombineImage: \ +!IF "$(NVidia_Optimus_dGPU)" == "1" +$(BUILD_DIR)\EfiCombineImageFile.ffs +!ENDIF + +EfiCombineImage1: \ +!IF "$(AMD_PX_CHELSEA_dGPU)" == "1" +$(BUILD_DIR)\EfiCombineImageFile1.ffs +!ENDIF + +EfiCombineImage2: \ +!IF "$(AMD_PX_THAMES_dGPU)" == "1" +$(BUILD_DIR)\EfiCombineImageFile2.ffs +!ENDIF + +$(BUILD_DIR)\EfiCombineImage.mak : $(EfiCombineImage_DIR)\$(@B).cif $(EfiCombineImage_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(EfiCombineImage_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +AMI_CSP_LIB_OBJS = $(AMI_CSP_LIB_OBJS) \ +$(BUILD_DIR)\EfiCombineImage.obj + +{$(EfiCombineImage_DIR)}.c{$(BUILD_DIR)}.obj:: + $(CC) $(CFLAGS) /Fo$(BUILD_DIR)\ $< + +$(BUILD_DIR)\EfiCombineImage.obj : $(EfiCombineImage_DIR)\EfiCombineImage.c + +!IF "$(NVidia_Optimus_dGPU)" == "1" +$(BUILD_DIR)\EfiCombineImageFile.ffs : $(EfiCombineImageFile) + $(MAKE) /f Core\FFS.mak \ + BUILD_DIR=$(BUILD_DIR) \ + GUID=$(NVidia_dGPU_MAKFILE_GUID) \ + TYPE=EFI_FV_FILETYPE_FREEFORM \ + BINFILE=$** FFSFILE=$@ COMPRESS=1 NAME=$(**B) +!ENDIF + +!IF "$(AMD_PX_CHELSEA_dGPU)" == "1" +$(BUILD_DIR)\EfiCombineImageFile1.ffs : $(EfiCombineImageFile1) + $(MAKE) /f Core\FFS.mak \ + BUILD_DIR=$(BUILD_DIR) \ + GUID=$(AMD_CHELSEA_MAKFILE_GUID) \ + TYPE=EFI_FV_FILETYPE_FREEFORM \ + BINFILE=$** FFSFILE=$@ COMPRESS=1 NAME=$(**B) +!ENDIF + +!IF "$(AMD_PX_THAMES_dGPU)" == "1" +$(BUILD_DIR)\EfiCombineImageFile2.ffs : $(EfiCombineImageFile2) + $(MAKE) /f Core\FFS.mak \ + BUILD_DIR=$(BUILD_DIR) \ + GUID=$(AMD_THAMES_MAKFILE_GUID) \ + TYPE=EFI_FV_FILETYPE_FREEFORM \ + BINFILE=$** FFSFILE=$@ COMPRESS=1 NAME=$(**B) +!ENDIF + +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2012, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* diff --git a/Board/EM/Platform/EfiCombineImage/EfiCombineImage.sdl b/Board/EM/Platform/EfiCombineImage/EfiCombineImage.sdl new file mode 100644 index 0000000..91ddf21 --- /dev/null +++ b/Board/EM/Platform/EfiCombineImage/EfiCombineImage.sdl @@ -0,0 +1,203 @@ +TOKEN + Name = "EfiCombineImage" + Value = "0" + Help = "Main Switch to Enable Efi Combine Image" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + TargetH = Yes + Master = Yes +End + +TOKEN + Name = "NVidia_Optimus_dGPU" + Value = "1" + TokenType = Boolean + TargetMAK = Yes + TargetH = Yes +End + +TOKEN + Name = "AMD_PX_CHELSEA_dGPU" + Value = "1" + TokenType = Boolean + TargetMAK = Yes + TargetH = Yes +End + +TOKEN + Name = "AMD_PX_THAMES_dGPU" + Value = "1" + TokenType = Boolean + TargetMAK = Yes + TargetH = Yes +End + +TOKEN + Name = "NVidia_dGPU_DID" + Value = "0x0FD2" + TokenType = Integer + TargetMAK = Yes + TargetH = Yes + Token = "NVidia_Optimus_dGPU" "=" "1" +End + +TOKEN + Name = "NVidia_dGPU_MAKFILE_GUID" + Value = "C5D7EAAD-B218-482c-A909-E3B8CDB00E94" + TokenType = Expression + TargetMAK = Yes + TargetH = Yes + Range = "GUID" + Token = "NVidia_Optimus_dGPU" "=" "1" +End + +TOKEN + Name = "NVidia_dGPU_HEADER_GUID" + Value = "{0xC5D7EAAD,0xB218,0x482c,0xA9,0x09,0xE3,0xB8,0xCD,0xB0,0x0E,0x94}" + TokenType = Expression + TargetMAK = Yes + TargetH = Yes + Range = "GUID" + Token = "NVidia_Optimus_dGPU" "=" "1" +End + +TOKEN + Name = "AMD_CHELSEA_DID" + Value = "0x682F" + TokenType = Integer + TargetMAK = Yes + TargetH = Yes + Token = "AMD_PX_CHELSEA_dGPU" "=" "1" +End + +TOKEN + Name = "AMD_CHELSEA_MAKFILE_GUID" + Value = "B9C6D5AB-5914-4b1b-B33D-B10D9D0075BE" + TokenType = Expression + TargetMAK = Yes + TargetH = Yes + Range = "GUID" + Token = "AMD_PX_CHELSEA_dGPU" "=" "1" +End + +TOKEN + Name = "AMD_CHELSEA_HEADER_GUID" + Value = "{0XB9C6D5AB,0X5914,0X4b1b,0XB3,0X3D,0XB1,0X0D,0X9D,0X00,0X75,0XBE}" + TokenType = Expression + TargetMAK = Yes + TargetH = Yes + Range = "GUID" + Token = "AMD_PX_CHELSEA_dGPU" "=" "1" +End + +TOKEN + Name = "AMD_THAMES_DID" + Value = "0x6840" + TokenType = Integer + TargetMAK = Yes + TargetH = Yes + Token = "AMD_PX_THAMES_dGPU" "=" "1" +End + +TOKEN + Name = "AMD_THAMES_MAKFILE_GUID" + Value = "633657DB-777F-4038-8D72-3E581518E03A" + TokenType = Expression + TargetMAK = Yes + TargetH = Yes + Range = "GUID" + Token = "AMD_PX_THAMES_dGPU" "=" "1" +End + +TOKEN + Name = "AMD_THAMES_HEADER_GUID" + Value = "{0X633657DB,0X777F,0X4038,0X8D,0X72,0X3E,0X58,0X15,0X18,0XE0,0X3A}" + TokenType = Expression + TargetMAK = Yes + TargetH = Yes + Range = "GUID" + Token = "AMD_PX_THAMES_dGPU" "=" "1" +End + +TOKEN + Name = "EfiCombineImageFile" + Value = "Chipset\NB\GOP\SandyBridge\vbt_edp.bin" + Help = "It is a sample, please modify to your VGA Oprom path." + TokenType = Expression + TargetMAK = Yes + Token = "NVidia_Optimus_dGPU" "=" "1" +End + +TOKEN + Name = "EfiCombineImageFile1" + Value = "Chipset\NB\GOP\SandyBridge\vbt_edp.bin" + Help = "It is a sample, please modify to your VGA Oprom path." + TokenType = Expression + TargetMAK = Yes + Token = "AMD_PX_CHELSEA_dGPU" "=" "1" +End + +TOKEN + Name = "EfiCombineImageFile2" + Value = "Chipset\NB\GOP\SandyBridge\vbt_edp.bin" + Help = "It is a sample, please modify to your VGA Oprom path." + TokenType = Expression + TargetMAK = Yes + Token = "AMD_PX_THAMES_dGPU" "=" "1" +End + +PATH + Name = "EfiCombineImage_DIR" +End + +MODULE + Help = "Includes EfiCombineImage.mak to Project" + File = "EfiCombineImage.mak" +End + +ELINK + Name = "OEM_PCI_DEVICE_CALLBACK(0x10DE, NVidia_dGPU_DID, GetEfiCombineImage)," + Parent = "OEM_PCI_DEVICE_GET_OPT_ROM" + Help = "It is a sample(Nvidia Optims), please change DID and VID depend on your device." + Token = "NVidia_Optimus_dGPU" "=" "1" + InvokeOrder = AfterParent +End + +ELINK + Name = "OEM_PCI_DEVICE_CALLBACK(0x1002, AMD_CHELSEA_DID, GetEfiCombineImage)," + Parent = "OEM_PCI_DEVICE_GET_OPT_ROM" + Help = "It is a sample(AMD Chelsea), please change DID and VID depend on your device." + Token = "AMD_PX_CHELSEA_dGPU" "=" "1" + InvokeOrder = AfterParent +End + +ELINK + Name = "OEM_PCI_DEVICE_CALLBACK(0x1002, AMD_THAMES_DID, GetEfiCombineImage)," + Parent = "OEM_PCI_DEVICE_GET_OPT_ROM" + Help = "It is a sample(AMD Thames), please change DID and VID depend on your device." + Token = "AMD_PX_THAMES_dGPU" "=" "1" + InvokeOrder = AfterParent +End + +ELINK + Name = "$(BUILD_DIR)\EfiCombineImageFile.ffs" + Parent = "FV_MAIN" + Token = "NVidia_Optimus_dGPU" "=" "1" + InvokeOrder = AfterParent +End + +ELINK + Name = "$(BUILD_DIR)\EfiCombineImageFile1.ffs" + Parent = "FV_MAIN" + Token = "AMD_PX_CHELSEA_dGPU" "=" "1" + InvokeOrder = AfterParent +End + +ELINK + Name = "$(BUILD_DIR)\EfiCombineImageFile2.ffs" + Parent = "FV_MAIN" + Token = "AMD_PX_THAMES_dGPU" "=" "1" + InvokeOrder = AfterParent +End + diff --git a/Board/EM/Platform/FirmwareVerInfo/FirmwareVerInfo.c b/Board/EM/Platform/FirmwareVerInfo/FirmwareVerInfo.c new file mode 100644 index 0000000..404a2cf --- /dev/null +++ b/Board/EM/Platform/FirmwareVerInfo/FirmwareVerInfo.c @@ -0,0 +1,218 @@ +/** @file +**/ + +#include +#include + +#include EFI_GUID_DEFINITION(DataHubRecords) +#include EFI_PROTOCOL_CONSUMER(DataHub) +#include EFI_PROTOCOL_CONSUMER(ExitPmAuth) +#include + +#include + + +#pragma pack(1) + +typedef struct { + UINT8 Type; + UINT8 Length; + UINT16 Handle; + UINT8 GroupName; +} SMBIOS_TYPE14_STRUCTURE_HDR; + +typedef struct { + UINT8 Type; + UINT16 Handle; +} SMBIOS_TYPE14_STRUCTURE_ITEM; + +#pragma pack() + +VOID CreateFirmwareVerInfo(IN EFI_EVENT Event, IN VOID *Context); + +EFI_SMBIOS_PROTOCOL *gSmbiosProtocol = NULL; + +/** + The user Entry Point for DXE driver. The user code starts with this function + as the real entry point for the image goes into a library that calls this + function. + + @param[in] ImageHandle The firmware allocated handle for the EFI image. + @param[in] SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The entry point is executed successfully. + @retval other Some error occurs when executing this entry point. + +**/ +EFI_STATUS +EFIAPI +FirmwareVerInfoEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable +) +{ + EFI_STATUS Status; + EFI_GUID gEfiSmbiosProtocolGuid = EFI_SMBIOS_PROTOCOL_GUID; + EFI_EVENT Event; + + DxeInitializeDriverLib (ImageHandle, SystemTable); + + Status = gBS->LocateProtocol(&gEfiSmbiosProtocolGuid, NULL, &gSmbiosProtocol); + ASSERT_EFI_ERROR(Status); + if (!EFI_ERROR(Status)) + { + Status = EfiCreateEventReadyToBoot( + EFI_TPL_CALLBACK, + CreateFirmwareVerInfo, + NULL, + &Event + ); + ASSERT_EFI_ERROR (Status); + } + + return EFI_SUCCESS; +} + + +EFI_STATUS BuildFviStruct(BOOLEAN GroupAssociation, EFI_DATA_RECORD_HEADER *Record) +{ + static VOID *FviStructBuffer = NULL; + static UINTN FviStructBufferSize = 0; + static UINTN FviStructSize = 0; + static UINTN ElementCount = 0; + + EFI_STATUS Status; + EFI_SUBCLASS_TYPE1_HEADER *DataHeader = NULL; + FVI_HEADER *FviHeader = NULL; + UINT16 BufferSize = 0; + SMBIOS_TYPE14_STRUCTURE_HDR *SmbiosHdr = NULL; + SMBIOS_TYPE14_STRUCTURE_ITEM *ItemPtr = NULL; + CHAR8 GroupName[] = "Firmware Version Info\0"; + + if (GroupAssociation) + { + if ((FviStructBuffer == NULL) && (FviStructSize > sizeof(SMBIOS_TYPE14_STRUCTURE_HDR))) + { + return EFI_UNSUPPORTED; + } + + SmbiosHdr = (SMBIOS_TYPE14_STRUCTURE_HDR *)FviStructBuffer; + + SmbiosHdr->Type = 14; + SmbiosHdr->Length = (UINT8)FviStructSize; + SmbiosHdr->Handle = 0xFFFF; + + SmbiosHdr->GroupName = 0x01; + EfiAsciiStrCpy((CHAR8 *)((UINT8 *)FviStructBuffer+FviStructSize), GroupName); + FviStructSize += sizeof(GroupName); + + Status = gSmbiosProtocol->SmbiosAddStructure((UINT8 *)SmbiosHdr, (UINT16)(FviStructSize)); + if (!EFI_ERROR(Status)) + { + gBS->FreePool(FviStructBuffer); + FviStructBuffer = NULL; + } + + return Status; + } + + if (Record == NULL) + { + return EFI_INVALID_PARAMETER; + } + + if (FviStructBuffer == NULL) + { + FviStructBufferSize = 0x2000; + FviStructBuffer = EfiLibAllocateZeroPool(FviStructBufferSize); + FviStructSize = sizeof(SMBIOS_TYPE14_STRUCTURE_HDR); + } + + SmbiosHdr = (SMBIOS_TYPE14_STRUCTURE_HDR *)FviStructBuffer; + ItemPtr = (SMBIOS_TYPE14_STRUCTURE_ITEM *)(SmbiosHdr + 1); + ItemPtr += ElementCount; + + if (EfiCompareGuid(&Record->DataRecordGuid, &gMiscSubClassName)) + { + DataHeader = (EFI_SUBCLASS_TYPE1_HEADER *)(Record + 1); + FviHeader = (FVI_HEADER *)(UINT8 *)(DataHeader + 1); + + if (FviHeader->Header.Type == FVI_SMBIOS_TYPE) + { + FviHeader->Header.Handle = 0xFFFF; + BufferSize = (UINT16)(Record->RecordSize - sizeof(EFI_DATA_RECORD_HEADER) - sizeof(EFI_SUBCLASS_TYPE1_HEADER)); + Status = gSmbiosProtocol->SmbiosAddStructure((UINT8 *)FviHeader, BufferSize); + if (!EFI_ERROR(Status)) + { + ItemPtr->Type = FviHeader->Header.Type; + ItemPtr->Handle = FviHeader->Header.Handle; + FviStructSize += sizeof(SMBIOS_TYPE14_STRUCTURE_ITEM); + ElementCount++; + } + } + } + + return EFI_SUCCESS; +} + + +VOID CreateFirmwareVerInfo(IN EFI_EVENT Event, IN VOID *Context) +{ + EFI_STATUS Status; + EFI_HANDLE DataHubHandle; + UINTN HandleSize; + EFI_DATA_HUB_PROTOCOL *DataHub = NULL; + EFI_DATA_RECORD_HEADER *Record = NULL; + UINT64 MonotonicCount = 0; + + HandleSize = sizeof (EFI_HANDLE); + + Status = gBS->LocateHandle ( + ByProtocol, + &gEfiDataHubProtocolGuid, + NULL, + &HandleSize, + &DataHubHandle + ); + if (EFI_ERROR (Status)) + { + return; + } + + Status = gBS->HandleProtocol ( + DataHubHandle, + &gEfiDataHubProtocolGuid, + &DataHub + ); + if (EFI_ERROR (Status)) + { + return; + } + + do { + Status = DataHub->GetNextRecord ( + DataHub, + &MonotonicCount, + NULL, + &Record); + if (!EFI_ERROR (Status)) + { + if (Record->DataRecordClass == EFI_DATA_RECORD_CLASS_DATA) + { + BuildFviStruct(FALSE, Record); + } + } + } while (!EFI_ERROR (Status) && (MonotonicCount != 0)); + + Status = BuildFviStruct(TRUE, NULL); + if (EFI_ERROR(Status)) + { + DEBUG((EFI_D_ERROR, "!!!Firmware Version Information Error!!!\n")); + DEBUG((EFI_D_ERROR, "!!!Type 14 ¡V Group Associations Indicator!!!\n")); + } + + if (Event != NULL) + { + gBS->CloseEvent(Event); + } +} diff --git a/Board/EM/Platform/FirmwareVerInfo/FirmwareVerInfo.cif b/Board/EM/Platform/FirmwareVerInfo/FirmwareVerInfo.cif new file mode 100644 index 0000000..5113f3e --- /dev/null +++ b/Board/EM/Platform/FirmwareVerInfo/FirmwareVerInfo.cif @@ -0,0 +1,11 @@ + + name = "FirmwareVerInfo" + category = ModulePart + LocalRoot = "Board\EM\Platform\FirmwareVerInfo" + RefName = "FirmwareVerInfo" +[files] +"FirmwareVerInfo.sdl" +"FirmwareVerInfo.mak" +"FirmwareVerInfo.dxs" +"FirmwareVerInfo.c" + diff --git a/Board/EM/Platform/FirmwareVerInfo/FirmwareVerInfo.dxs b/Board/EM/Platform/FirmwareVerInfo/FirmwareVerInfo.dxs new file mode 100644 index 0000000..ea6c9fb --- /dev/null +++ b/Board/EM/Platform/FirmwareVerInfo/FirmwareVerInfo.dxs @@ -0,0 +1,50 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/FirmwareVerInfo/FirmwareVerInfo.dxs 1 6/13/12 8:38a Yurenlai $ +// +// $Revision: 1 $ +// +// $Date: 6/13/12 8:38a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/FirmwareVerInfo/FirmwareVerInfo.dxs $ +// +// 1 6/13/12 8:38a Yurenlai +// [TAG] None +// [Category] Improvement +// [Description] Support Firmware Version Information. +// [Files] AcpiPlatform.cif, Board/EM/Platform/FirmwareVerInfo/*.* +// +//************************************************************************* + +DEPENDENCY_START + AFTER {0xEDA39402, 0xF375, 0x4496, 0x92, 0xD3, 0x83, 0xB4, 0x3C, 0xB8, 0xA7, 0x6A} +DEPENDENCY_END + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Board/EM/Platform/FirmwareVerInfo/FirmwareVerInfo.mak b/Board/EM/Platform/FirmwareVerInfo/FirmwareVerInfo.mak new file mode 100644 index 0000000..1d0c956 --- /dev/null +++ b/Board/EM/Platform/FirmwareVerInfo/FirmwareVerInfo.mak @@ -0,0 +1,29 @@ +# /*++ +# +# --*/ +all : FirmwareVerInfo + +FirmwareVerInfo : $(BUILD_DIR)\FirmwareVerInfo.mak FirmwareVerInfoBin + +$(BUILD_DIR)\FirmwareVerInfo.mak : $(FirmwareVerInfo_DIR)\FirmwareVerInfo.cif $(FirmwareVerInfo_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(FirmwareVerInfo_DIR)\FirmwareVerInfo.cif $(CIF2MAK_DEFAULTS) + +FirmwareVerInfo_INCLUDES = \ + $(EDK_INCLUDES)\ + /I Include\ + $(INTEL_PCH_INCLUDES) + +FirmwareVerInfo_LIB_LINKS =\ + $(EFIDRIVERLIB) + +FirmwareVerInfoBin : $(FirmwareVerInfo_LIB_LINKS) + $(MAKE) /$(MAKEFLAGS) $(EDK_DEFAULTS)\ + /f $(BUILD_DIR)\FirmwareVerInfo.mak all\ + NAME=FirmwareVerInfo\ + "MY_INCLUDES=$(FirmwareVerInfo_INCLUDES)"\ + GUID=132A6630-FEB5-4ba2-85FB-FD2635379257\ + ENTRY_POINT=FirmwareVerInfoEntryPoint\ + DEPEX1=$(FirmwareVerInfo_DIR)\FirmwareVerInfo.dxs \ + DEPEX1_TYPE=EFI_SECTION_DXE_DEPEX \ + TYPE=BS_DRIVER\ + COMPRESS=1 diff --git a/Board/EM/Platform/FirmwareVerInfo/FirmwareVerInfo.sdl b/Board/EM/Platform/FirmwareVerInfo/FirmwareVerInfo.sdl new file mode 100644 index 0000000..4cddc59 --- /dev/null +++ b/Board/EM/Platform/FirmwareVerInfo/FirmwareVerInfo.sdl @@ -0,0 +1,80 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2011, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* + +#************************************************************************* +# $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/FirmwareVerInfo/FirmwareVerInfo.sdl 2 11/20/12 7:22a Alanlin $ +# +# $Revision: 2 $ +# +# $Date: 11/20/12 7:22a $ +#************************************************************************* +# Revision History +# ---------------- +# $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/FirmwareVerInfo/FirmwareVerInfo.sdl $ +# +# 2 11/20/12 7:22a Alanlin +# +# 1 6/13/12 8:38a Yurenlai +# [TAG] None +# [Category] Improvement +# [Description] Support Firmware Version Information. +# [Files] AcpiPlatform.cif, Board/EM/Platform/FirmwareVerInfo/*.* +# +#************************************************************************* +TOKEN + Name = "FirmwareVerInfo_SUPPORT" + Value = "0" + Help = "Main switch to enable FirmwareVerInfo support in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes + Token = "PI_SPECIFICATION_VERSION" ">=" "0x10000" +End + +TOKEN + Name = "FVI_SMBIOS_TYPE" + Value = "0xDD" + TokenType = Integer + TargetH = Yes +End + +PATH + Name = "FirmwareVerInfo_DIR" +End + +MODULE + Help = "Includes FirmwareVerInfo.mak to Project" + File = "FirmwareVerInfo.mak" +End + +ELINK + Name = "$(BUILD_DIR)\FirmwareVerInfo.ffs" + Parent = "FV_MAIN" + InvokeOrder = AfterParent +End + +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2011, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* diff --git a/Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.c b/Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.c new file mode 100644 index 0000000..24abc14 --- /dev/null +++ b/Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.c @@ -0,0 +1,512 @@ +/** @file +UEFI PI specification supersedes Inte's Framework Specification. +EFI_FIRMWARE_VOLUME_PROTOCOL defined in Intel Framework Pkg is replaced by +EFI_FIRMWARE_VOLUME2_PROTOCOL in MdePkg. +This module produces FV on top of FV2. This module is used on platform when both of +these two conditions are true: +1) Framework module consuming FV is present +2) And the platform only produces FV2 + +Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which 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. +Module Name: + +**/ + +#include "EdkIIGlueDxe.h" + +#include EFI_PROTOCOL_DEFINITION (FirmwareVolume2) +#include EFI_PROTOCOL_DEFINITION (FirmwareVolume) + +#define FIRMWARE_VOLUME_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32 ('f', 'v', 't', 'h') + +typedef struct { + UINTN Signature; + EFI_FIRMWARE_VOLUME_PROTOCOL FirmwareVolume; + EFI_FIRMWARE_VOLUME2_PROTOCOL *FirmwareVolume2; +} FIRMWARE_VOLUME_PRIVATE_DATA; + +#define FIRMWARE_VOLUME_PRIVATE_DATA_FROM_THIS(a) CR (a, FIRMWARE_VOLUME_PRIVATE_DATA, FirmwareVolume, FIRMWARE_VOLUME_PRIVATE_DATA_SIGNATURE) + +typedef UINT64 FRAMEWORK_EFI_FV_ATTRIBUTES; + +/** + Convert FV attrbiutes to FV2 attributes. + + @param Fv2Attributes FV2 attributes. + + @return FV attributes. + +**/ +FRAMEWORK_EFI_FV_ATTRIBUTES +Fv2AttributesToFvAttributes ( + IN EFI_FV_ATTRIBUTES Fv2Attributes + ) +{ + // + // Clear those filed that is not defined in Framework FV spec and Alignment conversion. + // + return (Fv2Attributes & 0x1ff) | ((UINTN) EFI_FV_ALIGNMENT_2 << RShiftU64((Fv2Attributes & EFI_FV2_ALIGNMENT), 16)); +} + +/** + Retrieves attributes, insures positive polarity of attribute bits, returns + resulting attributes in output parameter. + + @param This Calling context + @param Attributes output buffer which contains attributes + + @retval EFI_SUCCESS The firmware volume attributes were returned. + +**/ +EFI_STATUS +EFIAPI +FvGetVolumeAttributes ( + IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, + OUT FRAMEWORK_EFI_FV_ATTRIBUTES *Attributes + ) +{ + EFI_STATUS Status; + FIRMWARE_VOLUME_PRIVATE_DATA *Private; + EFI_FIRMWARE_VOLUME2_PROTOCOL *FirmwareVolume2; + + Private = FIRMWARE_VOLUME_PRIVATE_DATA_FROM_THIS (This); + FirmwareVolume2 = Private->FirmwareVolume2; + + Status = FirmwareVolume2->GetVolumeAttributes ( + FirmwareVolume2, + Attributes + ); + if (!EFI_ERROR (Status)) { + *Attributes = Fv2AttributesToFvAttributes (*Attributes); + } + return Status; +} + +/** + Sets volume attributes. + + @param This Calling context + @param Attributes Buffer which contains attributes + + @retval EFI_INVALID_PARAMETER A bit in Attributes was invalid + @retval EFI_SUCCESS The requested firmware volume attributes were set + and the resulting EFI_FV_ATTRIBUTES is returned in + Attributes. + @retval EFI_ACCESS_DENIED The Device is locked and does not permit modification. + +**/ +EFI_STATUS +EFIAPI +FvSetVolumeAttributes ( + IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, + IN OUT FRAMEWORK_EFI_FV_ATTRIBUTES *Attributes + ) +{ + FIRMWARE_VOLUME_PRIVATE_DATA *Private; + EFI_FIRMWARE_VOLUME2_PROTOCOL *FirmwareVolume2; + EFI_FV_ATTRIBUTES Fv2Attributes; + EFI_STATUS Status; + + Private = FIRMWARE_VOLUME_PRIVATE_DATA_FROM_THIS (This); + FirmwareVolume2 = Private->FirmwareVolume2; + + Fv2Attributes = (*Attributes & 0x1ff); + Status = FirmwareVolume2->SetVolumeAttributes ( + FirmwareVolume2, + &Fv2Attributes + ); + + *Attributes = Fv2AttributesToFvAttributes (Fv2Attributes); + + return Status; +} + +/** + Read the requested file (NameGuid) and returns data in Buffer. + + @param This Calling context + @param NameGuid Filename identifying which file to read + @param Buffer Pointer to pointer to buffer in which contents of file are returned. +
+ If Buffer is NULL, only type, attributes, and size are returned as + there is no output buffer. +
+ If Buffer != NULL and *Buffer == NULL, the output buffer is allocated + from BS pool by ReadFile +
+ If Buffer != NULL and *Buffer != NULL, the output buffer has been + allocated by the caller and is being passed in. + @param BufferSize Indicates the buffer size passed in, and on output the size + required to complete the read + @param FoundType Indicates the type of the file who's data is returned + @param FileAttributes Indicates the attributes of the file who's data is resturned + @param AuthenticationStatus Indicates the authentication status of the data + + @retval EFI_SUCCESS The call completed successfully + @retval EFI_WARN_BUFFER_TOO_SMALL The buffer is too small to contain the requested output. + The buffer is filled and the output is truncated. + @retval EFI_NOT_FOUND NameGuid was not found in the firmware volume. + @retval EFI_DEVICE_ERROR A hardware error occurred when attempting to access the firmware volume. + @retval EFI_ACCESS_DENIED The firmware volume is configured to disallow reads. + @retval EFI_OUT_OF_RESOURCES An allocation failure occurred. + +**/ +EFI_STATUS +EFIAPI +FvReadFile ( + IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, + IN EFI_GUID *NameGuid, + IN OUT VOID **Buffer, + IN OUT UINTN *BufferSize, + OUT EFI_FV_FILETYPE *FoundType, + OUT EFI_FV_FILE_ATTRIBUTES *FileAttributes, + OUT UINT32 *AuthenticationStatus + ) +{ + FIRMWARE_VOLUME_PRIVATE_DATA *Private; + EFI_FIRMWARE_VOLUME2_PROTOCOL *FirmwareVolume2; + EFI_STATUS Status; + + Private = FIRMWARE_VOLUME_PRIVATE_DATA_FROM_THIS (This); + FirmwareVolume2 = Private->FirmwareVolume2; + + Status = FirmwareVolume2->ReadFile ( + FirmwareVolume2, + NameGuid, + Buffer, + BufferSize, + FoundType, + FileAttributes, + AuthenticationStatus + ); + + // + // For Framework FV attrbutes, only alignment fields are valid. + // + *FileAttributes = *FileAttributes & EFI_FV_FILE_ATTRIB_ALIGNMENT; + + return Status; +} + +/** + Read the requested section from the specified file and returns data in Buffer. + + @param This Calling context + @param NameGuid Filename identifying the file from which to read + @param SectionType Indicates what section type to retrieve + @param SectionInstance Indicates which instance of SectionType to retrieve + @param Buffer Pointer to pointer to buffer in which contents of file are returned. +
+ If Buffer is NULL, only type, attributes, and size are returned as + there is no output buffer. +
+ If Buffer != NULL and *Buffer == NULL, the output buffer is allocated + from BS pool by ReadFile +
+ If Buffer != NULL and *Buffer != NULL, the output buffer has been + allocated by the caller and is being passed in. + @param BufferSize Indicates the buffer size passed in, and on output the size + required to complete the read + @param AuthenticationStatus Indicates the authentication status of the data + + @retval EFI_SUCCESS The call completed successfully. + @retval EFI_WARN_BUFFER_TOO_SMALL The buffer is too small to contain the requested output. + The buffer is filled and the output is truncated. + @retval EFI_OUT_OF_RESOURCES An allocation failure occurred. + @retval EFI_NOT_FOUND Name was not found in the firmware volume. + @retval EFI_DEVICE_ERROR A hardware error occurred when attempting to access the firmware volume. + @retval EFI_ACCESS_DENIED The firmware volume is configured to disallow reads. + +**/ +EFI_STATUS +EFIAPI +FvReadSection ( + IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, + IN EFI_GUID *NameGuid, + IN EFI_SECTION_TYPE SectionType, + IN UINTN SectionInstance, + IN OUT VOID **Buffer, + IN OUT UINTN *BufferSize, + OUT UINT32 *AuthenticationStatus + ) +{ + FIRMWARE_VOLUME_PRIVATE_DATA *Private; + EFI_FIRMWARE_VOLUME2_PROTOCOL *FirmwareVolume2; + + Private = FIRMWARE_VOLUME_PRIVATE_DATA_FROM_THIS (This); + FirmwareVolume2 = Private->FirmwareVolume2; + + return FirmwareVolume2->ReadSection ( + FirmwareVolume2, + NameGuid, + SectionType, + SectionInstance, + Buffer, + BufferSize, + AuthenticationStatus + ); +} + +/** + Write the supplied file (NameGuid) to the FV. + + @param This Calling context + @param NumberOfFiles Indicates the number of file records pointed to by FileData + @param WritePolicy Indicates the level of reliability of the write with respect to + things like power failure events. + @param FileData A pointer to an array of EFI_FV_WRITE_FILE_DATA structures. Each + element in the array indicates a file to write, and there are + NumberOfFiles elements in the input array. + + @retval EFI_SUCCESS The write completed successfully. + @retval EFI_OUT_OF_RESOURCES The firmware volume does not have enough free space to store file(s). + @retval EFI_DEVICE_ERROR A hardware error occurred when attempting to access the firmware volume. + @retval EFI_WRITE_PROTECTED The firmware volume is configured to disallow writes. + @retval EFI_NOT_FOUND A delete was requested, but the requested file was not + found in the firmware volume. + @retval EFI_INVALID_PARAMETER A delete was requested with a multiple file write. + An unsupported WritePolicy was requested. + An unknown file type was specified. + A file system specific error has occurred. + +**/ +EFI_STATUS +EFIAPI +FvWriteFile ( + IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, + IN UINT32 NumberOfFiles, + IN EFI_FV_WRITE_POLICY WritePolicy, + IN EFI_FV_WRITE_FILE_DATA *FileData + ) +{ + FIRMWARE_VOLUME_PRIVATE_DATA *Private; + EFI_FIRMWARE_VOLUME2_PROTOCOL *FirmwareVolume2; + EFI_FV_WRITE_FILE_DATA *PiFileData; + EFI_STATUS Status; + UINTN Index; + + Private = FIRMWARE_VOLUME_PRIVATE_DATA_FROM_THIS (This); + FirmwareVolume2 = Private->FirmwareVolume2; + + PiFileData = AllocateCopyPool (sizeof (EFI_FV_WRITE_FILE_DATA), FileData); + ASSERT (PiFileData != NULL); + + // + // Framework Spec assume firmware files are Memory-Mapped. + // + for (Index = 0; Index < NumberOfFiles; Index++) { + PiFileData[Index].FileAttributes |= EFI_FV_FILE_ATTRIB_MEMORY_MAPPED; + } + + Status = FirmwareVolume2->WriteFile ( + FirmwareVolume2, + NumberOfFiles, + WritePolicy, + (EFI_FV_WRITE_FILE_DATA *)FileData + ); + + FreePool (PiFileData); + return Status; +} + +/** + Given the input key, search for the next matching file in the volume. + + @param This Calling context + @param Key Pointer to a caller allocated buffer that contains an implementation + specific key that is used to track where to begin searching on + successive calls. + @param FileType Indicates the file type to filter for + @param NameGuid Guid filename of the file found + @param Attributes Attributes of the file found + @param Size Size in bytes of the file found + + @retval EFI_SUCCESS The output parameters are filled with data obtained from + the first matching file that was found. + @retval EFI_NOT_FOUND No files of type FileType were found. + @retval EFI_DEVICE_ERROR A hardware error occurred when attempting to access + the firmware volume. + @retval EFI_ACCESS_DENIED The firmware volume is configured to disallow reads. + +**/ +EFI_STATUS +EFIAPI +FvGetNextFile ( + IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, + IN OUT VOID *Key, + IN OUT EFI_FV_FILETYPE *FileType, + OUT EFI_GUID *NameGuid, + OUT EFI_FV_FILE_ATTRIBUTES *Attributes, + OUT UINTN *Size + ) +{ + FIRMWARE_VOLUME_PRIVATE_DATA *Private; + EFI_FIRMWARE_VOLUME2_PROTOCOL *FirmwareVolume2; + EFI_STATUS Status; + + Private = FIRMWARE_VOLUME_PRIVATE_DATA_FROM_THIS (This); + FirmwareVolume2 = Private->FirmwareVolume2; + + Status = FirmwareVolume2->GetNextFile ( + FirmwareVolume2, + Key, + FileType, + NameGuid, + Attributes, + Size + ); + + // + // For Framework FV attrbutes, only alignment fields are valid. + // + *Attributes = *Attributes & EFI_FV_FILE_ATTRIB_ALIGNMENT; + + return Status; +} + +// +// Firmware Volume Protocol template +// +EFI_EVENT mFvRegistration; + +FIRMWARE_VOLUME_PRIVATE_DATA gFirmwareVolumePrivateDataTemplate = { + FIRMWARE_VOLUME_PRIVATE_DATA_SIGNATURE, + { + FvGetVolumeAttributes, + FvSetVolumeAttributes, + FvReadFile, + FvReadSection, + FvWriteFile, + FvGetNextFile, + 0, + NULL + }, + NULL +}; + +// +// Module globals +// +/** + This notification function is invoked when an instance of the + EFI_FIRMWARE_VOLUME2_PROTOCOL is produced. It installs another instance of the + EFI_FIRMWARE_VOLUME_PROTOCOL on the same handle. + + @param Event The event that occured + @param Context Context of event. Not used in this nofication function. + +**/ +VOID +EFIAPI +FvNotificationEvent ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + EFI_STATUS Status; + UINTN BufferSize; + EFI_HANDLE Handle; + FIRMWARE_VOLUME_PRIVATE_DATA *Private; + EFI_FIRMWARE_VOLUME_PROTOCOL *FirmwareVolume; + + while (TRUE) { + BufferSize = sizeof (Handle); + Status = gBS->LocateHandle ( + ByRegisterNotify, + &gEfiFirmwareVolume2ProtocolGuid, + mFvRegistration, + &BufferSize, + &Handle + ); + if (EFI_ERROR (Status)) { + // + // Exit Path of While Loop.... + // + break; + } + + // + // Skip this handle if the Firmware Volume Protocol is already installed + // + Status = gBS->HandleProtocol ( + Handle, + &gEfiFirmwareVolumeProtocolGuid, + (VOID **)&FirmwareVolume + ); + if (!EFI_ERROR (Status)) { + continue; + } + + // + // Allocate private data structure + // + Private = AllocateCopyPool (sizeof (FIRMWARE_VOLUME_PRIVATE_DATA), &gFirmwareVolumePrivateDataTemplate); + if (Private == NULL) { + continue; + } + + // + // Retrieve the Firmware Volume2 Protocol + // + Status = gBS->HandleProtocol ( + Handle, + &gEfiFirmwareVolume2ProtocolGuid, + (VOID **)&Private->FirmwareVolume2 + ); + ASSERT_EFI_ERROR (Status); + + // + // Fill in rest of private data structure + // + Private->FirmwareVolume.KeySize = Private->FirmwareVolume2->KeySize; + Private->FirmwareVolume.ParentHandle = Private->FirmwareVolume2->ParentHandle; + + // + // Install Firmware Volume Protocol onto same handle + // + Status = gBS->InstallMultipleProtocolInterfaces ( + &Handle, + &gEfiFirmwareVolumeProtocolGuid, + &Private->FirmwareVolume, + NULL + ); + ASSERT_EFI_ERROR (Status); + } +} + + +/** + The user Entry Point for DXE driver. The user code starts with this function + as the real entry point for the image goes into a library that calls this + function. + + @param[in] ImageHandle The firmware allocated handle for the EFI image. + @param[in] SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The entry point is executed successfully. + @retval other Some error occurs when executing this entry point. + +**/ +EFI_STATUS +EFIAPI +InitializeFirmwareVolume2 ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EfiCreateProtocolNotifyEvent ( + &gEfiFirmwareVolume2ProtocolGuid, + TPL_CALLBACK, + FvNotificationEvent, + NULL, + &mFvRegistration + ); + return EFI_SUCCESS; +} diff --git a/Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.cif b/Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.cif new file mode 100644 index 0000000..298ce70 --- /dev/null +++ b/Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.cif @@ -0,0 +1,11 @@ + + name = "FvOnFv2Thunk" + category = ModulePart + LocalRoot = "Board\EM\Platform\FvOnFv2Thunk" + RefName = "FvOnFv2Thunk" +[files] +"FvOnFv2Thunk.sdl" +"FvOnFv2Thunk.mak" +"FvOnFv2Thunk.dxs" +"FvOnFv2Thunk.c" + diff --git a/Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.dxs b/Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.dxs new file mode 100644 index 0000000..74a64cc --- /dev/null +++ b/Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.dxs @@ -0,0 +1,47 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/FvOnFv2Thunk/FvOnFv2Thunk.dxs 1 4/25/12 1:05p Yurenlai $ +// +// $Revision: 1 $ +// +// $Date: 4/25/12 1:05p $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/FvOnFv2Thunk/FvOnFv2Thunk.dxs $ +// +// 1 4/25/12 1:05p Yurenlai +// FvOnFv2Thunk initialization. +// +//************************************************************************* + +DEPENDENCY_START + TRUE +DEPENDENCY_END + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.mak b/Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.mak new file mode 100644 index 0000000..551de97 --- /dev/null +++ b/Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.mak @@ -0,0 +1,55 @@ +# /*++ +# +# --*/ +all : FvOnFv2Thunk + +FvOnFv2Thunk : $(BUILD_DIR)\FvOnFv2Thunk.mak FvOnFv2ThunkBin + +$(BUILD_DIR)\FvOnFv2Thunk.mak : $(FvOnFv2Thunk_DIR)\FvOnFv2Thunk.cif $(FvOnFv2Thunk_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(FvOnFv2Thunk_DIR)\FvOnFv2Thunk.cif $(CIF2MAK_DEFAULTS) + +FvOnFv2Thunk_INCLUDES = \ + $(EdkIIGlueLib_INCLUDES) + +FvOnFv2Thunk_DEFINES = $(MY_DEFINES)\ + /D"__EDKII_GLUE_MODULE_ENTRY_POINT__=InitializeFirmwareVolume2"\ + /D __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__ \ + /D __EDKII_GLUE_BASE_MEMORY_LIB__ \ + /D __EDKII_GLUE_UEFI_DEVICE_PATH_LIB__ \ + /D __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__ \ + /D __EDKII_GLUE_UEFI_LIB__ \ + /D __EDKII_GLUE_DXE_MEMORY_ALLOCATION_LIB__ \ + /D __EDKII_GLUE_BASE_PCI_LIB_PCI_EXPRESS__ \ + /D __EDKII_GLUE_DXE_REPORT_STATUS_CODE_LIB__ \ + /D __EDKII_GLUE_DXE_DEBUG_LIB_REPORT_STATUS_CODE__ \ + /D __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__ + +FvOnFv2Thunk_LIB_LINKS =\ +!IF "$(x64_BUILD)"=="1" + $(EdkIIGlueBaseLibX64_LIB)\ +!ELSE + $(EdkIIGlueBaseLibIA32_LIB)\ +!ENDIF + $(EdkIIGlueBaseIoLibIntrinsic_LIB)\ + $(EdkIIGlueBaseMemoryLib_LIB)\ + $(EdkIIGlueDxeMemoryAllocationLib_LIB)\ + $(EdkIIGlueUefiBootServicesTableLib_LIB)\ + $(EdkIIGlueUefiLib_LIB)\ + $(EdkIIGlueDxeReportStatusCodeLib_LIB)\ + $(EdkIIGlueDxeDebugLibReportStatusCode_LIB)\ + $(EDKFRAMEWORKPROTOCOLLIB)\ + $(EDKPROTOCOLLIB) + +FvOnFv2ThunkBin : $(FvOnFv2Thunk_LIB_LINKS) + $(MAKE) /$(MAKEFLAGS) $(EDKIIGLUE_DEFAULTS)\ + /f $(BUILD_DIR)\FvOnFv2Thunk.mak all\ + NAME=FvOnFv2Thunk\ + "MY_INCLUDES=$(FvOnFv2Thunk_INCLUDES)"\ + "MY_DEFINES=$(FvOnFv2Thunk_DEFINES)" \ + GUID=5007A40E-A5E0-44f7-86AE-662F9A91DA26\ + ENTRY_POINT=_ModuleEntryPoint\ + EDKIIModule=DXEDRIVER\ + DEPEX1=$(FvOnFv2Thunk_DIR)\FvOnFv2Thunk.dxs \ + DEPEX1_TYPE=EFI_SECTION_DXE_DEPEX \ + TYPE=BS_DRIVER\ + COMPRESS=1\ diff --git a/Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.sdl b/Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.sdl new file mode 100644 index 0000000..bc09146 --- /dev/null +++ b/Board/EM/Platform/FvOnFv2Thunk/FvOnFv2Thunk.sdl @@ -0,0 +1,68 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2011, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* + +#************************************************************************* +# $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/FvOnFv2Thunk/FvOnFv2Thunk.sdl 1 4/25/12 1:04p Yurenlai $ +# +# $Revision: 1 $ +# +# $Date: 4/25/12 1:04p $ +#************************************************************************* +# Revision History +# ---------------- +# $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/FvOnFv2Thunk/FvOnFv2Thunk.sdl $ +# +# 1 4/25/12 1:04p Yurenlai +# FvOnFv2Thunk initialization. +# +#************************************************************************* +TOKEN + Name = "FvOnFv2Thunk_SUPPORT" + Value = "1" + Help = "Main switch to enable FvOnFv2Thunk support in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes + Token = "PI_SPECIFICATION_VERSION" ">=" "0x10000" +End + +PATH + Name = "FvOnFv2Thunk_DIR" +End + +MODULE + Help = "Includes FvOnFv2Thunk.mak to Project" + File = "FvOnFv2Thunk.mak" +End + +ELINK + Name = "$(BUILD_DIR)\FvOnFv2Thunk.ffs" + Parent = "FV_MAIN" + InvokeOrder = BeforeParent +End + +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2011, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* diff --git a/Board/EM/Platform/GenAcpiTable.exe b/Board/EM/Platform/GenAcpiTable.exe new file mode 100644 index 0000000..401283d Binary files /dev/null and b/Board/EM/Platform/GenAcpiTable.exe differ diff --git a/Board/EM/Platform/Include/IntelPlatformInclude.cif b/Board/EM/Platform/Include/IntelPlatformInclude.cif new file mode 100644 index 0000000..a3d47bd --- /dev/null +++ b/Board/EM/Platform/Include/IntelPlatformInclude.cif @@ -0,0 +1,10 @@ + + name = "IntelPlatformInclude" + category = ModulePart + LocalRoot = "Board\EM\Platform\Include" + RefName = "IntelPlatformInclude" +[files] +"IntelPlatformInclude.sdl" +[parts] +"IntelPlatformPpi" + diff --git a/Board/EM/Platform/Include/IntelPlatformInclude.sdl b/Board/EM/Platform/Include/IntelPlatformInclude.sdl new file mode 100644 index 0000000..636eb7d --- /dev/null +++ b/Board/EM/Platform/Include/IntelPlatformInclude.sdl @@ -0,0 +1,15 @@ +TOKEN + Name = "INTEL_PLATFORM_INCLUDE_SUPPORT" + Value = "1" + Help = "Main switch to enable INTEL_PLATFORM_INCLUDE support in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes +End + +PATH + Name = "IntelPlatformInclude_DIR" +End + + diff --git a/Board/EM/Platform/Include/Ppi/IntelPlatformPpi.cif b/Board/EM/Platform/Include/Ppi/IntelPlatformPpi.cif new file mode 100644 index 0000000..011427c --- /dev/null +++ b/Board/EM/Platform/Include/Ppi/IntelPlatformPpi.cif @@ -0,0 +1,9 @@ + + name = "IntelPlatformPpi" + category = ModulePart + LocalRoot = "Board\EM\Platform\Include\Ppi" + RefName = "IntelPlatformPpi" +[files] +"IntelPlatformPpi.sdl" +"TcgPeiDone.h" + diff --git a/Board/EM/Platform/Include/Ppi/IntelPlatformPpi.sdl b/Board/EM/Platform/Include/Ppi/IntelPlatformPpi.sdl new file mode 100644 index 0000000..694dd94 --- /dev/null +++ b/Board/EM/Platform/Include/Ppi/IntelPlatformPpi.sdl @@ -0,0 +1,15 @@ +TOKEN + Name = "INTEL_PLATFORM_PPI_SUPPORT" + Value = "1" + Help = "Main switch to enable INTEL_PLATFORM_PPI support in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes +End + +PATH + Name = "IntelPlatformPpi_DIR" +End + + diff --git a/Board/EM/Platform/Include/Ppi/TcgPeiDone.h b/Board/EM/Platform/Include/Ppi/TcgPeiDone.h new file mode 100644 index 0000000..5f91596 --- /dev/null +++ b/Board/EM/Platform/Include/Ppi/TcgPeiDone.h @@ -0,0 +1,43 @@ +/*++ + This file contains a 'Sample Driver' and is licensed as such + under the terms of your license agreement with Intel or your + vendor. This file may be modified by the user, subject to + the additional terms of the license agreement +--*/ +/*++ + +Copyright (c) 1999 - 2010 Intel Corporation. All rights reserved +This software and associated documentation (if any) is furnished +under a license and may only be used or copied in accordance +with the terms of the license. Except as permitted by such +license, no part of this software or documentation may be +reproduced, stored in a retrieval system, or transmitted in any +form or by any means without the express written consent of +Intel Corporation. + + +Module Name: + + TcgPeiDone.h + +Abstract: + +This file contains PPI GUID installed at the end of TCG component +initialization + +--*/ +#ifndef _PEI_TCGPEIDONE_PPI_H_ +#define _PEI_TCGPEIDONE_PPI_H_ + +// +// This is an indicator GUID without any data. It represents the fact that a PEIM +// has written the address of the PEI_TPM_PPI_GUID into the EFI_PEI_SERVICES +// +#define PEI_TPM_PPI_GUID \ +{ \ + 0xca4853f4, 0xe94b, 0x42b4, 0x86, 0x42, 0xcd, 0xe2, 0x8a, 0x7f, 0xac, 0x2d \ +} + +extern EFI_GUID gPeiTpmPpiGuid; + +#endif diff --git a/Board/EM/Platform/IntelRefVerDisplay/IntelRefVerDisplay.cif b/Board/EM/Platform/IntelRefVerDisplay/IntelRefVerDisplay.cif new file mode 100644 index 0000000..35dcd67 --- /dev/null +++ b/Board/EM/Platform/IntelRefVerDisplay/IntelRefVerDisplay.cif @@ -0,0 +1,12 @@ + + name = "IntelRefVerDisplay" + category = ModulePart + LocalRoot = "Board\EM\Platform\IntelRefVerDisplay" + RefName = "IntelRefVerDisplay" +[files] +"IntelRefVerDisplay.sdl" +"IntelRefVerDisplay.mak" +"IntelRefVerDisplay.sd" +"IntelRefVerDisplay.uni" +"IntelRefVerSetup.c" + diff --git a/Board/EM/Platform/IntelRefVerDisplay/IntelRefVerDisplay.mak b/Board/EM/Platform/IntelRefVerDisplay/IntelRefVerDisplay.mak new file mode 100644 index 0000000..030dbed --- /dev/null +++ b/Board/EM/Platform/IntelRefVerDisplay/IntelRefVerDisplay.mak @@ -0,0 +1,105 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2011, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* + +#************************************************************************* +# $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/IntelRefVerDisplay/IntelRefVerDisplay.mak 4 6/13/12 8:51a Yurenlai $ +# +# $Revision: 4 $ +# +# $Date: 6/13/12 8:51a $ +#************************************************************************* +# Revision History +# ---------------- +# $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/IntelRefVerDisplay/IntelRefVerDisplay.mak $ +# +# 4 6/13/12 8:51a Yurenlai +# [TAG] None +# [Description] 01. Implement Intel Rapid Start Technology RC version +# info. +# 02. Remove DPTF and TxT RefCode version in setup, because +# they are not separate components. +# [Files] IntelRefVerDisplay.mak, IntelRefVerDisplay.sd, +# IntelRefVerDisplay.uni, IntelRefVerSetup.c +# +# 3 4/25/12 1:22p Yurenlai +# [TAG] None +# [Category] Improvement +# [Description] Corrected Setup RC Version info. +# [Files] IntelRefVerDisplay.mak, IntelRefVerSetup.c, AcpiAsl.sdl +# +# 2 2/24/12 1:27a Yurenlai +# Initial IntelRefVerDisplay midule part. +# +# 1 2/09/12 12:39a Yurenlai +# Initial check in. +# +#************************************************************************* +# +# +# Name: IntelRefVerDisplay.mak +# +# Description: MAK file for the IntelRefVerDisplay module +# +# +#************************************************************************* +All : IntelRefVerDisplay + +IntelRefVerDisplay : $(BUILD_DIR)\IntelRefVerDisplay.mak + +SetupSdbs : $(BUILD_DIR)\IntelRefVerDisplay.sdb + +$(BUILD_DIR)\IntelRefVerDisplay.sdb : $(IntelRefVerDisplay_DIR)\$(@B).sd $(IntelRefVerDisplay_DIR)\$(@B).uni + $(STRGATHER) -i INCLUDE -parse -newdb -db $(BUILD_DIR)\$(@B).sdb $(IntelRefVerDisplay_DIR)\$(@B).uni + $(STRGATHER) -scan -db $(BUILD_DIR)\$(@B).sdb -od $(BUILD_DIR)\$(@B).sdb $(IntelRefVerDisplay_DIR)\$(@B).sd + +$(BUILD_DIR)\IntelRefVerDisplay.mak : $(IntelRefVerDisplay_DIR)\$(@B).cif $(IntelRefVerDisplay_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(IntelRefVerDisplay_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +IntelRefVerSetup_INCLUDES= \ +!if "$(INTEL_CPURC_SUPPORT)"=="1" + /I$(CpuProtocolLib_DIR)\ +!endif + /I$(INTEL_SA_PROTOCOL_LIB_DIR)\ + /I$(INTEL_PCH_PROTOCOL_LIB_DIR)\ + /I$(AcpiProtocolLib_DIR)\ +!if "$(iME_SUPPORT)"=="1" + /I$(MeProtocolLib_DIR)\ +!endif +!if "$(IntelTXT_SUPPORT)"=="1" + /I$(TxtProtocolLib_DIR)\ +!endif +!if "$(DigitalThermalSensor_SUPPORT)"=="1" + /I$(DtsProtocolLib_DIR)\ +!endif +!if "$(RapidStart_SUPPORT)"=="1" + /I$(RapidStartProtocolLib_DIR)\ +!endif + +SetupBin : $(BUILD_DIR)\IntelRefVerSetup.obj + +$(BUILD_DIR)\IntelRefVerSetup.obj : $(PROJECT_DIR)\$(IntelRefVerDisplay_DIR)\IntelRefVerSetup.c $(BUILD_DIR)\SetupStrTokens.h + $(CC) $(CFLAGS) $(IntelRefVerSetup_INCLUDES) /Fo$(BUILD_DIR)\ $(IntelRefVerDisplay_DIR)\IntelRefVerSetup.c +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2011, 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/Platform/IntelRefVerDisplay/IntelRefVerDisplay.sd b/Board/EM/Platform/IntelRefVerDisplay/IntelRefVerDisplay.sd new file mode 100644 index 0000000..ee9b912 --- /dev/null +++ b/Board/EM/Platform/IntelRefVerDisplay/IntelRefVerDisplay.sd @@ -0,0 +1,159 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/IntelRefVerDisplay/IntelRefVerDisplay.sd 4 7/11/12 4:01a Yurenlai $ +// +// $Revision: 4 $ +// +// $Date: 7/11/12 4:01a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/IntelRefVerDisplay/IntelRefVerDisplay.sd $ +// +// 4 7/11/12 4:01a Yurenlai +// [TAG] None +// [Category] Improvement +// [Description] Corrected Setup RefCcode Version info. +// [Files] IntelRefVerSetup.cm IntelRefVerDisplay.sd +// +// 3 6/13/12 8:51a Yurenlai +// [TAG] None +// [Description] 01. Implement Intel Rapid Start Technology RC version +// info. +// 02. Remove DPTF and TxT RefCode version in setup, because +// they are not separate components. +// [Files] IntelRefVerDisplay.mak, IntelRefVerDisplay.sd, +// IntelRefVerDisplay.uni, IntelRefVerSetup.c +// +// 2 2/24/12 1:27a Yurenlai +// Initial IntelRefVerDisplay midule part. +// +// 1 2/09/12 12:39a Yurenlai +// Initial check in. +// +//************************************************************************* + +//************************************************************************* +// +// +// Name: IntelRefVerDisplay.sd +// +// Description: Setup file for IntelRefVerDisplay driver. It displays the +// version of Intel RC Driver and its Version String in a form of Advanced +// tab of setup screen +// +// +//************************************************************************* + +#ifdef SETUP_DATA_DEFINITION +// Put NVRAM data definitions here. +// For example: UINT8 Data1; +// These definitions will be converted by the build process +// to a definitions of SETUP_DATA fields. +#endif + +#ifdef ADVANCED_FORM_SET + + #ifdef FORM_SET_ITEM + // Define controls to be added to the main page of the formset + #endif + + #ifdef FORM_SET_GOTO + // Define goto commands for the forms defined in this file + goto INTEL_RC_VERSION_FORM_ID, + prompt = STRING_TOKEN(STR_INTEL_RC_VERSION_FORM), + help = STRING_TOKEN(STR_INTEL_RC_VERSION_FORM_HELP); + #endif + + + #ifdef FORM_SET_FORM + // Define forms + #ifndef INTEL_RC_VERSION_FORM_SETUP + #define INTEL_RC_VERSION_FORM_SETUP + + form formid = AUTO_ID(INTEL_RC_VERSION_FORM_ID), + title = STRING_TOKEN(STR_INTEL_RC_VERSION_FORM); + +#if defined (INTEL_CPURC_SUPPORT) && INTEL_CPURC_SUPPORT + text + help = STRING_TOKEN (STR_INTEL_CPU_RC_VER_HELP), + text = STRING_TOKEN (STR_INTEL_CPU_RC_VER_NAME), + text = STRING_TOKEN (STR_INTEL_CPU_RC_VER_VALUE), + flags = 0, key = 0; +#endif + + text + help = STRING_TOKEN (STR_INTEL_SA_RC_VER_HELP), + text = STRING_TOKEN (STR_INTEL_SA_RC_VER_NAME), + text = STRING_TOKEN (STR_INTEL_SA_RC_VER_VALUE), + flags = 0, key = 0; + + text + help = STRING_TOKEN (STR_INTEL_PCH_RC_VER_HELP), + text = STRING_TOKEN (STR_INTEL_PCH_RC_VER_NAME), + text = STRING_TOKEN (STR_INTEL_PCH_RC_VER_VALUE), + flags = 0, key = 0; + + text + help = STRING_TOKEN (STR_INTEL_ACPI_RC_VER_HELP), + text = STRING_TOKEN (STR_INTEL_ACPI_RC_VER_NAME), + text = STRING_TOKEN (STR_INTEL_ACPI_RC_VER_VALUE), + flags = 0, key = 0; + +#if defined (iME_SUPPORT) && iME_SUPPORT + text + help = STRING_TOKEN (STR_INTEL_ME_RC_VER_HELP), + text = STRING_TOKEN (STR_INTEL_ME_RC_VER_NAME), + text = STRING_TOKEN (STR_INTEL_ME_RC_VER_VALUE), + flags = 0, key = 0; +#endif + +#if defined (DigitalThermalSensor_SUPPORT) && DigitalThermalSensor_SUPPORT + text + help = STRING_TOKEN (STR_INTEL_DTS_RC_VER_HELP), + text = STRING_TOKEN (STR_INTEL_DTS_RC_VER_NAME), + text = STRING_TOKEN (STR_INTEL_DTS_RC_VER_VALUE), + flags = 0, key = 0; +#endif + +#if defined (RapidStart_SUPPORT) && RapidStart_SUPPORT + text + help = STRING_TOKEN (STR_INTEL_RST_RC_VER_HELP), + text = STRING_TOKEN (STR_INTEL_RST_RC_VER_NAME), + text = STRING_TOKEN (STR_INTEL_RST_RC_VER_VALUE), + flags = 0, key = 0; +#endif + + endform; // VERSION_FORM_ID + + #endif // INTEL_RC_VERSION_FORM_SETUP + #endif // FORM_SET_FORM + +#endif // ADVANCED_FORM_SET + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, 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/Platform/IntelRefVerDisplay/IntelRefVerDisplay.sdl b/Board/EM/Platform/IntelRefVerDisplay/IntelRefVerDisplay.sdl new file mode 100644 index 0000000..78bc42a --- /dev/null +++ b/Board/EM/Platform/IntelRefVerDisplay/IntelRefVerDisplay.sdl @@ -0,0 +1,36 @@ +TOKEN + Name = "IntelRefVerDisplay_SUPPORT" + Value = "1" + Help = "Main switch to enable IntelRefVerDisplay support in Project" + TokenType = Boolean + TargetMAK = Yes + TargetH = Yes + Master = Yes +End + +PATH + Name = "IntelRefVerDisplay_DIR" +End + +MODULE + Help = "Includes IntelRefVerDisplay.mak to Project" + File = "IntelRefVerDisplay.mak" +End + +ELINK + Name = "InitIntelVersionInfo," + Parent = "SetupStringInit" + InvokeOrder = AfterParent +End + +ELINK + Name = "$(BUILD_DIR)\IntelRefVerDisplay.sdb" + Parent = "SETUP_SDBS" + InvokeOrder = AfterParent +End + +ELINK + Name = "$(IntelRefVerDisplay_DIR)\IntelRefVerDisplay.sd" + Parent = "SETUP_DEFINITIONS" + InvokeOrder = AfterParent +End diff --git a/Board/EM/Platform/IntelRefVerDisplay/IntelRefVerDisplay.uni b/Board/EM/Platform/IntelRefVerDisplay/IntelRefVerDisplay.uni new file mode 100644 index 0000000..ddd4757 Binary files /dev/null and b/Board/EM/Platform/IntelRefVerDisplay/IntelRefVerDisplay.uni differ diff --git a/Board/EM/Platform/IntelRefVerDisplay/IntelRefVerSetup.c b/Board/EM/Platform/IntelRefVerDisplay/IntelRefVerSetup.c new file mode 100644 index 0000000..ada088a --- /dev/null +++ b/Board/EM/Platform/IntelRefVerDisplay/IntelRefVerSetup.c @@ -0,0 +1,261 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/IntelRefVerDisplay/IntelRefVerSetup.c 5 7/11/12 4:01a Yurenlai $ +// +// $Revision: 5 $ +// +// $Date: 7/11/12 4:01a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/IntelRefVerDisplay/IntelRefVerSetup.c $ +// +// 5 7/11/12 4:01a Yurenlai +// [TAG] None +// [Category] Improvement +// [Description] Corrected Setup RefCcode Version info. +// [Files] IntelRefVerSetup.cm IntelRefVerDisplay.sd +// +// 4 6/13/12 8:51a Yurenlai +// [TAG] None +// [Description] 01. Implement Intel Rapid Start Technology RC version +// info. +// 02. Remove DPTF and TxT RefCode version in setup, because +// they are not separate components. +// [Files] IntelRefVerDisplay.mak, IntelRefVerDisplay.sd, +// IntelRefVerDisplay.uni, IntelRefVerSetup.c +// +// 3 4/25/12 1:22p Yurenlai +// [TAG] None +// [Category] Improvement +// [Description] Corrected Setup RC Version info. +// [Files] IntelRefVerDisplay.mak, IntelRefVerSetup.c, AcpiAsl.sdl +// +// 2 2/24/12 1:28a Yurenlai +// Initial IntelRefVerDisplay midule part. +// +// 1 2/09/12 12:39a Yurenlai +// Initial check in. +// +//************************************************************************* +// +// +// Name: IntelRefVerSetup.c +// +// Description: Display the verison of Intel RC drivers +// +// +//************************************************************************* + +//---------------------------------------------------------------------------- +// Include(s) +//---------------------------------------------------------------------------- +#include +#include +#include +#include +#if defined (INTEL_CPURC_SUPPORT) && INTEL_CPURC_SUPPORT +#include +#endif +#include +#include +#include +#if defined (iME_SUPPORT) && iME_SUPPORT +#include +#endif +#if defined (IntelTXT_SUPPORT) && IntelTXT_SUPPORT +#include +#endif +#if defined (DigitalThermalSensor_SUPPORT) && DigitalThermalSensor_SUPPORT +#include +#endif +#if defined (RapidStart_SUPPORT) && RapidStart_SUPPORT +#include +#endif + +// +//--------------------------------------------------------------------------- +// +// Name: UpdateStringValue +// +// Description: Update the value of Intel RC drivers string +// +// Input: UINT32 RCVersion - Intel RC driver version +// STRING_REF StrRef - String Token defining which string in the database +// +// Output: VOID +// +//--------------------------------------------------------------------------- +// + +VOID +UpdateStringValue( + EFI_HII_HANDLE HiiHandle, + UINT32 RCVersion, + STRING_REF StrRef +) +{ + UINT8 x, y, z, w; + + x = (UINT8) ((RCVersion & 0xFF000000) >> 24); + y = (UINT8) ((RCVersion & 0xFF0000) >> 16); + z = (UINT8) ((RCVersion & 0xFF00) >> 8); + w = (UINT8) ((RCVersion & 0xFF)); + + InitString ( HiiHandle, + StrRef, + L"%d.%d.%d.%d", + x, y, z, w); +} + +// +//--------------------------------------------------------------------------- +// +// Name: InitIntelVersionInfo +// +// Description: This function will fullfill the puspose to retrive the version +// of Intel RC Drivers and put into variables of IntelRefVerDisplay.uni file. +// +// Input: EFI_HII_HANDLE HiiHandle +// +// Output: VOID +// +//--------------------------------------------------------------------------- +// + +VOID +InitIntelVersionInfo( + EFI_HII_HANDLE HiiHandle, + UINT16 Class +) +{ + EFI_STATUS Status; +#if defined (INTEL_CPURC_SUPPORT) && INTEL_CPURC_SUPPORT + EFI_GUID gDxeCpuInfoProtocolGuid = DXE_CPU_INFO_PROTOCOL_GUID; + DXE_CPU_INFO_PROTOCOL *CpuInfo; +#endif + EFI_GUID gEfiSaInfoProtocolGuid = EFI_SA_INFO_PROTOCOL_GUID; + EFI_SA_INFO_PROTOCOL *SaInfo; + EFI_GUID gEfiPchInfoProtocolGuid = EFI_PCH_INFO_PROTOCOL_GUID; + EFI_PCH_INFO_PROTOCOL *PchInfo; + EFI_GUID gEfiAcpiInfoProtocolGuid = EFI_ACPI_INFO_PROTOCOL_GUID; + EFI_ACPI_INFO_PROTOCOL *AcpiInfo; +#if defined (iME_SUPPORT) && iME_SUPPORT + EFI_GUID gEfiMeRcInfoProtocolGuid = EFI_ME_RC_INFO_PROTOCOL_GUID; + EFI_ME_RC_INFO_PROTOCOL *MeInfo; +#endif +#if defined (DigitalThermalSensor_SUPPORT) && DigitalThermalSensor_SUPPORT + EFI_GUID gEfiDtsInfoProtocolGuid = EFI_DTS_INFO_PROTOCOL_GUID; + EFI_DTS_INFO_PROTOCOL *DtsInfo; +#endif +#if defined (RapidStart_SUPPORT) && RapidStart_SUPPORT + EFI_GUID gRapidStartInfoProtocolGuid = RAPID_START_INFO_PROTOCOL_GUID; + RAPID_START_INFO_PROTOCOL *RSTInfo; +#endif + + if (Class != ADVANCED_FORM_SET_CLASS) { + return; + } + +#if defined (INTEL_CPURC_SUPPORT) && INTEL_CPURC_SUPPORT + Status = pBS->LocateProtocol(&gDxeCpuInfoProtocolGuid, + NULL, + &CpuInfo); + if (!EFI_ERROR (Status)) { + UpdateStringValue(HiiHandle, + CpuInfo->RcVersion, + STRING_TOKEN (STR_INTEL_CPU_RC_VER_VALUE)); + } +#endif + + // System Agent RefCode Version. + Status = pBS->LocateProtocol(&gEfiSaInfoProtocolGuid, + NULL, + &SaInfo); + if (!EFI_ERROR (Status)) { + UpdateStringValue(HiiHandle, + SaInfo->RCVersion, + STRING_TOKEN (STR_INTEL_SA_RC_VER_VALUE)); + } + + // Pch RefCode Version. + Status = pBS->LocateProtocol(&gEfiPchInfoProtocolGuid, + NULL, + &PchInfo); + if (!EFI_ERROR (Status)) { + UpdateStringValue(HiiHandle, + PchInfo->RCVersion, + STRING_TOKEN (STR_INTEL_PCH_RC_VER_VALUE)); + } + + // ACPI RefCode Version. + Status = pBS->LocateProtocol(&gEfiAcpiInfoProtocolGuid, + NULL, + &AcpiInfo); + if (!EFI_ERROR (Status)) { + UpdateStringValue(HiiHandle, + AcpiInfo->RCVersion, + STRING_TOKEN (STR_INTEL_ACPI_RC_VER_VALUE)); + }; + +#if defined (iME_SUPPORT) && iME_SUPPORT + Status = pBS->LocateProtocol(&gEfiMeRcInfoProtocolGuid, + NULL, + &MeInfo); + if (!EFI_ERROR (Status)) { + UpdateStringValue(HiiHandle, + MeInfo->RCVersion, + STRING_TOKEN (STR_INTEL_ME_RC_VER_VALUE)); + } +#endif + +#if defined (DigitalThermalSensor_SUPPORT) && DigitalThermalSensor_SUPPORT + Status = pBS->LocateProtocol(&gEfiDtsInfoProtocolGuid, + NULL, + &DtsInfo); + if (!EFI_ERROR (Status)) { + UpdateStringValue(HiiHandle, + DtsInfo->RCVersion, + STRING_TOKEN (STR_INTEL_DTS_RC_VER_VALUE)); + } +#endif + +#if defined (RapidStart_SUPPORT) && RapidStart_SUPPORT + Status = pBS->LocateProtocol(&gRapidStartInfoProtocolGuid, + NULL, + &RSTInfo); + if (!EFI_ERROR (Status)) { + UpdateStringValue(HiiHandle, + RSTInfo->RCVersion, + STRING_TOKEN (STR_INTEL_RST_RC_VER_VALUE)); + } +#endif + + return; +} +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Board/EM/Platform/Library/Dxe/DxeKscLib/DxeKscLib.c b/Board/EM/Platform/Library/Dxe/DxeKscLib/DxeKscLib.c new file mode 100644 index 0000000..f48c576 --- /dev/null +++ b/Board/EM/Platform/Library/Dxe/DxeKscLib/DxeKscLib.c @@ -0,0 +1,288 @@ + +#include +#include +#include "KscLib.h" + +EFI_CPU_IO_PROTOCOL *mDxeKscLibCpuIo; + +BOOLEAN mDxeKscLibInitialized = FALSE; +extern EFI_BOOT_SERVICES *pBS; + +// +// Function implemenations +// +EFI_STATUS +InitializeKscLib ( + VOID + ) +/*++ + +Routine Description: + + Initialize the library. + The DXE library only requires CPU IO protocol, so this will locate CPU IO protocol + and save it for future use. + +Arguments: + + None. + +Returns: + + EFI_SUCCESS - KscLib is successfully initialized. + +--*/ +{ + EFI_STATUS Status; + UINT8 Data; + + // + // Locate CpuIo protocol + // + + Status = pBS->LocateProtocol (&gEfiCpuIoProtocolGuid, NULL, &mDxeKscLibCpuIo); + ASSERT_EFI_ERROR (Status); + + // + // Fail if EC doesn't exist. + // + mDxeKscLibCpuIo->Io.Read (mDxeKscLibCpuIo, EfiCpuIoWidthUint8, KSC_C_PORT, 1, &Data); + if(Data == 0xff){ + mDxeKscLibInitialized = FALSE; + Status = EFI_DEVICE_ERROR; + } else { + mDxeKscLibInitialized = TRUE; + Status = EFI_SUCCESS; + } + return Status; +} + +EFI_STATUS +SendKscCommand ( + UINT8 Command + ) +/*++ + +Routine Description: + + Sends command to Keyboard System Controller. + +Arguments: + + Command - Command byte to send + +Returns: + + EFI_SUCCESS - Command success + EFI_DEVICE_ERROR - Command error + +--*/ +{ + UINTN Index; + UINT8 KscStatus; + EFI_STATUS Status; + + KscStatus = 0; + Index = 0; + + // + // Locate CpuIo protocol + // + + Status = pBS->LocateProtocol (&gEfiCpuIoProtocolGuid, NULL, &mDxeKscLibCpuIo); + ASSERT_EFI_ERROR (Status); + + // + // Wait for KSC to be ready (with a timeout) + // + ReceiveKscStatus (&KscStatus); + while (((KscStatus & KSC_S_IBF) != 0) && (Index < KSC_TIME_OUT)) { + pBS->Stall (15); + ReceiveKscStatus (&KscStatus); + Index++; + } + if (Index >= KSC_TIME_OUT) { + return EFI_DEVICE_ERROR; + } + + // + // Send the KSC command + // + Status = mDxeKscLibCpuIo->Io.Write ( + mDxeKscLibCpuIo, + EfiCpuIoWidthUint8, + KSC_C_PORT, + 1, + &Command + ); + ASSERT_EFI_ERROR (Status); + + return EFI_SUCCESS; +} + +EFI_STATUS +ReceiveKscStatus ( + UINT8 *KscStatus + ) +/*++ + +Routine Description: + + Receives status from Keyboard System Controller. + +Arguments: + + Status - Status byte to receive + +Returns: + + EFI_SUCCESS - Always success + +--*/ +{ + EFI_STATUS Status = EFI_SUCCESS; + + // + // Locate CpuIo protocol + // + + Status = pBS->LocateProtocol (&gEfiCpuIoProtocolGuid, NULL, &mDxeKscLibCpuIo); + ASSERT_EFI_ERROR (Status); + + // + // Read and return the status + // + Status = mDxeKscLibCpuIo->Io.Read ( + mDxeKscLibCpuIo, + EfiCpuIoWidthUint8, + KSC_C_PORT, + 1, + KscStatus + ); + ASSERT_EFI_ERROR (Status); + + return EFI_SUCCESS; +} + +EFI_STATUS +SendKscData ( + UINT8 Data + ) +/*++ + +Routine Description: + + Sends data to Keyboard System Controller. + +Arguments: + + Data - Data byte to send + +Returns: + + EFI_SUCCESS - Success + EFI_TIMEOUT - Timeout + Other - Failed + +--*/ +{ + UINTN Index; + UINT8 KscStatus; + EFI_STATUS Status = EFI_SUCCESS; + + Index = 0; + + // + // Locate CpuIo protocol + // + Status = pBS->LocateProtocol (&gEfiCpuIoProtocolGuid, NULL, &mDxeKscLibCpuIo); + ASSERT_EFI_ERROR (Status); + + // + // Wait for KSC to be ready (with a timeout) + // + ReceiveKscStatus (&KscStatus); + while (((KscStatus & KSC_S_IBF) != 0) && (Index < KSC_TIME_OUT)) { + pBS->Stall (15); + ReceiveKscStatus (&KscStatus); + Index++; + } + if (Index >= KSC_TIME_OUT) { + return EFI_DEVICE_ERROR; + } + + // + // Send the data and return + // + Status = mDxeKscLibCpuIo->Io.Write ( + mDxeKscLibCpuIo, + EfiCpuIoWidthUint8, + KSC_D_PORT, + 1, + &Data + ); + ASSERT_EFI_ERROR (Status); + + return EFI_SUCCESS; +} + +EFI_STATUS +ReceiveKscData ( + UINT8 *Data + ) +/*++ + +Routine Description: + + Receives data from Keyboard System Controller. + +Arguments: + + Data - Data byte received + +Returns: + + EFI_SUCCESS - Read success + EFI_DEVICE_ERROR - Read error + +--*/ +{ + UINTN Index; + UINT8 KscStatus; + EFI_STATUS Status = EFI_SUCCESS; + + Index = 0; + + // + // Locate CpuIo protocol + // + + Status = pBS->LocateProtocol (&gEfiCpuIoProtocolGuid, NULL, &mDxeKscLibCpuIo); + ASSERT_EFI_ERROR (Status); + // + // Wait for KSC to be ready (with a timeout) + // + ReceiveKscStatus (&KscStatus); + while (((KscStatus & KSC_S_OBF) == 0) && (Index < KSC_TIME_OUT)) { + pBS->Stall (15); + ReceiveKscStatus (&KscStatus); + Index++; + } + if (Index >= KSC_TIME_OUT) { + return EFI_DEVICE_ERROR; + } + + // + // Read KSC data and return + // + Status = mDxeKscLibCpuIo->Io.Read ( + mDxeKscLibCpuIo, + EfiCpuIoWidthUint8, + KSC_D_PORT, + 1, + Data + ); + ASSERT_EFI_ERROR (Status); + + return EFI_SUCCESS; +} diff --git a/Board/EM/Platform/Library/Dxe/DxeKscLib/DxeKscLib.cif b/Board/EM/Platform/Library/Dxe/DxeKscLib/DxeKscLib.cif new file mode 100644 index 0000000..887e0f7 --- /dev/null +++ b/Board/EM/Platform/Library/Dxe/DxeKscLib/DxeKscLib.cif @@ -0,0 +1,11 @@ + + name = "DxeKscLib" + category = ModulePart + LocalRoot = "Board\EM\Platform\Library\Dxe\DxeKscLib" + RefName = "DxeKscLib" +[files] +"DxeKscLib.sdl" +"DxeKscLib.mak" +"DxeKscLib.c" +"KscLib.h" + diff --git a/Board/EM/Platform/Library/Dxe/DxeKscLib/DxeKscLib.mak b/Board/EM/Platform/Library/Dxe/DxeKscLib/DxeKscLib.mak new file mode 100644 index 0000000..d60b49e --- /dev/null +++ b/Board/EM/Platform/Library/Dxe/DxeKscLib/DxeKscLib.mak @@ -0,0 +1,65 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2011, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* + +#************************************************************************* +# $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/IntelPlatformProtocolLib/DxeKscLib/DxeKscLib.mak 1 2/09/12 12:39a Yurenlai $ +# +# $Revision: 1 $ +# +# $Date: 2/09/12 12:39a $ +#************************************************************************* +# Revision History +# ---------------- +# $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/IntelPlatformProtocolLib/DxeKscLib/DxeKscLib.mak $ +# +# 1 2/09/12 12:39a Yurenlai +# Initial check in. +# +#************************************************************************* +# +# +# Name: .mak +# +# Description: +# +# +#********************************************************************** +all : DxeKscLib + +$(BUILD_DIR)\DxeKscLib.lib : DxeKscLib + +DxeKscLib : $(BUILD_DIR)\DxeKscLib.mak DxeKscLibBin + +$(BUILD_DIR)\DxeKscLib.mak : $(DxeKscLib_DIR)\$(@B).cif $(DxeKscLib_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(DxeKscLib_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +DxeKscLibBin : $(EFIDRIVERLIB) + $(MAKE) /$(MAKEFLAGS) $(BUILD_DEFAULTS)\ + /f $(BUILD_DIR)\DxeKscLib.mak all\ + "CFLAGS=$(CFLAGS) "\ + TYPE=LIBRARY \ + +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2011, 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/Platform/Library/Dxe/DxeKscLib/DxeKscLib.sdl b/Board/EM/Platform/Library/Dxe/DxeKscLib/DxeKscLib.sdl new file mode 100644 index 0000000..677ad94 --- /dev/null +++ b/Board/EM/Platform/Library/Dxe/DxeKscLib/DxeKscLib.sdl @@ -0,0 +1,40 @@ +TOKEN + Name = "INTEL_CRB_DXE_KSC_LIB_SUPPORT" + Value = "1" + Help = "Main switch to enable INTEL_CRB_DXE_KSC_LIB(EC:H8)support in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes +End + +PATH + Name = "DxeKscLib_DIR" +End + +MODULE + Help = "Includes DxeKscLib.mak to Project" + File = "DxeKscLib.mak" +End + +ELINK + Name = "DxeKscLib_LIB" + InvokeOrder = ReplaceParent +End + +ELINK + Name = "$(BUILD_DIR)\DxeKscLib.lib" + Parent = "DxeKscLib_LIB" + InvokeOrder = AfterParent +End + +ELINK + Name = "DxeKscLib_INCLUDES" + InvokeOrder = ReplaceParent +End + +ELINK + Name = "/I $(DxeKscLib_DIR)" + Parent = "DxeKscLib_INCLUDES" + InvokeOrder = AfterParent +End diff --git a/Board/EM/Platform/Library/Dxe/DxeKscLib/KscLib.h b/Board/EM/Platform/Library/Dxe/DxeKscLib/KscLib.h new file mode 100644 index 0000000..2aee1c7 --- /dev/null +++ b/Board/EM/Platform/Library/Dxe/DxeKscLib/KscLib.h @@ -0,0 +1,260 @@ + +#ifndef _KSC_LIB_H_ +#define _KSC_LIB_H_ + +// +// Include files +// +///#include "Tiano.h" + +// +// Timeout if KSC command/data fails +// +#define KSC_TIME_OUT 0x20000 + +// +// The Keyboard and System management Controller (KSC) implements a standard 8042 keyboard +// controller interface at ports 0x60/0x64 and a ACPI compliant system management controller +// at ports 0x62/0x66. Port 0x66 is the command and status port, port 0x62 is the data port. +// +#define KSC_D_PORT 0x62 +#define KSC_C_PORT 0x66 + +// +// Status Port 0x62 +// +#define KSC_S_OVR_TMP 0x80 // Current CPU temperature exceeds the threshold +#define KSC_S_SMI_EVT 0x40 // SMI event is pending +#define KSC_S_SCI_EVT 0x20 // SCI event is pending +#define KSC_S_BURST 0x10 // KSC is in burst mode or normal mode +#define KSC_S_CMD 0x08 // Byte in data register is command/data +#define KSC_S_IGN 0x04 // Ignored +#define KSC_S_IBF 0x02 // Input buffer is full/empty +#define KSC_S_OBF 0x01 // Output buffer is full/empty + +// +// KSC commands that are issued to the KSC through the command port (0x66). +// New commands and command parameters should only be written by the host when IBF=0. +// Data read from the KSC data port is valid only when OBF=1. +// +#define KSC_C_SMI_NOTIFY_ENABLE 0x04 // Enable SMI notifications to the host +#define KSC_C_SMI_NOTIFY_DISABLE 0x05 // SMI notifications are disabled and pending notifications cleared +#define KSC_C_QUERY_SYS_STATUS 0x06 // Returns 1 byte of information about the system status +#define KSC_B_SYS_STATUS_FAN 0x40 // Fan status (1 = ON) +#define KSC_B_SYS_STATUS_DOCK 0x20 // Dock status (1 = Docked) +#define KSC_B_SYS_STATUS_AC 0x10 // AC power (1 = AC powered) +#define KSC_B_SYS_STATUS_THERMAL 0x0F // CPU thermal state (0 ~ 9) +#define KSC_C_FAB_ID 0x0D // Get the board fab ID in the lower 3 bits +#define KSC_C_SYSTEM_POWER_OFF 0x22 // Turn off the system power +#define KSC_C_LAN_ON 0x46 // Turn on the power to LAN through EC/KSC +#define KSC_C_LAN_OFF 0x47 // Turn off the power to LAN through EC/KSC +#define KSC_C_GET_TEMP 0x50 // Returns the CPU temperature as read from the SMBus thermal sensor. +#define KSC_C_SET_CTEMP 0x58 // The next byte written to the data port will be the shutdown temperature +#define KSC_EC_PCH_SMBUS_EN 0x60 // EC PCH SMBus thermal monitoring Enable cmd +#define KSC_EC_PCH_SMBUS_DIS 0x61 // EC PCH SMBus thermal monitoring Disable cmd +#define KSC_TS_ON_DIMM_EN 0x6B // TS-on-DIMM thermal monitoring enable command +#define KSC_TS_ON_DIMM_DIS 0x6C // TS-on-DIMM thermal monitoring disable command +#define KSC_C_PCH_SMBUS_MSG_LENGTH 0x6D // PCH SMBus block read buffer length +#define KSC_C_PCH_SMBUS_PEC_EN 0x6E // PCH SMBus Packet Error Checking (PEC) Enable command. +#define KSC_C_PCH_SMBUS_PEC_DIS 0x76 // PCH SMBus Packet Error Checking (PEC) Disable command. +#define KSC_C_EC_SMBUS_HIGH_SPEED 0x75 // EC SMBus high speed mode command +#define KSC_EC_PCH_SMBUS_WRITE_EN 0x68 // EC PCH SMBus Write Enable cmd +#define KSC_EC_PCH_SMBUS_WRITE_DIS 0x69 // EC PCH SMBus Write Disable cmd +#define KSC_C_SMI_QUERY 0x70 // The host reads the data port to retrieve the notifications +#define KSC_C_SMI_TIMER 0x71 // Commands the KSC to generate a periodic SMI to the host +#define KSC_C_SMI_HOTKEY 0x72 // Get the scan code of hotkey pressed (CTRL + ALT + SHIFT + key) +#define KSC_C_READ_MEM 0x80 // Read the KSC memory +#define KSC_C_WRITE_MEM 0x81 // Write the KSC memory +#define KSC_C_DOCK_STATUS 0x8A // Get the dock status +#define KSC_B_DOCK_STATUS_ATTACH 0x01 // Dock status (1 = Attach) +#define KSC_C_KSC_REVISION 0x90 // Get the revision for the KSC +#define KSC_C_SMI_INJECT 0xBA // The next byte written to the data port will generate an immediate SMI +#define KSC_C_SMI_DISABLE 0xBC // SMI generation by the KSC is disabled +#define KSC_C_SMI_ENABLE 0xBD // SMI generation by the KSC is enabled +#define KSC_C_ACPI_ENABLE 0xAA // Enable ACPI mode +#define KSC_C_ACPI_DISABLE 0xAB // Disable ACPI mode + +// +// KSC commands that are only valid if the EC has ACPI mode enabled. +// Note that capacity and voltage are 16 bit values, thus you need to read them from +// ACPI space with two reads (little Endian). +// +#define KSC_VIRTUAL_BAT_STATUS 48 // Status of the virtual battery (present) +#define KSC_VIRTUAL_BAT_PRESENT_MASK 0x10 // Bit 4 is the indicator + +#define KSC_REAL_BAT1_STATUS 50 // Status of the first real battery (present, charging) +#define KSC_REAL_BAT1_REMAINING_CAPACITY 89 // Remaining capacity in mWh +#define KSC_REAL_BAT1_RESOLUTION_VOLTAGE 93 // Full resolution voltage in mV + +#define KSC_REAL_BAT2_STATUS 54 // Status of the second real battery (present, charging) +#define KSC_REAL_BAT2_REMAINING_CAPACITY 99 // Remaining capacity in mWh +#define KSC_REAL_BAT2_RESOLUTION_VOLTAGE 103 // Full resolution voltage in mV + +#define KSC_REAL_BAT_PRESENT_MASK 0x8 // Bit 3 is the indicator +#define KSC_REAL_BAT_CHARGING_MASK 0x1 // Bit 1 is the indicator + +// +// SMI notification code table, read through command KSC_C_SMI_QUERY +// +#define KSC_N_SMI_NULL 0x00 // Null marks the end of the SMI notification queue +#define KSC_N_SMI_HOTKEY 0x20 // Hotkey pressed SMI +#define KSC_N_SMI_ACINSERTION 0x30 // AC insertion SMI +#define KSC_N_SMI_ACREMOVAL 0x31 // AC removal SMI +#define KSC_N_SMI_PWRSW 0x32 // Power switch press SMI +#define KSC_N_SMI_LID 0x33 // Lid switch change SMI +#define KSC_N_SMI_VB 0x34 // Virtual battery switch change SMI +#define KSC_N_SMI_THERM_0 0x60 // Thermal state 0 SMI +#define KSC_N_SMI_THERM_1 0x61 // Thermal state 1 SMI +#define KSC_N_SMI_THERM_2 0x62 // Thermal state 2 SMI +#define KSC_N_SMI_THERM_3 0x63 // Thermal state 3 SMI +#define KSC_N_SMI_THERM_4 0x64 // Thermal state 4 SMI +#define KSC_N_SMI_THERM_5 0x65 // Thermal state 5 SMI +#define KSC_N_SMI_THERM_6 0x66 // Thermal state 6 SMI +#define KSC_N_SMI_THERM_7 0x67 // Thermal state 7 SMI +#define KSC_N_SMI_THERM_8 0x68 // Thermal state 8 SMI +#define KSC_N_SMI_DOCKED 0x70 // Dock complete SMI +#define KSC_N_SMI_UNDOCKED 0x71 // Undock complete SMI +#define KSC_N_SMI_UNDOCKREQUEST 0x72 // Undocking request SMI +#define KSC_N_SMI_TIMER 0x80 // Timer wakeup SMI + +// +// Hotkey scan code (CTRL + ALT + SHIFT + key) +// +#define KSC_HK_ESC 0x01 // ESC +#define KSC_HK_1 0x02 // 1 ! +#define KSC_HK_2 0x03 // 2 @ +#define KSC_HK_3 0x04 // 3 # +#define KSC_HK_4 0x05 // 4 $ +#define KSC_HK_5 0x06 // 5 % +#define KSC_HK_6 0x07 // 6 ^ +#define KSC_HK_7 0x08 // 7 & +#define KSC_HK_8 0x09 // 8 * +#define KSC_HK_9 0x0A // 9 ( +#define KSC_HK_0 0x0B // 0 ) +#define KSC_HK_MINUS 0x0C // - _ +#define KSC_HK_ADD 0x0D // = + +#define KSC_HK_F1 0x3B // F1 +#define KSC_HK_F2 0x3C // F2 +#define KSC_HK_F3 0x3D // F3 +#define KSC_HK_F4 0x3E // F4 +#define KSC_HK_F5 0x3F // F5 +#define KSC_HK_F6 0x40 // F6 +#define KSC_HK_F7 0x41 // F7 +#define KSC_HK_F8 0x42 // F8 +#define KSC_HK_F9 0x43 // F9 +#define KSC_HK_F10 0x44 // F10 +#define KSC_HK_F11 0x57 // F11 +#define KSC_HK_F12 0x58 // F12 + +// +// Function declarations +// +EFI_STATUS +InitializeKscLib ( + VOID + ); +/*++ + +Routine Description: + + This function initializes the KSC library. + It must be called before using any of the other KSC library functions. + +Arguments: + + None. + +Returns: + + EFI_SUCCESS - KscLib is successfully initialized. + +--*/ + +EFI_STATUS +SendKscCommand ( + UINT8 Command + ); +/*++ + +Routine Description: + + Send a command to the Keyboard System Controller. + +Arguments: + + Command - Command byte to send + +Returns: + + EFI_SUCCESS - Command success + EFI_TIMEOUT - Command timeout + Other - Command failed + +--*/ + +EFI_STATUS +SendKscData ( + UINT8 Data + ); +/*++ + +Routine Description: + + Sends data to Keyboard System Controller. + +Arguments: + + Data - Data byte to send + +Returns: + + EFI_SUCCESS - Success + EFI_TIMEOUT - Timeout + Other - Failed + +--*/ + +EFI_STATUS +ReceiveKscData ( + UINT8 *Data + ); +/*++ + +Routine Description: + + Receives data from Keyboard System Controller. + +Arguments: + + Data - Data byte received + +Returns: + + EFI_SUCCESS - Read success + EFI_TIMEOUT - Read timeout + Other - Read failed + +--*/ + +EFI_STATUS +ReceiveKscStatus ( + UINT8 *KscStatus + ); +/*++ + +Routine Description: + + Receives status from Keyboard System Controller. + +Arguments: + + Status - Status byte to receive + +Returns: + + EFI_SUCCESS - Success + Other - Failed + +--*/ + +#endif diff --git a/Board/EM/Platform/Library/IntelPlatformProtocolLib.cif b/Board/EM/Platform/Library/IntelPlatformProtocolLib.cif new file mode 100644 index 0000000..37defe0 --- /dev/null +++ b/Board/EM/Platform/Library/IntelPlatformProtocolLib.cif @@ -0,0 +1,13 @@ + + name = "IntelPlatformProtocolLib" + category = ModulePart + LocalRoot = "Board\EM\Platform\Library" + RefName = "IntelPlatformProtocolLib" +[files] +"IntelPlatformProtocolLib.sdl" +"IntelPlatformProtocolLib.mak" +"Protocol\GlobalNvsArea\GlobalNvsArea.h" +"Protocol\GlobalNvsArea\GlobalNvsArea.c" +[parts] +"DxeKscLib" + diff --git a/Board/EM/Platform/Library/IntelPlatformProtocolLib.mak b/Board/EM/Platform/Library/IntelPlatformProtocolLib.mak new file mode 100644 index 0000000..e87ad62 --- /dev/null +++ b/Board/EM/Platform/Library/IntelPlatformProtocolLib.mak @@ -0,0 +1,64 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2011, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* + +#************************************************************************* +# $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/IntelPlatformProtocolLib/IntelPlatformProtocolLib.mak 1 2/09/12 12:38a Yurenlai $ +# +# $Revision: 1 $ +# +# $Date: 2/09/12 12:38a $ +#************************************************************************* +# Revision History +# ---------------- +# $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/IntelPlatformProtocolLib/IntelPlatformProtocolLib.mak $ +# +# 1 2/09/12 12:38a Yurenlai +# Initial check in. +# +#************************************************************************* +# +# +# Name: .mak +# +# Description: +# +# +#********************************************************************** +all : IntelPlatformProtocolLib + +$(BUILD_DIR)\IntelPlatformProtocolLib.lib : IntelPlatformProtocolLib + +IntelPlatformProtocolLib : $(BUILD_DIR)\IntelPlatformProtocolLib.mak IntelPlatformProtocolLibBin + +$(BUILD_DIR)\IntelPlatformProtocolLib.mak : $(IntelPlatformProtocolLib_DIR)\$(@B).cif $(IntelPlatformProtocolLib_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(IntelPlatformProtocolLib_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +IntelPlatformProtocolLibBin : + $(MAKE) /$(MAKEFLAGS) $(EDK_DEFAULTS)\ + /f $(BUILD_DIR)\IntelPlatformProtocolLib.mak all\ + "MY_INCLUDES= /I$(MISCFRAMEWORK_DIR) $(EDK_INCLUDES) $(INTEL_PLATFORM_PROTOCOL_INCLUDES)" \ + TYPE=LIBRARY \ +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2011, 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/Platform/Library/IntelPlatformProtocolLib.sdl b/Board/EM/Platform/Library/IntelPlatformProtocolLib.sdl new file mode 100644 index 0000000..85a786e --- /dev/null +++ b/Board/EM/Platform/Library/IntelPlatformProtocolLib.sdl @@ -0,0 +1,47 @@ +TOKEN + Name = "INTEL_PLATFORM_PROTOCOL_LIB_SUPPORT" + Value = "1" + Help = "Main switch to enable INTEL_PLATFORM_PROTOCOL_LIB support in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes +End + +PATH + Name = "IntelPlatformProtocolLib_DIR" +End + +MODULE + Help = "Includes IntelPlatformProtocolLib.mak to Project" + File = "IntelPlatformProtocolLib.mak" +End + +ELINK + Name = "INTEL_PLATFORM_PROTOCOL_INCLUDES" + InvokeOrder = ReplaceParent +End + +ELINK + Name = "/I$(PROJECT_DIR)\Board\EM\Platform" + Parent = "INTEL_PLATFORM_PROTOCOL_INCLUDES" + InvokeOrder = AfterParent +End + +ELINK + Name = "/I$(PROJECT_DIR)\Board\EM\Platform\Library" + Parent = "INTEL_PLATFORM_PROTOCOL_INCLUDES" + InvokeOrder = AfterParent +End + +ELINK + Name = "IntelPlatformProtocolLib_LIB" + InvokeOrder = ReplaceParent +End + +ELINK + Name = "$(BUILD_DIR)\IntelPlatformProtocolLib.lib" + Parent = "IntelPlatformProtocolLib_LIB" + InvokeOrder = AfterParent +End + diff --git a/Board/EM/Platform/Library/Protocol/GlobalNvsArea/GlobalNvsArea.c b/Board/EM/Platform/Library/Protocol/GlobalNvsArea/GlobalNvsArea.c new file mode 100644 index 0000000..dfa84f8 --- /dev/null +++ b/Board/EM/Platform/Library/Protocol/GlobalNvsArea/GlobalNvsArea.c @@ -0,0 +1,37 @@ +/*++ + +Copyright (c) 1999 - 2010 Intel Corporation. All rights reserved +This software and associated documentation (if any) is furnished +under a license and may only be used or copied in accordance +with the terms of the license. Except as permitted by such +license, no part of this software or documentation may be +reproduced, stored in a retrieval system, or transmitted in any +form or by any means without the express written consent of +Intel Corporation. + + +Module Name: + + GlobalNvsArea.c + +Abstract: + + Global NVS Area description protocol implementation. + +--*/ +/*++ + This file contains an 'Intel Peripheral Driver' and is + licensed for Intel CPUs and chipsets under the terms of your + license agreement with Intel or your vendor. This file may + be modified by the user, subject to additional terms of the + license agreement +--*/ + + +#include "Tiano.h" + +#include EFI_PROTOCOL_DEFINITION (GlobalNvsArea) + +EFI_GUID gEfiGlobalNvsAreaProtocolGuid = EFI_GLOBAL_NVS_AREA_PROTOCOL_GUID; + +EFI_GUID_STRING (&gEfiGlobalNvsAreaProtocolGuid, "Global NVS Area Protocol", "Protocol describing ACPI NVS memory region used by ACPI subsystem."); diff --git a/Board/EM/Platform/Library/Protocol/GlobalNvsArea/GlobalNvsArea.h b/Board/EM/Platform/Library/Protocol/GlobalNvsArea/GlobalNvsArea.h new file mode 100644 index 0000000..da4d4ee --- /dev/null +++ b/Board/EM/Platform/Library/Protocol/GlobalNvsArea/GlobalNvsArea.h @@ -0,0 +1,535 @@ +/*++ + This file contains a 'Sample Driver' and is licensed as such + under the terms of your license agreement with Intel or your + vendor. This file may be modified by the user, subject to + the additional terms of the license agreement +--*/ + +/*++ + +Copyright (c) 1999 - 2010 Intel Corporation. All rights reserved +This software and associated documentation (if any) is furnished +under a license and may only be used or copied in accordance +with the terms of the license. Except as permitted by such +license, no part of this software or documentation may be +reproduced, stored in a retrieval system, or transmitted in any +form or by any means without the express written consent of +Intel Corporation. + + +Module Name: + + GlobalNvsArea.h + +Abstract: + + Definition of the global NVS area protocol. This protocol + publishes the address and format of a global ACPI NVS buffer used as a communications + buffer between SMM code and ASL code. + The format is derived from the ACPI reference code, version 0.95. + + Note: Data structures defined in this protocol are not naturally aligned. + +--*/ + +#ifndef _GLOBAL_NVS_AREA_H_ +#define _GLOBAL_NVS_AREA_H_ + +// +// Includes +// + + +// +// Forward reference for pure ANSI compatability +// +EFI_FORWARD_DECLARATION (EFI_GLOBAL_NVS_AREA_PROTOCOL); + +// +// Global NVS Area Protocol GUID +// +#define EFI_GLOBAL_NVS_AREA_PROTOCOL_GUID \ + { \ + 0x74e1e48, 0x8132, 0x47a1, 0x8c, 0x2c, 0x3f, 0x14, 0xad, 0x9a, 0x66, 0xdc \ + } +// +// Global NVS Area Protocol GUID +// +#define EFI_GLOBAL_SANVS_AREA_PROTOCOL_GUID \ + { \ + 0x9f8083d3, 0x292c, 0x4f8f, 0x88, 0x79, 0xca, 0xcc, 0x8e, 0x63, 0xed, 0x67 \ + } +// +// Revision id - Added TPM related fields +// +#define GLOBAL_NVS_AREA_REVISION_1 1 +// +// Extern the GUID for protocol users. +// +extern EFI_GUID gEfiGlobalNvsAreaProtocolGuid; +extern EFI_GUID gEfiGlobalSaNvsAreaProtocolGuid; + +// +// Global NVS Area definition +// +#pragma pack (1) +typedef struct { + // + // Miscellaneous Dynamic Values, the definitions below need to be matched + // GNVS definitions in Platform.ASL + // + UINT16 OperatingSystem; // (000) Operating System + UINT8 SmiFunction; // (002) SMI Function Call (ASL to SMI via I/O Trap) + UINT8 SmiParameter0; // (003) SMIF - Parameter 0 + UINT8 SmiParameter1; // (004) SMIF - Parameter 1 + UINT8 SciFunction; // (005) SCI Function Call (SMI to ASL via _L00) + UINT8 SciParameter0; // (006) SCIF - Parameter 0 + UINT8 SciParameter1; // (007) SCIF - Parameter 1 + UINT8 GlobalLock; // (008) Global Lock Function Call (EC Communication) + UINT8 LockParameter0; // 009) LCKF - Parameter 0 + UINT8 LockParameter1; // (010) LCKF - Parameter 1 + UINT32 Port80DebugValue; // (011) Port 80 Debug Port Value + UINT8 PowerState; // (015) Power State (AC Mode = 1) + UINT8 DebugState; // (016) Debug State + + + // + // Thermal Policy Values + // + UINT8 THOF; // (017) Enable Thermal Offset for KSC + UINT8 Ac1TripPoint; // (018) Active Trip Point 1 + UINT8 Ac0TripPoint; // (019) Active Trip Point + UINT8 PassiveThermalTripPoint; // (020) Passive Trip Point + UINT8 PassiveTc1Value; // (021) Passive Trip Point TC1 Value + UINT8 PassiveTc2Value; // (022) Passive Trip Point TC2 Value + UINT8 PassiveTspValue; // (023) Passive Trip Point TSP Value + UINT8 CriticalThermalTripPoint; // (024) Critical Trip Point + UINT8 EnableDigitalThermalSensor; // (025) Digital Thermal Sensor Enable + UINT8 BspDigitalThermalSensorTemperature; // (026) Digital Thermal Sensor 1 Reading + UINT8 ApDigitalThermalSensorTemperature; // (027) Digital Thermal Sensor 2 Reading + UINT8 DigitalThermalSensorSmiFunction; // (028) DTS SMI Function Call + UINT8 Reserved[1]; // (029) + + // + // Battery Support Registers: (Moved outside this ASL code but still in used) + // + UINT8 NumberOfBatteries; // (030) Battery Number Present + UINT8 BatteryCapacity0; // (031) Battery 0 Stored Capacity + UINT8 BatteryCapacity1; // (032) Battery 1 Stored Capacity + UINT8 BatteryCapacity2; // (033) Battery 2 Stored Capacity + UINT8 BatteryStatus0; // (034) Battery 0 Stored Status + UINT8 BatteryStatus1; // (035) Battery 1 Stored Status + UINT8 BatteryStatus2; // (036) Battery 2 Stored Status + + // NOTE: Do NOT Change the Offset of Revision Field + UINT8 Revision; // (037) Revision of the structure EFI_GLOBAL_NVS_AREA + UINT8 Reserved3[2]; // (038:039) + + // + // Processor Configuration Values + // + UINT8 ApicEnable; // (040) APIC Enabled by SBIOS (APIC Enabled = 1) + UINT8 ThreadCount; // (041) Number of Enabled Threads + UINT8 CurentPdcState0; // (042) PDC settings, Processor 0 + UINT8 CurentPdcState1; // (043) PDC settings, Processor 1 + UINT8 MaximumPpcState; // (044) Maximum PPC state + UINT32 PpmFlags; // (045) PPM configuration flags, same as CFGD + UINT8 C6C7Latency; // (049) C6/C7 Entry/Exit latency + + // + // SIO Configuration Values + // + UINT8 DockedSioPresent; // (050) Dock SIO Present + UINT8 DockComA; // (051) COM A Port + UINT8 DockComB; // (052) COM B Port + UINT8 DockLpt; // (053) LPT Port + UINT8 DockFdc; // (054) FDC Port + UINT8 SmscComPort; // (055) SMSC Com Port + UINT8 SmscComCirPort; // (056) SMSC Com CIR Port + UINT8 SMSC1007; // (057) SMSC1007 SIO Present + UINT8 WPCN381U; // (058) WPCN381U SIO Present + UINT8 SMSC1000; // (059) SMSC1000 SIO Present + + // + // Extended Mobile Access Values + // + UINT8 EmaEnable; // (060) EMA Enable + UINT16 EmaPointer; // (061) EMA Pointer + UINT16 EmaLength; // (063:064) EMA Length + + UINT8 Reserved8[1]; // (065) + + // + // Mobile East Fork Values + // + UINT8 MefEnable; // (066) Mobile East Fork Enable + + // + // PCIe Dock Status + // + UINT8 PcieDockStatus; // (067) PCIe Dock Status + + UINT8 Reserved9[4]; // (068:071) + + // + // TPM Registers + // + UINT8 MorData; // (072) Memory Overwrite Request Data + UINT8 TcgParamter; // (073) Used for save the Mor and/or physical presence paramter + UINT32 PPResponse; // (074) Physical Presence request operation response + UINT8 PPRequest; // (078) Physical Presence request operation + UINT8 LastPPRequest; // (079) Last Physical Presence request operation + + // + // SATA Values + // + UINT8 GtfTaskFileBufferPort0[7]; // (080) GTF Task File Buffer for Port 0 + UINT8 GtfTaskFileBufferPort2[7]; // (087) GTF Task File Buffer for Port 2 + UINT8 IdeMode; // (094) IDE Mode (Compatible\Enhanced) + UINT8 GtfTaskFileBufferPort1[7]; // (095) GTF Task File Buffer for Port 1 + + // + // Board Id + // This field is for the ASL code to know whether this board is Matanzas, or Oakmont, etc + // + UINT16 BoardId; // (102) Platform board id + UINT8 PlatformId; // (104) Platform id + UINT8 ECTG; // (105) Toggle EC + UINT8 Reserved10[6]; // 106:111 + UINT8 PcieOSCControl; // (112) PCIE OSC Control + UINT8 NativePCIESupport; // (113) Native PCI Express Support + + // + // USB Sideband Deferring Support + // + UINT8 HostAlertVector1; // (114) GPE vector used for HOST_ALERT#1 + UINT8 HostAlertVector2; // (115) GPE vector used for HOST_ALERT#2 + + UINT8 Reserved11[6]; // 116:121 + UINT8 DosDisplaySupportFlag; // (122) _DOS Display Support Flag. + UINT8 EcAvailable; // (123) Embedded Controller Availability Flag. + UINT8 GPIC; // (124) Global IOAPIC/8259 Interrupt Mode Flag. + UINT8 CTYP; // (125) Global Cooling Type Flag. + UINT8 L01C; // (126) Global L01 Counter. + UINT8 VFN0; // (127) Virtual Fan0 Status. + UINT8 VFN1; // (128) Virtual Fan1 Status. + UINT8 VFN2; // (129) Virtual Fan2 Status. + UINT8 VFN3; // (130) Virtual Fan3 Status. + UINT8 VFN4; // (131) Virtual Fan4 Status. + UINT8 VFN5; // (132) Virtual Fan5 Status. + UINT8 VFN6; // (133) Virtual Fan6 Status. + UINT8 VFN7; // (134) Virtual Fan7 Status. + UINT8 VFN8; // (135) Virtual Fan8 Status. + UINT8 VFN9; // (136) Virtual Fan9 Status. + UINT8 Reserved12[6]; // 137:142 + + // + // Thermal + // + UINT8 ActiveThermalTripPointSA; // (143) Active Trip Point for MCH + UINT8 PassiveThermalTripPointSA; // (144) Passive Trip Point for MCH + UINT8 ActiveThermalTripPointTMEM; // (145) Active Trip Point for TMEM + UINT8 PassiveThermalTripPointTMEM; // (146) Passive Trip Point for TMEM + UINT32 PlatformCpuId; // (147) CPUID Feature Information [EAX] + UINT32 TBARB; // (151) Thermal Base Low Address for BIOS + UINT32 TBARBH; // (155) Thermal Base High Address for BIOS + UINT8 RunTimeInterface; // (159) Run Time Interface for Intelligent Power Savings + UINT8 TsOnDimmEnabled; // (160) TS-on-DIMM is chosen in SETUP and present on the DIMM + UINT8 ActiveThermalTripPointPCH; // (161) Active Trip Point for PCH + UINT8 PassiveThermalTripPointPCH; // (162) Passive Trip Point for PCH + + // + // Board info + // + UINT8 PlatformFlavor; // (163) Platform Flavor + UINT8 BoardRev; // (164) Board Rev + + // Package temperature + UINT8 PackageDTSTemperature; // (165) Package Temperature + UINT8 IsPackageTempMSRAvailable; // (166) Package Temperature MSR available + UINT8 PeciAccessMethod; // (167) PECI Access Method (Direct I/O or ACPI) + UINT8 Ac0FanSpeed; // (168) _AC0 Fan Speed + UINT8 Ac1FanSpeed; // (169) _AC1 Fan Speed + // New Thermal Policy Values for DTS. + UINT8 Ap2DigitalThermalSensorTemperature; // (170) Temperature of the second AP + UINT8 Ap3DigitalThermalSensorTemperature; // (171) Temperature of the third AP + UINT8 Reserved16[4]; // (172):(175) are reserved for future use + + UINT8 LTRE1; // (176) Latency Tolerance Reporting Enable + UINT8 LTRE2; // (177) Latency Tolerance Reporting Enable + UINT8 LTRE3; // (178) Latency Tolerance Reporting Enable + UINT8 LTRE4; // (179) Latency Tolerance Reporting Enable + UINT8 LTRE5; // (180) Latency Tolerance Reporting Enable + UINT8 LTRE6; // (181) Latency Tolerance Reporting Enable + UINT8 LTRE7; // (182) Latency Tolerance Reporting Enable + UINT8 LTRE8; // (183) Latency Tolerance Reporting Enable + + UINT8 OBFF1; // (184) Optimized Buffer Flush and Fill + UINT8 OBFF2; // (185) Optimized Buffer Flush and Fill + UINT8 OBFF3; // (186) Optimized Buffer Flush and Fill + UINT8 OBFF4; // (187) Optimized Buffer Flush and Fill + UINT8 OBFF5; // (188) Optimized Buffer Flush and Fill + UINT8 OBFF6; // (189) Optimized Buffer Flush and Fill + UINT8 OBFF7; // (190) Optimized Buffer Flush and Fill + UINT8 OBFF8; // (191) Optimized Buffer Flush and Fill + + UINT8 XhciMode; // (192) xHCI controller mode + UINT32 XTUBaseAddress; // (193) XTU Continous structure Base Address + UINT32 XTUSize; // (197) XTU Entries Size + UINT32 XMPBaseAddress; // (201) XTU Base Address + UINT8 DDRReferenceFreq; // (205) DDR Reference Frequency + + UINT8 Rtd3Support; // (206) Runtime D3 support. + UINT8 Rtd3P0dl; // (207) User selctable Delay for Device D0 transition. + UINT8 Rtd3P3dl; // (208) User selctable Delay for Device D3 transition. + // + // DPTF Devices and trip points + // + UINT8 EnableDptfDevice; // (209) EnableDptfDevice + + UINT8 EnableSaDevice; // (210) EnableSaDevice + UINT8 CriticalThermalTripPointSA; // (211) CriticalThermalTripPointSa + UINT8 HotThermalTripPointSA; // (212) HotThermalTripPointSa + + UINT8 EnablePchDevice; // (213) EnablePchDevice + UINT8 CriticalThermalTripPointPCH; // (214) CriticalThermalTripPointPch + UINT8 HotThermalTripPointPCH; // (215) HotThermalTripPointPch + // + // DPTF Policies + // + UINT8 EnableCtdpPolicy; // (216) EnableCtdpPolicy + UINT8 EnableLpmPolicy; // (217) EnableLpmPolicy + UINT8 CurrentLowPowerMode; // (218) CurrentLowPowerMode for LPM + UINT8 EnableCurrentExecutionUnit; // (219) EnableCurrentExecutionUnit + UINT16 TargetGfxFreq; // (220:221) TargetGfxFreq + // + // DPPM Devices and trip points + // + UINT8 EnableMemoryDevice; // (222) EnableMemoryDevice + UINT8 CriticalThermalTripPointTMEM; // (223) CriticalThermalTripPointTMEM + UINT8 HotThermalTripPointTMEM; // (224) HotThermalTripPointTMEM + + UINT8 EnableFan1Device; // (225) EnableFan1Device + UINT8 EnableFan2Device; // (226) EnableFan2Device + + UINT8 EnableAmbientDevice; // (227) EnableAmbientDevice + UINT8 ActiveThermalTripPointAmbient; // (228) ActiveThermalTripPointAmbient + UINT8 PassiveThermalTripPointAmbient; // (229) PassiveThermalTripPointAmbient + UINT8 CriticalThermalTripPointAmbient;// (230) CriticalThermalTripPointAmbient + UINT8 HotThermalTripPointAmbient; // (231) HotThermalTripPointAmbient + + UINT8 EnableSkinDevice; // (232) EnableSkinDevice + UINT8 ActiveThermalTripPointSkin; // (233) ActiveThermalTripPointSkin + UINT8 PassiveThermalTripPointSkin; // (234) PassiveThermalTripPointSkin + UINT8 CriticalThermalTripPointSkin; // (235) CriticalThermalTripPointSkin + UINT8 HotThermalTripPointSkin; // (236) HotThermalTripPointSkin + + UINT8 EnableExhaustFanDevice; // (237) EnableExhaustFanDevice + UINT8 ActiveThermalTripPointExhaustFan; // (238) ActiveThermalTripPointExhaustFan + UINT8 PassiveThermalTripPointExhaustFan; // (239) PassiveThermalTripPointExhaustFan + UINT8 CriticalThermalTripPointExhaustFan; // (240) CriticalThermalTripPointExhaustFan + UINT8 HotThermalTripPointExhaustFan; // (241) HotThermalTripPointExhaustFan + + UINT8 EnableVRDevice; // (242) EnableVRDevice + UINT8 ActiveThermalTripPointVR; // (243) ActiveThermalTripPointVR + UINT8 PassiveThermalTripPointVR; // (244) PassiveThermalTripPointVR + UINT8 CriticalThermalTripPointVR; // (245) CriticalThermalTripPointVR + UINT8 HotThermalTripPointVR; // (246) HotThermalTripPointVR + // + // DPPM Policies + // + UINT8 EnableActivePolicy; // (247) EnableActivePolicy + UINT8 EnablePassivePolicy; // (248) EnablePassivePolicy + UINT8 EnableCriticalPolicy; // (249) EnableCriticalPolicy + UINT8 EnableCoolingModePolicy; // (250) EnableCoolingModePolicy + UINT8 TrtRevision; // (251) TrtRevision + // + // CLPO (Current Logical Processor Off lining Setting) + // + UINT8 LPOEnable; // (252) LPOEnable + UINT8 LPOStartPState; // (253) LPOStartPState + UINT8 LPOStepSize; // (254) LPOStepSize + UINT8 LPOPowerControlSetting; // (255) LPOPowerControlSetting + UINT8 LPOPerformanceControlSetting; // (256) LPOPerformanceControlSetting + // + // Miscellaneous DPTF + // + UINT32 PpccStepSize; // (257:260) PPCC Step Size + UINT8 EnableDisplayParticipant; // (261) EnableDisplayParticipant + // + // PFAT + // + UINT64 PfatMemAddress; // (262:269) PFAT Memory Address for Tool Interface + UINT8 PfatMemSize; // (270) PFAT Memory Size for Tool Interface + UINT16 PfatIoTrapAddress; // (271) PFAT IoTrap Address for Tool Interface + // + // Smart Connect Technology + // + UINT8 IsctCfg; // (273) Isct Configuration + // + // Audio DSP + // + UINT32 DspBar0; // (274) Audio DSP BAR0 + UINT32 DspBar1; // (278) Audio DSP BAR1 + // + // NFC support + // + UINT8 NFCEnable; // (282) NFC module selection + // + // ADSP Codec Selection + // + UINT8 AudioDspCodec; // (283) Audio Codec selection + // + // Sensor Hub Enable + // + UINT8 SensorHubEnable; // (284) Sensor Hub Enable + + UINT8 LowPowerS0Idle; // (285) Low Power S0 Idle Enable + + // + // BIOS only version of Config TDP + // + UINT8 ConfigTdpBios; // (286) enable/disable BIOS only version of Config TDP + + UINT8 Reserved17[232]; // (287):(518) are reserved for future use + UINT8 EnablePowerDevice; // (519) EnablePowerDevice + UINT8 EnablePowerPolicy; // (520) EnablePowerPolicy + UINT8 UsbPowerResourceTest; // (521) RTD3 USB Power Resource config + // + // Intel Serial(R) IO Sensor Device Selection + // + UINT8 SDS0; // (522) I2C0 Sensor Device Selection + UINT16 SDS1; // (523) I2C1 Sensor Device Selection + UINT8 SDS2; // (525) SPI0 Sensor Device Selection + UINT8 SDS3; // (526) SPI1 Sensor Device Selection + UINT8 SDS4; // (527) UART0 Sensor Device Selection + UINT8 SDS5; // (528) UART1 Sensor Device Selection + UINT8 Reserved20[1]; // (529) 529 no longer used. + UINT8 RIC0; // (530) RTD3 support for I2C0 SH + UINT8 PepDevice; // (531) RTD3 PEP support list(BIT0 - GFx , BIT1 - Sata, BIT2 - UART, BIT3 - SDHC, Bit4 - I2C0, BIT5 - I2C1, Bit6 - XHCI, Bit7 - Audio) + UINT8 DVS0; // (532) Port0 DevSlp Enable + UINT8 DVS1; // (533) Port1 DevSlp Enable + UINT8 DVS2; // (534) Port2 DevSlp Enable + UINT8 DVS3; // (535) Port3 DevSlp Enable + UINT8 GBSX; // (536) Virtual GPIO button Notify Sleep State Change + UINT8 IUBE; // (537) IUER Button Enable + UINT8 IUCE; // (538) IUER Convertible Enable + UINT8 IUDE; // (539) IUER Dock Enable + UINT8 ECNO; // (540) EC Notification of Low Power S0 Idle State + UINT16 AUDD; // (541) RTD3 Audio Codec device delay + UINT16 DSPD; // (543) RTD3 ADSP device delay + UINT16 IC0D; // (545) RTD3 SensorHub delay time after applying power to device + UINT16 IC1D; // (547) RTD3 TouchPanel delay time after applying power to device + UINT16 IC1S; // (549) RTD3 TouchPad delay time after applying power to device + UINT16 VRRD; // (551) VR Ramp up delay + UINT8 PSCP; // (553) P-state Capping + UINT8 RWAG; // (554) Rtd3 W/A Gpio, allow W/A for port 1 and 6 to use GPIO from SDHC device + UINT16 I20D; // (555) Delay in _PS0 after powering up I2C0 Controller + UINT16 I21D; // (557) Delay in _PS0 after powering up I2C1 Controller + + UINT8 Reserved18[2]; // (559:560) are reserved for future use + UINT8 RCG0; // (561) RTD3 Config Setting(BIT0:ZPODD,BIT1:USB Camera Port4, BIT2/3:SATA Port3) + UINT8 ECDB; // (562) EC Debug Light (CAPS LOCK) for when in Low Power S0 Idle State + UINT8 P2ME; // (563) Ps2 Mouse Enable + + UINT16 SSH0; // (564) SSCN-LOW for I2C0 + UINT16 SSL0; // (566) SSCN-HIGH for I2C0 + UINT16 SSD0; // (568) SSCN-HOLD for I2C0 + UINT16 FMH0; // (570) FMCN-LOW for I2C0 + UINT16 FML0; // (572) FMCN-HIGH for I2C0 + UINT16 FMD0; // (574) FMCN-HOLD for I2C0 + UINT16 FPH0; // (576) FPCN-LOW for I2C0 + UINT16 FPL0; // (578) FPCN-HIGH for I2C0 + UINT16 FPD0; // (580) FPCN-HOLD for I2C0 + UINT16 SSH1; // (582) SSCN-LOW for I2C1 + UINT16 SSL1; // (584) SSCN-HIGH for I2C1 + UINT16 SSD1; // (586) SSCN-HOLD for I2C1 + UINT16 FMH1; // (588) FMCN-LOW for I2C1 + UINT16 FML1; // (590) FMCN-HIGH for I2C1 + UINT16 FMD1; // (592) FMCN-HOLD for I2C1 + UINT16 FPH1; // (594) FPCN-LOW for I2C1 + UINT16 FPL1; // (596) FPCN-HIGH for I2C1 + UINT16 FPD1; // (598) FPCN-HOLD for I2C1 + UINT16 M0C0; // (600) M0D3 for I2C0 + UINT16 M1C0; // (602) M1D3 for I2C0 + UINT16 M2C0; // (604) M0D0 for I2C0 + UINT16 M0C1; // (606) M0D3 for I2C1 + UINT16 M1C1; // (608) M1D3 for I2C1 + UINT16 M2C1; // (610) M0D0 for I2C1 + UINT16 M0C2; // (612) M0D3 for SPI0 + UINT16 M1C2; // (614) M1D3 for SPI0 + UINT16 M0C3; // (616) M0D3 for SPI1 + UINT16 M1C3; // (618) M1D3 for SPI1 + UINT16 M0C4; // (620) M0D3 for UA00 + UINT16 M1C4; // (622) M1D3 for UA00 + UINT16 M0C5; // (624) M0D3 for UA01 + UINT16 M1C5; // (626) M1D3 for UA01 + UINT8 TBSF; // (628) ThunderBolt SMI Function Number + UINT32 GIRQ; // (629) GPIO IRQ + UINT8 DMTP; // (633) PIRQS 34,50(GPIO) + UINT8 DMTD; // (634) PIRQX 39,55(GPIO) + UINT8 DMSH; // (635) PIRQM 28,14(GPIO) + UINT8 LANP; // (636) LAN PHY Status 0 = Not Present, 1 = Present + UINT8 Reserved19[1]; // (637) 637 no longer used. + UINT8 SHSB; // (638) Sensor Standby mode + UINT8 PL1LimitCS; // (639) set PL1 limit when entering CS + UINT16 PL1LimitCSValue; // (640) PL1 limit value + UINT8 GN1E; // (642) EnableGen1Participant + UINT8 G1AT; // (643) ActiveThermalTripPointGen1 + UINT8 G1PT; // (644) PassiveThermalTripPointGen1 + UINT8 G1CT; // (645) CriticalThermalTripPointGen1 + UINT8 G1HT; // (646) HotThermalTripPointGen1 + UINT8 GN2E; // (647) EnableGen2Participant + UINT8 G2AT; // (648) ActiveThermalTripPointGen2 + UINT8 G2PT; // (649) PassiveThermalTripPointGen2 + UINT8 G2CT; // (650) CriticalThermalTripPointGen2 + UINT8 G2HT; // (651) HotThermalTripPointGen2 + UINT8 WWSD; // (652) EnableWwanTempSensorDevice + UINT8 CVSD; // (653) EnableCpuVrTempSensorDevice + UINT8 SSDD; // (654) EnableSsdTempSensorDevice + UINT8 INLD; // (655) EnableInletFanTempSensorDevice + UINT8 IFAT; // (656) ActiveThermalTripPointInletFan + UINT8 IFPT; // (657) PassiveThermalTripPointInletFan + UINT8 IFCT; // (658) CriticalThermalTripPointInletFan + UINT8 IFHT; // (659) HotThermalTripPointInletFan + UINT8 DOSD; // (660) DMA OS detection, 1 = check for OS version when enabling DMA, 0 = don't care about OS + UINT8 USBH; // (661) USB Sensor Hub Enable/Disable + UINT8 BCV4; // (662) Broadcom's Bluetooth adapter's revision + UINT8 WTV0; // (663) I2C0/WITT devices version + UINT8 WTV1; // (664) I2C1/WITT devices version + UINT8 APFU; // (665) Atmel panel FW update Enable/Disable + UINT8 SOHP; // (666) SMI on Hot Plug for TBT devices + UINT8 NOHP; // (667) Notify on Hot Plug for TBT devices + UINT8 TBSE; // (668) ThunderBolt Root port selector + UINT8 WKFN; // (669) WAK Finished + UINT16 PEPC; // (670) PEP Constraints + UINT16 VRSD; // (672) VR Staggering delay + UINT8 PB1E; // (674) 10sec Power button support Bit0: 10 sec P-button Enable/Disable + // Bit1: Internal Flag + // Bit2: Rotation Lock flag, 0:unlock, 1:lock + // Bit3: Slate/Laptop Mode Flag, 0: Slate, 1: Laptop + // Bit4: Undock / Dock Flag, 0: Undock, 1: Dock + // Bit5, 6: reserved for future use. + // Bit7: EC 10sec PB Override state for S3/S4 wake up. + UINT8 WAND; // (675) EnableWWANParticipant + UINT8 WWAT; // (676) ActiveThermalTripPointWWAN + UINT8 WWPT; // (677) PassiveThermalTripPointWWAN + UINT8 WWCT; // (678) CriticalThermalTripPointWWAN + UINT8 WWHT; // (679) HotThermalTripPointWWAN + UINT8 Reserved21[5]; // (680:684) are reserved for future use + UINT16 MPLT; // (685) Minimum Power Limit for DPTF use via PPCC Object + UINT8 GR13; // (687) GPIO13 Rework for Sawtooth Peak + UINT8 SPST; // (688) SATA port state, Bit0 - Port0, Bit1 - Port1, Bit2 - Port2, Bit3 - Port3 + UINT8 ECLP; // (689) EC Low Power Mode: 1 - Enabled, 0 - Disabled + UINT8 INSC; // (690) Intel RMT Configuration +} EFI_GLOBAL_NVS_AREA; +#pragma pack () + +// +// Global NVS Area Protocol +// +typedef struct _EFI_GLOBAL_NVS_AREA_PROTOCOL { + EFI_GLOBAL_NVS_AREA *Area; +} EFI_GLOBAL_NVS_AREA_PROTOCOL; + +#endif diff --git a/Board/EM/Platform/PlatformInfo/PlatformInfo.c b/Board/EM/Platform/PlatformInfo/PlatformInfo.c new file mode 100644 index 0000000..cb6910f --- /dev/null +++ b/Board/EM/Platform/PlatformInfo/PlatformInfo.c @@ -0,0 +1,166 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/PlatformInfo/PlatformInfo.c 4 10/31/12 4:28a Alanlin $ +// +// $Revision: 4 $ +// +// $Date: 10/31/12 4:28a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/PlatformInfo/PlatformInfo.c $ +// +// 4 10/31/12 4:28a Alanlin +// [TAG] None +// [Category] Improvement +// [Description] Fine tune Platform Board Information. +// +// 3 7/03/12 1:27a Yurenlai +// [TAG] None +// [Category] Improvement +// [Description] Update Shark Bay Client ACPI Reference Code Alpha 2 +// 0.6.0. +// [Files] ReferenceCode\AcpiTables\*.*, GlobalNvsArea.h, +// AcpiPlatform.c, PlatformInfo.c, PlatformEC.asl +// +// 2 4/05/12 7:45a Yurenlai +// [TAG] None +// [Category] Improvement +// [Severity] Important +// [Description] Fixed building error for Intel System Agent +// Label:"4.6.5.3_Intel_SA-RC_055_004". +// [Files] PlatformSetupInfo.c, PlatformSetupInfo.mak, +// AcpiPlatform.c, PlatformInfo.c +// +// 1 2/09/12 12:33a Yurenlai +// Initial check in. +// +//************************************************************************* +// +//--------------------------------------------------------------------------- +// +// Name: PlatformInfo.c +// +// Description: Installs EFI_PLATFORM_INFO_PROTOCOL_GUID +// +//--------------------------------------------------------------------------- +// + +#include "PlatformInfo.h" +#include "Token.h" +#include +#include +#include +#include +#include + +EFI_GUID gPlatformInfoProtocolGuid = EFI_PLATFORM_INFO_PROTOCOL_GUID; + +PLATFORM_INFO_PROTOCOL mPlatformInfoProtocol; + +EFI_STATUS +PlatformInfoInit ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +/*++ + +Routine Description: + Entry point for the driver. + + This routine gets info from the PlatformInfoHob and produces a protocol + to be consumed by DXE drivers to identify platforms. + +Arguments: + + ImageHandle - Image Handle. + SystemTable - EFI System Table. + +Returns: + + EFI_SUCCESS - Function has completed successfully. + Others - All other error conditions encountered result in an ASSERT. + +--*/ +{ + EFI_STATUS Status; + UINT16 McDeviceId; + UINT16 LpcDeviceId; + PCH_SERIES PchSeries = GetPchSeries(); + + InitAmiLib(ImageHandle,SystemTable); + // + // Get PlatformInfo from the HOB data, fill up the protocol + // + mPlatformInfoProtocol.RevisonId = PlatformInfo_RevisonId; + mPlatformInfoProtocol.BoardId = PlatformInfo_BoardId; + mPlatformInfoProtocol.BoardRev = PlatformInfo_BoardRev; + + // Read MC device ID + McDeviceId = READ_PCI16_NB(R_SA_MC_DEVICE_ID); + // Read PCH device ID + LpcDeviceId = READ_PCI16_SB(R_PCH_LPC_DEVICE_ID); + + if(IS_SA_DEVICE_ID_MOBILE(McDeviceId)) { + mPlatformInfoProtocol.PlatformFlavor = FlavorMobile; + if (PchSeries == PchLp) { + mPlatformInfoProtocol.BoardId = BoardIdhiteTipMountain1; + } + mPlatformInfoProtocol.BoardRev = (mPlatformInfoProtocol.BoardId & 0xF0) >> 4; + + } else if(IS_SA_DEVICE_ID_DESKTOP (McDeviceId)) { + if(IS_PCH_LPT_LPC_DEVICE_ID_WS (LpcDeviceId)) { + mPlatformInfoProtocol.PlatformFlavor = FlavorWorkStation; + } else if(IS_PCH_LPT_LPC_DEVICE_ID_SERVER (LpcDeviceId)) { + mPlatformInfoProtocol.PlatformFlavor = FlavorUpServer; + } else { + mPlatformInfoProtocol.PlatformFlavor = FlavorDesktop; + mPlatformInfoProtocol.BoardId = BoardIdFlatheadCreek; + mPlatformInfoProtocol.BoardRev = 0; + } + } else if(IS_SA_DEVICE_ID_SERVER (McDeviceId)) { + mPlatformInfoProtocol.PlatformFlavor = FlavorUpServer; + } else { + mPlatformInfoProtocol.PlatformFlavor = FlavorDesktop; + } + + // + // Install the PlatformInfo Protocol. + // + Status = pBS->InstallProtocolInterface ( + &ImageHandle, + &gPlatformInfoProtocolGuid, + EFI_NATIVE_INTERFACE, + &mPlatformInfoProtocol + ); + ASSERT_EFI_ERROR (Status); + + return EFI_SUCCESS; +} + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, 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/Platform/PlatformInfo/PlatformInfo.cif b/Board/EM/Platform/PlatformInfo/PlatformInfo.cif new file mode 100644 index 0000000..0456b11 --- /dev/null +++ b/Board/EM/Platform/PlatformInfo/PlatformInfo.cif @@ -0,0 +1,12 @@ + + name = "PlatformInfo" + category = ModulePart + LocalRoot = "Board\EM\Platform\PlatformInfo" + RefName = "PlatformInfo" +[files] +"PlatformInfo.sdl" +"PlatformInfo.mak" +"PlatformInfo.dxs" +"PlatformInfo.c" +"PlatformInfo.h" + diff --git a/Board/EM/Platform/PlatformInfo/PlatformInfo.dxs b/Board/EM/Platform/PlatformInfo/PlatformInfo.dxs new file mode 100644 index 0000000..1477e36 --- /dev/null +++ b/Board/EM/Platform/PlatformInfo/PlatformInfo.dxs @@ -0,0 +1,59 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/PlatformInfo/PlatformInfo.dxs 1 2/09/12 12:33a Yurenlai $ +// +// $Revision: 1 $ +// +// $Date: 2/09/12 12:33a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/PlatformInfo/PlatformInfo.dxs $ +// +// 1 2/09/12 12:33a Yurenlai +// Initial check in. +// +//************************************************************************* + +// +//---------------------------------------------------------------------------- +// +// Name: PlatformInfo.DXS +// +// Description: This file is the dependency file for the PlatformInfo driver. +// +//---------------------------------------------------------------------------- +// + + +DEPENDENCY_START + TRUE +DEPENDENCY_END + + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Board/EM/Platform/PlatformInfo/PlatformInfo.h b/Board/EM/Platform/PlatformInfo/PlatformInfo.h new file mode 100644 index 0000000..6ee5a1c --- /dev/null +++ b/Board/EM/Platform/PlatformInfo/PlatformInfo.h @@ -0,0 +1,74 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/PlatformInfo/PlatformInfo.h 2 10/31/12 4:28a Alanlin $ +// +// $Revision: 2 $ +// +// $Date: 10/31/12 4:28a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/PlatformInfo/PlatformInfo.h $ +// +// 2 10/31/12 4:28a Alanlin +// [TAG] None +// [Category] Improvement +// [Description] Fine tune Platform Board Information. +// +// 1 2/09/12 12:33a Yurenlai +// Initial check in. +// +//************************************************************************* + + +#ifndef _PLATFORM_INFO_DRIVER_H_ +#define _PLATFORM_INFO_DRIVER_H_ + +#include "EFI.h" + +#define EFI_PLATFORM_INFO_PROTOCOL_GUID \ + { \ + 0xd9035175, 0x8ce2, 0x47de, 0xa8, 0xb8, 0xcc, 0x98, 0xe5, 0xe2, 0xa8, 0x85 \ + } + +EFI_FORWARD_DECLARATION (PLATFORM_INFO_PROTOCOL); + +typedef struct _PLATFORM_INFO_PROTOCOL { + UINT8 RevisonId; // Structure Revision ID + UINT8 PlatformFlavor; // Platform Flavor + UINT16 BoardId; // Board ID + UINT8 BoardRev; // Board Revision +} PLATFORM_INFO_PROTOCOL; + +extern EFI_GUID gPlatformInfoProtocolGuid; + + +#endif + + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Board/EM/Platform/PlatformInfo/PlatformInfo.mak b/Board/EM/Platform/PlatformInfo/PlatformInfo.mak new file mode 100644 index 0000000..bc32739 --- /dev/null +++ b/Board/EM/Platform/PlatformInfo/PlatformInfo.mak @@ -0,0 +1,82 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2011, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* + +#************************************************************************* +# $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/PlatformInfo/PlatformInfo.mak 1 2/09/12 12:33a Yurenlai $ +# +# $Revision: 1 $ +# +# $Date: 2/09/12 12:33a $ +#************************************************************************* +# Revision History +# ---------------- +# $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/PlatformInfo/PlatformInfo.mak $ +# +# 1 2/09/12 12:33a Yurenlai +# Initial check in. +# +#************************************************************************* +# +# +# Name: PlatformInfo.mak +# +# Description: This make file builds AcpiPlatform module DXE +# components and link them to respective binary +# +# +#************************************************************************* + +#--------------------------------------------------------------------------- +# Create PLATFORMINFO DXE Component +#--------------------------------------------------------------------------- +all : PlatformInfo + +PlatformInfo : $(BUILD_DIR)\PlatformInfo.mak PlatformInfoBin + +$(BUILD_DIR)\PlatformInfo.mak : $(PlatformInfo_DIR)\PlatformInfo.cif $(PlatformInfo_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(PlatformInfo_DIR)\PlatformInfo.cif $(CIF2MAK_DEFAULTS) + +PLATFORM_INFO_INCLUDES = \ + $(ACPI_PLATFORM_INCLUDES)\ + $(INTEL_MCH_INCLUDES)\ + $(INTEL_PCH_INCLUDES) + +PLATFORM_INFO_DEFINES = $(MY_DEFINES) $(MCH_DEFINES)\ + + +PlatformInfoBin: $(AMIDXELIB) $(AMICSPLib) + $(MAKE) /$(MAKEFLAGS) $(BUILD_DEFAULTS)\ + /f $(BUILD_DIR)\PlatformInfo.mak all \ + "MY_INCLUDES=$(PLATFORM_INFO_INCLUDES)"\ + GUID=1314216C-CB8D-421c-B854-06231386E642\ + ENTRY_POINT=PlatformInfoInit \ + TYPE=BS_DRIVER\ + DEPEX1=$(PlatformInfo_DIR)\PlatformInfo.dxs\ + DEPEX1_TYPE=EFI_SECTION_DXE_DEPEX\ + COMPRESS=1 + + +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2011, 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/Platform/PlatformInfo/PlatformInfo.sdl b/Board/EM/Platform/PlatformInfo/PlatformInfo.sdl new file mode 100644 index 0000000..8d7ff46 --- /dev/null +++ b/Board/EM/Platform/PlatformInfo/PlatformInfo.sdl @@ -0,0 +1,93 @@ +TOKEN + Name = "PlatformInfo_SUPPORT" + Value = "1" + Help = "Main switch to enable PlatformInfo support in Project" + TokenType = Boolean + TargetMAK = Yes + Master = Yes +End + +TOKEN + Name = "PlatformInfo_RevisonId" + Value = "0x01" + Help = "BoardId Red Fort" + TokenType = Integer + TargetMAK = Yes + TargetH = Yes +End + +TOKEN + Name = "PlatformInfo_PlatformFlavor" + Value = "$(FlavorDesktop)" + Help = "BoardId Red Fort" + TokenType = Integer + TargetMAK = Yes + TargetH = Yes + Token = "PCH_SKU" "=" "0" +End + +TOKEN + Name = "PlatformInfo_PlatformFlavor" + Value = "$(FlavorMobile)" + Help = "BoardId Red Fort" + TokenType = Integer + TargetMAK = Yes + TargetH = Yes + Token = "PCH_SKU" "=" "1" +End + +TOKEN + Name = "PlatformInfo_BoardId" + Value = "$(BoardIdGraysReef)" + Help = "BoardId Emerald Lake" + TokenType = Integer + TargetMAK = Yes + TargetH = Yes +End + +TOKEN + Name = "PlatformInfo_BoardRev" + Value = "0x00" + Help = "BoardId Red Fort" + TokenType = Integer + TargetMAK = Yes + TargetH = Yes + Token = "PCH_SKU" "=" "0" +End + +TOKEN + Name = "PlatformInfo_BoardRev" + Value = "0x02" + Help = "BoardId Red Fort" + TokenType = Integer + TargetMAK = Yes + TargetH = Yes + Token = "PCH_SKU" "=" "1" +End + +PATH + Name = "PlatformInfo_DIR" +End + +MODULE + Help = "Includes PlatformInfo.mak to Project" + File = "PlatformInfo.mak" +End + +ELINK + Name = "$(BUILD_DIR)\PlatformInfo.ffs" + Parent = "FV_MAIN" + InvokeOrder = AfterParent +End + +ELINK + Name = "PLATFORM_INFO_INCLUDES" + InvokeOrder = ReplaceParent +End + +ELINK + Name = "/I $(PlatformInfo_DIR)" + Parent = "PLATFORM_INFO_INCLUDES" + InvokeOrder = AfterParent +End + diff --git a/Board/EM/Platform/PlatformSetup.h b/Board/EM/Platform/PlatformSetup.h new file mode 100644 index 0000000..857d048 --- /dev/null +++ b/Board/EM/Platform/PlatformSetup.h @@ -0,0 +1,101 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/PlatformSetup.h 4 1/15/13 5:47a Alanlin $ +// +// $Revision: 4 $ +// +// $Date: 1/15/13 5:47a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/PlatformSetup.h $ +// +// 4 1/15/13 5:47a Alanlin +// [TAG] None +// [Category] Normal +// [Severity] Normal +// [Description] Add setup item and setting for DPTF +// [Files] Acpiplatform.c, Acpiplatform.sd, Acpiplatform.uni, +// PlatformSetup.h +// +// 3 10/31/12 4:43a Alanlin +// [TAG] None +// [Category] Improvement +// [Severity] Normal +// [Description] Fine tune Platform Board Information. +// +// 2 7/27/12 5:11a Yurenlai +// [TAG] None +// [Category] Improvement +// [Description] Create DPTF and CPPC setup item. +// [Files] AcpiPlatform.c, AcpiPlatform.sd, AcpiPlatform.uni, +// PlatformSetup.h +// +// 1 2/09/12 12:31a Yurenlai +// Initial check in. +// +//************************************************************************* +// +// +// Name: PlatformSetup.h +// +// Description: OEM Specific Setup Variables and Structures +// +// +//************************************************************************* +#ifndef _OEMSETUP_H_ +#define _OEMSETUP_H_ +#ifdef __cplusplus +extern "C" { +#endif + + #pragma pack(1) + + typedef struct _SETUP_PLATFORM_DATA + { + + UINT8 GbePciePortNum; + UINT8 PlatformFlavor; + UINT8 PcieSBDE; + UINT8 PegPresent[4]; + UINT8 DimmPresent[4]; + UINT8 IGFXAvailable; + UINT8 VTdAvailable; + UINT8 PlatformSupportCppc; + UINT8 PlatformSupportRtD3; + UINT8 LPMSupport; + }SETUP_PLATFORM_DATA; + + #pragma pack() + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.c b/Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.c new file mode 100644 index 0000000..9f3b2f2 --- /dev/null +++ b/Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.c @@ -0,0 +1,866 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/PlatformSetupInfo/PlatformSetupInfo.c 13 8/02/13 6:46a Alanlin $ +// +// $Revision: 13 $ +// +// $Date: 8/02/13 6:46a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/PlatformSetupInfo/PlatformSetupInfo.c $ +// +// 13 8/02/13 6:46a Alanlin +// [TAG] None +// [Category] Normal +// [Severity] Normal +// [Description] Update to support Haswell ULT D0 setup info +// [Files] PlatformSetupInfo.c +// +// 12 6/04/13 10:10a Alanlin +// [TAG] None +// [Category] Bug Fix +// [Severity] Normal +// [Symptom] UEFI_231C_SCT_Final_Draft_201303 test failed. +// [RootCause] The variable use illegal variable guid. +// [Solution] Change GUID form EFI_GLOBAL_VARIABLE to +// AMI_GLOBAL_VARIABLE_GUID. +// [Files] PlatformSetupInfo.c +// +// 11 3/15/13 6:56a Alanlin +// [TAG] None +// [Category] Normal +// [Severity] Normal +// [Description] Add PCH Lan version information. +// [Files] PlatformSetupInfo.c, PlatformSetupInfo.h. +// +// 10 1/28/13 11:12p Alanlin +// [TAG] EIP113555 +// [Category] Important +// [Severity] Important +// [Description] Update Shark Bay Client ACPI Reference Code Beta Version +// 1.0.0 +// +// 9 1/18/13 3:59a Alanlin +// [TAG] None +// [Category] Normal +// [Severity] Normal +// [Description] Fixed that Setup menu shows incorrect CPU informaion for +// C0 stepping +// [Files] PlatformSetupInfo.c. +// +// 8 1/15/13 5:48a Alanlin +// [TAG] None +// [Category] Normal +// [Severity] Normal +// [Description] Update to support Haswell C0 and ULT C1 setup info +// [Files] PlatformSetupInfo.c, PlatformSetupInfo.h +// +// 7 11/26/12 6:01a Alanlin +// [TAG] None +// [Category] Improvement +// [Severity] Normal +// [Description] Fixed that Setup menu shows incorrect CPU informaion for +// Sharkbay ULT. +// [Files] PlatformSetupInfo.c, PlatformSetupInfo.h +// +// 6 8/14/12 8:56a Yurenlai +// [TAG] None +// [Category] Improvement +// [Severity] Important +// [Description] Update to support Haswell B0 and ULT A0 setup info. +// [Files] PlatformSetupInfo.c, PlatformSetupInfo.h +// +// 5 7/11/12 3:55a Yurenlai +// [TAG] None +// [Category] Improvement +// [Description] Correct Lan PHY Revision in BIOS Setup info. +// [Files] PlatformSetupInfo.c, PlatformSetupInfo.h +// +// 4 4/25/12 1:23p Yurenlai +// [TAG] None +// [Category] Improvement +// [Description] Correct Graphics Technology (GT) Displays (GT Info) in +// BIOS Setup. +// [Files] PlatformSetupInfo.c, PlatformSetupInfo.h +// +// 3 4/05/12 7:14a Yurenlai +// [TAG] None +// [Category] Improvement +// [Severity] Important +// [Description] Fixed building error for Intel System Agent +// Label:"4.6.5.3_Intel_SA-RC_055_004". +// [Files] PlatformSetupInfo.c, PlatformSetupInfo.mak +// +// 2 3/26/12 4:06a Yurenlai +// [TAG] EIP86219 +// [Category] New Feature +// [Description] Add PCH information in SharkBay BIOS setup. +// [Files] PlatformSetupInfo.c, PlatformSetupInfo.sd, +// PlatformSetupInfo.uni +// +// 1 2/24/12 1:02a Yurenlai +// Add PlatformSetupInfo module part. +// +//************************************************************************* +// +// +// Name: PlatformSetupInfo.c +// +// Description: Display platform information +// +// +//********************************************************************** + +//---------------------------------------------------------------------------- +// Include(s) +//---------------------------------------------------------------------------- +#include +#include +#include +#include +#include +#if defined (IntelTXT_SUPPORT) && IntelTXT_SUPPORT +#include +#endif +#if defined CRB_EC_SUPPORT && CRB_EC_SUPPORT +#include +#endif +#if EFI_SPECIFICATION_VERSION>0x20000 +#include +#include +#define LANGUAGE_CODE_ENGLISH "en-US" +#else +#include +#endif +#include "PchRegs.h" +#include "PlatformSetupInfo.h" +#include "CpuRegs.h" + +EFI_HII_HANDLE gMainHiiHandle = NULL; + +// +//--------------------------------------------------------------------------- +// Name: UpdateCpuInformation +// +// Description: Update CPU Information to Main page. +// +// Input: None +// +// Output: None +//--------------------------------------------------------------------------- +// +VOID +UpdateCpuInformation (VOID) +{ + UINT32 RegEax, RegEbx, RegEcx, RegEdx; + UINT32 CpuSignature; + UINT32 CpuID; + UINT8 CpuStepping; + UINTN i, Count; + UINT8 CpuCores = NumCpuCores(); + CPU_REV ProcessorRevisionTable[] = { + {CPUID_FULL_FAMILY_MODEL_HASWELL_A0, 0x01, "A0"}, + {CPUID_FULL_FAMILY_MODEL_HASWELL_B0, 0x02, "B0"}, + {CPUID_FULL_FAMILY_MODEL_HASWELL_B0, 0x05, "C0"}, + {CPUID_FULL_FAMILY_MODEL_HASWELL_C0, 0x05, "C0"}, + {CPUID_FULL_FAMILY_MODEL_HASWELL_C0, 0x06, "C0"}, + {CPUID_FULL_FAMILY_MODEL_HASWELL_ULT, 0x01, "A0"}, + {CPUID_FULL_FAMILY_MODEL_HASWELL_ULT, 0x02, "B0"}, + {CPUID_FULL_FAMILY_MODEL_HASWELL_ULT, 0x03, "B1"}, + {CPUID_FULL_FAMILY_MODEL_HASWELL_ULT_C0, 0x09, "C0"}, + {CPUID_FULL_FAMILY_MODEL_HASWELL_ULT_C0, 0x0B, "D0"}, + {CPUID_FULL_FAMILY_MODEL_CRYSTALWELL, 0x02, "B0"}, + }; + + CPULib_CpuID (1, &RegEax, &RegEbx, &RegEcx, &RegEdx); + CpuSignature = RegEax & CPUID_FULL_FAMILY_MODEL; + CpuID = RegEax & 0xFFFFF; + CpuStepping = MmioRead8 (PciNBD0F0RegBase + PCIE_Revision_Identification); + + + switch (CpuSignature) { + case CPUID_FULL_FAMILY_MODEL_HASWELL: + InitString ( + gMainHiiHandle, + STRING_TOKEN (STR_BOARD_PROCESSOR_VALUE), + L"%a", + "Haswell" + ); + break; + case CPUID_FULL_FAMILY_MODEL_HASWELL_ULT: + InitString ( + gMainHiiHandle, + STRING_TOKEN (STR_BOARD_PROCESSOR_VALUE), + L"%a", + "Haswell ULT" + ); + break; + case CPUID_FULL_FAMILY_MODEL_CRYSTALWELL: + InitString ( + gMainHiiHandle, + STRING_TOKEN (STR_BOARD_PROCESSOR_VALUE), + L"%a", + "Crystalwell" + ); + break; + default: + InitString ( + gMainHiiHandle, + STRING_TOKEN (STR_BOARD_PROCESSOR_VALUE), + L"%a", + "Unknown" + ); + } + + Count = sizeof (ProcessorRevisionTable) / sizeof (ProcessorRevisionTable[0]); + for (i = 0; i < Count; i++) { + if ((CpuID == ProcessorRevisionTable[i].CPUID) && (CpuStepping == ProcessorRevisionTable[i].Stepping)){ + InitString ( + gMainHiiHandle, + STRING_TOKEN (STR_BOARD_PROCESSOR_STEPPING_VALUE), + L"%a", + ProcessorRevisionTable[i].String + ); + break; + } + } + + InitString ( + gMainHiiHandle, + STRING_TOKEN (STR_BOARD_PROCESSOR_COUNT_VALUE), + L"%xCore(s) / %xThread(s)", + CpuCores, + CpuCores * (IsHtEnabled() ? 2 : 1) + ); +} + +// +//--------------------------------------------------------------------------- +// Name: UpdatePchInformation +// +// Description: Update PCH Information to Main page. +// +// Input: None +// +// Output: None +//--------------------------------------------------------------------------- +// +VOID +UpdatePchInformation (VOID) +{ + UINT16 Data16; + + Data16 = MmioRead16 (PciD31F0RegBase + R_PCH_LPC_DEVICE_ID); + + if (IS_PCH_LPTH_LPC_DEVICE_ID (Data16)) { + InitString ( + gMainHiiHandle, + STRING_TOKEN (STR_BOARD_CHIP_SB_VALUE), + L"%a", + "LynxPoint" + ); + } + else if (IS_PCH_LPTLP_LPC_DEVICE_ID (Data16)) { + InitString ( + gMainHiiHandle, + STRING_TOKEN (STR_BOARD_CHIP_SB_VALUE), + L"%a", + "LynxPoint-LP" + ); + } + else { + InitString ( + gMainHiiHandle, + STRING_TOKEN (STR_BOARD_CHIP_SB_VALUE), + L"%a", + "Unknown" + ); + } + +#if defined (IntelTXT_SUPPORT) && IntelTXT_SUPPORT + // + // Platform PCH TXT capability + // + if (MmioRead32 (TXT_PUBLIC_BASE + 0x10) & BIT0) { + InitString ( + gMainHiiHandle, + STRING_TOKEN (STR_BOARD_PLATFORM_TXT_VALUE), + L"%a", + "Supported" + ); + } else { + InitString ( + gMainHiiHandle, + STRING_TOKEN (STR_BOARD_PLATFORM_TXT_VALUE), + L"%a", + "Unsupported" + ); + } +#endif +} + +#if defined CRB_EC_SUPPORT && CRB_EC_SUPPORT +// +//--------------------------------------------------------------------------- +// Name: UpdateEcVersion +// +// Description: Update the version of CRB EC. +// +// Input: None +// +// Output: None +//--------------------------------------------------------------------------- +// +VOID +UpdateEcVersion (VOID) +{ + EFI_STATUS Status = EFI_SUCCESS; + EFI_GUID EfiEcAccessProtocolGuid = EC_PROTOCOL_GUID; + EFI_EC_ACCESS_PROTOCOL *ECAccess = NULL; + EFI_GUID gAmiGlobalVariableGuid = AMI_GLOBAL_VARIABLE_GUID; + UINT8 DataHigh = 0; + UINT8 DataLow = 0; + UINTN VariableSize; + + Status = pBS->LocateProtocol (&EfiEcAccessProtocolGuid, NULL, &ECAccess); + if (EFI_ERROR(Status)) { + return; + } + + // + // Initializing the size for retrieving variable(s) "ECRev1" & "ECRev2" + // + VariableSize = sizeof (UINT8); + pRS->GetVariable ( + L"ECRev1", + &gAmiGlobalVariableGuid, + NULL, + &VariableSize, + &DataHigh + ); + pRS->GetVariable ( + L"ECRev2", + &gAmiGlobalVariableGuid, + NULL, + &VariableSize, + &DataLow + ); + + InitString ( + gMainHiiHandle, + STRING_TOKEN (STR_BOARD_CHIP_EC_REV_VALUE), + L"%02X%a%02X", + DataHigh, + ".", + DataLow + ); +} +#endif + +// +//--------------------------------------------------------------------------- +// Name: UpdateLanPhyRevision +// +// Description: Retrieves LAN PHY Revision. +// +// Input: None +// +// Output: None +//--------------------------------------------------------------------------- +// +VOID +UpdateLanPhyRevision (VOID) +{ + UINTN PciD25F0RegBase; + UINT32 GbEBar; + UINT32 RegisterValue; + UINTN LoopTime; + UINT8 LanPhyRev; + UINTN Index; + UINT8 Data; + BOOLEAN Found; + LAN_PHY_INFO LanPhyInfoTable[] = { + { LAN_PHY_REV_A0, "A0" }, + { LAN_PHY_REV_A1, "A1" }, + { LAN_PHY_REV_A2, "A2" }, + { LAN_PHY_REV_A3, "A3" }, + { LAN_PHY_REV_B0, "B0" }, + { LAN_PHY_REV_C0, "C0" }}; + GbEBar = 0; + LanPhyRev = 0; + Found = FALSE; + + PciD25F0RegBase = + ( + PCIEX_BASE_ADDRESS + + ((PCI_BUS_NUMBER_PCH_LAN) << 20) + + ((PCI_DEVICE_NUMBER_PCH_LAN) << 15) + + ((PCI_FUNCTION_NUMBER_PCH_LAN) << 12) + ); + GbEBar = MmioRead32 (PciD25F0RegBase + R_PCH_LAN_MEM_BASE_A) & B_PCH_LAN_MBARB_BA; + + Data = MmioRead8 (PciD25F0RegBase + R_PCH_LAN_CMD); + // + // Command Register's Value is 0 in Fast Boot and Modifying here + // + if ((Data & B_PCH_LAN_CMD_MSE) == 0) { + MmioWrite8 ((PciD25F0RegBase + R_PCH_LAN_CMD), 0x07); + Found = TRUE; + } + // + // Request semaphore + // + Mmio32 (GbEBar, PHY_SEMAPHORE_REG) |= BIT5; + + for (LoopTime = 0; LoopTime < GBE_MAX_LOOP_TIME; LoopTime++) { + RegisterValue = MmioRead32 (GbEBar + PHY_SEMAPHORE_REG); + + if (RegisterValue & BIT5) { + break; + } + + pBS->Stall (10); + } + + if (LoopTime >= GBE_MAX_LOOP_TIME) { + return ; + } + // + // Write PHY_CONFIG_REG with set page 769 + // + MmioWrite32 ((GbEBar + PHY_CONFIG_REG), PHY_PAGE769_SET_REG); + for (LoopTime = 0; LoopTime < GBE_MAX_LOOP_TIME; LoopTime++) { + RegisterValue = MmioRead32 (GbEBar + PHY_CONFIG_REG); + + if (RegisterValue & BIT28) { + break; + } + + pBS->Stall (10); + } + + if (LoopTime >= GBE_MAX_LOOP_TIME) { + return ; + } + // + // Delay 4ms after page change + // + pBS->Stall (4000); + + // + // Write PHY_CONFIG_REG with slow MDIO mode + // + MmioWrite32 ((GbEBar + PHY_CONFIG_REG), PHY_SLOW_MDIO_MODE_REG); + for (LoopTime = 0; LoopTime < GBE_MAX_LOOP_TIME; LoopTime++) { + RegisterValue = MmioRead32 (GbEBar + PHY_CONFIG_REG); + + if (RegisterValue & BIT28) { + break; + } + + pBS->Stall (10); + } + + if (LoopTime >= GBE_MAX_LOOP_TIME) { + return ; + } + // + // Read register PHY Version (offset 0x3) + // + MmioWrite32 ((GbEBar + PHY_CONFIG_REG), PHY_READ_PHY_OFFSET3_REG); + for (LoopTime = 0; LoopTime < GBE_MAX_LOOP_TIME; LoopTime++) { + RegisterValue = MmioRead32 (GbEBar + PHY_CONFIG_REG); + if (RegisterValue & BIT28) { + break; + } + + pBS->Stall (10); + } + + if (LoopTime >= GBE_MAX_LOOP_TIME) { + return ; + } + // + // Read LAN PHY revision from PHY register 3 + // + LanPhyRev = (UINT8) MmioRead16 (GbEBar + PHY_CONFIG_REG); + + // + // Write PHY_CONFIG_REG to write fast mdio mode + // + MmioWrite32 ((GbEBar + PHY_CONFIG_REG), PHY_FAST_MDIO_MODE_REG); + for (LoopTime = 0; LoopTime < GBE_MAX_LOOP_TIME; LoopTime++) { + RegisterValue = MmioRead32 (GbEBar + PHY_CONFIG_REG); + + if (RegisterValue & BIT28) { + break; + } + + pBS->Stall (10); + } + + if (LoopTime >= GBE_MAX_LOOP_TIME) { + return ; + } + // + // Free semaphore + // + Mmio32 (GbEBar, PHY_SEMAPHORE_REG) &= ~BIT5; + + // + // LAN PHY Revision + // + if (LanPhyRev) { + for (Index = 0; Index < (sizeof (LanPhyInfoTable)/sizeof (LAN_PHY_INFO)); Index++) { + if (LanPhyRev == LanPhyInfoTable[Index].LanPhyRev) { + InitString ( + gMainHiiHandle, + STRING_TOKEN (STR_BOARD_LAN_PHY_REV_VALUE), + L"%a", + LanPhyInfoTable[Index].LanPhyString + ); + break; + } + } + } + + if (Found == TRUE) { + MmioWrite8 ((PciD25F0RegBase + R_PCH_LAN_CMD), Data); + } + + return ; +} + +// +//--------------------------------------------------------------------------- +// Name: UpdateSpiClockFreqInfo +// +// Description: Update SPI Clock Frequency information to Main page. +// +// Input: None +// +// Output: None +//--------------------------------------------------------------------------- +// +VOID +UpdateSpiClockFreqInfo (VOID) +{ + UINT32 Flcomp; + UINT32 SpiFrequ; + + MmioRW32 ((SB_RCBA + R_PCH_SPI_FDOC), (UINT32)(V_PCH_SPI_FDOC_FDSS_COMP), (UINT32)(B_PCH_SPI_FDOC_FDSS_MASK | B_PCH_SPI_FDOC_FDSI_MASK)); + Flcomp = MmioRead32 (SB_RCBA + R_PCH_SPI_FDOD); + + // Check Dual Output Fast Read Support + if (Flcomp & BIT30) { + InitString ( + gMainHiiHandle, + STRING_TOKEN (STR_SPI_DOFR_SUPPORT_VALUE), + L"%a", + "Supported" + ); + } + else { + InitString ( + gMainHiiHandle, + STRING_TOKEN (STR_SPI_DOFR_SUPPORT_VALUE), + L"%a", + "Unsupported" + ); + } + + // + // Fast Read Clock Frequency + // + switch ((Flcomp & (BIT23 | BIT22 | BIT21)) >> 21) { + case V_PCH_SPI_SSFC_SCF_20MHZ: + SpiFrequ = 20; + InitString ( + gMainHiiHandle, + STRING_TOKEN (STR_SPI_FAST_READ_FREQUENCY_VALUE), + L"%d MHz", + SpiFrequ + ); + break; + case V_PCH_SPI_SSFC_SCF_33MHZ: + SpiFrequ = 33; + InitString ( + gMainHiiHandle, + STRING_TOKEN (STR_SPI_FAST_READ_FREQUENCY_VALUE), + L"%d MHz", + SpiFrequ + ); + break; + case V_PCH_SPI_SSFC_SCF_50MHZ: + SpiFrequ = 50; + InitString ( + gMainHiiHandle, + STRING_TOKEN (STR_SPI_FAST_READ_FREQUENCY_VALUE), + L"%d MHz", + SpiFrequ + ); + break; + default: break; + } + + // + // Write and Erase Clock Frequency + // + switch ((Flcomp & (BIT26 | BIT25 | BIT24)) >> 24) { + case V_PCH_SPI_SSFC_SCF_20MHZ: + SpiFrequ = 20; + InitString ( + gMainHiiHandle, + STRING_TOKEN (STR_SPI_WRITE_CLOCK_FREQUENCY_VALUE), + L"%d MHz", + SpiFrequ + ); + break; + case V_PCH_SPI_SSFC_SCF_33MHZ: + SpiFrequ = 33; + InitString ( + gMainHiiHandle, + STRING_TOKEN (STR_SPI_WRITE_CLOCK_FREQUENCY_VALUE), + L"%d MHz", + SpiFrequ + ); + break; + case V_PCH_SPI_SSFC_SCF_50MHZ: + SpiFrequ = 50; + InitString ( + gMainHiiHandle, + STRING_TOKEN (STR_SPI_WRITE_CLOCK_FREQUENCY_VALUE), + L"%d MHz", + SpiFrequ + ); + break; + default: break; + } + + // + // Read ID and Read Status Clock Frequency + // + switch ((Flcomp & (BIT29 | BIT28 | BIT27)) >> 27) { + case V_PCH_SPI_SSFC_SCF_20MHZ: + SpiFrequ = 20; + InitString ( + gMainHiiHandle, + STRING_TOKEN (STR_SPI_READ_CLOCK_FREQUENCY_VALUE), + L"%d MHz", + SpiFrequ + ); + break; + case V_PCH_SPI_SSFC_SCF_33MHZ: + SpiFrequ = 33; + InitString ( + gMainHiiHandle, + STRING_TOKEN (STR_SPI_READ_CLOCK_FREQUENCY_VALUE), + L"%d MHz", + SpiFrequ + ); + break; + case V_PCH_SPI_SSFC_SCF_50MHZ: + SpiFrequ = 50; + InitString ( + gMainHiiHandle, + STRING_TOKEN (STR_SPI_READ_CLOCK_FREQUENCY_VALUE), + L"%d MHz", + SpiFrequ + ); + break; + default: break; + } +} + +// +//---------------------------------------------------------------------------- +// Procedure: GetAndUpdateHiiString +// +// Description: This function Reads a String from HII Handle and updates the +// string to Main HII Handle. +// +// Input: HiiHandleGet - Efi Hii Handle +// TokenGet - String Token +// TokenUpdate - String Token +// +// Output: Returns EFI_STATUS +//---------------------------------------------------------------------------- +// +EFI_STATUS GetAndUpdateHiiString ( + IN EFI_HII_HANDLE HiiHandleGet, + IN STRING_REF TokenGet, + IN STRING_REF TokenUpdate) +{ + EFI_STATUS Status = EFI_SUCCESS; +#if EFI_SPECIFICATION_VERSION>0x20000 + static EFI_HII_STRING_PROTOCOL *HiiString = NULL; + CHAR8 Language[] = LANGUAGE_CODE_ENGLISH; +#else + static EFI_HII_PROTOCOL *Hii = NULL; +#endif + CHAR16 String[0x100]; + UINTN StringLength = sizeof(String)/sizeof(CHAR16); + + if (HiiHandleGet == NULL) { + return EFI_INVALID_PARAMETER; + } + +#if EFI_SPECIFICATION_VERSION > 0x20000 + if (HiiString == NULL) { + Status = pBS->LocateProtocol (&gEfiHiiStringProtocolGuid, NULL, &HiiString); + } +#else + if (Hii == NULL) { + Status = pBS->LocateProtocol (&gEfiHiiProtocolGuid, NULL, &Hii); + } +#endif + ASSERT_EFI_ERROR(Status); + + pBS->SetMem(String, (sizeof(CHAR16) * StringLength), 0); + +#if EFI_SPECIFICATION_VERSION>0x20000 + Status = HiiString->GetString (HiiString, + (CHAR8*) &Language, + HiiHandleGet, + TokenGet, + String, + &StringLength, + NULL); +#else + Status = Hii->GetString (Hii, + HiiHandleGet, + TokenGet, + FALSE, + NULL, + &StringLength, + String); +#endif + + if (EFI_ERROR(Status)) { + return Status; + } + + ASSERT (gMainHiiHandle != NULL); + + InitString ( + gMainHiiHandle, + TokenUpdate, + L"%s", + String + ); + + return EFI_SUCCESS; +} + + // (EIP86219)> +// +//--------------------------------------------------------------------------- +// Name: InitPlatformSetupInfo +// +// Description: This function will display platform information and put into +// variables of PlatformSetupInfo.uni file. +// +// Input: EFI_HII_HANDLE HiiHandle +// +// Output: VOID +//--------------------------------------------------------------------------- +// +VOID +InitPlatformSetupInfo( + EFI_HII_HANDLE HiiHandle, + UINT16 Class +) +{ + if (Class == MAIN_FORM_SET_CLASS) { + gMainHiiHandle = HiiHandle; + + UpdateCpuInformation (); + + UpdatePchInformation (); + + UpdateLanPhyRevision (); + +#if defined CRB_EC_SUPPORT && CRB_EC_SUPPORT + UpdateEcVersion (); +#endif + + UpdateSpiClockFreqInfo (); + } + + if (Class == ADVANCED_FORM_SET_CLASS) { + // + // Update Processor Information + // + GetAndUpdateHiiString (HiiHandle, STRING_TOKEN(STR_CPU_SKT0_VERSION_VALUE), STRING_TOKEN(STR_BOARD_PROCESSOR_VERSION_VALUE)); + + GetAndUpdateHiiString (HiiHandle, STRING_TOKEN(STR_PROCESSOR_SPEED_VALUE), STRING_TOKEN(STR_BOARD_PROCESSOR_SPEED_VALUE)); + + GetAndUpdateHiiString (HiiHandle, STRING_TOKEN(STR_CPU_SKT0_CPUID_VALUE), STRING_TOKEN(STR_BOARD_PROCESSOR_ID_VALUE)); + + GetAndUpdateHiiString (HiiHandle, STRING_TOKEN(STR_CPU_SKT0_MICROCODE_VALUE), STRING_TOKEN(STR_BOARD_PROCESSOR_MICROCODE_VALUE)); + +#if defined (iME_SUPPORT) && iME_SUPPORT + // + // Update ME Information + // + GetAndUpdateHiiString (HiiHandle, STRING_TOKEN(STR_ME_FW_VERSION_VALUE), STRING_TOKEN(STR_BOARD_ME_FW_REV_VALUE)); + + GetAndUpdateHiiString (HiiHandle, STRING_TOKEN(STR_ME_FW_SKU_VALUE), STRING_TOKEN(STR_BOARD_ME_FW_SKU_VALUE)); +#endif + } + + if (Class == CHIPSET_FORM_SET_CLASS) { + // + // Update SA Information + // +#if (defined(CSM_SUPPORT) && (CSM_SUPPORT != 0)) + GetAndUpdateHiiString (HiiHandle, STRING_TOKEN(STR_CHIP_IGFX_VBIOS_REV_VALUE), STRING_TOKEN(STR_BOARD_IGFX_VBIOS_REV_VALUE)); +#endif + + GetAndUpdateHiiString (HiiHandle, STRING_TOKEN(STR_MRC_REV_VALUE), STRING_TOKEN(STR_BOARD_MRC_REV_VALUE)); + + GetAndUpdateHiiString (HiiHandle, STRING_TOKEN(STR_MEMORY_SIZE_VALUE), STRING_TOKEN(STR_BOARD_MEMORY_SIZE_VALUE)); + + GetAndUpdateHiiString (HiiHandle, STRING_TOKEN(STR_MEMORY_SPEED_VALUE), STRING_TOKEN(STR_BOARD_MEMORY_FREQ_VALUE)); + + // Display GT Type with RP0 Frequency Information + GetAndUpdateHiiString (HiiHandle, STRING_TOKEN(STR_PROCESSOR_GT_VALUE), STRING_TOKEN(STR_BOARD_PROCESSOR_GT_VALUE)); + + // + // Update PCH Information + // + GetAndUpdateHiiString (HiiHandle, STRING_TOKEN(STR_PCH_SKU_VALUE), STRING_TOKEN(STR_BOARD_CHIP_SB_SKU_VALUE)); + GetAndUpdateHiiString (HiiHandle, STRING_TOKEN(STR_PCH_REVID_VALUE), STRING_TOKEN(STR_BOARD_CHIP_SB_REV_VALUE)); + } + + return; +} + // <(EIP86219) + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.cif b/Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.cif new file mode 100644 index 0000000..5a51931 --- /dev/null +++ b/Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.cif @@ -0,0 +1,13 @@ + + name = "PlatformSetupInfo" + category = ModulePart + LocalRoot = "Board\EM\Platform\PlatformSetupInfo" + RefName = "PlatformSetupInfo" +[files] +"PlatformSetupInfo.sdl" +"PlatformSetupInfo.mak" +"PlatformSetupInfo.sd" +"PlatformSetupInfo.uni" +"PlatformSetupInfo.c" +"PlatformSetupInfo.h" + diff --git a/Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.h b/Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.h new file mode 100644 index 0000000..cbbaef5 --- /dev/null +++ b/Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.h @@ -0,0 +1,150 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/PlatformSetupInfo/PlatformSetupInfo.h 7 3/15/13 6:57a Alanlin $ +// +// $Revision: 7 $ +// +// $Date: 3/15/13 6:57a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/PlatformSetupInfo/PlatformSetupInfo.h $ +// +// 7 3/15/13 6:57a Alanlin +// [TAG] None +// [Category] Normal +// [Severity] Normal +// [Description] Add PCH Lan version information. +// [Files] PlatformSetupInfo.c, PlatformSetupInfo.h. +// +// 6 1/15/13 5:49a Alanlin +// [TAG] None +// [Category] Normal +// [Severity] Normal +// [Description] Update to support Haswell C0 and ULT C1 setup info +// [Files] PlatformSetupInfo.c, PlatformSetupInfo.h +// +// 5 11/26/12 6:02a Alanlin +// [TAG] None +// [Category] Improvement +// [Severity] Normal +// [Description] Fixed that Setup menu shows incorrect CPU informaion for +// Sharkbay ULT. +// [Files] PlatformSetupInfo.c, PlatformSetupInfo.h +// +// +// 4 8/14/12 8:56a Yurenlai +// [TAG] None +// [Category] Improvement +// [Severity] Important +// [Description] Update to support Haswell B0 and ULT A0 setup info. +// [Files] PlatformSetupInfo.c, PlatformSetupInfo.h +// +// 3 7/11/12 3:55a Yurenlai +// [TAG] None +// [Category] Improvement +// [Description] Correct Lan PHY Revision in BIOS Setup info. +// [Files] PlatformSetupInfo.c, PlatformSetupInfo.h +// +// 2 4/25/12 1:23p Yurenlai +// [TAG] None +// [Category] Improvement +// [Description] Correct Graphics Technology (GT) Displays (GT Info) in +// BIOS Setup. +// [Files] PlatformSetupInfo.c, PlatformSetupInfo.h +// +// 1 2/24/12 1:02a Yurenlai +// Add PlatformSetupInfo module part. +// +//************************************************************************* + +// +//---------------------------------------------------------------------------- +// +// Name: PlatformSetupInfo.h +// +// Description: Header file for PlatformSetupInfo module. +// +//---------------------------------------------------------------------------- +// + +#ifndef __PLATFORM_SETUP_INFO_H__ +#define __PLATFORM_SETUP_INFO_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define CPUID_FULL_FAMILY_MODEL_HASWELL_A0 0x000306C1 // Haswell +#define CPUID_FULL_FAMILY_MODEL_HASWELL_B0 0x000306C2 // Haswell +#define CPUID_FULL_FAMILY_MODEL_HASWELL_C0 0x000306C3 // Haswell C-0 +#define CPUID_FULL_FAMILY_MODEL_HASWELL_ULT 0x00040650 // Haswell ULT +#define CPUID_FULL_FAMILY_MODEL_HASWELL_ULT_C0 0x00040651 // Haswell ULT C-1 +#define CPUID_FULL_FAMILY_MODEL_CRYSTALWELL 0x00040660 // CRYSTALWELL + +#define PciD31F0RegBase PCIEX_BASE_ADDRESS + (UINT32) (31 << 15) +#define PciNBD0F0RegBase PCIEX_BASE_ADDRESS +#define PCIE_Revision_Identification 0x08 +// +// LAN PHY Revision definitions +// +#define PHY_CONFIG_REG 0x00000020 +#define PHY_SEMAPHORE_REG 0x00000F00 +#define PHY_PAGE769_SET_REG 0x43f6020 +#define PHY_SLOW_MDIO_MODE_REG 0x4302580 +#define PHY_READ_PHY_OFFSET3_REG 0x8430000 +#define PHY_FAST_MDIO_MODE_REG 0x4302180 +#define LAN_PHY_REV_A0 0xA1 +#define LAN_PHY_REV_A1 0xA2 +#define LAN_PHY_REV_A2 0xA3 +#define LAN_PHY_REV_A3 0xA4 +#define LAN_PHY_REV_B0 0xA6 +#define LAN_PHY_REV_C0 0xA7 + +// Max loop value for GBE check +#define GBE_MAX_LOOP_TIME 4000 + +#pragma pack(1) +typedef struct { + UINT32 CPUID; + UINT8 Stepping; + CHAR8 String[16]; +} CPU_REV; + +typedef struct _LAN_PHY_INFO { + UINT16 LanPhyRev; + char *LanPhyString; +} LAN_PHY_INFO; +#pragma pack() + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.mak b/Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.mak new file mode 100644 index 0000000..c2e7e72 --- /dev/null +++ b/Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.mak @@ -0,0 +1,82 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2011, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* + +#************************************************************************* +# $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/PlatformSetupInfo/PlatformSetupInfo.mak 2 4/05/12 7:14a Yurenlai $ +# +# $Revision: 2 $ +# +# $Date: 4/05/12 7:14a $ +#************************************************************************* +# Revision History +# ---------------- +# $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/PlatformSetupInfo/PlatformSetupInfo.mak $ +# +# 2 4/05/12 7:14a Yurenlai +# [TAG] None +# [Category] Improvement +# [Severity] Important +# [Description] Fixed building error for Intel System Agent +# Label:"4.6.5.3_Intel_SA-RC_055_004". +# [Files] PlatformSetupInfo.c, PlatformSetupInfo.mak +# +# 1 2/24/12 1:02a Yurenlai +# Add PlatformSetupInfo module part. +# +#************************************************************************* +# +# +# Name: PlatformSetupInfo.mak +# +# Description: MAK file for the PlatformSetupInfo module +# +# +#************************************************************************* +All : PlatformSetupInfo + +PlatformSetupInfo : $(BUILD_DIR)\PlatformSetupInfo.mak + +SetupSdbs : $(BUILD_DIR)\PlatformSetupInfo.sdb + +$(BUILD_DIR)\PlatformSetupInfo.sdb : $(PlatformSetupInfo_DIR)\$(@B).sd $(PlatformSetupInfo_DIR)\$(@B).uni + $(STRGATHER) -i INCLUDE -parse -newdb -db $(BUILD_DIR)\$(@B).sdb $(PlatformSetupInfo_DIR)\$(@B).uni + $(STRGATHER) -scan -db $(BUILD_DIR)\$(@B).sdb -od $(BUILD_DIR)\$(@B).sdb $(PlatformSetupInfo_DIR)\$(@B).sd + +$(BUILD_DIR)\PlatformSetupInfo.mak : $(PlatformSetupInfo_DIR)\$(@B).cif $(PlatformSetupInfo_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(PlatformSetupInfo_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +PlatformSetupInfo_INCLUDES= \ + $(INTEL_PCH_INCLUDES)\ +!if "$(IntelTXT_SUPPORT)"=="1" + $(TXT_INCLUDES)\ +!endif + $(PROJECT_CPU_INCLUDES)\ + +SetupBin : $(BUILD_DIR)\PlatformSetupInfo.obj + +$(BUILD_DIR)\PlatformSetupInfo.obj : $(PROJECT_DIR)\$(PlatformSetupInfo_DIR)\PlatformSetupInfo.c $(BUILD_DIR)\SetupStrTokens.h + $(CC) $(CFLAGS) $(PlatformSetupInfo_INCLUDES) /Fo$(BUILD_DIR)\ $(PlatformSetupInfo_DIR)\PlatformSetupInfo.c +#********************************************************************** +#********************************************************************** +#** ** +#** (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/Platform/PlatformSetupInfo/PlatformSetupInfo.sd b/Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.sd new file mode 100644 index 0000000..c245074 --- /dev/null +++ b/Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.sd @@ -0,0 +1,300 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/PlatformSetupInfo/PlatformSetupInfo.sd 2 3/26/12 4:10a Yurenlai $ +// +// $Revision: 2 $ +// +// $Date: 3/26/12 4:10a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/PlatformSetupInfo/PlatformSetupInfo.sd $ +// +// 2 3/26/12 4:10a Yurenlai +// [TAG] EIP86219 +// [Category] New Feature +// [Description] Add PCH information in SharkBay BIOS setup. +// [Files] PlatformSetupInfo.c, PlatformSetupInfo.sd, +// PlatformSetupInfo.uni +// +// 1 2/24/12 1:02a Yurenlai +// Add PlatformSetupInfo module part. +// +//************************************************************************* + +//************************************************************************* +// +// +// Name: PlatformSetupInfo.sd +// +// Description: Setup file for PlatformSetupInfo driver. It displays the +// platform information and its Version String in a form of Main +// tab of setup screen +// +// +//************************************************************************* +#ifdef FORM_SET_TYPEDEF + +#endif + + +#ifdef SETUP_DATA_DEFINITION +// Put NVRAM data definitions here. +// For example: UINT8 Data1; +// These definitions will be converted by the build process +// to a definitions of SETUP_DATA fields. +#endif + +#ifdef MAIN_FORM_SET + + #ifdef FORM_SET_ITEM + // + // Define controls to be added to the main page of the formset + // + + // + // CPU INFORMATION + // + SEPARATOR + SUBTITLE(STRING_TOKEN(STR_BOARD_CPU_FORM_SUBTITLE)) + + text + help = STRING_TOKEN(STR_BOARD_PROCESSOR_HELP), + text = STRING_TOKEN(STR_BOARD_PROCESSOR_STRING), + text = STRING_TOKEN(STR_BOARD_PROCESSOR_VALUE), + flags = 0, key = 0; + + text + help = STRING_TOKEN(STR_BOARD_PROCESSOR_VERSION_HELP), + text = STRING_TOKEN(STR_BOARD_PROCESSOR_VERSION_STRING), + text = STRING_TOKEN(STR_BOARD_PROCESSOR_VERSION_VALUE), + flags = 0, key = 0; + + text + help = STRING_TOKEN(STR_BOARD_PROCESSOR_SPEED_HELP), + text = STRING_TOKEN(STR_BOARD_PROCESSOR_SPEED_STRING), + text = STRING_TOKEN(STR_BOARD_PROCESSOR_SPEED_VALUE), + flags = 0, key = 0; + + text + help = STRING_TOKEN(STR_BOARD_PROCESSOR_ID_HELP), + text = STRING_TOKEN(STR_BOARD_PROCESSOR_ID_STRING), + text = STRING_TOKEN(STR_BOARD_PROCESSOR_ID_VALUE), + flags = 0, key = 0; + + text + help = STRING_TOKEN(STR_BOARD_PROCESSOR_STEPPING_HELP), + text = STRING_TOKEN(STR_BOARD_PROCESSOR_STEPPING_STRING), + text = STRING_TOKEN(STR_BOARD_PROCESSOR_STEPPING_VALUE), + flags = 0, key = 0; +/* + text + help = STRING_TOKEN(STR_BOARD_PROCESSOR_PACKAGE_HELP), + text = STRING_TOKEN(STR_BOARD_PROCESSOR_PACKAGE_STRING), + text = STRING_TOKEN(STR_BOARD_PROCESSOR_PACKAGE_VALUE), + flags = 0, key = 0; +*/ + text + help = STRING_TOKEN(STR_BOARD_PROCESSOR_COUNT_HELP), + text = STRING_TOKEN(STR_BOARD_PROCESSOR_COUNT_STRING), + text = STRING_TOKEN(STR_BOARD_PROCESSOR_COUNT_VALUE), + flags = 0, key = 0; + + text + help = STRING_TOKEN(STR_BOARD_PROCESSOR_MICROCODE_HELP), + text = STRING_TOKEN(STR_BOARD_PROCESSOR_MICROCODE_STRING), + text = STRING_TOKEN(STR_BOARD_PROCESSOR_MICROCODE_VALUE), + flags = 0, key = 0; + + text + help = STRING_TOKEN(STR_BOARD_PROCESSOR_GT_HELP), + text = STRING_TOKEN(STR_BOARD_PROCESSOR_GT_STRING), + text = STRING_TOKEN(STR_BOARD_PROCESSOR_GT_VALUE), + flags = 0, key = 0; + + SEPARATOR +#if defined(CSM_SUPPORT) && (CSM_SUPPORT != 0) + suppressif (PlatformInfo_PlatformFlavor == FlavorUpServer); + text + help = STRING_TOKEN(STR_BOARD_IGFX_VBIOS_REV_HELP), + text = STRING_TOKEN(STR_BOARD_IGFX_VBIOS_REV_NAME), + text = STRING_TOKEN(STR_BOARD_IGFX_VBIOS_REV_VALUE), + flags = 0, + key = 0; + endif; +#endif + + text + help = STRING_TOKEN(STR_BOARD_MRC_REV_HELP), + text = STRING_TOKEN(STR_BOARD_MRC_REV_NAME), + text = STRING_TOKEN(STR_BOARD_MRC_REV_VALUE), + flags = 0, + key = 0; + + text + help = STRING_TOKEN(STR_BOARD_MEMORY_SIZE_HELP), + text = STRING_TOKEN(STR_BOARD_MEMORY_SIZE_NAME), + text = STRING_TOKEN(STR_BOARD_MEMORY_SIZE_VALUE), + flags = 0, + key = 0; + + text + help = STRING_TOKEN(STR_BOARD_MEMORY_FREQ_HELP), + text = STRING_TOKEN(STR_BOARD_MEMORY_FREQ_NAME), + text = STRING_TOKEN(STR_BOARD_MEMORY_FREQ_VALUE), + flags = 0, + key = 0; + + // (EIP86219)> + // + // PCH INFORMATION + // + SEPARATOR + SUBTITLE(STRING_TOKEN(STR_BOARD_SB_INFORMATION)) + + text + help = STRING_TOKEN(STR_BOARD_CHIP_SB_NAME_HELP), + text = STRING_TOKEN(STR_BOARD_CHIP_SB_NAME), + text = STRING_TOKEN(STR_BOARD_CHIP_SB_VALUE), + flags = 0, + key = 0; + + text + help = STRING_TOKEN (STR_BOARD_CHIP_SB_SKU_HELP), + text = STRING_TOKEN (STR_BOARD_CHIP_SB_SKU_NAME), + text = STRING_TOKEN (STR_BOARD_CHIP_SB_SKU_VALUE), + flags = 0, key = 0; + + text + help = STRING_TOKEN(STR_BOARD_CHIP_SB_REV_HELP), + text = STRING_TOKEN(STR_BOARD_CHIP_SB_REV_NAME), + text = STRING_TOKEN(STR_BOARD_CHIP_SB_REV_VALUE), + flags = 0, + key = 0; +/* + text + help = STRING_TOKEN(STR_BOARD_CHIP_SB_PACKAGE_HELP), + text = STRING_TOKEN(STR_BOARD_CHIP_SB_PACKAGE_NAME), + text = STRING_TOKEN(STR_BOARD_CHIP_SB_PACKAGE_VALUE), + flags = 0, + key = 0; +*/ + // <(EIP86219) + +#if defined (IntelTXT_SUPPORT) && IntelTXT_SUPPORT + text + help = STRING_TOKEN(STR_BOARD_PLATFORM_TXT_HELP), + text = STRING_TOKEN(STR_BOARD_PLATFORM_TXT_NAME), + text = STRING_TOKEN(STR_BOARD_PLATFORM_TXT_VALUE), + flags = 0, + key = 0; +#endif + + text + help = STRING_TOKEN(STR_BOARD_LAN_PHY_REV_HELP), + text = STRING_TOKEN(STR_BOARD_LAN_PHY_REV_STRING), + text = STRING_TOKEN(STR_BOARD_LAN_PHY_REV_VALUE), + flags = 0, key = 0; + + // + // KSC EC INFORMATION + // + SEPARATOR +#if defined CRB_EC_SUPPORT && CRB_EC_SUPPORT + suppressif (PlatformInfo_PlatformFlavor != FlavorMobile); + text + help = STRING_TOKEN(STR_BOARD_CHIP_EC_REV_HELP), + text = STRING_TOKEN(STR_BOARD_CHIP_EC_REV_NAME), + text = STRING_TOKEN(STR_BOARD_CHIP_EC_REV_VALUE), + flags = 0, + key = 0; + endif; +#endif + +#if defined (iME_SUPPORT) && iME_SUPPORT + suppressif (PlatformInfo_PlatformFlavor == FlavorUpServer); + text + help = STRING_TOKEN(STR_BOARD_ME_FW_REV_HELP), + text = STRING_TOKEN(STR_BOARD_ME_FW_REV_PROMPT), + text = STRING_TOKEN(STR_BOARD_ME_FW_REV_VALUE), + flags = 0, + key = 0; + + text + help = STRING_TOKEN(STR_BOARD_ME_FW_SKU_HELP), + text = STRING_TOKEN(STR_BOARD_ME_FW_SKU_PROMPT), + text = STRING_TOKEN(STR_BOARD_ME_FW_SKU_VALUE), + flags = 0, + key = 0; + endif; +#endif + + // + // SPI Information + // + SEPARATOR + SUBTITLE(STRING_TOKEN(STR_SPI_CLK_FREQ)) + text + help = STRING_TOKEN(STR_SPI_DOFR_SUPPORT_HELP), + text = STRING_TOKEN(STR_SPI_DOFR_SUPPORT), + text = STRING_TOKEN(STR_SPI_DOFR_SUPPORT_VALUE), + flags = 0, + key = 0; + + text + help = STRING_TOKEN(STR_SPI_READ_CLOCK_FREQUENCY_HELP), + text = STRING_TOKEN(STR_SPI_READ_CLOCK_FREQUENCY), + text = STRING_TOKEN(STR_SPI_READ_CLOCK_FREQUENCY_VALUE), + flags = 0, + key = 0; + + text + help = STRING_TOKEN(STR_SPI_WRITE_CLOCK_FREQUENCY_HELP), + text = STRING_TOKEN(STR_SPI_WRITE_CLOCK_FREQUENCY), + text = STRING_TOKEN(STR_SPI_WRITE_CLOCK_FREQUENCY_VALUE), + flags = 0, + key = 0; + + text + help = STRING_TOKEN(STR_SPI_FAST_READ_FREQUENCY_HELP), + text = STRING_TOKEN(STR_SPI_FAST_READ_FREQUENCY), + text = STRING_TOKEN(STR_SPI_FAST_READ_FREQUENCY_VALUE), + flags = 0, + key = 0; + + #endif + + #ifdef FORM_SET_GOTO + // + // Define goto commands for the forms defined in this file + // + #endif + +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, 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/Platform/PlatformSetupInfo/PlatformSetupInfo.sdl b/Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.sdl new file mode 100644 index 0000000..436ea37 --- /dev/null +++ b/Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.sdl @@ -0,0 +1,38 @@ +TOKEN + Name = "PlatformSetupInfo_SUPPORT" + Value = "1" + Help = "Main switch to enable PlatformSetupInfo support in Project" + TokenType = Boolean + TargetMAK = Yes + TargetH = Yes + Master = Yes +End + +PATH + Name = "PlatformSetupInfo_DIR" +End + +MODULE + Help = "Includes PlatformSetupInfo.mak to Project" + File = "PlatformSetupInfo.mak" +End + +ELINK + Name = "$(BUILD_DIR)\PlatformSetupInfo.sdb" + Parent = "SETUP_SDBS" + InvokeOrder = AfterParent +End + +ELINK + Name = "$(PlatformSetupInfo_DIR)\PlatformSetupInfo.sd" + Parent = "SETUP_DEFINITIONS" + InvokeOrder = AfterParent +End + +ELINK + Name = "InitPlatformSetupInfo," + Parent = "SetupStringInit" + Priority = -10 + InvokeOrder = AfterParent +End + diff --git a/Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.uni b/Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.uni new file mode 100644 index 0000000..5c974f6 Binary files /dev/null and b/Board/EM/Platform/PlatformSetupInfo/PlatformSetupInfo.uni differ diff --git a/Board/EM/Platform/ReleaseNotes.chm b/Board/EM/Platform/ReleaseNotes.chm new file mode 100644 index 0000000..f648121 Binary files /dev/null and b/Board/EM/Platform/ReleaseNotes.chm differ diff --git a/Board/EM/Platform/SMBIOSUpdateData/SMBIOSUpdateData.c b/Board/EM/Platform/SMBIOSUpdateData/SMBIOSUpdateData.c new file mode 100644 index 0000000..65f67fc --- /dev/null +++ b/Board/EM/Platform/SMBIOSUpdateData/SMBIOSUpdateData.c @@ -0,0 +1,731 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/SMBIOSUpdateData/SMBIOSUpdateData.c 1 2/09/12 12:35a Yurenlai $ +// +// $Revision: 1 $ +// +// $Date: 2/09/12 12:35a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/SMBIOSUpdateData/SMBIOSUpdateData.c $ +// +// 1 2/09/12 12:35a Yurenlai +// Initial check in. +// +//************************************************************************* + + +#include "Tiano.h" +#include "EfiDriverLib.h" +#include +#include +#include "SmbiosUpdateDataProtocol.h" + +EFI_GUID gEfiSmbiosProtocolGuid = EFI_SMBIOS_PROTOCOL_GUID; +EFI_SMBIOS_PROTOCOL *gSmbiosProtocol; + +EFI_GUID gEfiSmbiosUpdateDataProtocolGuid = EFI_SMBIOS_UPDATE_DATA_PROTOCOL_GUID; + +EFI_SMBIOS_UPDATE_DATA_PROTOCOL SmbiosUpdateDataProtocol = {SMBIOS_GetFreeHandle, + SMBIOS_FindStructure, + SMBIOS_GetStructureBase, + SMBIOS_DeleteStructure, + SMBIOS_CopyStructure, + SMBIOS_InsertStructure}; + +// +//---------------------------------------------------------------------------- +// Procedure: GetStructureLength +// +// Description: Returns the length of the structure pointed by BufferStart +// in bytes +// +// Input: UINT8 *BufferStart +// +// Output: Structure Size +// +// Modified: +// +// Referrals: +// +// Notes: +//---------------------------------------------------------------------------- +// +UINT16 +GetStructureLength( + IN UINT8 *BufferStart +) +{ + UINT8 *BufferEnd = BufferStart; + + BufferEnd += ((SMBIOS_STRUCTURE_HEADER*)BufferStart)->Length; + while (*(UINT16*)BufferEnd != 0) { + BufferEnd++; + } + return (UINT16)(BufferEnd + 2 - BufferStart); // +2 for double zero terminator +} + +// +//---------------------------------------------------------------------------- +// Procedure: GetTotalStructureSize +// +// Description: Returns the total structure size +// +// Input: UINT8 *Buffer +// +// Output: Total structure size +// +// Modified: +// +// Referrals: +// +// Notes: +//---------------------------------------------------------------------------- +// +UINT16 +GetTotalStructureSize( + IN UINT8 *Buffer +) +{ + UINT16 Length = 0; + UINT16 BlockSize; + + while (((SMBIOS_STRUCTURE_HEADER*)Buffer)->Type != 127) { + BlockSize = GetStructureLength(Buffer); + Length = Length +BlockSize; + Buffer += BlockSize; + } + Length = Length+ GetStructureLength(Buffer); + return Length; +} + +// +//---------------------------------------------------------------------------- +// Procedure: FindStructureByType +// +// Description: Find structure type starting from memory location pointed by +// Buffer +// +// Input: UINT8 **Buffer +// UINT8 **StructureFoundPtr +// UINT8 SearchType +// UINT8 Instance +// +// Output: If SearchType is found: +// UINT8 **Buffer - Points to the next structure +// UINT8 **StructureFoundPtr - Points to the structure +// that was found +// If SearchType is not found: +// UINT8 **Buffer - No change +// UINT8 **StructureFoundPtr = NULL +// +// Modified: +// +// Referrals: +// +// Notes: +//---------------------------------------------------------------------------- +// +BOOLEAN +FindStructureByType( + IN OUT UINT8 **Buffer, + IN OUT UINT8 **StructureFoundPtr, + IN UINT8 SearchType, + IN UINT8 Instance // 1-based +) +{ + UINT8 *BufferPtr = *Buffer; + BOOLEAN FindStatus = FALSE; + + *StructureFoundPtr = NULL; + while (((SMBIOS_STRUCTURE_HEADER*)BufferPtr)->Type != 127) { + if (((SMBIOS_STRUCTURE_HEADER*)BufferPtr)->Type == SearchType) { + // If this instance, set the find status flag and update the Buffer pointer + if (--Instance == 0) { + FindStatus = TRUE; + *StructureFoundPtr = BufferPtr; + *Buffer = BufferPtr + GetStructureLength(BufferPtr); + break; + } + } + BufferPtr += GetStructureLength(BufferPtr); + } + if ((FindStatus == FALSE) && (SearchType == 127)) { + FindStatus = TRUE; + *StructureFoundPtr = BufferPtr; + *Buffer = BufferPtr + GetStructureLength(BufferPtr); + } + return FindStatus; +} + +// +//---------------------------------------------------------------------------- +// Procedure: FindStructureByHandle +// +// Description: Find structure handle starting from memory location pointed +// by Buffer +// +// Input: UINT8 **Buffer +// UINT16 Handle +// +// Output: If SearchType is found: +// UINT8 **Buffer - Points to the structure that was found +// +// Modified: +// +// Referrals: +// +// Notes: +//---------------------------------------------------------------------------- +// +BOOLEAN +FindStructureByHandle( + IN OUT UINT8 **Buffer, + IN UINT16 Handle +) +{ + while (((SMBIOS_STRUCTURE_HEADER*)*Buffer)->Handle != Handle) { + if (((SMBIOS_STRUCTURE_HEADER*)*Buffer)->Type == 127) { + return FALSE; + } + *Buffer += GetStructureLength(*Buffer); + } + return TRUE; +} + +// +//---------------------------------------------------------------------------- +// Procedure: GetNumberOfStructures +// +// Description: Returns the number of structures starting from Buffer til +// (and including) type 127 structure. +// +// Input: UINT8 *Buffer +// +// Output: Number of structures +// +// Modified: +// +// Referrals: +// +// Notes: +//---------------------------------------------------------------------------- +// +UINT16 +GetNumberOfStructures( + IN UINT8 *Buffer +) +{ + UINT8 *BufferPtr = Buffer; + UINT16 SmbiosStrucCount = 1; + + while (((SMBIOS_STRUCTURE_HEADER*)BufferPtr)->Type != 127) { + ++SmbiosStrucCount; + BufferPtr += GetStructureLength(BufferPtr); + } + return SmbiosStrucCount; +} + +// +//---------------------------------------------------------------------------- +// Procedure: GetLargestStructureSize +// +// Description: Returns the largest structure size +// +// Input: UINT8 *Buffer +// +// Output: Largest structure size +// +// Modified: +// +// Referrals: +// +// Notes: +//---------------------------------------------------------------------------- +// +UINT16 +GetLargestStructureSize( + IN UINT8 *Buffer +) +{ + UINT8 *BufferPtr = Buffer; + UINT8 *LastBufferPtr; + UINT16 LargestStructureSize = 0; + UINT16 CurrentStructureSize; + + while (((SMBIOS_STRUCTURE_HEADER*)BufferPtr)->Type != 127) { + LastBufferPtr = BufferPtr; + BufferPtr += ((SMBIOS_STRUCTURE_HEADER*)BufferPtr)->Length; + while (TRUE) { + if ((*(UINT16*)BufferPtr) == 0) { + BufferPtr += 2; + break; + } + BufferPtr++; + } + CurrentStructureSize = (UINT16)(BufferPtr - LastBufferPtr); + if (CurrentStructureSize > LargestStructureSize) { + LargestStructureSize = CurrentStructureSize; + } + } + return LargestStructureSize; +} + +// +//---------------------------------------------------------------------------- +// Procedure: SmbiosCheckSum +// +// Description: Returns the checksum of "length" bytes starting from the +// "*ChecksumSrc" +// +// Input: UINT8 *ChecksumSrc +// UINT8 length +// +// Output: Checksum value +// +// Modified: +// +// Referrals: +// +// Notes: +//---------------------------------------------------------------------------- +// +UINT8 +SmbiosCheckSum( + IN UINT8 *ChecksumSrc, + IN UINT8 length +) +{ + UINT8 Checksum = 0; + UINT8 i; + + for (i = 0; i < length; i++) { + Checksum = Checksum + *ChecksumSrc++; + } + return (0 - Checksum); +} + +// +//---------------------------------------------------------------------------- +// Procedure: UpdateEPSHeader +// +// Description: Updates the SMBIOS Entry Point Header +// +// Input: SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint +// +// Output: None +// +// Modified: +// +// Referrals: +// +// Notes: +//---------------------------------------------------------------------------- +// +VOID +UpdateEPSHeader( + IN SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint +) +{ + UINT8 *SmbiosDataTableAddr = NULL; + + // Get Smbios Data Table Address + SmbiosDataTableAddr = (UINT8*)(UINTN)pSmbiosTableEntryPoint->TableAddress; + + // Updating EPS Header + // Update SMBIOS Data Structure Table length in EPS Header + pSmbiosTableEntryPoint->TableLength = GetTotalStructureSize(SmbiosDataTableAddr); + + // Find and update number of SMBios Structures in EPS Header + pSmbiosTableEntryPoint->NumberOfSmbiosStructures = GetNumberOfStructures(SmbiosDataTableAddr); + + // Find and update largest SMBios Structure in EPS Header + pSmbiosTableEntryPoint->MaxStructureSize = GetLargestStructureSize((UINT8*)(UINTN)pSmbiosTableEntryPoint->TableAddress); + + // Update Checksums in EPS Header + pSmbiosTableEntryPoint->IntermediateChecksum = 0; + pSmbiosTableEntryPoint->IntermediateChecksum = SmbiosCheckSum((UINT8*)pSmbiosTableEntryPoint + 0x10, 15); + pSmbiosTableEntryPoint->EntryPointStructureChecksum = 0; + pSmbiosTableEntryPoint->EntryPointStructureChecksum = SmbiosCheckSum((UINT8*)pSmbiosTableEntryPoint, + pSmbiosTableEntryPoint->EntryPointLength); +} + +// +//---------------------------------------------------------------------------- +// Procedure: SMBIOS_GetFreeHandle +// +// Description: SMBIOSUpdateData protocol - Searches available handle +// of Smbios Data Table +// +// +// Input: SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint +// +// Output: UINT16 Handle or -1(if not found) +// +// Modified: +// +// Referrals: +// +// Notes: +//---------------------------------------------------------------------------- +// +UINT16 +SMBIOS_GetFreeHandle( + IN SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint +) +{ + EFI_STATUS FoundStatus; + + UINT16 Handle = 0; + UINT8 *StructurePtr = NULL; + UINT8 *SmbiosDataTableAddr = NULL; + + // Get Smbios Data Table Address + SmbiosDataTableAddr = (UINT8*)(UINTN)pSmbiosTableEntryPoint->TableAddress; + + //Count Handle form 0 to 0xFFFF to find available Handle + for(Handle = 0; Handle < 0xFFFF; Handle++){ + StructurePtr = SmbiosDataTableAddr; + FoundStatus = FindStructureByHandle(&StructurePtr,Handle); + if(!FoundStatus){ + return Handle; + } + } + + return (UINT16)-1; // No available Handle to use; +} + +// +//---------------------------------------------------------------------------- +// Procedure: SMBIOS_FindStructure +// +// Description: SMBIOSUpdateData protocol - Searches handle of Smbios Table by Type +// +// +// Input: SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint +// UINT8 Type +// UINT8 Index +// +// Output: UINT16 Handle or -1(if not found) +// +// Modified: +// +// Referrals: +// +// Notes: +//---------------------------------------------------------------------------- +// +UINT16 +SMBIOS_FindStructure( + IN SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint, + IN UINT8 Type, + IN UINT8 Index +) +{ + EFI_STATUS FoundStatus; + + UINT16 Handle = 0; + UINT8 *StructurePtr = NULL; + UINT8 *SmbiosDataTableAddr = NULL; + + // Get Smbios Data Table Address + SmbiosDataTableAddr = (UINT8*)(UINTN)pSmbiosTableEntryPoint->TableAddress; + + FoundStatus = FindStructureByType(&SmbiosDataTableAddr, &StructurePtr, Type, Index); + Handle = ((SMBIOS_STRUCTURE_HEADER*)StructurePtr)->Handle; + + // Return Handle of found structure + if(FoundStatus){ + return Handle; + } else{ + return (UINT16)-1; + } + +} + +// +//---------------------------------------------------------------------------- +// Procedure: SMBIOS_GetStructureBase +// +// Description: SMBIOSUpdateData protocol - Get structure address by Handle +// +// +// Input: SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint +// UINT8 *StructureFoundPtr +// UINT16 Handle +// +// Output: UINT8 * or NULL - Points to the structure that was found +// +// Modified: +// +// Referrals: +// +// Notes: +//---------------------------------------------------------------------------- +// +UINT8 * +SMBIOS_GetStructureBase( + IN SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint, + IN UINT16 Handle +) +{ + EFI_STATUS FoundStatus; + + UINT8 *FoundStructurePtr = NULL; + UINT8 *SmbiosDataTableAddr = NULL; + + // Get Smbios Data Table Address + SmbiosDataTableAddr = (UINT8*)(UINTN)pSmbiosTableEntryPoint->TableAddress; + FoundStructurePtr = SmbiosDataTableAddr; + + FoundStatus = FindStructureByHandle(&FoundStructurePtr, Handle); + + if(FoundStatus){ + return FoundStructurePtr; + } else{ + return NULL; + } + +} + +// +//---------------------------------------------------------------------------- +// Procedure: SMBIOS_DeleteStructure +// +// Description: SMBIOSUpdateData protocol - Delete SMBIOS structure by handle +// +// Input: SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint +// UINT16 Handle +// +// Output: EFI_STATUS +// +// Modified: +// +// Referrals: +// +// Notes: +//---------------------------------------------------------------------------- +// +EFI_STATUS +SMBIOS_DeleteStructure( + IN SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint, + IN UINT16 Handle +) +{ +/* + EFI_STATUS FoundStatus; + + UINT16 BufferSize = 0; + UINT8 *StructurePtr = NULL; + UINT8 *NextStructurePtr = NULL; + UINT8 *SmbiosDataTableAddr = NULL; + + // Get Smbios Data Table Address + SmbiosDataTableAddr = (UINT8*)pSmbiosTableEntryPoint->TableAddress; + StructurePtr = SmbiosDataTableAddr; + + FoundStatus = FindStructureByHandle(&StructurePtr, Handle); + + if (FoundStatus){ + // Calculate data size which we want to move + BufferSize = GetTotalStructureSize(StructurePtr) - GetStructureLength(StructurePtr); + + // Calculate next structure address + NextStructurePtr = StructurePtr + GetStructureLength(StructurePtr); + + // Copy Structure + gBS->CopyMem(StructurePtr, NextStructurePtr, BufferSize); + + UpdateEPSHeader(pSmbiosTableEntryPoint); + } + + return FoundStatus; +*/ + return gSmbiosProtocol->SmbiosDeleteStructure(Handle); +} + +// +//---------------------------------------------------------------------------- +// Procedure: SMBIOS_CopyStructure +// +// Description: SMBIOSUpdateData protocol - Copy SMBIOS structure by Handle +// to a new allocated memory +// +// Input: SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint +// UINT16 Handle +// +// Output: UINT8 * or NULL - Points to the new structure address +// +// Modified: +// +// Referrals: +// +// Notes: +//---------------------------------------------------------------------------- +// +UINT8 * +SMBIOS_CopyStructure( + IN SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint, + IN UINT16 Handle +) +{ + EFI_STATUS FoundStatus; + + UINT16 BufferSize; + UINT8 *BufferPtrTemp; + UINT8 *FoundStructurePtr = NULL; + UINT8 *SmbiosDataTableAddr = NULL; + + // Get Smbios Data Table Address + SmbiosDataTableAddr = (UINT8*)(UINTN)pSmbiosTableEntryPoint->TableAddress; + FoundStructurePtr = SmbiosDataTableAddr; + + // Check Handle of Structure if exit + FoundStatus = FindStructureByHandle(&FoundStructurePtr, Handle); + + if (FoundStatus){ + BufferSize = GetStructureLength(FoundStructurePtr); + + // Allocate Memory for structure copy + gBS->AllocatePool(EfiBootServicesData, BufferSize, &BufferPtrTemp); + + // Copy Structure to memory + gBS->CopyMem(BufferPtrTemp, FoundStructurePtr, BufferSize); + + return BufferPtrTemp; + + } else { + return NULL; + } + +} + +// +//---------------------------------------------------------------------------- +// Procedure: SMBIOS_InsertStructure +// +// Description: SMBIOSUpdateData protocol - Insert SMBIOS structure +// +// Input: SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint +// UINT8 *SourceStructurePtr +// UINTN BufferSize +// +// Output: EFI_STATUS +// +// Modified: +// +// Referrals: +// +// Notes: +//---------------------------------------------------------------------------- +// +EFI_STATUS +SMBIOS_InsertStructure( + IN SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint, + IN UINT8 *StructurePtrTemp, + IN UINT16 BufferSize +) +{ +/* + EFI_STATUS FoundStatus; + + UINT16 Handle = 0; + UINT16 EOSBufferSize = 0; + UINT8 *EOSBufferPtrTemp = NULL; + UINT8 *FoundStructurePtr = NULL; + UINT8 *SmbiosDataTableAddr = NULL; + + // Get Smbios Data Table Address + SmbiosDataTableAddr = (UINT8*)pSmbiosTableEntryPoint->TableAddress; + EOSBufferPtrTemp = SmbiosDataTableAddr; + FoundStructurePtr = SmbiosDataTableAddr; + + // Check Handle of Structure if available + Handle = ((SMBIOS_STRUCTURE_HEADER*)StructurePtrTemp)->Handle; + FoundStatus = FindStructureByHandle(&FoundStructurePtr, Handle); + + if (!FoundStatus){ + // Move End-of-table Structure(Type 127) to allocate space for structure copy + FindStructureByHandle(&EOSBufferPtrTemp, 127); + EOSBufferSize = GetStructureLength(EOSBufferPtrTemp); + FoundStructurePtr = EOSBufferPtrTemp + BufferSize; + gBS->CopyMem(FoundStructurePtr, EOSBufferPtrTemp, EOSBufferSize); + + // Copy Source Structure form memory + gBS->CopyMem(EOSBufferPtrTemp, StructurePtrTemp, BufferSize); + + UpdateEPSHeader(pSmbiosTableEntryPoint); + } + + return !FoundStatus; +*/ + UINT16 Handle = 0; + + Handle = ((SMBIOS_STRUCTURE_HEADER*)StructurePtrTemp)->Handle; + return gSmbiosProtocol->SmbiosAddStrucByHandle(Handle, StructurePtrTemp, BufferSize); +} + +// +//---------------------------------------------------------------------------- +// Procedure: SMIBiosUpdateMemoryRecordDriverEntryPoint +// +// Description: Update memory record DXE driver for Intel Tiano SmBiosMemory Driver. +// +// Input: +// +// Output: EFI_STATUS +// +// Modified: +// +// Referrals: +// +// Notes: +//---------------------------------------------------------------------------- +// +EFI_STATUS SMBIOSUpdateDataDriverEntryPoint( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable +) +{ + EFI_STATUS Status; + + DxeInitializeDriverLib (ImageHandle, SystemTable); + + Status = gBS->LocateProtocol(&gEfiSmbiosProtocolGuid, NULL, &gSmbiosProtocol); + ASSERT_EFI_ERROR(Status); + + Status = gBS->InstallProtocolInterface(&ImageHandle, + &gEfiSmbiosUpdateDataProtocolGuid, + EFI_NATIVE_INTERFACE, + &SmbiosUpdateDataProtocol); + + return Status; +} + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, 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/Platform/SMBIOSUpdateData/SMBIOSUpdateData.cif b/Board/EM/Platform/SMBIOSUpdateData/SMBIOSUpdateData.cif new file mode 100644 index 0000000..7e4aa0e --- /dev/null +++ b/Board/EM/Platform/SMBIOSUpdateData/SMBIOSUpdateData.cif @@ -0,0 +1,12 @@ + + name = "SMBIOSUpdateData" + category = ModulePart + LocalRoot = "Board\EM\Platform\SMBIOSUpdateData" + RefName = "SMBIOSUpdateData" +[files] +"SMBIOSUpdateData.sdl" +"SMBIOSUpdateData.mak" +"SMBIOSUpdateData.dxs" +"SMBIOSUpdateData.c" +"SmbiosUpdateDataProtocol.h" + diff --git a/Board/EM/Platform/SMBIOSUpdateData/SMBIOSUpdateData.dxs b/Board/EM/Platform/SMBIOSUpdateData/SMBIOSUpdateData.dxs new file mode 100644 index 0000000..2b87536 --- /dev/null +++ b/Board/EM/Platform/SMBIOSUpdateData/SMBIOSUpdateData.dxs @@ -0,0 +1,49 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/SMBIOSUpdateData/SMBIOSUpdateData.dxs 1 2/09/12 12:35a Yurenlai $ +// +// $Revision: 1 $ +// +// $Date: 2/09/12 12:35a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/SMBIOSUpdateData/SMBIOSUpdateData.dxs $ +// +// 1 2/09/12 12:35a Yurenlai +// Initial check in. +// +//************************************************************************* +#include +#include + +DEPENDENCY_START + EFI_SMBIOS_PROTOCOL_GUID +DEPENDENCY_END + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, 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/Platform/SMBIOSUpdateData/SMBIOSUpdateData.mak b/Board/EM/Platform/SMBIOSUpdateData/SMBIOSUpdateData.mak new file mode 100644 index 0000000..40254b2 --- /dev/null +++ b/Board/EM/Platform/SMBIOSUpdateData/SMBIOSUpdateData.mak @@ -0,0 +1,77 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2011, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* + +#************************************************************************* +# $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/SMBIOSUpdateData/SMBIOSUpdateData.mak 1 2/09/12 12:35a Yurenlai $ +# +# $Revision: 1 $ +# +# $Date: 2/09/12 12:35a $ +#************************************************************************* +# Revision History +# ---------------- +# $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Platform/SMBIOSUpdateData/SMBIOSUpdateData.mak $ +# +# 1 2/09/12 12:35a Yurenlai +# Initial check in. +# +#************************************************************************* +# +# +# Name: SMBIOSUpdateData.mak +# +# Description: This make file builds SMBIOSUpdateData module PEI & DXE +# components and link them to respective binary +# +# +#************************************************************************* + + +all : SMBIOSUpdateData + +SMBIOSUpdateData : $(BUILD_DIR)\SMBIOSUpdateData.mak SMBIOSUpdateDataBin + +$(BUILD_DIR)\SMBIOSUpdateData.mak : $(SMBIOSUpdateData_DIR)\SMBIOSUpdateData.CIF $(SMBIOSUpdateData_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(SMBIOSUpdateData_DIR)\SMBIOSUpdateData.CIF $(CIF2MAK_DEFAULTS) + +SMBIOSUpdateData_INCLUDES = \ + $(EDK_INCLUDES)\ + /I$(PROJECT_DIR)\ + /IInclude\ + +SMBIOSUpdateDataBin : $(EFIDRIVERLIB) + $(MAKE) /$(MAKEFLAGS) $(EDK_DEFAULTS)\ + /f $(BUILD_DIR)\SMBIOSUpdateData.mak all\ + NAME=SMBIOSUpdateData\ + "MY_INCLUDES=$(SMBIOSUpdateData_INCLUDES)"\ + GUID=B98999A4-E96F-475a-99FC-762126F50F5A\ + ENTRY_POINT=SMBIOSUpdateDataDriverEntryPoint\ + DEPEX1=$(SMBIOSUpdateData_DIR)\SMBIOSUpdateData.dxs \ + DEPEX1_TYPE=EFI_SECTION_DXE_DEPEX \ + TYPE=BS_DRIVER\ + COMPRESS=1\ + +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2011, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* diff --git a/Board/EM/Platform/SMBIOSUpdateData/SMBIOSUpdateData.sdl b/Board/EM/Platform/SMBIOSUpdateData/SMBIOSUpdateData.sdl new file mode 100644 index 0000000..e4b7448 --- /dev/null +++ b/Board/EM/Platform/SMBIOSUpdateData/SMBIOSUpdateData.sdl @@ -0,0 +1,24 @@ +TOKEN + Name = "SMBIOSUpdateData_SUPPORT" + Value = "1" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes + Help = "Main switch to enable SMBIOSUpdateData support in Project" +End + +MODULE + Help = "Includes SMBIOSUpdateData.mak to Project" + File = "SMBIOSUpdateData.mak" +End + +PATH + Name = "SMBIOSUpdateData_DIR" +End + +ELINK + Name = "$(BUILD_DIR)\SMBIOSUpdateData.ffs" + Parent = "FV_MAIN" + InvokeOrder = AfterParent +End diff --git a/Board/EM/Platform/SMBIOSUpdateData/SmbiosUpdateDataProtocol.h b/Board/EM/Platform/SMBIOSUpdateData/SmbiosUpdateDataProtocol.h new file mode 100644 index 0000000..991c091 --- /dev/null +++ b/Board/EM/Platform/SMBIOSUpdateData/SmbiosUpdateDataProtocol.h @@ -0,0 +1,100 @@ +/*++ +Copyright (c) 2009 Intel Corporation. All rights reserved. +This software and associated documentation (if any) is furnished +under a license and may only be used or copied in accordance +with the terms of the license. Except as permitted by such +license, no part of this software or documentation may be +reproduced, stored in a retrieval system, or transmitted in any +form or by any means without the express written consent of +Intel Corporation. +--*/ + +#ifndef _EFI_SMBOS_UPDATE_DATA_PROTOCOL_H_ +#define _EFI_SMBOS_UPDATE_DATA_PROTOCOL_H_ + +#include +#include + +#define EFI_SMBIOS_UPDATE_DATA_PROTOCOL_GUID \ + {0x67269263, 0xaf1, 0x45dd, 0x93, 0xc8, 0x29, 0x99, 0x21, 0xd0, 0xe1, 0xe9} + +typedef struct _EFI_SMBIOS_UPDATE_DATA_PROTOCOL EFI_SMBIOS_UPDATE_DATA_PROTOCOL; + +typedef UINT16 (EFIAPI *EFI_SMBIOS_UPDATE_DATA_GET_FREE_HANDLE) ( + IN SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint +); + +typedef UINT16 (EFIAPI *EFI_SMBIOS_UPDATE_DATA_FIND_STRUCTURE) ( + IN SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint, + IN UINT8 Type, + IN UINT8 Index +); + +typedef UINT8 * (EFIAPI *EFI_SMBIOS_UPDATE_DATA_GET_STRUCTURE_BASE) ( + IN SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint, + IN UINT16 Handle +); + +typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_UPDATE_DATA_DELETE_STRUCTURE) ( + IN SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint, + IN UINT16 Handle +); + +typedef UINT8 * (EFIAPI *EFI_SMBIOS_UPDATE_DATA_COPY_STRUCTURE) ( + IN SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint, + IN UINT16 Handle +); + +typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_UPDATE_DATA_INSERT_STRUCTURE) ( + IN SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint, + IN UINT8 *StructurePtrTemp, + IN UINT16 BufferSize +); + +typedef struct _EFI_SMBIOS_UPDATE_DATA_PROTOCOL { + EFI_SMBIOS_UPDATE_DATA_GET_FREE_HANDLE SMBIOS_GetFreeHandle; + EFI_SMBIOS_UPDATE_DATA_FIND_STRUCTURE SMBIOS_FindStructure; + EFI_SMBIOS_UPDATE_DATA_GET_STRUCTURE_BASE SMBIOS_GetStructureBase; + EFI_SMBIOS_UPDATE_DATA_DELETE_STRUCTURE SMBIOS_DeleteStructure; + EFI_SMBIOS_UPDATE_DATA_COPY_STRUCTURE SMBIOS_CopyStructure; + EFI_SMBIOS_UPDATE_DATA_INSERT_STRUCTURE SMBIOS_InsertStructure; +}; + +UINT16 +SMBIOS_GetFreeHandle( + IN SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint +); + +UINT16 +SMBIOS_FindStructure( + IN SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint, + IN UINT8 Type, + IN UINT8 Index +); + +UINT8 * +SMBIOS_GetStructureBase( + IN SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint, + IN UINT16 Handle +); + +EFI_STATUS +SMBIOS_DeleteStructure( + IN SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint, + IN UINT16 Handle +); + +UINT8 * +SMBIOS_CopyStructure( + IN SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint, + IN UINT16 Handle +); + +EFI_STATUS +SMBIOS_InsertStructure( + IN SMBIOS_TABLE_ENTRY_POINT *pSmbiosTableEntryPoint, + IN UINT8 *StructurePtrTemp, + IN UINT16 BufferSize +); + +#endif diff --git a/Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.asl b/Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.asl new file mode 100644 index 0000000..e9df479 --- /dev/null +++ b/Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.asl @@ -0,0 +1,52 @@ + +DefinitionBlock ( + "AcpiDebug.aml", + "SSDT", + 1, + "Intel_", + "ADebTabl", + 0x1000 + ) +{ + Scope(\) + { + // + // These pointers are patched during POST. + // + Name(DPTR, 0x80000000) // Address of Acpi debug memory buffer, fixed up during POST + Name(EPTR, 0x80000000) // End of Acpi debug memory buffer, fixed up during POST + Name(CPTR, 0x80000000) // Current pointer used as an index into the buffer(starts after the buffer signature), fixed up during POST + + // + //Use a Mutex to prevent multiple calls from simutaneously writing to the same memory. + // + Mutex(MMUT, 0) + + // + // Write a string to a memory buffer + // + Method(MDBG,1,Serialized) + { + Store (Acquire(MMUT, 1000),Local0) // save Acquire result so we can check for Mutex acquired + If (LEqual(Local0, Zero)) // check for Mutex acquired + { + OperationRegion(ABLK, SystemMemory, CPTR, 16) // Operation region to allow writes to ACPI debug buffer + Field(ABLK, ByteAcc, NoLock, Preserve) + { + Offset(0x0), + AAAA, 128 // 16 byte string or data + } + Store(Arg0,AAAA) // anything past string buffer size is ignored by ACPI + + Add(CPTR,16,CPTR) // advance current pointer to next string location in memory buffer + If (LGreaterEqual(CPTR,EPTR) ) // check for end of 64kb Acpi debug buffer + { + Add(DPTR,16,CPTR) // wrap around to beginning of buffer if the end has been reached + } + Release(MMUT) + } + Return(Local0) // return error code indicating whether Mutex was acquired + } + + } // End Scope +} // End SSDT diff --git a/Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.cif b/Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.cif new file mode 100644 index 0000000..9c26ea5 --- /dev/null +++ b/Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.cif @@ -0,0 +1,10 @@ + + name = "SsdtAcpiDebug" + category = ModulePart + LocalRoot = "Board\EM\Platform\SsdtAcpiDebug" + RefName = "SsdtAcpiDebug" +[files] +"SsdtAcpiDebug.sdl" +"SsdtAcpiDebug.mak" +"SsdtAcpiDebug.asl" + diff --git a/Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.mak b/Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.mak new file mode 100644 index 0000000..98910bc --- /dev/null +++ b/Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.mak @@ -0,0 +1,80 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2011, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* + +#************************************************************************* +# +# +# Name: SsdtAcpiDebug.mak +# +# Description: MAke file to build Aptio ACPI ASL components +# +# +# +#************************************************************************* +all : BuildACPIDEBUG + +BuildACPIDEBUG : $(BUILD_DIR)\ACPIDEBUG.ffs + +#----------------------------------------------------------------------- +# ASL compiler definition +#----------------------------------------------------------------------- +!IF "$(ACPIPLATFORM_ASL_COMPILER)"=="" +!ERROR It is an invalid path, please check your ASL compiler path. +!ENDIF + +IASL = $(ACPIPLATFORM_ASL_COMPILER) +#----------------------------------------------------------------------- +$(BUILD_DIR)\SsdtAcpiDebug.aml : $(INTEL_ACPIDEBUG_ASL_FILE) + @cl /C /EP $(INTEL_ACPIDEBUG_ASL_FILE) > $(BUILD_DIR)\SsdtAcpiDebug.asl + $(IASL) -p $(BUILD_DIR)\SsdtAcpiDebug.aml $(BUILD_DIR)\SsdtAcpiDebug.asl + +$(BUILD_DIR)\SsdtAcpiDebug.sec: $(BUILD_DIR)\SsdtAcpiDebug.aml + $(GENSECTION) -I $*.aml -O $@ -S EFI_SECTION_RAW + +#Note. Expand the package with SsdtAcpiDebug tables. +# DXE phase will load the tables +# and update Aml contents if provided in Acpiplatform.c + +$(BUILD_DIR)\ACPIDEBUG.ffs: $(BUILD_DIR)\SsdtAcpiDebug.sec + $(GENFFSFILE) -B $(BUILD_DIR) -V -o $@ -P1 <<$(BUILD_DIR)\SsdtAcpiDebug.pkg + +PACKAGE.INF +[.] +BASE_NAME = ACPIDEBUG +FFS_FILEGUID = 94AB6AED-9719-48ef-831C-2E9C29758C33 +FFS_FILETYPE = EFI_FV_FILETYPE_FREEFORM +FFS_ATTRIB_CHECKSUM = TRUE + +IMAGE_SCRIPT = +{ + Compress (dummy) { + $(PROJECT_DIR)\$(BUILD_DIR)\SsdtAcpiDebug.sec + } +} +< + name = "SsdtSensorHub" + category = ModulePart + LocalRoot = "Board\EM\Platform\SsdtSensorHub" + RefName = "SsdtSensorHub" +[files] +"SsdtSensorHub.sdl" +"SsdtSensorHub.mak" +"SsdtSensorHub.asl" + diff --git a/Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.mak b/Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.mak new file mode 100644 index 0000000..77444e6 --- /dev/null +++ b/Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.mak @@ -0,0 +1,80 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2011, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* + +#************************************************************************* +# +# +# Name: SsdtAcpiDebug.mak +# +# Description: MAke file to build Aptio ACPI ASL components +# +# +# +#************************************************************************* +all : BuildSENSORHUB + +BuildSENSORHUB : $(BUILD_DIR)\SENSORHUB.ffs + +#----------------------------------------------------------------------- +# ASL compiler definition +#----------------------------------------------------------------------- +!IF "$(ACPIPLATFORM_ASL_COMPILER)"=="" +!ERROR It is an invalid path, please check your ASL compiler path. +!ENDIF + +IASL = $(ACPIPLATFORM_ASL_COMPILER) +#----------------------------------------------------------------------- +$(BUILD_DIR)\SsdtSensorHub.aml : $(INTEL_SENSORHUB_ASL_FILE) + @cl /C /EP $(INTEL_SENSORHUB_ASL_FILE) > $(BUILD_DIR)\SsdtSensorHub.asl + $(IASL) -p $(BUILD_DIR)\SsdtSensorHub.aml $(BUILD_DIR)\SsdtSensorHub.asl + +$(BUILD_DIR)\SsdtSensorHub.sec: $(BUILD_DIR)\SsdtSensorHub.aml + $(GENSECTION) -I $*.aml -O $@ -S EFI_SECTION_RAW + +#Note. Expand the package with SsdtSensorHub tables. +# DXE phase will load the tables +# and update Aml contents if provided in Acpiplatform.c + +$(BUILD_DIR)\SENSORHUB.ffs: $(BUILD_DIR)\SsdtSensorHub.sec + $(GENFFSFILE) -B $(BUILD_DIR) -V -o $@ -P1 <<$(BUILD_DIR)\SsdtSensorHub.pkg + +PACKAGE.INF +[.] +BASE_NAME = SENSORHUB +FFS_FILEGUID = A3201EEC-1612-4577-8924-CB32D542D22C +FFS_FILETYPE = EFI_FV_FILETYPE_FREEFORM +FFS_ATTRIB_CHECKSUM = TRUE + +IMAGE_SCRIPT = +{ + Compress (dummy) { + $(PROJECT_DIR)\$(BUILD_DIR)\SsdtSensorHub.sec + } +} +<