summaryrefslogtreecommitdiffstats
path: root/IntelFrameworkPkg/Include/Guid/Capsule.h
blob: 6dfdb11a617209ca2e02065fc7de2d14e513b31d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/** @file
  Framework Capule related Definition.

Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent

  @par Revision Reference:
  Capsule Spec Version 0.9
**/

#ifndef _CAPSULE_GUID_H__
#define _CAPSULE_GUID_H__

//
// This is the GUID of the capsule header of the image on disk.
//
#define EFI_CAPSULE_GUID \
  { \
    0x3B6686BD, 0x0D76, 0x4030, {0xB7, 0x0E, 0xB5, 0x51, 0x9E, 0x2F, 0xC5, 0xA0 } \
  }

//
// This is the GUID of the configuration results file created by the capsule
// application.
//
#define EFI_CONFIG_FILE_NAME_GUID \
  { \
    0x98B8D59B, 0xE8BA, 0x48EE, {0x98, 0xDD, 0xC2, 0x95, 0x39, 0x2F, 0x1E, 0xDB } \
  }

///
/// Bits in the flags field of the capsule header.
/// This flag is set if the capsule can support setup changes, and cleared if it cannot.
///
#define EFI_CAPSULE_HEADER_FLAG_SETUP 0x00000001

#define CAPSULE_BLOCK_DESCRIPTOR_SIGNATURE  SIGNATURE_32 ('C', 'B', 'D', 'S')

//
// An array of these structs describe the blocks that make up a capsule for
// a capsule update.
//
typedef struct {
  UINT64                Length;     ///< Length of the data block.
  EFI_PHYSICAL_ADDRESS  Data;       ///< Physical address of the data block.
  UINT32                Signature;  ///< CBDS.
  UINT32                CheckSum;   ///< To sum this structure to 0.
} FRAMEWORK_EFI_CAPSULE_BLOCK_DESCRIPTOR;

typedef struct {
  EFI_GUID  OemGuid;
  UINT32    HeaderSize;
  //
  // UINT8                       OemHdrData[];
  //
} EFI_CAPSULE_OEM_HEADER;

typedef struct {
  ///
  /// A defined GUID that indicates the start of a capsule.
  ///
  EFI_GUID  CapsuleGuid;
  ///
  /// The size of the EFI_CAPSULE_HEADER structure.
  ///
  UINT32    HeaderSize;
  ///
  /// A bit-mapped list describing the capsule's attributes.
  /// All undefined bits should be written as zero (0).
  ///
  UINT32    Flags;
  ///
  /// The length in bytes (27,415 for an image containing 27,415 bytes) of the entire image
  /// including all headers. If this value is greater than the size of the data presented in
  /// the capsule body, the image is separated across multiple media. If this
  /// value is less than the size of the data, it is an error.
  ///
  UINT32    CapsuleImageSize;
  ///
  /// A zero-based number that enables a capsule to be split into pieces and then
  /// recombined for easier transfer across media with limited size. The lower the
  /// SequenceNumber, the earlier in the final image that the part of the capsule is to
  /// appear. In capsules that are not split, this value shall be zero.
  ///
  UINT32    SequenceNumber;
  ///
  /// Used to group the various pieces of a split capsule to ensure that they comprise the
  /// same base image. It is valid for this item to be zero, in which case the capsule cannot
  /// be split into components.
  ///
  EFI_GUID  InstanceId;
  ///
  /// The offset in bytes from the beginning of the header to the start of an EFI string that
  /// contains a description of the identity of the subcapsules that make up the capsule. If
  /// the capsule is not split, this value should be zero. The same string should be
  /// presented for all subcapsules that constitute the same capsule.
  ///
  UINT32    OffsetToSplitInformation;
  ///
  /// The offset in bytes from the beginning of the header to the start of the part of the
  /// capsule that is to be transferred to DXE.
  ///
  UINT32    OffsetToCapsuleBody;
  ///
  /// The offset in bytes from the beginning of the header to the start of the OEM-defined
  /// header. This value must be less than OffsetToCapsuleBody.
  ///
  UINT32    OffsetToOemDefinedHeader;
  ///
  /// The offset in bytes from the beginning of the header to the start of human-readable
  /// text that describes the entity that created the capsule. This value must be less than OffsetToCapsuleBody.
  ///
  UINT32    OffsetToAuthorInformation;
  ///
  /// The offset in bytes from the beginning of the header to the start of human-readable
  /// text that describes the revision of the capsule and/or the capsule's contents. This
  /// value must be less than OffsetToCapsuleBody.
  ///
  UINT32    OffsetToRevisionInformation;
  ///
  /// The offset in bytes from the beginning of the header to the start of a one-line (less
  /// than 40 Unicode characters in any language) description of the capsule. It is intended
  /// to be used by OS-present applications when providing a list of capsules from which
  /// the user can choose. This value must be less than OffsetToCapsuleBody.
  ///
  UINT32    OffsetToShortDescription;
  ///
  /// The offset in bytes from the beginning of the header to the start of an EFI string
  ///
  UINT32    OffsetToLongDescription;
  ///
  /// This field is reserved for future use by this specification. For future compatibility,
  /// this field must be set to zero
  ///
  UINT32    OffsetToApplicableDevices;
} FRAMEWORK_EFI_CAPSULE_HEADER;

extern EFI_GUID gEfiCapsuleGuid;
extern EFI_GUID gEfiConfigFileNameGuid;

#endif