1. Remove IntelFrameworkPkg.dec package dependency from EdkFvbServiceLib.inf and...
[mirror_edk2.git] / MdeModulePkg / Include / Common / FlashMap.h
CommitLineData
94774441 1/*++\r
2\r
3Copyright (c) 2006, Intel Corporation\r
4All rights reserved. This program and the accompanying materials\r
5are licensed and made available under the terms and conditions of the BSD License\r
6which accompanies this distribution. The full text of the license may be found at\r
7http://opensource.org/licenses/bsd-license.php\r
8\r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11\r
12Module Name:\r
13\r
14 FlashMap.h\r
15\r
16Abstract:\r
17\r
18 FlashMap PPI defined in Tiano\r
19\r
20 This code abstracts FlashMap access\r
21\r
22--*/\r
23\r
24#ifndef __COMMON_FLASHMAP_H__\r
25#define __COMMON_FLASHMAP_H__\r
26\r
ecd9cd15 27//#include <Common/FrameworkHob.h>\r
94774441 28//\r
29// Definition for flash map GUIDed HOBs\r
30//\r
31typedef UINT32 EFI_FLASH_AREA_ATTRIBUTES;\r
32\r
33#define EFI_FLASH_AREA_FV 0x0001\r
34#define EFI_FLASH_AREA_SUBFV 0x0002\r
35#define EFI_FLASH_AREA_MEMMAPPED_FV 0x0004\r
36#define EFI_FLASH_AREA_REQUIRED 0x0008\r
37#define EFI_FLASH_AREA_CORRUPT 0x0010\r
38\r
39typedef UINT8 EFI_FLASH_AREA_TYPE;\r
40\r
41#define EFI_FLASH_AREA_RECOVERY_BIOS 0x0 // Recovery code\r
42#define EFI_FLASH_AREA_MAIN_BIOS 0x1 // Regular BIOS code\r
43#define EFI_FLASH_AREA_PAL_B 0x2 // PAL-B\r
44#define EFI_FLASH_AREA_RESERVED_03 0x3 // Reserved for backwards compatibility\r
45#define EFI_FLASH_AREA_RESERVED_04 0x4 // Reserved for backwards compatibility\r
46#define EFI_FLASH_AREA_DMI_FRU 0x5 // DMI FRU information\r
47#define EFI_FLASH_AREA_OEM_BINARY 0x6 // OEM Binary Code/data\r
48#define EFI_FLASH_AREA_RESERVED_07 0x7 // Reserved for backwards compatibility\r
49#define EFI_FLASH_AREA_RESERVED_08 0x8 // Reserved for backwards compatibility\r
50#define EFI_FLASH_AREA_RESERVED_09 0x9 // Reserved for backwards compatibility\r
51#define EFI_FLASH_AREA_RESERVED_0A 0x0a // Reserved for backwards compatibility\r
52#define EFI_FLASH_AREA_EFI_VARIABLES 0x0b // EFI variables\r
53#define EFI_FLASH_AREA_MCA_LOG 0x0c // MCA error log\r
54#define EFI_FLASH_AREA_SMBIOS_LOG 0x0d // SMBIOS error log\r
55#define EFI_FLASH_AREA_FTW_BACKUP 0x0e // A backup block during FTW operations\r
56#define EFI_FLASH_AREA_FTW_STATE 0x0f // State information during FTW operations\r
57#define EFI_FLASH_AREA_UNUSED 0x0fd // Not used\r
58#define EFI_FLASH_AREA_GUID_DEFINED 0x0fe // Usage defined by a GUID\r
59#pragma pack(1)\r
60//\r
61// An individual sub-area Entry.\r
62// A single flash area may consist of more than one sub-area.\r
63//\r
64typedef struct {\r
65 EFI_FLASH_AREA_ATTRIBUTES Attributes;\r
66 UINT32 Reserved;\r
67 EFI_PHYSICAL_ADDRESS Base;\r
68 EFI_PHYSICAL_ADDRESS Length;\r
69 EFI_GUID FileSystem;\r
70} EFI_FLASH_SUBAREA_ENTRY;\r
71\r
72typedef struct {\r
73 UINT8 Reserved[3];\r
74 EFI_FLASH_AREA_TYPE AreaType;\r
75 EFI_GUID AreaTypeGuid;\r
76 UINT32 NumEntries;\r
77 EFI_FLASH_SUBAREA_ENTRY Entries[1];\r
78} EFI_FLASH_MAP_ENTRY_DATA;\r
79\r
80typedef struct {\r
81 EFI_HOB_GENERIC_HEADER Header;\r
82 EFI_GUID Name;\r
83 UINT8 Reserved[3];\r
84 EFI_FLASH_AREA_TYPE AreaType;\r
85 EFI_GUID AreaTypeGuid;\r
86 UINT32 NumEntries;\r
87 EFI_FLASH_SUBAREA_ENTRY Entries[1];\r
88} EFI_HOB_FLASH_MAP_ENTRY_TYPE;\r
89\r
90//\r
91// Internal definitions\r
92//\r
93typedef struct {\r
94 UINT8 Reserved[3];\r
95 EFI_FLASH_AREA_TYPE AreaType;\r
96 EFI_GUID AreaTypeGuid;\r
97 UINT32 NumberOfEntries;\r
98 EFI_FLASH_SUBAREA_ENTRY SubAreaData;\r
99} EFI_FLASH_AREA_HOB_DATA;\r
100\r
101typedef struct {\r
102 UINTN Base;\r
103 UINTN Length;\r
104 EFI_FLASH_AREA_ATTRIBUTES Attributes;\r
105 EFI_FLASH_AREA_TYPE AreaType;\r
106 UINT8 Reserved[3];\r
107 EFI_GUID AreaTypeGuid;\r
108} EFI_FLASH_AREA_DATA;\r
109\r
110#pragma pack()\r
111\r
112#endif\r