1 /*++ 2 3 Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR> 4 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 EfiFlashMap.h 15 16 Abstract: 17 18 Defines for the EFI Flash Map functionality 19 20 --*/ 21 22 #ifndef _EFI_FLASHMAP_H_ 23 #define _EFI_FLASHMAP_H_ 24 25 #include "PeiHob.h" 26 27 // 28 // Definition for flash map GUIDed HOBs 29 // 30 typedef UINT32 EFI_FLASH_AREA_ATTRIBUTES; 31 32 #define EFI_FLASH_AREA_FV 0x0001 33 #define EFI_FLASH_AREA_SUBFV 0x0002 34 #define EFI_FLASH_AREA_MEMMAPPED_FV 0x0004 35 #define EFI_FLASH_AREA_REQUIRED 0x0008 36 #define EFI_FLASH_AREA_CORRUPT 0x0010 37 38 typedef UINT8 EFI_FLASH_AREA_TYPE; 39 40 #define EFI_FLASH_AREA_RECOVERY_BIOS 0x0 // Recovery code 41 #define EFI_FLASH_AREA_MAIN_BIOS 0x1 // Regular BIOS code 42 #define EFI_FLASH_AREA_PAL_B 0x2 // PAL-B 43 #define EFI_FLASH_AREA_RESERVED_03 0x3 // Reserved for backwards compatibility 44 #define EFI_FLASH_AREA_RESERVED_04 0x4 // Reserved for backwards compatibility 45 #define EFI_FLASH_AREA_DMI_FRU 0x5 // DMI FRU information 46 #define EFI_FLASH_AREA_OEM_BINARY 0x6 // OEM Binary Code/data 47 #define EFI_FLASH_AREA_RESERVED_07 0x7 // Reserved for backwards compatibility 48 #define EFI_FLASH_AREA_RESERVED_08 0x8 // Reserved for backwards compatibility 49 #define EFI_FLASH_AREA_RESERVED_09 0x9 // Reserved for backwards compatibility 50 #define EFI_FLASH_AREA_RESERVED_0A 0x0a // Reserved for backwards compatibility 51 #define EFI_FLASH_AREA_EFI_VARIABLES 0x0b // EFI variables 52 #define EFI_FLASH_AREA_MCA_LOG 0x0c // MCA error log 53 #define EFI_FLASH_AREA_SMBIOS_LOG 0x0d // SMBIOS error log 54 #define EFI_FLASH_AREA_FTW_BACKUP 0x0e // A backup block during FTW operations 55 #define EFI_FLASH_AREA_FTW_STATE 0x0f // State information during FTW operations 56 #define EFI_FLASH_AREA_UNUSED 0x0fd // Not used 57 #define EFI_FLASH_AREA_GUID_DEFINED 0x0fe // Usage defined by a GUID 58 #pragma pack(1) 59 // 60 // An individual sub-area Entry. 61 // A single flash area may consist of more than one sub-area. 62 // 63 typedef struct { 64 EFI_FLASH_AREA_ATTRIBUTES Attributes; 65 UINT32 Reserved; 66 EFI_PHYSICAL_ADDRESS Base; 67 EFI_PHYSICAL_ADDRESS Length; 68 EFI_GUID FileSystem; 69 } EFI_FLASH_SUBAREA_ENTRY; 70 71 typedef struct { 72 UINT8 Reserved[3]; 73 EFI_FLASH_AREA_TYPE AreaType; 74 EFI_GUID AreaTypeGuid; 75 UINT32 NumEntries; 76 EFI_FLASH_SUBAREA_ENTRY Entries[1]; 77 } EFI_FLASH_MAP_ENTRY_DATA; 78 79 typedef struct { 80 UINT8 Reserved[3]; 81 EFI_FLASH_AREA_TYPE AreaType; 82 EFI_GUID AreaTypeGuid; 83 UINT32 NumberOfEntries; 84 EFI_FLASH_SUBAREA_ENTRY Entries[1]; 85 // 86 // Extended Hob data. 87 // 88 // VolumeId and FilePath indicating a unique file. 89 // 90 UINT32 VolumeId; 91 CHAR16 FilePath[256]; 92 UINT32 ActuralSize; 93 UINT32 Offset; 94 } EFI_FLASH_MAP_FS_ENTRY_DATA; 95 96 typedef struct { 97 EFI_HOB_GENERIC_HEADER Header; 98 EFI_GUID Name; 99 UINT8 Reserved[3]; 100 EFI_FLASH_AREA_TYPE AreaType; 101 EFI_GUID AreaTypeGuid; 102 UINT32 NumEntries; 103 EFI_FLASH_SUBAREA_ENTRY Entries[1]; 104 } EFI_HOB_FLASH_MAP_ENTRY_TYPE; 105 106 // 107 // Internal definitions 108 // 109 typedef struct { 110 UINT8 Reserved[3]; 111 EFI_FLASH_AREA_TYPE AreaType; 112 EFI_GUID AreaTypeGuid; 113 UINT32 NumberOfEntries; 114 EFI_FLASH_SUBAREA_ENTRY SubAreaData; 115 } EFI_FLASH_AREA_HOB_DATA; 116 117 typedef struct { 118 UINTN Base; 119 UINTN Length; 120 EFI_FLASH_AREA_ATTRIBUTES Attributes; 121 EFI_FLASH_AREA_TYPE AreaType; 122 UINT8 Reserved[3]; 123 EFI_GUID AreaTypeGuid; 124 } EFI_FLASH_AREA_DATA; 125 126 #pragma pack() 127 128 #endif // #ifndef _EFI_FLASHMAP_H_ 129