diff options
Diffstat (limited to 'ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Dxe')
5 files changed, 252 insertions, 0 deletions
diff --git a/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Dxe/SaPcieDxeLib.c b/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Dxe/SaPcieDxeLib.c new file mode 100644 index 0000000..ccf7775 --- /dev/null +++ b/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Dxe/SaPcieDxeLib.c @@ -0,0 +1,99 @@ +/** @file + This is DXE 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" +#include EFI_PROTOCOL_CONSUMER (BootScriptSave) + +/** + 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 - Always returns EFI_SUCCESS +**/ +EFI_STATUS +SaScriptMemWrite ( + IN UINT16 TableName, + IN EFI_BOOT_SCRIPT_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + IN VOID *Buffer +) +{ + SCRIPT_MEM_WRITE (TableName, Width, Address, Count, 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 - Always returns EFI_SUCCESS +**/ +EFI_STATUS +SaScriptMemReadWrite ( + IN UINT16 TableName, + IN EFI_BOOT_SCRIPT_WIDTH Width, + IN UINT64 Address, + IN VOID *Data, + IN VOID *DataMask +) +{ + SCRIPT_MEM_READ_WRITE (TableName, Width, Address, Data, 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 - Always returns EFI_SUCCESS +**/ +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 + ) +{ + SCRIPT_MEM_POLL (TableName, Width, Address, BitMask, BitValue, Duration, LoopTimes); + return EFI_SUCCESS; +} diff --git a/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Dxe/SaPcieDxeLib.cif b/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Dxe/SaPcieDxeLib.cif new file mode 100644 index 0000000..1574d65 --- /dev/null +++ b/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Dxe/SaPcieDxeLib.cif @@ -0,0 +1,11 @@ +<component> + name = "SaPcieDxeLib" + category = ModulePart + LocalRoot = "ReferenceCode\Chipset\SystemAgent\Library\SaPcieLib\Dxe\" + RefName = "SaPcieDxeLib" +[files] +"SaPcieDxeLib.sdl" +"SaPcieDxeLib.mak" +"SaPcieDxeLib.c" +"SaPcieDxeLib.inf" +<endComponent> diff --git a/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Dxe/SaPcieDxeLib.inf b/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Dxe/SaPcieDxeLib.inf new file mode 100644 index 0000000..5ab9c93 --- /dev/null +++ b/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Dxe/SaPcieDxeLib.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 = SaPcieDxeLib +COMPONENT_TYPE = LIBRARY + +[sources.common] + ../Common/SaPcieLib.h + ../Common/SaPcieLib.c + SaPcieDxeLib.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/Dxe + $(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/Dxe/SaPcieDxeLib.mak b/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Dxe/SaPcieDxeLib.mak new file mode 100644 index 0000000..fc86ac2 --- /dev/null +++ b/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Dxe/SaPcieDxeLib.mak @@ -0,0 +1,46 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2011, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* + +# MAK file for the ModulePart:SaPcieDxeLib +EDK : SaPcieDxeLib + +SaPcieDxeLib : $(BUILD_DIR)\SaPcieDxeLib.mak SaPcieDxeLibBin + +$(BUILD_DIR)\SaPcieDxeLib.mak : $(SaPcieDxeLib_DIR)\$(@B).cif $(SaPcieDxeLib_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(SaPcieDxeLib_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +$(SaPcieDxeLib_LIB) : SaPcieDxeLib + +SaPcieDxeLib_DEFINES = \ + $(CFLAGS) \ + +SaPcieDxeLibBin: $(SaPcieLib_LIB) + $(MAKE) /$(MAKEFLAGS) $(EDK_DEFAULTS) \ + /f $(BUILD_DIR)\SaPcieDxeLib.mak all \ + "CFLAGS=$(SaPcieDxeLib_DEFINES)"\ + TYPE=LIBRARY LIBRARIES= \ + LIBRARY_NAME=$(SaPcieDxeLib_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/Dxe/SaPcieDxeLib.sdl b/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Dxe/SaPcieDxeLib.sdl new file mode 100644 index 0000000..2b306dd --- /dev/null +++ b/ReferenceCode/Chipset/SystemAgent/Library/SaPcieLib/Dxe/SaPcieDxeLib.sdl @@ -0,0 +1,33 @@ +TOKEN + Name = "SaPcieDxeLib_SUPPORT" + Value = "1" + Help = "Main switch to enable SaPcieDxeLib support in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + TargetH = Yes + Master = Yes + Token = "SaPcieLib_SUPPORT" "=" "1" +# Token = "SA_PCIE_ASPM_IN_DXE" "=" "1" +End + +PATH + Name = "SaPcieDxeLib_DIR" + Help = "SaPcieDxeLib file source directory" +End + +MODULE + File = "SaPcieDxeLib.mak" + Help = "Includes SaPcieDxeLib.mak to Project" +End + +ELINK + Name = "SaPcieDxeLib_LIB" + InvokeOrder = ReplaceParent +End + +ELINK + Name = "$(BUILD_DIR)\SaPcieDxeLib.lib" + Parent = "SaPcieDxeLib_LIB" + InvokeOrder = AfterParent +End
\ No newline at end of file |