summaryrefslogtreecommitdiffstats
path: root/UefiPayloadPkg/Include/Guid
diff options
context:
space:
mode:
authorGuo Dong <guo.dong@intel.com>2021-09-22 14:31:29 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-10-25 17:28:21 +0000
commit1d66480aa4a8c4c0612d5c91e4061e2fdaf36f6c (patch)
treeaf0c4a57159cbcceb5dcd5ef4b301b3032dcd1ab /UefiPayloadPkg/Include/Guid
parentbed990aae6b68b7fcadedb81075ae9619e12c1e6 (diff)
downloadedk2-1d66480aa4a8c4c0612d5c91e4061e2fdaf36f6c.tar.gz
edk2-1d66480aa4a8c4c0612d5c91e4061e2fdaf36f6c.tar.bz2
edk2-1d66480aa4a8c4c0612d5c91e4061e2fdaf36f6c.zip
UefiPayloadPkg: Add SpiFlashLib
This is a common SPI Flash library used for the Intel platform that supports SPI hardware sequence. This library provides actual SPI flash operation via Intel PCH SPI controller. 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/Guid')
-rw-r--r--UefiPayloadPkg/Include/Guid/SpiFlashInfoGuid.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/UefiPayloadPkg/Include/Guid/SpiFlashInfoGuid.h b/UefiPayloadPkg/Include/Guid/SpiFlashInfoGuid.h
new file mode 100644
index 0000000000..6241463007
--- /dev/null
+++ b/UefiPayloadPkg/Include/Guid/SpiFlashInfoGuid.h
@@ -0,0 +1,38 @@
+/** @file
+ This file defines the hob structure for the SPI flash variable info.
+
+ Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR>
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef SPI_FLASH_INFO_GUID_H_
+#define SPI_FLASH_INFO_GUID_H_
+
+#include <IndustryStandard/Acpi.h>
+//
+// SPI Flash infor hob GUID
+//
+extern EFI_GUID gSpiFlashInfoGuid;
+
+//
+// Set this bit if platform need disable SMM write protection when writing flash
+// in SMM mode using this method: -- AsmWriteMsr32 (0x1FE, MmioRead32 (0xFED30880) | BIT0);
+//
+#define FLAGS_SPI_DISABLE_SMM_WRITE_PROTECT BIT0
+
+//
+// Reuse ACPI definition
+//
+typedef EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE PLD_GENERIC_ADDRESS;
+#define SPACE_ID_PCI_CONFIGURATION EFI_ACPI_3_0_PCI_CONFIGURATION_SPACE
+#define REGISTER_BIT_WIDTH_DWORD EFI_ACPI_3_0_DWORD
+
+typedef struct {
+ UINT8 Revision;
+ UINT8 Reserved;
+ UINT16 Flags;
+ PLD_GENERIC_ADDRESS SpiAddress;
+} SPI_FLASH_INFO;
+
+#endif