]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SignedCapsulePkg/Include: Add PlatformFlashAccessLib header.
authorJiewen Yao <jiewen.yao@intel.com>
Wed, 21 Sep 2016 01:37:01 +0000 (09:37 +0800)
committerJiewen Yao <jiewen.yao@intel.com>
Tue, 8 Nov 2016 14:40:52 +0000 (22:40 +0800)
This library is used to abstract platform flash access.
This library is consumed by a capsule update module.
It may cover SystemFirmware region and/or non-SystemFirmware region.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
SignedCapsulePkg/Include/Library/PlatformFlashAccessLib.h [new file with mode: 0644]

diff --git a/SignedCapsulePkg/Include/Library/PlatformFlashAccessLib.h b/SignedCapsulePkg/Include/Library/PlatformFlashAccessLib.h
new file mode 100644 (file)
index 0000000..0a8858e
--- /dev/null
@@ -0,0 +1,57 @@
+/** @file\r
+  Platform flash device access library.\r
+\r
+  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+\r
+#ifndef __PLATFORM_FLASH_ACCESS_LIB_H__\r
+#define __PLATFORM_FLASH_ACCESS_LIB_H__\r
+\r
+typedef enum {\r
+  FlashAddressTypeRelativeAddress,\r
+  FlashAddressTypeAbsoluteAddress,\r
+} FLASH_ADDRESS_TYPE;\r
+\r
+//\r
+// Type 0 ~ 0x7FFFFFFF is defined in this library.\r
+// Type 0x80000000 ~ 0xFFFFFFFF is reserved for OEM.\r
+//\r
+typedef enum {\r
+  PlatformFirmwareTypeSystemFirmware,\r
+  PlatformFirmwareTypeNvRam,\r
+} PLATFORM_FIRMWARE_TYPE;\r
+\r
+/**\r
+  Perform flash write opreation.\r
+\r
+  @param[in] FirmwareType      The type of firmware.\r
+  @param[in] FlashAddress      The address of flash device to be accessed.\r
+  @param[in] FlashAddressType  The type of flash device address.\r
+  @param[in] Buffer            The pointer to the data buffer.\r
+  @param[in] Length            The length of data buffer in bytes.\r
+\r
+  @retval EFI_SUCCESS           The operation returns successfully.\r
+  @retval EFI_WRITE_PROTECTED   The flash device is read only.\r
+  @retval EFI_UNSUPPORTED       The flash device access is unsupported.\r
+  @retval EFI_INVALID_PARAMETER The input parameter is not valid.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PerformFlashWrite (\r
+  IN PLATFORM_FIRMWARE_TYPE       FirmwareType,\r
+  IN EFI_PHYSICAL_ADDRESS         FlashAddress,\r
+  IN FLASH_ADDRESS_TYPE           FlashAddressType,\r
+  IN VOID                         *Buffer,\r
+  IN UINTN                        Length\r
+  );\r
+\r
+#endif\r