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