From b7c51c9cf4864df6aabb99a1ae843becd577237c Mon Sep 17 00:00:00 2001 From: raywu Date: Fri, 15 Jun 2018 00:00:50 +0800 Subject: init. 1AQQW051 --- .../Library/SaPcieLib/Smm/SaPcieSmmLib.c | 94 ++++++++++++++++++++++ .../Library/SaPcieLib/Smm/SaPcieSmmLib.cif | 11 +++ .../Library/SaPcieLib/Smm/SaPcieSmmLib.inf | 63 +++++++++++++++ .../Library/SaPcieLib/Smm/SaPcieSmmLib.mak | 50 ++++++++++++ .../Library/SaPcieLib/Smm/SaPcieSmmLib.sdl | 34 ++++++++ 5 files changed, 252 insertions(+) create mode 100644 ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Smm/SaPcieSmmLib.c create mode 100644 ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Smm/SaPcieSmmLib.cif create mode 100644 ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Smm/SaPcieSmmLib.inf create mode 100644 ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Smm/SaPcieSmmLib.mak create mode 100644 ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Smm/SaPcieSmmLib.sdl (limited to 'ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Smm') diff --git a/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Smm/SaPcieSmmLib.c b/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Smm/SaPcieSmmLib.c new file mode 100644 index 0000000..5d44c9c --- /dev/null +++ b/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Smm/SaPcieSmmLib.c @@ -0,0 +1,94 @@ +/** @file + This is SMM library code used by Intel System Agent PCIe library + +@copyright + Copyright (c) 2012 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 an 'Intel Peripheral Driver' and uniquely + identified as "Intel Reference Module" 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 "EfiScriptLib.h" + +/** + Wrapper for boot script with opcode EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE + + @param[in] TableName - Desired boot script table + @param[in] Width - The width of the memory operations. + @param[in] Address - The base address of the memory operations. + @param[in] Count - The number of memory operations to perform. + @param[in] Buffer - The source buffer from which to write the data. + + @retval EFI_SUCCESS - The operation was executed successfully +**/ +EFI_STATUS +SaScriptMemWrite ( + IN UINT16 TableName, + IN EFI_BOOT_SCRIPT_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + IN VOID *Buffer +) +{ + return EFI_SUCCESS; +} + +/** + Wrapper for boot script with opcode EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE + + @param[in] TableName - Desired boot script table + @param[in] Width - The width of the memory operations. + @param[in] Address - The base address of the memory operations. + @param[in] Data - A pointer to the data to be OR-ed. + @param[in] DataMask - A pointer to the data mask to be AND-ed with the data read from the register. + + @retval EFI_SUCCESS - The operation was executed successfully +**/ +EFI_STATUS +SaScriptMemReadWrite ( + IN UINT16 TableName, + IN EFI_BOOT_SCRIPT_WIDTH Width, + IN UINT64 Address, + IN VOID *Data, + IN VOID *DataMask +) +{ + return EFI_SUCCESS; +} + +/** + Wrapper for boot script for Polling one memory mapping register + + @param[in] TableName - Desired boot script table + @param[in] Width - The width of the memory operations. + @param[in] Address - The base address of the memory operations. + @param[in] BitMask - A pointer to the bit mask to be AND-ed with the data read from the register. + @param[in] BitValue - A pointer to the data value after to be Masked. + @param[in] Duration - Duration in microseconds of the stall. + @param[in] LoopTimes - The times of the register polling. + + @retval EFI_SUCCESS - The operation was executed successfully +**/ +EFI_STATUS +SaScriptMemPoll ( + IN UINT16 TableName, + IN EFI_BOOT_SCRIPT_WIDTH Width, + IN UINT64 Address, + IN VOID *BitMask, + IN VOID *BitValue, + IN UINTN Duration, + IN UINTN LoopTimes + ) +{ + return EFI_SUCCESS; +} \ No newline at end of file diff --git a/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Smm/SaPcieSmmLib.cif b/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Smm/SaPcieSmmLib.cif new file mode 100644 index 0000000..9fa9ac2 --- /dev/null +++ b/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Smm/SaPcieSmmLib.cif @@ -0,0 +1,11 @@ + + name = "SaPcieSmmLib" + category = ModulePart + LocalRoot = "ReferenceCode\Chipset\SystemAgent\Library\SaPcieLib\Smm\" + RefName = "SaPcieSmmLib" +[files] +"SaPcieSmmLib.sdl" +"SaPcieSmmLib.mak" +"SaPcieSmmLib.c" +"SaPcieSmmLib.inf" + diff --git a/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Smm/SaPcieSmmLib.inf b/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Smm/SaPcieSmmLib.inf new file mode 100644 index 0000000..97c4c12 --- /dev/null +++ b/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Smm/SaPcieSmmLib.inf @@ -0,0 +1,63 @@ +## @file +# Component description file for the SA PCIE library +# +#@copyright +# Copyright (c) 2012 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 +# + +[defines] +BASE_NAME = SaPcieSmmLib +COMPONENT_TYPE = LIBRARY + +[sources.common] + ../Common/SaPcieLib.h + ../Common/SaPcieLib.c + SaPcieSmmLib.c + +[includes.common] + . + $(EDK_SOURCE)/Foundation/Library/Pei/Include + $(EDK_SOURCE)/Foundation/Efi + $(EDK_SOURCE)/Foundation/Include + $(EDK_SOURCE)/Foundation/Efi/Include + $(EDK_SOURCE)/Foundation/Framework/Include + $(EFI_SOURCE)/$(PROJECT_PCH_ROOT)/Include + $(EFI_SOURCE)/$(PROJECT_PCH_ROOT) + $(EFI_SOURCE)/$(PROJECT_PCH_ROOT)/Include/Library + $(EFI_SOURCE)/$(PROJECT_SA_ROOT)/Library/SaPcieLib/Smm + $(EFI_SOURCE)/$(PROJECT_SA_ROOT)/Include + $(EFI_SOURCE)/$(PROJECT_SA_ROOT) + $(EFI_SOURCE)/$(PROJECT_CPU_ROOT)/Include/Library + $(EFI_SOURCE)/$(PROJECT_CPU_ROOT)/Include +# +# EDK II Glue Library utilizes some standard headers from EDK +# + $(EFI_SOURCE) + $(EDK_SOURCE)/Foundation + $(EDK_SOURCE)/Foundation/Framework + $(EDK_SOURCE)/Foundation/Include/IndustryStandard + $(EDK_SOURCE)/Foundation/Core/Dxe + $(EDK_SOURCE)/Foundation/Include/Pei + $(EDK_SOURCE)/Foundation/Library/Dxe/Include + $(EDK_SOURCE)/Foundation/Library/EdkIIGlueLib/Include + +[libraries.common] + EdkIIGlueBasePciLibPciExpress + +[nmake.common] +C_FLAGS = $(C_FLAGS) +C_STD_INCLUDE= + + diff --git a/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Smm/SaPcieSmmLib.mak b/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Smm/SaPcieSmmLib.mak new file mode 100644 index 0000000..4d18c76 --- /dev/null +++ b/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Smm/SaPcieSmmLib.mak @@ -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 ** +#** ** +#************************************************************************* +#************************************************************************* + +#--------------------------------------------------------------------------- +# Create SaPcieSmmLib Driver +#--------------------------------------------------------------------------- + +# MAK file for the ModulePart:SaPcieSmmLib +EDK : SaPcieSmmLib + +SaPcieSmmLib : $(BUILD_DIR)\SaPcieSmmLib.mak SaPcieSmmLibBin + +$(BUILD_DIR)\SaPcieSmmLib.mak : $(SaPcieSmmLib_DIR)\$(@B).cif $(SaPcieSmmLib_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(SaPcieSmmLib_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +$(SaPcieSmmLib_LIB) : SaPcieSmmLib + +SaPcieSmmLib_DEFINES = \ + $(CFLAGS) \ + +SaPcieSmmLibBin: $(SaPcieLib_LIB) + $(MAKE) /$(MAKEFLAGS) $(EDK_DEFAULTS) \ + /f $(BUILD_DIR)\SaPcieSmmLib.mak all \ + "CFLAGS=$(SaPcieSmmLib_DEFINES)"\ + TYPE=LIBRARY LIBRARIES= \ + LIBRARY_NAME=$(SaPcieSmmLib_LIB) +#************************************************************************* +#************************************************************************* +#** ** +#** (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/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Smm/SaPcieSmmLib.sdl b/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Smm/SaPcieSmmLib.sdl new file mode 100644 index 0000000..5641512 --- /dev/null +++ b/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Smm/SaPcieSmmLib.sdl @@ -0,0 +1,34 @@ +TOKEN + Name = "SaPcieSmmLib_SUPPORT" + Value = "1" + Help = "Main switch to enable SaPcieSmmLib support in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + TargetH = Yes + Master = Yes + Token = "SaPcieLib_SUPPORT" "=" "1" +# Token = "SA_PCIE_ASPM_IN_SMM" "=" "1" +End + + +PATH + Name = "SaPcieSmmLib_DIR" + Help = "SaPcieSmmLib file source directory" +End + +MODULE + File = "SaPcieSmmLib.mak" + Help = "Includes SaPcieSmmLib.mak to Project" +End + +ELINK + Name = "SaPcieSmmLib_LIB" + InvokeOrder = ReplaceParent +End + +ELINK + Name = "$(BUILD_DIR)\SaPcieSmmLib_Lib.lib" + Parent = "SaPcieSmmLib_LIB" + InvokeOrder = AfterParent +End \ No newline at end of file -- cgit v1.2.3