From b7c51c9cf4864df6aabb99a1ae843becd577237c Mon Sep 17 00:00:00 2001 From: raywu Date: Fri, 15 Jun 2018 00:00:50 +0800 Subject: init. 1AQQW051 --- MiscFramework/Efi.h | 1 + MiscFramework/Guid/AcpiVariable/AcpiVariable.c | 35 +++ MiscFramework/Guid/AcpiVariable/AcpiVariable.h | 84 ++++++ .../Guid/ExtdAcpiVariable/ExtdAcpiVariable.c | 17 ++ .../Guid/ExtdAcpiVariable/ExtdAcpiVariable.h | 51 ++++ MiscFramework/Guid/FrameworkGuidLib.cif | 22 ++ MiscFramework/Guid/FrameworkGuidLib.mak | 67 +++++ MiscFramework/Guid/FrameworkGuidLib.sdl | 26 ++ MiscFramework/Guid/LegacyBios/LegacyBios.h | 38 +++ .../Guid/MemoryConfigData/MemoryConfigData.c | 35 +++ .../Guid/MemoryConfigData/MemoryConfigData.h | 40 +++ MiscFramework/Guid/TcgDataHob/TcgDataHob.c | 28 ++ MiscFramework/Guid/TcgDataHob/TcgDataHob.h | 34 +++ MiscFramework/Guid/TcgLogHob/TcgLogHob.c | 29 ++ MiscFramework/Guid/TcgLogHob/TcgLogHob.h | 41 +++ .../Guid/TpmStateInitHob/TpmStateInitHob.c | 29 ++ .../Guid/TpmStateInitHob/TpmStateInitHob.h | 39 +++ .../Library/Dxe/EfiRegTableLib/EfiRegTableLib.c | 313 +++++++++++++++++++++ .../Library/Dxe/EfiRegTableLib/EfiRegTableLib.cif | 10 + .../Library/Dxe/EfiRegTableLib/EfiRegTableLib.mak | 80 ++++++ .../Library/Dxe/EfiRegTableLib/EfiRegTableLib.sdl | 36 +++ .../Smm/EfiSmmDriverLib/EfiSmmDriverLib.cif | 12 + .../Smm/EfiSmmDriverLib/EfiSmmDriverLib.mak | 70 +++++ .../Smm/EfiSmmDriverLib/EfiSmmDriverLib.sdl | 36 +++ .../Library/Smm/EfiSmmDriverLib/LibGlobals.c | 45 +++ .../Library/Smm/EfiSmmDriverLib/SmmDriverLib.c | 244 ++++++++++++++++ MiscFramework/Library/Smm/EfiSmmDriverLib/debug.c | 169 +++++++++++ MiscFramework/MiscFramework.cif | 18 ++ MiscFramework/MiscFramework.mak | 66 +++++ MiscFramework/MiscFramework.sdl | 40 +++ MiscFramework/Ppi/AtaController/AtaController.c | 35 +++ MiscFramework/Ppi/AtaController/AtaController.h | 62 ++++ MiscFramework/Ppi/AtaPolicy/AtaPolicy.c | 35 +++ MiscFramework/Ppi/AtaPolicy/AtaPolicy.h | 45 +++ MiscFramework/Ppi/Capsule/Capsule.c | 36 +++ MiscFramework/Ppi/Capsule/Capsule.h | 69 +++++ MiscFramework/Ppi/FrameworkPpiLib.cif | 21 ++ MiscFramework/Ppi/FrameworkPpiLib.mak | 60 ++++ MiscFramework/Ppi/FrameworkPpiLib.sdl | 28 ++ .../Ppi/PlatformMemoryRange/PlatformMemoryRange.c | 35 +++ .../Ppi/PlatformMemoryRange/PlatformMemoryRange.h | 156 ++++++++++ .../Ppi/PlatformMemorySize/PlatformMemorySize.c | 35 +++ .../Ppi/PlatformMemorySize/PlatformMemorySize.h | 55 ++++ MiscFramework/Ppi/SmbusPolicy/SmbusPolicy.c | 35 +++ MiscFramework/Ppi/SmbusPolicy/SmbusPolicy.h | 48 ++++ MiscFramework/Ppi/SmmControl/SmmControl.c | 35 +++ MiscFramework/Ppi/SmmControl/SmmControl.h | 67 +++++ MiscFramework/Ppi/SmmControlLib.cif | 11 + MiscFramework/Ppi/SmmControlLib.mak | 72 +++++ MiscFramework/Ppi/SmmControlLib.sdl | 28 ++ MiscFramework/TcgAcpi.h | 45 +++ 51 files changed, 2768 insertions(+) create mode 100644 MiscFramework/Efi.h create mode 100644 MiscFramework/Guid/AcpiVariable/AcpiVariable.c create mode 100644 MiscFramework/Guid/AcpiVariable/AcpiVariable.h create mode 100644 MiscFramework/Guid/ExtdAcpiVariable/ExtdAcpiVariable.c create mode 100644 MiscFramework/Guid/ExtdAcpiVariable/ExtdAcpiVariable.h create mode 100644 MiscFramework/Guid/FrameworkGuidLib.cif create mode 100644 MiscFramework/Guid/FrameworkGuidLib.mak create mode 100644 MiscFramework/Guid/FrameworkGuidLib.sdl create mode 100644 MiscFramework/Guid/LegacyBios/LegacyBios.h create mode 100644 MiscFramework/Guid/MemoryConfigData/MemoryConfigData.c create mode 100644 MiscFramework/Guid/MemoryConfigData/MemoryConfigData.h create mode 100644 MiscFramework/Guid/TcgDataHob/TcgDataHob.c create mode 100644 MiscFramework/Guid/TcgDataHob/TcgDataHob.h create mode 100644 MiscFramework/Guid/TcgLogHob/TcgLogHob.c create mode 100644 MiscFramework/Guid/TcgLogHob/TcgLogHob.h create mode 100644 MiscFramework/Guid/TpmStateInitHob/TpmStateInitHob.c create mode 100644 MiscFramework/Guid/TpmStateInitHob/TpmStateInitHob.h create mode 100644 MiscFramework/Library/Dxe/EfiRegTableLib/EfiRegTableLib.c create mode 100644 MiscFramework/Library/Dxe/EfiRegTableLib/EfiRegTableLib.cif create mode 100644 MiscFramework/Library/Dxe/EfiRegTableLib/EfiRegTableLib.mak create mode 100644 MiscFramework/Library/Dxe/EfiRegTableLib/EfiRegTableLib.sdl create mode 100644 MiscFramework/Library/Smm/EfiSmmDriverLib/EfiSmmDriverLib.cif create mode 100644 MiscFramework/Library/Smm/EfiSmmDriverLib/EfiSmmDriverLib.mak create mode 100644 MiscFramework/Library/Smm/EfiSmmDriverLib/EfiSmmDriverLib.sdl create mode 100644 MiscFramework/Library/Smm/EfiSmmDriverLib/LibGlobals.c create mode 100644 MiscFramework/Library/Smm/EfiSmmDriverLib/SmmDriverLib.c create mode 100644 MiscFramework/Library/Smm/EfiSmmDriverLib/debug.c create mode 100644 MiscFramework/MiscFramework.cif create mode 100644 MiscFramework/MiscFramework.mak create mode 100644 MiscFramework/MiscFramework.sdl create mode 100644 MiscFramework/Ppi/AtaController/AtaController.c create mode 100644 MiscFramework/Ppi/AtaController/AtaController.h create mode 100644 MiscFramework/Ppi/AtaPolicy/AtaPolicy.c create mode 100644 MiscFramework/Ppi/AtaPolicy/AtaPolicy.h create mode 100644 MiscFramework/Ppi/Capsule/Capsule.c create mode 100644 MiscFramework/Ppi/Capsule/Capsule.h create mode 100644 MiscFramework/Ppi/FrameworkPpiLib.cif create mode 100644 MiscFramework/Ppi/FrameworkPpiLib.mak create mode 100644 MiscFramework/Ppi/FrameworkPpiLib.sdl create mode 100644 MiscFramework/Ppi/PlatformMemoryRange/PlatformMemoryRange.c create mode 100644 MiscFramework/Ppi/PlatformMemoryRange/PlatformMemoryRange.h create mode 100644 MiscFramework/Ppi/PlatformMemorySize/PlatformMemorySize.c create mode 100644 MiscFramework/Ppi/PlatformMemorySize/PlatformMemorySize.h create mode 100644 MiscFramework/Ppi/SmbusPolicy/SmbusPolicy.c create mode 100644 MiscFramework/Ppi/SmbusPolicy/SmbusPolicy.h create mode 100644 MiscFramework/Ppi/SmmControl/SmmControl.c create mode 100644 MiscFramework/Ppi/SmmControl/SmmControl.h create mode 100644 MiscFramework/Ppi/SmmControlLib.cif create mode 100644 MiscFramework/Ppi/SmmControlLib.mak create mode 100644 MiscFramework/Ppi/SmmControlLib.sdl create mode 100644 MiscFramework/TcgAcpi.h (limited to 'MiscFramework') diff --git a/MiscFramework/Efi.h b/MiscFramework/Efi.h new file mode 100644 index 0000000..aefcbd6 --- /dev/null +++ b/MiscFramework/Efi.h @@ -0,0 +1 @@ +#include "Tiano.h" \ No newline at end of file diff --git a/MiscFramework/Guid/AcpiVariable/AcpiVariable.c b/MiscFramework/Guid/AcpiVariable/AcpiVariable.c new file mode 100644 index 0000000..a181f41 --- /dev/null +++ b/MiscFramework/Guid/AcpiVariable/AcpiVariable.c @@ -0,0 +1,35 @@ +/*++ + 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 +--*/ +/*++ + +Copyright (c) 1999 - 2003 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: + + AcpiVariable.c + +Abstract: + + GUIDs used for ACPI variables. + +--*/ + +#include "Tiano.h" +#include EFI_GUID_DEFINITION (AcpiVariable) + +EFI_GUID gEfiAcpiVariableGuid = EFI_ACPI_VARIABLE_GUID; + +EFI_GUID_STRING(&gEfiAcpiVariableGuid, "ACPI Variable", "ACPI 2.0 Variable GUID"); diff --git a/MiscFramework/Guid/AcpiVariable/AcpiVariable.h b/MiscFramework/Guid/AcpiVariable/AcpiVariable.h new file mode 100644 index 0000000..44cb5c3 --- /dev/null +++ b/MiscFramework/Guid/AcpiVariable/AcpiVariable.h @@ -0,0 +1,84 @@ +// +// 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 +// +/*++ + +Copyright (c) 1999 - 2003 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: + + AcpiVariable.h + +Abstract: + + GUIDs used for ACPI variables. + +--*/ + +#ifndef _ACPI_VARIABLE_H_ +#define _ACPI_VARIABLE_H_ + +#define EFI_ACPI_VARIABLE_GUID \ + { \ + 0xaf9ffd67, 0xec10, 0x488a, 0x9d, 0xfc, 0x6c, 0xbf, 0x5e, 0xe2, 0x2c, 0x2e \ + } + +#define ACPI_GLOBAL_VARIABLE L"AcpiGlobalVariable" + +// +// The following structure combine all ACPI related variables into one in order +// to boost performance +// +#pragma pack (1) +typedef struct { + UINT16 Limit; + UINTN Base; +} PSEUDO_DESCRIPTOR; +#pragma pack() + +typedef struct { + BOOLEAN APState; + BOOLEAN S3BootPath; + EFI_PHYSICAL_ADDRESS WakeUpBuffer; + EFI_PHYSICAL_ADDRESS GdtrProfile; + EFI_PHYSICAL_ADDRESS IdtrProfile; + EFI_PHYSICAL_ADDRESS CpuPrivateData; + EFI_PHYSICAL_ADDRESS StackAddress; + EFI_PHYSICAL_ADDRESS MicrocodePointerBuffer; + + EFI_PHYSICAL_ADDRESS SmramBase; + EFI_PHYSICAL_ADDRESS SmmStartImageBase; + UINT32 SmmStartImageSize; + UINT32 NumberOfCpus; + UINT32 ApInitDone; +} ACPI_CPU_DATA; + +typedef struct { + // + // Acpi Related variables + // + EFI_PHYSICAL_ADDRESS AcpiReservedMemoryBase; + UINT32 AcpiReservedMemorySize; + EFI_PHYSICAL_ADDRESS S3ReservedLowMemoryBase; + EFI_PHYSICAL_ADDRESS AcpiBootScriptTable; + EFI_PHYSICAL_ADDRESS RuntimeScriptTableBase; + EFI_PHYSICAL_ADDRESS AcpiFacsTable; + UINT64 SystemMemoryLength; + ACPI_CPU_DATA AcpiCpuData; +} ACPI_VARIABLE_SET; + +extern EFI_GUID gEfiAcpiVariableGuid; + +#endif diff --git a/MiscFramework/Guid/ExtdAcpiVariable/ExtdAcpiVariable.c b/MiscFramework/Guid/ExtdAcpiVariable/ExtdAcpiVariable.c new file mode 100644 index 0000000..fa1c540 --- /dev/null +++ b/MiscFramework/Guid/ExtdAcpiVariable/ExtdAcpiVariable.c @@ -0,0 +1,17 @@ +/*-- +Module Name: + + AcpiVariable.c + +Abstract: + + GUIDs used for ACPI variables. + +--*/ + +#include "Tiano.h" +#include EFI_GUID_DEFINITION (ExtdAcpiVariable) + +EFI_GUID gEfiExtdAcpiVariableGuid = EFI_EXTD_ACPI_VARIABLE_GUID; + +EFI_GUID_STRING(&gEfiExtdAcpiVariableGuid, "ACPI Varigable", "ACPI 2.0 Variable GUID"); diff --git a/MiscFramework/Guid/ExtdAcpiVariable/ExtdAcpiVariable.h b/MiscFramework/Guid/ExtdAcpiVariable/ExtdAcpiVariable.h new file mode 100644 index 0000000..945d6e4 --- /dev/null +++ b/MiscFramework/Guid/ExtdAcpiVariable/ExtdAcpiVariable.h @@ -0,0 +1,51 @@ +// +// 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 +// +/*++ + +Copyright (c) 1999 - 2003 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: + + AcpiVariable.h + +Abstract: + + GUIDs used for ACPI variables. + +--*/ + +#ifndef _ACPI_VARIABLE_H_ +#define _ACPI_VARIABLE_H_ + +#define EFI_EXTD_ACPI_VARIABLE_GUID \ + { \ + 0xbf0c61cd, 0x9ba, 0x49d8, 0x91, 0x87, 0xc2, 0x3a, 0x19, 0x38, 0x41, 0xa4 \ + } + +#define EXTD_ACPI_GLOBAL_VARIABLE L"ExtdAcpiGlobalVariable" + +typedef struct _EXTD_ACPI_VARIABLE_SET { + // + //Miscellanious ACPI Related variables + // + EFI_PHYSICAL_ADDRESS ExtdAcpiFacsTable; + EFI_PHYSICAL_ADDRESS ExtdAcpiFacpTable; +} EXTD_ACPI_VARIABLE_SET; + + +extern EFI_GUID gEfiExtdAcpiVariableGuid; + +#endif diff --git a/MiscFramework/Guid/FrameworkGuidLib.cif b/MiscFramework/Guid/FrameworkGuidLib.cif new file mode 100644 index 0000000..1bd8089 --- /dev/null +++ b/MiscFramework/Guid/FrameworkGuidLib.cif @@ -0,0 +1,22 @@ + + name = "FrameworkGuidLib" + category = ModulePart + LocalRoot = "MiscFramework\Guid\" + RefName = "FrameworkGuidLib" +[files] +"FrameworkGuidLib.sdl" +"FrameworkGuidLib.mak" +"TcgDataHob\TcgDataHob.c" +"TcgDataHob\TcgDataHob.h" +"TcgLogHob\TcgLogHob.c" +"TcgLogHob\TcgLogHob.h" +"LegacyBios\LegacyBios.h" +"TpmStateInitHob\TpmStateInitHob.c" +"TpmStateInitHob\TpmStateInitHob.h" +"AcpiVariable\AcpiVariable.c" +"AcpiVariable\AcpiVariable.h" +"MemoryConfigData\MemoryConfigData.c" +"MemoryConfigData\MemoryConfigData.h" +"ExtdAcpiVariable\ExtdAcpiVariable.c" +"ExtdAcpiVariable\ExtdAcpiVariable.h" + diff --git a/MiscFramework/Guid/FrameworkGuidLib.mak b/MiscFramework/Guid/FrameworkGuidLib.mak new file mode 100644 index 0000000..0d6f8e5 --- /dev/null +++ b/MiscFramework/Guid/FrameworkGuidLib.mak @@ -0,0 +1,67 @@ +#********************************************************************** +#********************************************************************** +#** ** +#** (C)Copyright 1985-2006, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#********************************************************************** +#********************************************************************** + +#********************************************************************** +# $Header: /Alaska/SOURCE/Modules/MPG/Calpella/MiscFramework/FrameworkGuidLib/FrameworkGuidLib.mak 1 10/15/08 2:19p Fasihm $ +# +# $Revision: 1 $ +# +# $Date: 10/15/08 2:19p $ +#********************************************************************** +# Revision History +# ---------------- +# +#********************************************************************** +# +# +# Name: FrameworkGuidLib.mak +# +# Description: +# +# +#********************************************************************** +EDK : FrameworkGuidLib + +$(FrameworkGuidLib_LIB) : FrameworkGuidLib + +FrameworkGuidLib : $(BUILD_DIR)\FrameworkGuidLib.mak FrameworkGuidLibBin + +$(BUILD_DIR)\FrameworkGuidLib.mak : $(FrameworkGuidLib_DIR)\$(@B).cif $(FrameworkGuidLib_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(FrameworkGuidLib_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +FrameworkGuidLibBin : + $(MAKE) /$(MAKEFLAGS) $(EDK_DEFAULTS)\ + /f $(BUILD_DIR)\FrameworkGuidLib.mak all\ + "MY_INCLUDES=$(EDK_INCLUDES) /I$(MISCFRAMEWORK_DIR)" \ + TYPE=LIBRARY +!IF "$(x64_BUILD)"=="1" + $(MAKE) /$(MAKEFLAGS) $(EDK_DEFAULTS) BUILD_DIR=$(BUILD_DIR)\IA32\ + /f $(BUILD_DIR)\FrameworkGuidLib.mak all\ + "MY_INCLUDES=$(EDK_INCLUDES) /I$(MISCFRAMEWORK_DIR)" \ + TYPE=PEI_LIBRARY +!ENDIF + +#********************************************************************** +#********************************************************************** +#** ** +#** (C)Copyright 1985-2006, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#********************************************************************** +#********************************************************************** \ No newline at end of file diff --git a/MiscFramework/Guid/FrameworkGuidLib.sdl b/MiscFramework/Guid/FrameworkGuidLib.sdl new file mode 100644 index 0000000..a7675b6 --- /dev/null +++ b/MiscFramework/Guid/FrameworkGuidLib.sdl @@ -0,0 +1,26 @@ +TOKEN + Name = "FrameworkGuidLib_SUPPORT" + Value = "1" + Help = "Main switch to enable FrameworkGuidLib support in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes +End + +TOKEN + Name = "FrameworkGuidLib_LIB" + Value = "$$(LIB_BUILD_DIR)\FrameworkGuidLib.lib" + TokenType = Expression + TargetMAK = Yes +End + +PATH + Name = "FrameworkGuidLib_DIR" +End + +MODULE + Help = "Includes FrameworkGuidLib.mak to Project" + File = "FrameworkGuidLib.mak" +End + diff --git a/MiscFramework/Guid/LegacyBios/LegacyBios.h b/MiscFramework/Guid/LegacyBios/LegacyBios.h new file mode 100644 index 0000000..52c63e8 --- /dev/null +++ b/MiscFramework/Guid/LegacyBios/LegacyBios.h @@ -0,0 +1,38 @@ +// +// This file contains 'Framework Code' and is licensed as such +// under the terms of your license agreement with Intel or your +// vendor. This file may not be modified, except as allowed by +// additional terms of your license agreement. +// +/*++ + +Copyright (c) 1999 - 2002 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: + + LegacyBios.h + +Abstract: + + +--*/ + +#ifndef _LEGACY_BIOS_H_ +#define _LEGACY_BIOS_H_ + +#define EFI_LEGACY_BIOS_GUID \ + { \ + 0x2e3044ac, 0x879f, 0x490f, 0x97, 0x60, 0xbb, 0xdf, 0xaf, 0x69, 0x5f, 0x50 \ + } + +extern EFI_GUID gEfiLegacyBiosGuid; + +#endif diff --git a/MiscFramework/Guid/MemoryConfigData/MemoryConfigData.c b/MiscFramework/Guid/MemoryConfigData/MemoryConfigData.c new file mode 100644 index 0000000..0e184c7 --- /dev/null +++ b/MiscFramework/Guid/MemoryConfigData/MemoryConfigData.c @@ -0,0 +1,35 @@ +/*++ + This file contains 'Framework Code' and is licensed as such + under the terms of your license agreement with Intel or your + vendor. This file may not be modified, except as allowed by + additional terms of your license agreement. +--*/ +/*++ + +Copyright (c) 1999 - 2001 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: + + MemoryConfigData.c + +Abstract: + + GUID used for Memory Configuration Data entries in the HOB list. + +--*/ + +#include "Tiano.h" +#include EFI_GUID_DEFINITION (MemoryConfigData) + +EFI_GUID gEfiMemoryConfigDataGuid = EFI_MEMORY_CONFIG_DATA_GUID; +CHAR16 EfiMemoryConfigVariable[] = L"MemoryConfig"; + +EFI_GUID_STRING(&gEfiMemoryConfigDataGuid, "Memory Config Data", "Memory Config Data HOB GUID for HOB list."); diff --git a/MiscFramework/Guid/MemoryConfigData/MemoryConfigData.h b/MiscFramework/Guid/MemoryConfigData/MemoryConfigData.h new file mode 100644 index 0000000..a934b9e --- /dev/null +++ b/MiscFramework/Guid/MemoryConfigData/MemoryConfigData.h @@ -0,0 +1,40 @@ +// +// This file contains 'Framework Code' and is licensed as such +// under the terms of your license agreement with Intel or your +// vendor. This file may not be modified, except as allowed by +// additional terms of your license agreement. +// +/*++ + +Copyright (c) 1999 - 2001 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: + + MemoryConfigData.h + +Abstract: + + GUID used for Memory Configuration Data entries in the HOB list. + +--*/ + +#ifndef _MEMORY_CONFIG_DATA_GUID_H_ +#define _MEMORY_CONFIG_DATA_GUID_H_ + +#define EFI_MEMORY_CONFIG_DATA_GUID \ + { \ + 0x80dbd530, 0xb74c, 0x4f11, 0x8c, 0x03, 0x41, 0x86, 0x65, 0x53, 0x28, 0x31 \ + } + +extern EFI_GUID gEfiMemoryConfigDataGuid; +extern CHAR16 EfiMemoryConfigVariable[]; + +#endif diff --git a/MiscFramework/Guid/TcgDataHob/TcgDataHob.c b/MiscFramework/Guid/TcgDataHob/TcgDataHob.c new file mode 100644 index 0000000..34de184 --- /dev/null +++ b/MiscFramework/Guid/TcgDataHob/TcgDataHob.c @@ -0,0 +1,28 @@ +/*++ + +Copyright (c) 1999 - 2002 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: + + TcgLogHob.c + +Abstract: + + GUIDs used for TCG-defined wake event data + +--*/ + +#include "Efi.h" +#include EFI_GUID_DEFINITION (TcgDataHob) + +EFI_GUID gEfiTcgWakeEventDataHobGuid = EFI_TCG_WAKE_EVENT_DATA_HOB_GUID; + +EFI_GUID_STRING (&gEfiTcgWakeEventDataHobGuid, "TCG Wake Event Data HOB", "TCG Wake Event Data HOB"); diff --git a/MiscFramework/Guid/TcgDataHob/TcgDataHob.h b/MiscFramework/Guid/TcgDataHob/TcgDataHob.h new file mode 100644 index 0000000..f9c5d5a --- /dev/null +++ b/MiscFramework/Guid/TcgDataHob/TcgDataHob.h @@ -0,0 +1,34 @@ +/*++ + +Copyright (c) 1999 - 2002 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: + + TcgLogHob.h + +Abstract: + + GUIDs used for TCG-defined wake event data + +--*/ + +#ifndef _TCG_DATA_HOB_GUID_H_ +#define _TCG_DATA_HOB_GUID_H_ + +// +// Definitions for TCG-Defined Wake Event Data +// +#define EFI_TCG_WAKE_EVENT_DATA_HOB_GUID \ + { 0xBBB810BB, 0x5EF0, 0x4E8F, 0xB2, 0x98, 0xAD, 0x74, 0xAA, 0x50, 0xEF, 0x0A } + +extern EFI_GUID gEfiTcgWakeEventDataHobGuid; + +#endif // _TCG_DATA_HOB_GUID_H_ diff --git a/MiscFramework/Guid/TcgLogHob/TcgLogHob.c b/MiscFramework/Guid/TcgLogHob/TcgLogHob.c new file mode 100644 index 0000000..f241828 --- /dev/null +++ b/MiscFramework/Guid/TcgLogHob/TcgLogHob.c @@ -0,0 +1,29 @@ +/*++ + +Copyright (c) 1999 - 2002 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: + + TcgLogHob.c + +Abstract: + + GUIDs used for TCG event log table + +--*/ + +#include "Efi.h" +#include EFI_GUID_DEFINITION (TcgLogHob) + + +EFI_GUID gEfiTcgLogHobGuid = EFI_TCG_LOG_HOB_GUID; + +EFI_GUID_STRING (&gEfiTcgLogHobGuid, "TCG Event Log HOB", "TCG Event Log HOB"); diff --git a/MiscFramework/Guid/TcgLogHob/TcgLogHob.h b/MiscFramework/Guid/TcgLogHob/TcgLogHob.h new file mode 100644 index 0000000..81c76e7 --- /dev/null +++ b/MiscFramework/Guid/TcgLogHob/TcgLogHob.h @@ -0,0 +1,41 @@ +/*++ + +Copyright (c) 1999 - 2002 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: + + TcgLogHob.h + +Abstract: + + GUIDs used for TCG event log table + +--*/ + +#ifndef _TCG_LOG_HOB_GUID_H_ +#define _TCG_LOG_HOB_GUID_H_ + +// +// Definitions for Flash Map +// +#define EFI_TCG_LOG_HOB_GUID \ + { 0x5f7d4e0e, 0x3d6d, 0x42bc, 0xa9, 0x42, 0xe, 0x91, 0xe8, 0x3e, 0x3c, 0x31 } + +typedef struct _TCG_LOG_HOB_ { + UINT32 TableMaxSize; + UINT32 TableSize; + UINT32 EventNum; + UINT32 Reserved; +} TCG_LOG_HOB; + +extern EFI_GUID gEfiTcgLogHobGuid; + +#endif // _TCG_LOG_HOB_GUID_H_ diff --git a/MiscFramework/Guid/TpmStateInitHob/TpmStateInitHob.c b/MiscFramework/Guid/TpmStateInitHob/TpmStateInitHob.c new file mode 100644 index 0000000..1eea80b --- /dev/null +++ b/MiscFramework/Guid/TpmStateInitHob/TpmStateInitHob.c @@ -0,0 +1,29 @@ +/*++ + +Copyright (c) 1999 - 2002 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: + + TpmStateInitHob.c + +Abstract: + + GUID of the HOB data for TPM state initialization. + +--*/ + +#include "Efi.h" +#include EFI_GUID_DEFINITION (TpmStateInitHob) + + +EFI_GUID gEfiTpmStateInitHobGuid = EFI_TPM_STATE_INIT_HUB_GUID; + +EFI_GUID_STRING (&gEfiTpmStateInitHobGuid, "TPM State Initialization HOB", "TPM State Initialization HOB"); diff --git a/MiscFramework/Guid/TpmStateInitHob/TpmStateInitHob.h b/MiscFramework/Guid/TpmStateInitHob/TpmStateInitHob.h new file mode 100644 index 0000000..8781972 --- /dev/null +++ b/MiscFramework/Guid/TpmStateInitHob/TpmStateInitHob.h @@ -0,0 +1,39 @@ +/*++ + +Copyright (c) 1999 - 2002 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: + + TpmStateInitHob.h + +Abstract: + + GUID of the HOB data for TPM state initialization. + +--*/ + +#ifndef _EFI_TPM_STATE_INIT_HUB_GUID_H_ +#define _EFI_TPM_STATE_INIT_HUB_GUID_H_ + +#define EFI_TPM_STATE_INIT_HUB_GUID \ + { 0xA0C6D918, 0x8DEE, 0x41BB, 0x9D, 0x92, 0x67, 0x53, 0xA5, 0x72, 0xB6, 0x52 }; + +typedef struct { + BOOLEAN TpmEnabledStateFlag; + BOOLEAN TpmActivatedStateFlag; + BOOLEAN TpmOwnedStateFlag; + UINT8 Reserved[5]; +} EFI_TPM_STATE_FLAGS; + + +extern EFI_GUID gEfiTpmStateInitHobGuid; + +#endif // _EFI_TPM_STATE_INIT_HUB_GUID_H_ diff --git a/MiscFramework/Library/Dxe/EfiRegTableLib/EfiRegTableLib.c b/MiscFramework/Library/Dxe/EfiRegTableLib/EfiRegTableLib.c new file mode 100644 index 0000000..ee8afab --- /dev/null +++ b/MiscFramework/Library/Dxe/EfiRegTableLib/EfiRegTableLib.c @@ -0,0 +1,313 @@ +/*++ + 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 - 2003 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: + + EfiRegTableLib.c + +Abstract: + + Lib function for table driven register initialization. + +Revision History + +--*/ + +#include "Tiano.h" +#include "EfiDriverLib.h" +#include "EfiRegTableLib.h" +#include "EfiDebug.h" + +// +// Local Functions +// +STATIC +VOID +PciWrite ( + EFI_REG_TABLE_PCI_WRITE *Entry, + EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo + ) +/*++ + +Routine Description: + Local worker function to process PCI_WRITE table entries. Performs write and + may also call BootScriptSave protocol if indicated in the Entry flags + +Arguments: + Entry - A pointer to the PCI_WRITE entry to process + + PciRootBridgeIo - A pointer to the instance of PciRootBridgeIo that is used + when processing the entry. + +Returns: + Nothing. + +--*/ +{ + EFI_STATUS Status; + + Status = PciRootBridgeIo->Pci.Write ( + PciRootBridgeIo, + (EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH) (OPCODE_EXTRA_DATA (Entry->OpCode)), + (UINT64) Entry->PciAddress, + 1, + &Entry->Data + ); + ASSERT_EFI_ERROR (Status); + + if (OPCODE_FLAGS (Entry->OpCode) & OPCODE_FLAG_S3SAVE) { + Status = BootScriptSavePciCfgWrite ( + EFI_ACPI_S3_RESUME_SCRIPT_TABLE, + (EFI_BOOT_SCRIPT_WIDTH) (OPCODE_EXTRA_DATA (Entry->OpCode)), + (UINT64) Entry->PciAddress, + 1, + &Entry->Data + ); + ASSERT_EFI_ERROR (Status); + } +} + +STATIC +VOID +PciReadModifyWrite ( + EFI_REG_TABLE_PCI_READ_MODIFY_WRITE *Entry, + EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo + ) +/*++ + +Routine Description: + Local worker function to process PCI_READ_MODIFY_WRITE table entries. + Performs RMW write and may also call BootScriptSave protocol if indicated in + the Entry flags. + +Arguments: + Entry - A pointer to the PCI_READ_MODIFY_WRITE entry to process. + + PciRootBridgeIo - A pointer to the instance of PciRootBridgeIo that is used + when processing the entry. + +Returns: + Nothing. + +--*/ +{ + EFI_STATUS Status; + UINT32 TempData; + + Status = PciRootBridgeIo->Pci.Read ( + PciRootBridgeIo, + (EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH) (OPCODE_EXTRA_DATA (Entry->OpCode)), + (UINT64) Entry->PciAddress, + 1, + &TempData + ); + ASSERT_EFI_ERROR (Status); + + Entry->OrMask &= Entry->AndMask; + TempData &= ~Entry->AndMask; + TempData |= Entry->OrMask; + + Status = PciRootBridgeIo->Pci.Write ( + PciRootBridgeIo, + (EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH) (OPCODE_EXTRA_DATA (Entry->OpCode)), + (UINT64) Entry->PciAddress, + 1, + &TempData + ); + ASSERT_EFI_ERROR (Status); + + if (OPCODE_FLAGS (Entry->OpCode) & OPCODE_FLAG_S3SAVE) { + Status = BootScriptSavePciCfgReadWrite ( + EFI_ACPI_S3_RESUME_SCRIPT_TABLE, + (EFI_BOOT_SCRIPT_WIDTH) (OPCODE_EXTRA_DATA (Entry->OpCode)), + (UINT64) Entry->PciAddress, + &Entry->OrMask, + &Entry->AndMask + ); + ASSERT_EFI_ERROR (Status); + } +} + +STATIC +VOID +MemReadModifyWrite ( + EFI_REG_TABLE_MEM_READ_MODIFY_WRITE *Entry, + EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo + ) +/*++ + +Routine Description: + Local worker function to process MEM_READ_MODIFY_WRITE table entries. + Performs RMW write and may also call BootScriptSave protocol if indicated in + the Entry flags. + +Arguments: + Entry - A pointer to the MEM_READ_MODIFY_WRITE entry to process. + + PciRootBridgeIo - A pointer to the instance of PciRootBridgeIo that is used + when processing the entry. + +Returns: + Nothing. + +--*/ +{ + EFI_STATUS Status; + UINT32 TempData; + + Status = PciRootBridgeIo->Mem.Read ( + PciRootBridgeIo, + (EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH) (OPCODE_EXTRA_DATA (Entry->OpCode)), + (UINT64) Entry->MemAddress, + 1, + &TempData + ); + ASSERT_EFI_ERROR (Status); + + Entry->OrMask &= Entry->AndMask; + TempData &= ~Entry->AndMask; + TempData |= Entry->OrMask; + + Status = PciRootBridgeIo->Mem.Write ( + PciRootBridgeIo, + (EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH) (OPCODE_EXTRA_DATA (Entry->OpCode)), + (UINT64) Entry->MemAddress, + 1, + &TempData + ); + ASSERT_EFI_ERROR (Status); + + if (OPCODE_FLAGS (Entry->OpCode) & OPCODE_FLAG_S3SAVE) { + Status = BootScriptSaveMemReadWrite ( + EFI_ACPI_S3_RESUME_SCRIPT_TABLE, + (EFI_BOOT_SCRIPT_WIDTH) (OPCODE_EXTRA_DATA (Entry->OpCode)), + Entry->MemAddress, + &Entry->OrMask, + &Entry->AndMask + ); + ASSERT_EFI_ERROR (Status); + } +} +// +// Exported functions +// +VOID +ProcessRegTablePci ( + EFI_REG_TABLE *RegTableEntry, + EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo, + EFI_CPU_IO_PROTOCOL *CpuIo + ) +/*++ + +Routine Description: + Processes register table assuming which may contain PCI, IO, MEM, and STALL + entries. + + No parameter checking is done so the caller must be careful about omitting + values for PciRootBridgeIo or CpuIo parameters. If the regtable does + not contain any PCI accesses, it is safe to omit the PciRootBridgeIo (supply + NULL). If the regtable does not contain any IO or Mem entries, it is safe to + omit the CpuIo (supply NULL). + + The RegTableEntry parameter is not checked, but is required. + + gBS is assumed to have been defined and is used when processing stalls. + + The function processes each entry sequentially until an OP_TERMINATE_TABLE + entry is encountered. + +Arguments: + RegTableEntry - A pointer to the register table to process + + PciRootBridgeIo - A pointer to the instance of PciRootBridgeIo that is used + when processing PCI table entries + + CpuIo - A pointer to the instance of CpuIo that is used when processing IO and + MEM table entries + +Returns: + Nothing. + +--*/ +{ + while (OPCODE_BASE (RegTableEntry->Generic.OpCode) != OP_TERMINATE_TABLE) { + switch (OPCODE_BASE (RegTableEntry->Generic.OpCode)) { + case OP_PCI_WRITE: + PciWrite ((EFI_REG_TABLE_PCI_WRITE *) RegTableEntry, PciRootBridgeIo); + break; + + case OP_PCI_READ_MODIFY_WRITE: + PciReadModifyWrite ((EFI_REG_TABLE_PCI_READ_MODIFY_WRITE *) RegTableEntry, PciRootBridgeIo); + break; + + case OP_MEM_READ_MODIFY_WRITE: + MemReadModifyWrite ((EFI_REG_TABLE_MEM_READ_MODIFY_WRITE *) RegTableEntry, PciRootBridgeIo); + break; + + default: + DEBUG ((EFI_D_ERROR, "RegTable ERROR: Unknown RegTable OpCode (%x)\n", OPCODE_BASE (RegTableEntry->Generic.OpCode))); + ASSERT (0); + break; + } + + RegTableEntry++; + } +} + +VOID +ProcessRegTableCpu ( + EFI_REG_TABLE *RegTableEntry, + EFI_CPU_IO_PROTOCOL *CpuIo + ) +/*++ + +Routine Description: + Processes register table assuming which may contain IO, MEM, and STALL + entries, but must NOT contain any PCI entries. Any PCI entries cause an + ASSERT in a DEBUG build and are skipped in a free build. + + No parameter checking is done. Both RegTableEntry and CpuIo parameters are + required. + + gBS is assumed to have been defined and is used when processing stalls. + + The function processes each entry sequentially until an OP_TERMINATE_TABLE + entry is encountered. + +Arguments: + RegTableEntry - A pointer to the register table to process + + CpuIo - A pointer to the instance of CpuIo that is used when processing IO and + MEM table entries + +Returns: + Nothing. + +--*/ +{ + while (OPCODE_BASE (RegTableEntry->Generic.OpCode) != OP_TERMINATE_TABLE) { + switch (OPCODE_BASE (RegTableEntry->Generic.OpCode)) { + default: + DEBUG ((EFI_D_ERROR, "RegTable ERROR: Unknown RegTable OpCode (%x)\n", OPCODE_BASE (RegTableEntry->Generic.OpCode))); + ASSERT (0); + break; + } + + RegTableEntry++; + } +} diff --git a/MiscFramework/Library/Dxe/EfiRegTableLib/EfiRegTableLib.cif b/MiscFramework/Library/Dxe/EfiRegTableLib/EfiRegTableLib.cif new file mode 100644 index 0000000..d3e2fc4 --- /dev/null +++ b/MiscFramework/Library/Dxe/EfiRegTableLib/EfiRegTableLib.cif @@ -0,0 +1,10 @@ + + name = "EfiRegTableLib" + category = ModulePart + LocalRoot = "MiscFramework\Library\Dxe\EfiRegTableLib" + RefName = "EfiRegTableLib" +[files] +"EfiRegTableLib.sdl" +"EfiRegTableLib.mak" +"EfiRegTableLib.c" + diff --git a/MiscFramework/Library/Dxe/EfiRegTableLib/EfiRegTableLib.mak b/MiscFramework/Library/Dxe/EfiRegTableLib/EfiRegTableLib.mak new file mode 100644 index 0000000..4c7f8fa --- /dev/null +++ b/MiscFramework/Library/Dxe/EfiRegTableLib/EfiRegTableLib.mak @@ -0,0 +1,80 @@ +#********************************************************************** +#********************************************************************** +#** ** +#** (C)Copyright 1985-2006, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#********************************************************************** +#********************************************************************** + +#********************************************************************** +# $Header: /Alaska/SOURCE/Modules/MPG/Calpella/MiscFramework/EfiRegTableLib/EfiRegTableLib.mak 1 10/15/08 2:19p Fasihm $ +# +# $Revision: 1 $ +# +# $Date: 10/15/08 2:19p $ +#********************************************************************** +# Revision History +# ---------------- +# $Log: /Alaska/SOURCE/Modules/MPG/Calpella/MiscFramework/EfiRegTableLib/EfiRegTableLib.mak $ +# +# 1 10/15/08 2:19p Fasihm +# Initial check-in for the Calpella Crb MiscFramework module used. +# +# 1 8/26/08 2:08p Fasihm +# This is the first CRB drop used for the PowerOn of the Calpella CRB +# platform (RedFort) +# With this project one needs to add the correct CPU Microcodes. +# +# 2 9/11/06 7:20p Fasihm +# Changed the CFLAGS to MY_LIBRARY for the Build process. +# +# 1 6/27/06 6:06p Felixp +# +# 1 6/05/06 6:31p Fasihm +# Initial check-in for the MiscFramework module placed in the Edk part on +# SSF. +# +# 1 5/12/06 3:12p Felixp +# +#********************************************************************** +# +# +# Name: EfiRegTableLib.mak +# +# Description: +# +# +#********************************************************************** +Framework : EfiRegTableLib + +$(BUILD_DIR)\EfiRegTableLib.lib : EfiRegTableLib + +EfiRegTableLib : $(BUILD_DIR)\EfiRegTableLib.mak EfiRegTableLibBin + +$(BUILD_DIR)\EfiRegTableLib.mak : $(EfiRegTableLib_DIR)\$(@B).cif $(EfiRegTableLib_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(EfiRegTableLib_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +EfiRegTableLibBin : + $(MAKE) /$(MAKEFLAGS) $(EDK_DEFAULTS)\ + /f $(BUILD_DIR)\EfiRegTableLib.mak all\ + "MY_INCLUDES=$(EDK_INCLUDES) $(MISCFRAMEWORK_INCLUDES)" \ + TYPE=LIBRARY \ +#********************************************************************** +#********************************************************************** +#** ** +#** (C)Copyright 1985-2006, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#********************************************************************** +#********************************************************************** \ No newline at end of file diff --git a/MiscFramework/Library/Dxe/EfiRegTableLib/EfiRegTableLib.sdl b/MiscFramework/Library/Dxe/EfiRegTableLib/EfiRegTableLib.sdl new file mode 100644 index 0000000..fdacee8 --- /dev/null +++ b/MiscFramework/Library/Dxe/EfiRegTableLib/EfiRegTableLib.sdl @@ -0,0 +1,36 @@ +TOKEN + Name = "EfiRegTableLib_SUPPORT" + Value = "1" + Help = "Main switch to enable EfiRegTableLib support in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes +End + +TOKEN + Name = "EfiRegTableLib" + Value = "$(BUILD_DIR)\EfiRegTableLib.lib" + TokenType = Expression + TargetMAK = Yes +End + +PATH + Name = "EfiRegTableLib_DIR" +End + +MODULE + Help = "Includes EfiRegTableLib.mak to Project" + File = "EfiRegTableLib.mak" +End + +ELINK + Name = "EfiRegTable_LIB" + InvokeOrder = ReplaceParent +End + +ELINK + Name = "$(BUILD_DIR)\EfiRegTable.lib" + Parent = "EfiRegTable_LIB" + InvokeOrder = AfterParent +End \ No newline at end of file diff --git a/MiscFramework/Library/Smm/EfiSmmDriverLib/EfiSmmDriverLib.cif b/MiscFramework/Library/Smm/EfiSmmDriverLib/EfiSmmDriverLib.cif new file mode 100644 index 0000000..d908ace --- /dev/null +++ b/MiscFramework/Library/Smm/EfiSmmDriverLib/EfiSmmDriverLib.cif @@ -0,0 +1,12 @@ + + name = "EfiSmmDriverLib" + category = ModulePart + LocalRoot = "MiscFramework\Library\Smm\EfiSmmDriverLib" + RefName = "EfiSmmDriverLib" +[files] +"EfiSmmDriverLib.sdl" +"EfiSmmDriverLib.mak" +"SmmDriverLib.c" +"LibGlobals.c" +"debug.c" + diff --git a/MiscFramework/Library/Smm/EfiSmmDriverLib/EfiSmmDriverLib.mak b/MiscFramework/Library/Smm/EfiSmmDriverLib/EfiSmmDriverLib.mak new file mode 100644 index 0000000..6a52cc0 --- /dev/null +++ b/MiscFramework/Library/Smm/EfiSmmDriverLib/EfiSmmDriverLib.mak @@ -0,0 +1,70 @@ +#********************************************************************** +#********************************************************************** +#** ** +#** (C)Copyright 1985-2006, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#********************************************************************** +#********************************************************************** + +#********************************************************************** +# $Header: /Alaska/SOURCE/Modules/MPG/Calpella/MiscFramework/EfiSmmDriverLib/EfiSmmDriverLib.mak 1 10/15/08 2:20p Fasihm $ +# +# $Revision: 1 $ +# +# $Date: 10/15/08 2:20p $ +#********************************************************************** +# Revision History +# ---------------- +# $Log: /Alaska/SOURCE/Modules/MPG/Calpella/MiscFramework/EfiSmmDriverLib/EfiSmmDriverLib.mak $ +# +# 1 10/15/08 2:20p Fasihm +# Initial check-in for the Calpella Crb MiscFramework module. +# +# 1 8/26/08 2:08p Fasihm +# This is the first CRB drop used for the PowerOn of the Calpella CRB +# platform (RedFort) +# With this project one needs to add the correct CPU Microcodes. +# +# +#********************************************************************** +# +# +# Name: EfiSmmDriverLib.mak +# +# Description: +# +# +#********************************************************************** +Framework : EfiSmmDriverLib + +$(BUILD_DIR)\EfiSmmDriverLib.lib : EfiSmmDriverLib + +EfiSmmDriverLib : $(BUILD_DIR)\EfiSmmDriverLib.mak EfiSmmDriverLibBin + +$(BUILD_DIR)\EfiSmmDriverLib.mak : $(EfiSmmDriverLib_DIR)\$(@B).cif $(EfiSmmDriverLib_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(EfiSmmDriverLib_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +EfiSmmDriverLibBin : + $(MAKE) /$(MAKEFLAGS) $(EDK_DEFAULTS)\ + /f $(BUILD_DIR)\EfiSmmDriverLib.mak all\ + "MY_INCLUDES=$(EDK_INCLUDES) $(MISCFRAMEWORK_INCLUDES)" \ + TYPE=LIBRARY \ +#********************************************************************** +#********************************************************************** +#** ** +#** (C)Copyright 1985-2006, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#********************************************************************** +#********************************************************************** \ No newline at end of file diff --git a/MiscFramework/Library/Smm/EfiSmmDriverLib/EfiSmmDriverLib.sdl b/MiscFramework/Library/Smm/EfiSmmDriverLib/EfiSmmDriverLib.sdl new file mode 100644 index 0000000..6234397 --- /dev/null +++ b/MiscFramework/Library/Smm/EfiSmmDriverLib/EfiSmmDriverLib.sdl @@ -0,0 +1,36 @@ +TOKEN + Name = "EfiSmmDriverLib_SUPPORT" + Value = "1" + Help = "Main switch to enable EfiSmmDriverLib support in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes +End + +TOKEN + Name = "EfiSmmDriverLib" + Value = "$(BUILD_DIR)\EfiSmmDriverLib.lib" + TokenType = Expression + TargetMAK = Yes +End + +MODULE + Help = "Includes EfiSmmDriverLib.mak to Project" + File = "EfiSmmDriverLib.mak" +End + +PATH + Name = "EfiSmmDriverLib_DIR" +End + +ELINK + Name = "EfiSmmDriverLib_LIB" + InvokeOrder = ReplaceParent +End + +ELINK + Name = "$(BUILD_DIR)\EfiSmmDriverLib.lib" + Parent = "EfiSmmDriverLib_LIB" + InvokeOrder = AfterParent +End \ No newline at end of file diff --git a/MiscFramework/Library/Smm/EfiSmmDriverLib/LibGlobals.c b/MiscFramework/Library/Smm/EfiSmmDriverLib/LibGlobals.c new file mode 100644 index 0000000..b163e98 --- /dev/null +++ b/MiscFramework/Library/Smm/EfiSmmDriverLib/LibGlobals.c @@ -0,0 +1,45 @@ +/*++ + This file contains 'Framework Code' and is licensed as such + under the terms of your license agreement with Intel or your + vendor. This file may not be modified, except as allowed by + additional terms of your license agreement. +--*/ +/*++ + +Copyright (c) 1999 - 2002 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: + + LibGlobals.c + +Abstract: + + Globals used in EFI SMM Driver Lib. They are initialized in EfiSmmDriverLib.c. + Each seperatly linked module has it's own copy of these globals. + + gBS - Boot Services table pointer + gRT - Runt Time services table pointer + gST - System Table pointer + + gErrorLevel - Debug error level. + +--*/ + +#include "Tiano.h" +#include EFI_PROTOCOL_DEFINITION (SmmBase) +#include EFI_PROTOCOL_DEFINITION (SmmStatusCode) + +EFI_BOOT_SERVICES *gBS; +EFI_RUNTIME_SERVICES *gRT; +EFI_SYSTEM_TABLE *gST; +EFI_SMM_BASE_PROTOCOL *gSMM; +EFI_SMM_STATUS_CODE_PROTOCOL *mSmmDebug; +UINTN gErrorLevel = EFI_DBUG_MASK | EFI_D_LOAD; diff --git a/MiscFramework/Library/Smm/EfiSmmDriverLib/SmmDriverLib.c b/MiscFramework/Library/Smm/EfiSmmDriverLib/SmmDriverLib.c new file mode 100644 index 0000000..bb3d8de --- /dev/null +++ b/MiscFramework/Library/Smm/EfiSmmDriverLib/SmmDriverLib.c @@ -0,0 +1,244 @@ +/*++ + This file contains 'Framework Code' and is licensed as such + under the terms of your license agreement with Intel or your + vendor. This file may not be modified, except as allowed by + additional terms of your license agreement. +--*/ +/*++ + +Copyright (c) 1999 - 2002 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: + + MgmtModeRuntimeUtils.c + +Abstract: + + Light weight lib to support EFI 2.0 SMM based drivers. + +--*/ + +// GC_TODO: fix comment to set correct module name: SmmDriverLib.c +#include "Tiano.h" +#include "EfiCommonLib.h" +#include "EfiSmmDriverLib.h" +#include EFI_PROTOCOL_DEFINITION (LoadedImage) + +EFI_DEVICE_PATH_PROTOCOL * +EfiAppendDevicePath ( + IN EFI_DEVICE_PATH_PROTOCOL *Src1, + IN EFI_DEVICE_PATH_PROTOCOL *Src2 + ); + +EFI_STATUS +EfiInitializeSmmDriverLib ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable, + IN OUT BOOLEAN *InSmm + ) +/*++ + +Routine Description: + + Intialize runtime Driver Lib if it has not yet been initialized. + +Arguments: + + (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT) + + GoVirtualChildEvent - Caller can register a virtual notification event. + +Returns: + + EFI_STATUS always returns EFI_SUCCESS + +--*/ +// GC_TODO: ImageHandle - add argument and description to function comment +// GC_TODO: SystemTable - add argument and description to function comment +// GC_TODO: InSmm - add argument and description to function comment +{ + EFI_STATUS Status; + EFI_HANDLE Handle; + EFI_LOADED_IMAGE_PROTOCOL *LoadedImage; + EFI_DEVICE_PATH_PROTOCOL *CompleteFilePath; + EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath; + + gSMM = NULL; + mSmmDebug = NULL; + + if ((SystemTable != NULL) && (SystemTable->BootServices != NULL)) { + + gST = SystemTable; + gBS = SystemTable->BootServices; + gRT = SystemTable->RuntimeServices; + + // + // It is OK if the SmmStatusCode Protocol is not found, don't check the status. + // + Status = gBS->LocateProtocol (&gEfiSmmStatusCodeProtocolGuid, NULL, &mSmmDebug); + + Status = gBS->LocateProtocol (&gEfiSmmBaseProtocolGuid, NULL, &gSMM); + if (EFI_ERROR (Status)) { + return Status; + } + + gSMM->InSmm (gSMM, InSmm); + + if (!(*InSmm)) { + // + // Not in SMM, initialization code is running under DXE environment + // + // + // Load this driver's image to memory + // + if (ImageHandle != NULL) { + Status = gBS->HandleProtocol ( + ImageHandle, + &gEfiLoadedImageProtocolGuid, + (VOID *) &LoadedImage + ); + + if (EFI_ERROR (Status)) { + return Status; + } + + gBS->HandleProtocol ( + LoadedImage->DeviceHandle, + &gEfiDevicePathProtocolGuid, + (VOID *) &ImageDevicePath + ); + + if (EFI_ERROR (Status)) { + return Status; + } + + CompleteFilePath = EfiAppendDevicePath ( + ImageDevicePath, + LoadedImage->FilePath + ); + // + // Load the image in memory to SMRAM; it will automatically generate the + // SMI. + // + Status = gSMM->Register (gSMM, CompleteFilePath, NULL, 0, &Handle, FALSE); + if (EFI_ERROR (Status)) { + return Status; + } + } + } + } + + return EFI_SUCCESS; + +} + +UINTN +EfiDevicePathSize ( + IN EFI_DEVICE_PATH_PROTOCOL *DevicePath + ) +/*++ + +Routine Description: + + GC_TODO: Add function description + +Arguments: + + DevicePath - GC_TODO: add argument description + +Returns: + + GC_TODO: add return values + +--*/ +{ + EFI_DEVICE_PATH_PROTOCOL *Start; + + if (NULL == DevicePath) { + return 0; + } + // + // Search for the end of the device path structure + // + Start = DevicePath; + while (!EfiIsDevicePathEnd (DevicePath)) { + DevicePath = EfiNextDevicePathNode (DevicePath); + } + // + // Compute the size and add back in the size of the end device path structure + // + return ((UINTN) DevicePath - (UINTN) Start) + sizeof (EFI_DEVICE_PATH_PROTOCOL); +} + +EFI_DEVICE_PATH_PROTOCOL * +EfiAppendDevicePath ( + IN EFI_DEVICE_PATH_PROTOCOL *Src1, + IN EFI_DEVICE_PATH_PROTOCOL *Src2 + ) +/*++ + +Routine Description: + Function is used to append a Src1 and Src2 together. + +Arguments: + Src1 - A pointer to a device path data structure. + + Src2 - A pointer to a device path data structure. + +Returns: + + A pointer to the new device path is returned. + NULL is returned if space for the new device path could not be allocated from pool. + It is up to the caller to free the memory used by Src1 and Src2 if they are no longer needed. + +--*/ +{ + EFI_STATUS Status; + UINTN Size; + UINTN Size1; + UINTN Size2; + EFI_DEVICE_PATH_PROTOCOL *NewDevicePath; + EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath; + + // + // Allocate space for the combined device path. It only has one end node of + // length EFI_DEVICE_PATH_PROTOCOL + // + Size1 = EfiDevicePathSize (Src1); + Size2 = EfiDevicePathSize (Src2); + Size = Size1 + Size2; + + if (Size1 != 0 && Size2 != 0) { + Size -= sizeof (EFI_DEVICE_PATH_PROTOCOL); + } + + Status = gBS->AllocatePool (EfiBootServicesData, Size, (VOID **) &NewDevicePath); + + if (EFI_ERROR (Status)) { + return NULL; + } + + gBS->CopyMem (NewDevicePath, Src1, Size1); + + // + // Over write Src1 EndNode and do the copy + // + if (Size1 != 0) { + SecondDevicePath = (EFI_DEVICE_PATH_PROTOCOL *) ((CHAR8 *) NewDevicePath + (Size1 - sizeof (EFI_DEVICE_PATH_PROTOCOL))); + } else { + SecondDevicePath = NewDevicePath; + + } + + gBS->CopyMem (SecondDevicePath, Src2, Size2); + + return NewDevicePath; +} diff --git a/MiscFramework/Library/Smm/EfiSmmDriverLib/debug.c b/MiscFramework/Library/Smm/EfiSmmDriverLib/debug.c new file mode 100644 index 0000000..842f3ab --- /dev/null +++ b/MiscFramework/Library/Smm/EfiSmmDriverLib/debug.c @@ -0,0 +1,169 @@ +/*++ + This file contains 'Framework Code' and is licensed as such + under the terms of your license agreement with Intel or your + vendor. This file may not be modified, except as allowed by + additional terms of your license agreement. +--*/ +/*++ + +Copyright (c) 1999 - 2002 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: + + Debug.c + +Abstract: + + Support for Debug primatives. + +--*/ + +#include "Tiano.h" +#include "EfiCommonLib.h" +#include "EfiSmmDriverLib.h" +#include EFI_GUID_DEFINITION (StatusCodeCallerId) +#include EFI_GUID_DEFINITION (StatusCodeDataTypeId) + +#define EFI_STATUS_CODE_DATA_MAX_SIZE64 (EFI_STATUS_CODE_DATA_MAX_SIZE / 8) + +VOID +EfiDebugAssert ( + IN CHAR8 *FileName, + IN INTN LineNumber, + IN CHAR8 *Description + ) +/*++ + +Routine Description: + + Worker function for ASSERT (). If Error Logging hub is loaded log ASSERT + information. If Error Logging hub is not loaded DEADLOOP (). + +Arguments: + + FileName - File name of failing routine. + + LineNumber - Line number of failing ASSERT(). + + Description - Description, usually the assertion, + +Returns: + + None + +--*/ +{ + + UINT64 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE64]; + + if (mSmmDebug != NULL) { + EfiDebugAssertWorker (FileName, LineNumber, Description, sizeof (Buffer), Buffer); + mSmmDebug->ReportStatusCode ( + mSmmDebug, + (EFI_ERROR_CODE | EFI_ERROR_UNRECOVERED), + (EFI_SOFTWARE_SMM_DRIVER | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE), + 0, + &gEfiCallerIdGuid, + (EFI_STATUS_CODE_DATA *) Buffer + ); + } + // + // don't return, this is an assert. + // + EFI_DEADLOOP (); +} + +VOID +EfiDebugVPrint ( + IN UINTN ErrorLevel, + IN CHAR8 *Format, + IN VA_LIST Marker + ) +/*++ + +Routine Description: + + Worker function for DEBUG(). If Error Logging hub is loaded log ASSERT + information. If Error Logging hub is not loaded do nothing. + +Arguments: + + ErrorLevel - If error level is set do the debug print. + + Format - String to use for the print, followed by Print arguments. + + Marker - VarArgs + +Returns: + + None + +--*/ +{ + UINT64 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE64]; + + if (!(gErrorLevel & ErrorLevel)) { + return ; + } + + EfiDebugVPrintWorker (ErrorLevel, Format, Marker, sizeof (Buffer), Buffer); + + if (mSmmDebug != NULL) { + mSmmDebug->ReportStatusCode ( + mSmmDebug, + EFI_DEBUG_CODE, + (EFI_SOFTWARE_SMM_DRIVER | EFI_DC_UNSPECIFIED), + 0, + &gEfiCallerIdGuid, + (EFI_STATUS_CODE_DATA *) Buffer + ); + } + + return ; +} + +VOID +EfiDebugPrint ( + IN UINTN ErrorLevel, + IN CHAR8 *Format, + ... + ) +/*++ + +Routine Description: + + Worker function for DEBUG(). If Error Logging hub is loaded log ASSERT + information. If Error Logging hub is not loaded do nothing. + + We use UINT64 buffers due to IPF alignment concerns. + +Arguments: + + ErrorLevel - If error level is set do the debug print. + + Format - String to use for the print, followed by Print arguments. + + ... - VAR args for Format + +Returns: + + None + +--*/ +{ + VA_LIST Marker; + + VA_START (Marker, Format); + + EfiDebugVPrint (ErrorLevel, Format, Marker); + + VA_END (Marker); +} diff --git a/MiscFramework/MiscFramework.cif b/MiscFramework/MiscFramework.cif new file mode 100644 index 0000000..e98f689 --- /dev/null +++ b/MiscFramework/MiscFramework.cif @@ -0,0 +1,18 @@ + + name = "MiscFramework" + category = eModule + LocalRoot = "MiscFramework\" + RefName = "MiscFramework" +[files] +"MiscFramework.sdl" +"MiscFramework.mak" +"Efi.h" +"TcgAcpi.h" +[parts] +"EfiRegTableLib" +"ProtocolLib" +"FrameworkPpiLib" +"FrameworkGuidLib" +"SmmControlLib" +"EfiSmmDriverLib" + diff --git a/MiscFramework/MiscFramework.mak b/MiscFramework/MiscFramework.mak new file mode 100644 index 0000000..b150979 --- /dev/null +++ b/MiscFramework/MiscFramework.mak @@ -0,0 +1,66 @@ +#********************************************************************** +#********************************************************************** +#** ** +#** (C)Copyright 1985-2006, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#********************************************************************** +#********************************************************************** +#********************************************************************** +# $Header: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/MiscFramework/MiscFramework.mak 2 5/07/12 2:41a Wesleychen $ +# +# $Revision: 2 $ +# +# $Date: 5/07/12 2:41a $ +#********************************************************************** +# Revision History +# ---------------- +# $Log: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/MiscFramework/MiscFramework.mak $ +# +# 2 5/07/12 2:41a Wesleychen +# +# 1 10/15/08 2:18p Fasihm +# Initial check-in for the Calpella Crb MiscFramework module used. +# +# 1 8/26/08 2:07p Fasihm +# This is the first CRB drop used for the PowerOn of the Calpella CRB +# platform (RedFort) +# With this project one needs to add the correct CPU Microcodes. +# +# 3 9/11/06 7:14p Fasihm +# Updated +# +# 2 7/13/06 9:23a Andriyn +# +# 1 6/27/06 6:06p Felixp +# +# 1 5/12/06 3:12p Felixp +# +#********************************************************************** +# +# +# Name: .mak +# +# Description: +# +# +#********************************************************************** +all : MiscFramework +#********************************************************************** +#********************************************************************** +#** ** +#** (C)Copyright 1985-2006, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#********************************************************************** +#********************************************************************** \ No newline at end of file diff --git a/MiscFramework/MiscFramework.sdl b/MiscFramework/MiscFramework.sdl new file mode 100644 index 0000000..1770a63 --- /dev/null +++ b/MiscFramework/MiscFramework.sdl @@ -0,0 +1,40 @@ +TOKEN + Name = "MiscFRAMEWORK_SUPPORT" + Value = "1" + Help = "Main switch to enable FRAMEWORK support in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes +End + +PATH + Name = "MISCFRAMEWORK_DIR" +End + +PATH + Name = "MISCFRAMEWORK_SOURCE" + Path = "$(MISCFRAMEWORK_DIR)" +End + +MODULE + Help = "Includes FRAMEWORK.mak to Project" + File = "MiscFramework.mak" +End + +ELINK + Name = "MISCFRAMEWORK_INCLUDES" + InvokeOrder = ReplaceParent +End + +ELINK + Name = "/I$(PROJECT_DIR)\MiscFramework" + Parent = "MISCFRAMEWORK_INCLUDES" + InvokeOrder = AfterParent +End + +ELINK + Name = "/I$(PROJECT_DIR)" + Parent = "MISCFRAMEWORK_INCLUDES" + InvokeOrder = AfterParent +End \ No newline at end of file diff --git a/MiscFramework/Ppi/AtaController/AtaController.c b/MiscFramework/Ppi/AtaController/AtaController.c new file mode 100644 index 0000000..77d1743 --- /dev/null +++ b/MiscFramework/Ppi/AtaController/AtaController.c @@ -0,0 +1,35 @@ +/*++ + This file contains 'Framework Code' and is licensed as such + under the terms of your license agreement with Intel or your + vendor. This file may not be modified, except as allowed by + additional terms of your license agreement. +--*/ +/*++ + +Copyright (c) 1999 - 2002 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: + + AtaController.c + +Abstract: + + ATA Controller PPI GUID as defined in EFI 2.0 + +--*/ + +#include "Tiano.h" +#include "Pei.h" +#include EFI_PPI_DEFINITION (AtaController) + +EFI_GUID gPeiAtaControllerPpiGuid = PEI_ATA_CONTROLLER_PPI_GUID; + +EFI_GUID_STRING(&gPeiAtaControllerPpiGuid, "AtaController", "ATA Controller PPI"); diff --git a/MiscFramework/Ppi/AtaController/AtaController.h b/MiscFramework/Ppi/AtaController/AtaController.h new file mode 100644 index 0000000..568fa71 --- /dev/null +++ b/MiscFramework/Ppi/AtaController/AtaController.h @@ -0,0 +1,62 @@ +// +// This file contains 'Framework Code' and is licensed as such +// under the terms of your license agreement with Intel or your +// vendor. This file may not be modified, except as allowed by +// additional terms of your license agreement. +// +/*++ + +Copyright (c) 1999 - 2002 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: + + AtaController.h + +Abstract: + + ATA Controller PPI as defined in EFI 2.0 + + This code abstracts the PEI core to provide ATA services. + +--*/ + +#ifndef _PEI_ATA_CONTROLLER_PPI_H_ +#define _PEI_ATA_CONTROLLER_PPI_H_ + +#define PEI_ATA_CONTROLLER_PPI_GUID \ + { \ + 0xa1e2176f, 0xcbda, 0x4f32, 0x87, 0x56, 0x7d, 0x7a, 0xe5, 0x22, 0xd6, 0x93 \ + } + +#define PEI_ICH_IDE_NONE 0x00 +#define PEI_ICH_IDE_PRIMARY 0x01 +#define PEI_ICH_IDE_SECONDARY 0x02 +#define PEI_ICH_SATA_NONE 0x04 +#define PEI_ICH_SATA_PRIMARY 0x08 +#define PEI_ICH_SATA_SECONDARY 0x010 + +EFI_FORWARD_DECLARATION (PEI_ATA_CONTROLLER_PPI); + +typedef +EFI_STATUS +(EFIAPI *PEI_ENABLE_ATA) ( + IN EFI_PEI_SERVICES **PeiServices, + IN PEI_ATA_CONTROLLER_PPI * This, + IN UINT8 ChannelMask + ); + +typedef struct _PEI_ATA_CONTROLLER_PPI { + PEI_ENABLE_ATA EnableAtaChannel; +} PEI_ATA_CONTROLLER_PPI; + +extern EFI_GUID gPeiAtaControllerPpiGuid; + +#endif diff --git a/MiscFramework/Ppi/AtaPolicy/AtaPolicy.c b/MiscFramework/Ppi/AtaPolicy/AtaPolicy.c new file mode 100644 index 0000000..a8e6be7 --- /dev/null +++ b/MiscFramework/Ppi/AtaPolicy/AtaPolicy.c @@ -0,0 +1,35 @@ +/*++ + This file contains 'Framework Code' and is licensed as such + under the terms of your license agreement with Intel or your + vendor. This file may not be modified, except as allowed by + additional terms of your license agreement. +--*/ +/*++ + +Copyright (c) 1999 - 2002 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: + + AtaPolicy.c + +Abstract: + + ATA Policy PPI GUID as defined in EFI 2.0 + +--*/ + +#include "Tiano.h" +#include "Pei.h" +#include EFI_PPI_DEFINITION (AtaPolicy) + +EFI_GUID gPeiAtaPolicyPpiGuid = PEI_ATA_POLICY_PPI_GUID; + +EFI_GUID_STRING(&gPeiAtaPolicyPpiGuid, "AtaPolicy", "ATA Policy PPI"); diff --git a/MiscFramework/Ppi/AtaPolicy/AtaPolicy.h b/MiscFramework/Ppi/AtaPolicy/AtaPolicy.h new file mode 100644 index 0000000..62fb8da --- /dev/null +++ b/MiscFramework/Ppi/AtaPolicy/AtaPolicy.h @@ -0,0 +1,45 @@ +// +// This file contains 'Framework Code' and is licensed as such +// under the terms of your license agreement with Intel or your +// vendor. This file may not be modified, except as allowed by +// additional terms of your license agreement. +// +/*++ + +Copyright (c) 1999 - 2002 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: + + AtaPolicy.h + +Abstract: + + ATA Policy PPI as defined in EFI 2.0 + +--*/ + +#ifndef _PEI_ATA_POLICY_PPI_H +#define _PEI_ATA_POLICY_PPI_H + +#define PEI_ATA_POLICY_PPI_GUID \ + { \ + 0x1b8ddea4, 0xdeb2, 0x4152, 0x91, 0xc2, 0xb7, 0x3c, 0xb1, 0x6c, 0xe4, 0x64 \ + } + +EFI_FORWARD_DECLARATION (PEI_ATA_POLICY_PPI); + +typedef struct _PEI_ATA_POLICY_PPI { + UINTN BaseAddress; +} PEI_ATA_POLICY_PPI; + +extern EFI_GUID gPeiAtaPolicyPpiGuid; + +#endif diff --git a/MiscFramework/Ppi/Capsule/Capsule.c b/MiscFramework/Ppi/Capsule/Capsule.c new file mode 100644 index 0000000..29e18a9 --- /dev/null +++ b/MiscFramework/Ppi/Capsule/Capsule.c @@ -0,0 +1,36 @@ +/*++ + This file contains 'Framework Code' and is licensed as such + under the terms of your license agreement with Intel or your + vendor. This file may not be modified, except as allowed by + additional terms of your license agreement. +--*/ +/*++ + +Copyright (c) 1999 - 2002 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: + + Capsule.c + +Abstract: + + Capsule PPI GUID declaration. + +--*/ + +#include "Tiano.h" +#include "PeiBind.h" +#include "PeiApi.h" +#include EFI_PPI_DEFINITION (Capsule) + +EFI_GUID gPeiCapsulePpiGuid = PEI_CAPSULE_PPI_GUID; + +EFI_GUID_STRING(&gPeiCapsulePpiGuid, "Capsule", "Capsule Update PPI"); diff --git a/MiscFramework/Ppi/Capsule/Capsule.h b/MiscFramework/Ppi/Capsule/Capsule.h new file mode 100644 index 0000000..aea915b --- /dev/null +++ b/MiscFramework/Ppi/Capsule/Capsule.h @@ -0,0 +1,69 @@ +// +// This file contains 'Framework Code' and is licensed as such +// under the terms of your license agreement with Intel or your +// vendor. This file may not be modified, except as allowed by +// additional terms of your license agreement. +// +/*++ + +Copyright (c) 1999 - 2002 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: + + Capsule.h + +Abstract: + + Capsule PPI definitions. + +--*/ + +#ifndef _PEI_CAPSULE_PPI_H_ +#define _PEI_CAPSULE_PPI_H_ + +#define PEI_CAPSULE_PPI_GUID \ + { \ + 0x3acf33ee, 0xd892, 0x40f4, 0xa2, 0xfc, 0x38, 0x54, 0xd2, 0xe1, 0x32, 0x3d \ + } + +EFI_FORWARD_DECLARATION (PEI_CAPSULE_PPI); + +typedef +EFI_STATUS +(EFIAPI *PEI_CAPSULE_COALESCE) ( + IN EFI_PEI_SERVICES **PeiServices, + IN OUT VOID **MemoryBase, + IN OUT UINTN *MemSize + ); + +typedef +EFI_STATUS +(EFIAPI *PEI_CAPSULE_CREATE_STATE) ( + IN EFI_PEI_SERVICES **PeiServices, + IN VOID *CapsuleBase, // returned from coalesce + IN UINTN CapsuleSize // returned from coalesce + ); + +typedef +EFI_STATUS +(EFIAPI *PEI_CAPSULE_CHECK_CAPSULE_UPDATE) ( + IN EFI_PEI_SERVICES **PeiServices + ); + +typedef struct _PEI_CAPSULE_PPI { + PEI_CAPSULE_COALESCE Coalesce; + PEI_CAPSULE_CHECK_CAPSULE_UPDATE CheckCapsuleUpdate; + PEI_CAPSULE_CREATE_STATE CreateState; +} PEI_CAPSULE_PPI; + +extern EFI_GUID gPeiCapsulePpiGuid; + +#endif // #ifndef _PEI_CAPSULE_PPI_H_ diff --git a/MiscFramework/Ppi/FrameworkPpiLib.cif b/MiscFramework/Ppi/FrameworkPpiLib.cif new file mode 100644 index 0000000..f8aed90 --- /dev/null +++ b/MiscFramework/Ppi/FrameworkPpiLib.cif @@ -0,0 +1,21 @@ + + name = "FrameworkPpiLib" + category = ModulePart + LocalRoot = "MiscFramework\Ppi" + RefName = "FrameworkPpiLib" +[files] +"FrameworkPpiLib.sdl" +"FrameworkPpiLib.mak" +"PlatformMemoryRange\PlatformMemoryRange.c" +"PlatformMemoryRange\PlatformMemoryRange.h" +"PlatformMemorySize\PlatformMemorySize.c" +"PlatformMemorySize\PlatformMemorySize.h" +"Capsule\Capsule.c" +"Capsule\Capsule.h" +"SmbusPolicy\SmbusPolicy.h" +"SmbusPolicy\SmbusPolicy.c" +"AtaController\AtaController.c" +"AtaController\AtaController.h" +"AtaPolicy\AtaPolicy.c" +"AtaPolicy\AtaPolicy.h" + diff --git a/MiscFramework/Ppi/FrameworkPpiLib.mak b/MiscFramework/Ppi/FrameworkPpiLib.mak new file mode 100644 index 0000000..b292eaf --- /dev/null +++ b/MiscFramework/Ppi/FrameworkPpiLib.mak @@ -0,0 +1,60 @@ +#********************************************************************** +#********************************************************************** +#** ** +#** (C)Copyright 1985-2006, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#********************************************************************** +#********************************************************************** + +#********************************************************************** +# $Header: /Alaska/SOURCE/Modules/MPG/Calpella/MiscFramework/FrameworkPpiLib/FrameworkPpiLib.mak 1 10/15/08 2:19p Fasihm $ +# +# $Revision: 1 $ +# +# $Date: 10/15/08 2:19p $ +#********************************************************************** +# Revision History +# ---------------- +# +#********************************************************************** +# +# +# Name: FrameworkPpiLib.mak +# +# Description: +# +# +#********************************************************************** +all : FrameworkPpiLib + +$(BUILD_DIR)\FrameworkPpiLib.lib : FrameworkPpiLib + +FrameworkPpiLib : $(BUILD_DIR)\FrameworkPpiLib.mak FrameworkPpiLibBin + +$(BUILD_DIR)\FrameworkPpiLib.mak : $(FrameworkPpiLib_DIR)\$(@B).cif $(FrameworkPpiLib_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(FrameworkPpiLib_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +FrameworkPpiLibBin : + $(MAKE) /$(MAKEFLAGS) $(EDK_DEFAULTS)\ + /f $(BUILD_DIR)\FrameworkPpiLib.mak all\ + "MY_INCLUDES=$(EDK_INCLUDES) /I$(MISCFRAMEWORK_DIR) /I$(EDK_INCLUDES) /I$(PROJECT_DIR)\Include\IndustryStandard" \ + TYPE=PEI_LIBRARY \ +#********************************************************************** +#********************************************************************** +#** ** +#** (C)Copyright 1985-2006, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#********************************************************************** +#********************************************************************** \ No newline at end of file diff --git a/MiscFramework/Ppi/FrameworkPpiLib.sdl b/MiscFramework/Ppi/FrameworkPpiLib.sdl new file mode 100644 index 0000000..16cb0d2 --- /dev/null +++ b/MiscFramework/Ppi/FrameworkPpiLib.sdl @@ -0,0 +1,28 @@ +TOKEN + Name = "FrameworkPpiLib_SUPPORT" + Value = "1" + Help = "Main switch to enable FrameworkPpiLib support in Project" + TokenType = Boolean + TargetMAK = Yes + Master = Yes +End + +PATH + Name = "FrameworkPpiLib_DIR" +End + +MODULE + Help = "Includes FrameworkPpiLib.mak to Project" + File = "FrameworkPpiLib.mak" +End + +ELINK + Name = "FrameworkPpiLib_LIB" + InvokeOrder = ReplaceParent +End + +ELINK + Name = "$(BUILD_DIR)\FrameworkPpiLib.lib" + Parent = "FrameworkPpiLib_LIB" + InvokeOrder = AfterParent +End diff --git a/MiscFramework/Ppi/PlatformMemoryRange/PlatformMemoryRange.c b/MiscFramework/Ppi/PlatformMemoryRange/PlatformMemoryRange.c new file mode 100644 index 0000000..54960fa --- /dev/null +++ b/MiscFramework/Ppi/PlatformMemoryRange/PlatformMemoryRange.c @@ -0,0 +1,35 @@ +/*++ + This file contains 'Framework Code' and is licensed as such + under the terms of your license agreement with Intel or your + vendor. This file may not be modified, except as allowed by + additional terms of your license agreement. +--*/ +/*++ + +Copyright (c) 1999 - 2002 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: + + PlatformMemoryRange.c + +Abstract: + + Platform Memory Range PPI GUID as defined in EFI 2.0 + +--*/ + +#include "Tiano.h" +#include "Pei.h" +#include EFI_PPI_DEFINITION (PlatformMemoryRange) + +EFI_GUID gPeiPlatformMemoryRangePpiGuid = PEI_PLATFORM_MEMORY_RANGE_PPI_GUID; + +EFI_GUID_STRING(&gPeiPlatformMemoryRangePpiGuid, "PlatformMemoryRange", "Platform Memory Range PPI"); diff --git a/MiscFramework/Ppi/PlatformMemoryRange/PlatformMemoryRange.h b/MiscFramework/Ppi/PlatformMemoryRange/PlatformMemoryRange.h new file mode 100644 index 0000000..6580729 --- /dev/null +++ b/MiscFramework/Ppi/PlatformMemoryRange/PlatformMemoryRange.h @@ -0,0 +1,156 @@ +// +// This file contains 'Framework Code' and is licensed as such +// under the terms of your license agreement with Intel or your +// vendor. This file may not be modified, except as allowed by +// additional terms of your license agreement. +// +/*++ + +Copyright (c) 1999 - 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. + + +Module Name: + + PlatformMemoryRange.h + +Abstract: + + Platform Memory Range PPI as defined in EFI 2.0 + + PPI for reserving special purpose memory ranges. + +--*/ + +#ifndef _PEI_PLATFORM_MEMORY_RANGE_H_ +#define _PEI_PLATFORM_MEMORY_RANGE_H_ + +#define PEI_PLATFORM_MEMORY_RANGE_PPI_GUID \ + { \ + 0x30eb2979, 0xb0f7, 0x4d60, 0xb2, 0xdc, 0x1a, 0x2c, 0x96, 0xce, 0xb1, 0xf4 \ + } + +EFI_FORWARD_DECLARATION (PEI_PLATFORM_MEMORY_RANGE_PPI); + +#define PEI_MEMORY_RANGE_OPTION_ROM UINT32 + +#define PEI_MR_OPTION_ROM_ALL 0xFFFFFFFF +#define PEI_MR_OPTION_ROM_NONE 0x00000000 +#define PEI_MR_OPTION_ROM_C0000_16K 0x00000001 +#define PEI_MR_OPTION_ROM_C4000_16K 0x00000002 +#define PEI_MR_OPTION_ROM_C8000_16K 0x00000004 +#define PEI_MR_OPTION_ROM_CC000_16K 0x00000008 +#define PEI_MR_OPTION_ROM_D0000_16K 0x00000010 +#define PEI_MR_OPTION_ROM_D4000_16K 0x00000020 +#define PEI_MR_OPTION_ROM_D8000_16K 0x00000040 +#define PEI_MR_OPTION_ROM_DC000_16K 0x00000080 +#define PEI_MR_OPTION_ROM_E0000_16K 0x00000100 +#define PEI_MR_OPTION_ROM_E4000_16K 0x00000200 +#define PEI_MR_OPTION_ROM_E8000_16K 0x00000400 +#define PEI_MR_OPTION_ROM_EC000_16K 0x00000800 +#define PEI_MR_OPTION_ROM_F0000_16K 0x00001000 +#define PEI_MR_OPTION_ROM_F4000_16K 0x00002000 +#define PEI_MR_OPTION_ROM_F8000_16K 0x00004000 +#define PEI_MR_OPTION_ROM_FC000_16K 0x00008000 + +// +// SMRAM Memory Range +// +#define PEI_MEMORY_RANGE_SMRAM UINT32 +#define PEI_MR_SMRAM_ALL 0xFFFFFFFF +#define PEI_MR_SMRAM_NONE 0x00000000 +#define PEI_MR_SMRAM_CACHEABLE_MASK 0x80000000 +#define PEI_MR_SMRAM_SEGTYPE_MASK 0x00FF0000 +#define PEI_MR_SMRAM_ABSEG_MASK 0x00010000 +#define PEI_MR_SMRAM_HSEG_MASK 0x00020000 +#define PEI_MR_SMRAM_TSEG_MASK 0x00040000 +// +// If adding additional entries, SMRAM Size +// is a multiple of 128KB. +// +#define PEI_MR_SMRAM_SIZE_MASK 0x0000FFFF +#define PEI_MR_SMRAM_SIZE_128K_MASK 0x00000001 +#define PEI_MR_SMRAM_SIZE_256K_MASK 0x00000002 +#define PEI_MR_SMRAM_SIZE_512K_MASK 0x00000004 +#define PEI_MR_SMRAM_SIZE_1024K_MASK 0x00000008 +#define PEI_MR_SMRAM_SIZE_2048K_MASK 0x00000010 +#define PEI_MR_SMRAM_SIZE_4096K_MASK 0x00000020 +#define PEI_MR_SMRAM_SIZE_8192K_MASK 0x00000040 +#define PEI_MR_SMRAM_SIZE_16384K_MASK 0x00000080 +#define PEI_MR_SMRAM_SIZE_32768K_MASK 0x00000100 + + +#define PEI_MR_SMRAM_ABSEG_128K_NOCACHE 0x00010001 +#define PEI_MR_SMRAM_HSEG_128K_CACHE 0x80020001 +#define PEI_MR_SMRAM_HSEG_128K_NOCACHE 0x00020001 +#define PEI_MR_SMRAM_TSEG_128K_CACHE 0x80040001 +#define PEI_MR_SMRAM_TSEG_128K_NOCACHE 0x00040001 +#define PEI_MR_SMRAM_TSEG_256K_CACHE 0x80040002 +#define PEI_MR_SMRAM_TSEG_256K_NOCACHE 0x00040002 +#define PEI_MR_SMRAM_TSEG_512K_CACHE 0x80040004 +#define PEI_MR_SMRAM_TSEG_512K_NOCACHE 0x00040004 +#define PEI_MR_SMRAM_TSEG_1024K_CACHE 0x80040008 +#define PEI_MR_SMRAM_TSEG_1024K_NOCACHE 0x00040008 + +// +// Graphics Memory Range +// +#define PEI_MEMORY_RANGE_GRAPHICS_MEMORY UINT32 +#define PEI_MR_GRAPHICS_MEMORY_ALL 0xFFFFFFFF +#define PEI_MR_GRAPHICS_MEMORY_NONE 0x00000000 +#define PEI_MR_GRAPHICS_MEMORY_CACHEABLE 0x80000000 +// +// If adding additional entries, Graphics Memory Size +// is a multiple of 512KB. +// +#define PEI_MR_GRAPHICS_MEMORY_SIZE_MASK 0x0000FFFF +#define PEI_MR_GRAPHICS_MEMORY_512K_NOCACHE 0x00000001 +#define PEI_MR_GRAPHICS_MEMORY_512K_CACHE 0x80000001 +#define PEI_MR_GRAPHICS_MEMORY_1M_NOCACHE 0x00000002 +#define PEI_MR_GRAPHICS_MEMORY_1M_CACHE 0x80000002 +#define PEI_MR_GRAPHICS_MEMORY_4M_NOCACHE 0x00000008 +#define PEI_MR_GRAPHICS_MEMORY_4M_CACHE 0x80000008 +#define PEI_MR_GRAPHICS_MEMORY_8M_NOCACHE 0x00000010 +#define PEI_MR_GRAPHICS_MEMORY_8M_CACHE 0x80000010 +#define PEI_MR_GRAPHICS_MEMORY_16M_NOCACHE 0x00000020 +#define PEI_MR_GRAPHICS_MEMORY_16M_CACHE 0x80000020 +#define PEI_MR_GRAPHICS_MEMORY_32M_NOCACHE 0x00000040 +#define PEI_MR_GRAPHICS_MEMORY_32M_CACHE 0x80000040 +#define PEI_MR_GRAPHICS_MEMORY_48M_NOCACHE 0x00000060 +#define PEI_MR_GRAPHICS_MEMORY_48M_CACHE 0x80000060 +#define PEI_MR_GRAPHICS_MEMORY_64M_NOCACHE 0x00000080 +#define PEI_MR_GRAPHICS_MEMORY_64M_CACHE 0x80000080 +#define PEI_MR_GRAPHICS_MEMORY_128M_NOCACHE 0x00000100 +#define PEI_MR_GRAPHICS_MEMORY_128M_CACHE 0x80000100 +#define PEI_MR_GRAPHICS_MEMORY_256M_NOCACHE 0x00000200 +#define PEI_MR_GRAPHICS_MEMORY_256M_CACHE 0x80000200 +// +// Pci Memory Hole +// +#define PEI_MEMORY_RANGE_PCI_MEMORY UINT32 +#define PEI_MR_PCI_MEMORY_SIZE_512M_MASK 0x00000001 + +typedef +EFI_STATUS +(EFIAPI *PEI_CHOOSE_RANGES) ( + IN EFI_PEI_SERVICES **PeiServices, + IN PEI_PLATFORM_MEMORY_RANGE_PPI * This, + IN OUT PEI_MEMORY_RANGE_OPTION_ROM * OptionRomMask, + IN OUT PEI_MEMORY_RANGE_SMRAM * SmramMask, + IN OUT PEI_MEMORY_RANGE_GRAPHICS_MEMORY * GraphicsMemoryMask, + IN OUT PEI_MEMORY_RANGE_PCI_MEMORY * PciMemoryMask + ); + +typedef struct _PEI_PLATFORM_MEMORY_RANGE_PPI { + PEI_CHOOSE_RANGES ChooseRanges; +} PEI_PLATFORM_MEMORY_RANGE_PPI; + +extern EFI_GUID gPeiPlatformMemoryRangePpiGuid; + +#endif diff --git a/MiscFramework/Ppi/PlatformMemorySize/PlatformMemorySize.c b/MiscFramework/Ppi/PlatformMemorySize/PlatformMemorySize.c new file mode 100644 index 0000000..90f54a4 --- /dev/null +++ b/MiscFramework/Ppi/PlatformMemorySize/PlatformMemorySize.c @@ -0,0 +1,35 @@ +/*++ + This file contains 'Framework Code' and is licensed as such + under the terms of your license agreement with Intel or your + vendor. This file may not be modified, except as allowed by + additional terms of your license agreement. +--*/ +/*++ + +Copyright (c) 1999 - 2003 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: + + PlatformMemorySize.c + +Abstract: + + Platform Memory Size PPI GUID as defined in Tiano + +--*/ + +#include "Tiano.h" +#include "Pei.h" +#include EFI_PPI_DEFINITION (PlatformMemorySize) + +EFI_GUID gPeiPlatformMemorySizePpiGuid = PEI_PLATFORM_MEMORY_SIZE_PPI_GUID; + +EFI_GUID_STRING(&gPeiPlatformMemorySizePpiGuid, "PlatformMemorySize", "Platform Memory Size PPI"); diff --git a/MiscFramework/Ppi/PlatformMemorySize/PlatformMemorySize.h b/MiscFramework/Ppi/PlatformMemorySize/PlatformMemorySize.h new file mode 100644 index 0000000..1233ed4 --- /dev/null +++ b/MiscFramework/Ppi/PlatformMemorySize/PlatformMemorySize.h @@ -0,0 +1,55 @@ +// +// This file contains 'Framework Code' and is licensed as such +// under the terms of your license agreement with Intel or your +// vendor. This file may not be modified, except as allowed by +// additional terms of your license agreement. +// +/*++ + +Copyright (c) 1999 - 2003 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: + + PlatformMemorySize.h + +Abstract: + + Platform Memory Size PPI as defined in Tiano + + PPI for describing the minimum platform memory size in order to successfully + pass control into DXE + +--*/ + +#ifndef _PEI_PLATFORM_MEMORY_SIZE_H_ +#define _PEI_PLATFORM_MEMORY_SIZE_H_ + +#define PEI_PLATFORM_MEMORY_SIZE_PPI_GUID \ + { \ + 0x9a7ef41e, 0xc140, 0x4bd1, 0xb8, 0x84, 0x1e, 0x11, 0x24, 0xb, 0x4c, 0xe6 \ + } + +EFI_FORWARD_DECLARATION (PEI_PLATFORM_MEMORY_SIZE_PPI); + +typedef +EFI_STATUS +(EFIAPI *PEI_GET_MINIMUM_PLATFORM_MEMORY_SIZE) ( + IN EFI_PEI_SERVICES **PeiServices, + IN PEI_PLATFORM_MEMORY_SIZE_PPI * This, + IN OUT UINT64 *MemorySize + ); + +typedef struct _PEI_PLATFORM_MEMORY_SIZE_PPI { + PEI_GET_MINIMUM_PLATFORM_MEMORY_SIZE GetPlatformMemorySize; +} PEI_PLATFORM_MEMORY_SIZE_PPI; + +extern EFI_GUID gPeiPlatformMemorySizePpiGuid; + +#endif diff --git a/MiscFramework/Ppi/SmbusPolicy/SmbusPolicy.c b/MiscFramework/Ppi/SmbusPolicy/SmbusPolicy.c new file mode 100644 index 0000000..ccaf621 --- /dev/null +++ b/MiscFramework/Ppi/SmbusPolicy/SmbusPolicy.c @@ -0,0 +1,35 @@ +/*++ + This file contains 'Framework Code' and is licensed as such + under the terms of your license agreement with Intel or your + vendor. This file may not be modified, except as allowed by + additional terms of your license agreement. +--*/ +/*++ + +Copyright (c) 1999 - 2002 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: + + SmbusPolicy.c + +Abstract: + + Smbus Policy PPI GUID as defined in EFI 2.0 + +--*/ + +#include "Tiano.h" +#include "Pei.h" +#include EFI_PPI_DEFINITION (SmbusPolicy) + +EFI_GUID gPeiSmbusPolicyPpiGuid = PEI_SMBUS_POLICY_PPI_GUID; + +EFI_GUID_STRING(&gPeiSmbusPolicyPpiGuid, "SmbusPolicy", "Smbus Policy PPI"); diff --git a/MiscFramework/Ppi/SmbusPolicy/SmbusPolicy.h b/MiscFramework/Ppi/SmbusPolicy/SmbusPolicy.h new file mode 100644 index 0000000..48cd755 --- /dev/null +++ b/MiscFramework/Ppi/SmbusPolicy/SmbusPolicy.h @@ -0,0 +1,48 @@ +// +// This file contains 'Framework Code' and is licensed as such +// under the terms of your license agreement with Intel or your +// vendor. This file may not be modified, except as allowed by +// additional terms of your license agreement. +// +/*++ + +Copyright (c) 1999 - 2002 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: + + SmbusPolicy.h + +Abstract: + + Smbus Policy PPI as defined in EFI 2.0 + +--*/ + +#ifndef _PEI_SMBUS_POLICY_PPI_H +#define _PEI_SMBUS_POLICY_PPI_H + +#define PEI_SMBUS_POLICY_PPI_GUID \ + { \ + 0x63b6e435, 0x32bc, 0x49c6, 0x81, 0xbd, 0xb7, 0xa1, 0xa0, 0xfe, 0x1a, 0x6c \ + } + +EFI_FORWARD_DECLARATION (PEI_SMBUS_POLICY_PPI); + +typedef struct _PEI_SMBUS_POLICY_PPI { + UINTN BaseAddress; + UINT32 PciAddress; + UINT8 NumRsvdAddress; + UINT8 *RsvdAddress; +} PEI_SMBUS_POLICY_PPI; + +extern EFI_GUID gPeiSmbusPolicyPpiGuid; + +#endif diff --git a/MiscFramework/Ppi/SmmControl/SmmControl.c b/MiscFramework/Ppi/SmmControl/SmmControl.c new file mode 100644 index 0000000..327821e --- /dev/null +++ b/MiscFramework/Ppi/SmmControl/SmmControl.c @@ -0,0 +1,35 @@ +/*++ + This file contains 'Framework Code' and is licensed as such + under the terms of your license agreement with Intel or your + vendor. This file may not be modified, except as allowed by + additional terms of your license agreement. +--*/ +/*++ + +Copyright (c) 1999 - 2002 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: + + SmmControl.c + +Abstract: + + Stall PPI GUID as defined in EFI 2.0 + +--*/ + +#include "Tiano.h" +#include "Pei.h" +#include EFI_PPI_DEFINITION (SmmControl) + +EFI_GUID gPeiSmmControlPpiGuid = PEI_SMM_CONTROL_PPI_GUID; + +EFI_GUID_STRING(&gPeiSmmControlPpiGuid, "SmmControl", "SMM Control PPI"); diff --git a/MiscFramework/Ppi/SmmControl/SmmControl.h b/MiscFramework/Ppi/SmmControl/SmmControl.h new file mode 100644 index 0000000..84b45d3 --- /dev/null +++ b/MiscFramework/Ppi/SmmControl/SmmControl.h @@ -0,0 +1,67 @@ +// +// This file contains 'Framework Code' and is licensed as such +// under the terms of your license agreement with Intel or your +// vendor. This file may not be modified, except as allowed by +// additional terms of your license agreement. +// +/*++ + +Copyright (c) 1999 - 2002 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: + + SmmControl.h + +Abstract: + + Stall PPI as defined in EFI 2.0 + + This code abstracts the PEI core to provide SmmControl services. + +--*/ + +#ifndef _PEI_SMM_CONTROL_PPI_H_ +#define _PEI_SMM_CONTROL_PPI_H_ + +#define PEI_SMM_CONTROL_PPI_GUID \ + { \ + 0x61c68702, 0x4d7e, 0x4f43, 0x8d, 0xef, 0xa7, 0x43, 0x5, 0xce, 0x74, 0xc5 \ + } + +EFI_FORWARD_DECLARATION (PEI_SMM_CONTROL_PPI); + +typedef +EFI_STATUS +(EFIAPI *PEI_SMM_ACTIVATE) ( + IN EFI_PEI_SERVICES **PeiServices, + IN PEI_SMM_CONTROL_PPI * This, + IN OUT INT8 *ArgumentBuffer OPTIONAL, + IN OUT UINTN *ArgumentBufferSize OPTIONAL, + IN BOOLEAN Periodic OPTIONAL, + IN UINTN ActivationInterval OPTIONAL + ); + +typedef +EFI_STATUS +(EFIAPI *PEI_SMM_DEACTIVATE) ( + IN EFI_PEI_SERVICES **PeiServices, + IN PEI_SMM_CONTROL_PPI * This, + IN BOOLEAN Periodic OPTIONAL + ); + +typedef struct _PEI_SMM_CONTROL_PPI { + PEI_SMM_ACTIVATE Trigger; + PEI_SMM_DEACTIVATE Clear; +} PEI_SMM_CONTROL_PPI; + +extern EFI_GUID gPeiSmmControlPpiGuid; + +#endif diff --git a/MiscFramework/Ppi/SmmControlLib.cif b/MiscFramework/Ppi/SmmControlLib.cif new file mode 100644 index 0000000..6a9624c --- /dev/null +++ b/MiscFramework/Ppi/SmmControlLib.cif @@ -0,0 +1,11 @@ + + name = "SmmControlLib" + category = ModulePart + LocalRoot = "MiscFramework\Ppi" + RefName = "SmmControlLib" +[files] +"SmmControl\SmmControl.c" +"SmmControl\SmmControl.h" +"SmmControlLib.sdl" +"SmmControlLib.mak" + diff --git a/MiscFramework/Ppi/SmmControlLib.mak b/MiscFramework/Ppi/SmmControlLib.mak new file mode 100644 index 0000000..f26f8b0 --- /dev/null +++ b/MiscFramework/Ppi/SmmControlLib.mak @@ -0,0 +1,72 @@ +#********************************************************************** +#********************************************************************** +#** ** +#** (C)Copyright 1985-2006, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#********************************************************************** +#********************************************************************** + +#********************************************************************** +# $Header: /Alaska/SOURCE/Modules/MPG/Calpella/MiscFramework/SmmControlLib/SmmControlLib.mak 1 10/15/08 2:20p Fasihm $ +# +# $Revision: 1 $ +# +# $Date: 10/15/08 2:20p $ +#********************************************************************** +# Revision History +# ---------------- +# +#********************************************************************** +# +# +# Name: FrameworkPpiLib.mak +# +# Description: +# +# +#********************************************************************** +all : SmmControlLib + +$(SmmControlLib_LIB) : SmmControlLib + +SmmControlLib : $(BUILD_DIR)\SmmControlLib.mak SmmControlLibBin + +$(BUILD_DIR)\SmmControlLib.mak : $(SmmControlLib_DIR)\$(@B).cif $(SmmControlLib_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(SmmControlLib_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +SmmControlLibBin : + $(MAKE) /$(MAKEFLAGS) $(EDK_DEFAULTS)\ +!IF "$(x64_BUILD)"=="1" + /f $(BUILD_DIR)\SmmControlLib.mak all\ + "MY_INCLUDES=$(EDK_INCLUDES) /I$(MISCFRAMEWORK_DIR) /I$(EDK_INCLUDES) /I$(PROJECT_DIR)\Include\IndustryStandard" \ + TYPE=LIBRARY + $(MAKE) /$(MAKEFLAGS) $(EDK_DEFAULTS)\ + BUILD_DIR=$(BUILD_DIR)\IA32\ + /f $(BUILD_DIR)\SmmControlLib.mak all\ + "MY_INCLUDES=$(EDK_INCLUDES) /I$(MISCFRAMEWORK_DIR) /I$(EDK_INCLUDES) /I$(PROJECT_DIR)\Include\IndustryStandard" \ + TYPE=PEI_LIBRARY +!ELSE + /f $(BUILD_DIR)\SmmControlLib.mak all\ + "MY_INCLUDES=$(EDK_INCLUDES) /I$(MISCFRAMEWORK_DIR) /I$(EDK_INCLUDES) /I$(PROJECT_DIR)\Include\IndustryStandard" \ + TYPE=PEI_LIBRARY +!ENDIF + +#********************************************************************** +#********************************************************************** +#** ** +#** (C)Copyright 1985-2006, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#********************************************************************** +#********************************************************************** \ No newline at end of file diff --git a/MiscFramework/Ppi/SmmControlLib.sdl b/MiscFramework/Ppi/SmmControlLib.sdl new file mode 100644 index 0000000..52ffc40 --- /dev/null +++ b/MiscFramework/Ppi/SmmControlLib.sdl @@ -0,0 +1,28 @@ +TOKEN + Name = "SmmControlLib_SUPPORT" + Value = "1" + Help = "Main switch to enable SmmControlLib support in Project" + TokenType = Boolean + TargetMAK = Yes + Master = Yes +End + +PATH + Name = "SmmControlLib_DIR" +End + +MODULE + Help = "Includes SmmControlLib.mak to Project" + File = "SmmControlLib.mak" +End + +ELINK + Name = "SmmControlLib_LIB" + InvokeOrder = ReplaceParent +End + +ELINK + Name = "$$(LIB_BUILD_DIR)\SmmControlLib.lib" + Parent = "SmmControlLib_LIB" + InvokeOrder = AfterParent +End diff --git a/MiscFramework/TcgAcpi.h b/MiscFramework/TcgAcpi.h new file mode 100644 index 0000000..3e0ba3e --- /dev/null +++ b/MiscFramework/TcgAcpi.h @@ -0,0 +1,45 @@ +#ifndef _TCG_ACPI_3_0_H_ +#define _TCG_ACPI_3_0_H_ + +#define EFI_ACPI_TABLE_GUID \ + { \ + 0xeb9d2d30, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d \ + } + +#define EFI_ACPI_20_TABLE_GUID \ + { \ + 0x8868e871, 0xe4f1, 0x11d3, 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 \ + } + +#define EFI_ACPI_30_TABLE_GUID EFI_ACPI_20_TABLE_GUID + +extern EFI_GUID gEfiAcpiTableGuid; +extern EFI_GUID gEfiAcpi20TableGuid; +extern EFI_GUID gEfiAcpi30TableGuid; +//#include "Acpi.h" + + +#pragma pack(1) + +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; + + +// +// "TCPA" Trusted Computing Platform Alliance Capabilities Table +// +#define EFI_ACPI_3_0_TRUSTED_COMPUTING_PLATFORM_ALLIANCE_CAPABILITIES_TABLE_SIGNATURE 0x41504354 + + +#pragma pack() + +#endif -- cgit v1.2.3