]>
Commit | Line | Data |
---|---|---|
615c14b6 JY |
1 | /** @file\r |
2 | Platform flash device access library.\r | |
3 | \r | |
4 | Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r | |
5 | This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | \r | |
16 | #ifndef __PLATFORM_FLASH_ACCESS_LIB_H__\r | |
17 | #define __PLATFORM_FLASH_ACCESS_LIB_H__\r | |
18 | \r | |
19 | typedef enum {\r | |
20 | FlashAddressTypeRelativeAddress,\r | |
21 | FlashAddressTypeAbsoluteAddress,\r | |
22 | } FLASH_ADDRESS_TYPE;\r | |
23 | \r | |
24 | //\r | |
25 | // Type 0 ~ 0x7FFFFFFF is defined in this library.\r | |
26 | // Type 0x80000000 ~ 0xFFFFFFFF is reserved for OEM.\r | |
27 | //\r | |
28 | typedef enum {\r | |
29 | PlatformFirmwareTypeSystemFirmware,\r | |
30 | PlatformFirmwareTypeNvRam,\r | |
31 | } PLATFORM_FIRMWARE_TYPE;\r | |
32 | \r | |
33 | /**\r | |
34 | Perform flash write opreation.\r | |
35 | \r | |
36 | @param[in] FirmwareType The type of firmware.\r | |
37 | @param[in] FlashAddress The address of flash device to be accessed.\r | |
38 | @param[in] FlashAddressType The type of flash device address.\r | |
39 | @param[in] Buffer The pointer to the data buffer.\r | |
40 | @param[in] Length The length of data buffer in bytes.\r | |
41 | \r | |
42 | @retval EFI_SUCCESS The operation returns successfully.\r | |
43 | @retval EFI_WRITE_PROTECTED The flash device is read only.\r | |
44 | @retval EFI_UNSUPPORTED The flash device access is unsupported.\r | |
45 | @retval EFI_INVALID_PARAMETER The input parameter is not valid.\r | |
46 | **/\r | |
47 | EFI_STATUS\r | |
48 | EFIAPI\r | |
49 | PerformFlashWrite (\r | |
50 | IN PLATFORM_FIRMWARE_TYPE FirmwareType,\r | |
51 | IN EFI_PHYSICAL_ADDRESS FlashAddress,\r | |
52 | IN FLASH_ADDRESS_TYPE FlashAddressType,\r | |
53 | IN VOID *Buffer,\r | |
54 | IN UINTN Length\r | |
55 | );\r | |
56 | \r | |
57 | #endif\r |