1 /*++
2 
3 Copyright (c) 2004 - 2010, 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   EfiCapsule.h
15 
16 Abstract:
17 
18   Defines for the EFI Capsule functionality
19 
20 --*/
21 
22 #ifndef _EFI_CAPSULE_H_
23 #define _EFI_CAPSULE_H_
24 
25 
26 #define CAPSULE_BLOCK_DESCRIPTOR_SIGNATURE  EFI_SIGNATURE_32 ('C', 'B', 'D', 'S')
27 
28 typedef struct {
29   EFI_GUID  OemGuid;
30   UINT32    HeaderSize;
31   //
32   // UINT8                       OemHdrData[];
33   //
34 } EFI_CAPSULE_OEM_HEADER;
35 
36 #if (EFI_SPECIFICATION_VERSION >= 0x00020000)
37 
38 #define MAX_SUPPORT_CAPSULE_NUM               50
39 #define CAPSULE_FLAGS_PERSIST_ACROSS_RESET    0x00010000
40 #define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE   0x00020000
41 
42 typedef struct {
43   UINT64                   Length;
44   union {
45     EFI_PHYSICAL_ADDRESS   DataBlock;
46     EFI_PHYSICAL_ADDRESS   ContinuationPointer;
47   } Union;
48 } EFI_CAPSULE_BLOCK_DESCRIPTOR;
49 
50 typedef struct {
51   EFI_GUID  CapsuleGuid;
52   UINT32    HeaderSize;
53   UINT32    Flags;
54   UINT32    CapsuleImageSize;
55 } EFI_CAPSULE_HEADER;
56 
57 typedef struct {
58   UINT32   CapsuleArrayNumber;
59   VOID*    CapsulePtr[1];
60 } EFI_CAPSULE_TABLE;
61 
62 //
63 // This struct is deprecated because VendorTable entries physical address will not be fixed up when
64 // transitioning from preboot to runtime phase. So we don't need CapsuleInfoTable to record capsule
65 // GUIDs any more for runtime convert.
66 //
67 typedef struct {
68   UINT32      CapsuleGuidNumber;
69   EFI_GUID    CapsuleGuidPtr[1];
70 } EFI_CAPSULE_INFO_TABLE;
71 
72 //
73 // This GUID is used for collecting all capsules' Guids who install in ConfigTable.
74 // This GUID is deprecated as well.
75 //
76 #define EFI_CAPSULE_INFO_GUID \
77   { \
78     0x8B34EAC7, 0x2690, 0x460B, {0x8B, 0xA5, 0xD5, 0xCF, 0x32, 0x83, 0x17, 0x35} \
79   }
80 
81 #else
82 
83 typedef struct {
84   EFI_GUID  CapsuleGuid;
85   UINT32    HeaderSize;
86   UINT32    Flags;
87   UINT32    CapsuleImageSize;
88   UINT32    SequenceNumber;
89   EFI_GUID  InstanceId;
90   UINT32    OffsetToSplitInformation;
91   UINT32    OffsetToCapsuleBody;
92   UINT32    OffsetToOemDefinedHeader;
93   UINT32    OffsetToAuthorInformation;
94   UINT32    OffsetToRevisionInformation;
95   UINT32    OffsetToShortDescription;
96   UINT32    OffsetToLongDescription;
97   UINT32    OffsetToApplicableDevices;
98 } EFI_CAPSULE_HEADER;
99 
100 //
101 // An array of these describe the blocks that make up a capsule for
102 // a capsule update.
103 //
104 typedef struct {
105   UINT64                Length;     // length of the data block
106   EFI_PHYSICAL_ADDRESS  Data;       // physical address of the data block
107   UINT32                Signature;  // CBDS
108   UINT32                CheckSum;   // to sum this structure to 0
109 } EFI_CAPSULE_BLOCK_DESCRIPTOR;
110 
111 #endif
112 
113 //
114 // Bits in the flags field of the capsule header
115 //
116 #define EFI_CAPSULE_HEADER_FLAG_SETUP 0x00000001  // supports setup changes
117 //
118 // This is the GUID of the capsule header of the image on disk.
119 //
120 #define EFI_CAPSULE_GUID \
121   { \
122     0x3B6686BD, 0x0D76, 0x4030, {0xB7, 0x0E, 0xB5, 0x51, 0x9E, 0x2F, 0xC5, 0xA0} \
123   }
124 
125 //
126 // This is the GUID of the file created by the capsule application that contains
127 // the path to the device(s) to update.
128 //
129 #define EFI_PATH_FILE_NAME_GUID \
130   { \
131     0x7644C181, 0xFA6E, 0x46DA, {0x80, 0xCB, 0x04, 0xB9, 0x90, 0x40, 0x62, 0xE8} \
132   }
133 //
134 // This is the GUID of the configuration results file created by the capsule
135 // application.
136 //
137 #define EFI_CONFIG_FILE_NAME_GUID \
138   { \
139     0x98B8D59B, 0xE8BA, 0x48EE, {0x98, 0xDD, 0xC2, 0x95, 0x39, 0x2F, 0x1E, 0xDB} \
140   }
141 
142 #endif // #ifndef _EFI_CAPSULE_H_
143