diff options
author | Guo Dong <guo.dong@intel.com> | 2021-09-22 14:22:42 -0700 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-10-25 17:28:21 +0000 |
commit | e7e8ea27d4d8790e76c26fa150e85b3277a72fd5 (patch) | |
tree | 4330de4bc255f9a2eed37864fd624dbf80800325 /UefiPayloadPkg/Include | |
parent | 87a34ca0cf6892e8c6784eb7e381b392d1176bb5 (diff) | |
download | edk2-e7e8ea27d4d8790e76c26fa150e85b3277a72fd5.tar.gz |
UefiPayloadPkg: Add a common SMM control Runtime DXE module
This module consumes SMM Registers HOB (SMI_GBL_EN and SMI_APM_EN) to
install SMM control 2 protocol gEfiSmmControl2ProtocolGuid.
The protocol activate() would set SMI_GBL_EN and SMI_APM_EN and trigger
SMI by writing to IO port 0xB3 and 0xB2.
Signed-off-by: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Benjamin You <benjamin.you@intel.com>
Diffstat (limited to 'UefiPayloadPkg/Include')
-rw-r--r-- | UefiPayloadPkg/Include/Guid/SmmRegisterInfoGuid.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/UefiPayloadPkg/Include/Guid/SmmRegisterInfoGuid.h b/UefiPayloadPkg/Include/Guid/SmmRegisterInfoGuid.h new file mode 100644 index 0000000000..8a1d3d7486 --- /dev/null +++ b/UefiPayloadPkg/Include/Guid/SmmRegisterInfoGuid.h @@ -0,0 +1,48 @@ +/** @file
+ This file defines the SMM info hob structure.
+
+ Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef PAYLOAD_SMM_REGISTER_INFO_GUID_H_
+#define PAYLOAD_SMM_REGISTER_INFO_GUID_H_
+
+#include <IndustryStandard/Acpi.h>
+
+///
+/// SMM Information GUID
+///
+extern EFI_GUID gSmmRegisterInfoGuid;
+
+///
+/// Reuse ACPI definition
+/// AddressSpaceId(0xC0-0xFF) is defined by OEM for MSR and other spaces
+///
+typedef EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE PLD_GENERIC_ADDRESS;
+
+#define REGISTER_ID_SMI_GBL_EN 1
+#define REGISTER_ID_SMI_GBL_EN_LOCK 2
+#define REGISTER_ID_SMI_EOS 3
+#define REGISTER_ID_SMI_APM_EN 4
+#define REGISTER_ID_SMI_APM_STS 5
+
+#pragma pack(1)
+typedef struct {
+ UINT64 Id;
+ UINT64 Value;
+ PLD_GENERIC_ADDRESS Address;
+} PLD_GENERIC_REGISTER;
+
+typedef struct {
+ UINT16 Revision;
+ UINT16 Reserved;
+ UINT32 Count;
+ PLD_GENERIC_REGISTER Registers[0];
+} PLD_SMM_REGISTERS;
+
+
+#pragma pack()
+
+#endif
|