summaryrefslogtreecommitdiff
path: root/include/efi_api.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/efi_api.h')
-rw-r--r--include/efi_api.h188
1 files changed, 188 insertions, 0 deletions
diff --git a/include/efi_api.h b/include/efi_api.h
index 5744f6aed8..ecb43a0607 100644
--- a/include/efi_api.h
+++ b/include/efi_api.h
@@ -217,6 +217,21 @@ enum efi_reset_type {
#define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE 0x00020000
#define CAPSULE_FLAGS_INITIATE_RESET 0x00040000
+#define CAPSULE_SUPPORT_AUTHENTICATION 0x0000000000000001
+#define CAPSULE_SUPPORT_DEPENDENCY 0x0000000000000002
+
+#define EFI_CAPSULE_REPORT_GUID \
+ EFI_GUID(0x39b68c46, 0xf7fb, 0x441b, 0xb6, 0xec, \
+ 0x16, 0xb0, 0xf6, 0x98, 0x21, 0xf3)
+
+#define EFI_MEMORY_RANGE_CAPSULE_GUID \
+ EFI_GUID(0xde9f0ec, 0x88b6, 0x428f, 0x97, 0x7a, \
+ 0x25, 0x8f, 0x1d, 0xe, 0x5e, 0x72)
+
+#define EFI_FIRMWARE_MANAGEMENT_CAPSULE_ID_GUID \
+ EFI_GUID(0x6dcbd5ed, 0xe82d, 0x4c44, 0xbd, 0xa1, \
+ 0x71, 0x94, 0x19, 0x9a, 0xd9, 0x2a)
+
struct efi_capsule_header {
efi_guid_t capsule_guid;
u32 header_size;
@@ -224,6 +239,54 @@ struct efi_capsule_header {
u32 capsule_image_size;
} __packed;
+struct efi_capsule_result_variable_header {
+ u32 variable_total_size;
+ u32 reserved;
+ efi_guid_t capsule_guid;
+ struct efi_time capsule_processed;
+ efi_status_t capsule_status;
+} __packed;
+
+struct efi_memory_range {
+ efi_physical_addr_t address;
+ u64 length;
+};
+
+struct efi_memory_range_capsule {
+ struct efi_capsule_header *header;
+ /* EFI_MEMORY_TYPE: 0x80000000-0xFFFFFFFF */
+ enum efi_mem_type os_requested_memory_type;
+ u64 number_of_memory_ranges;
+ struct efi_memory_range memory_ranges[];
+} __packed;
+
+struct efi_firmware_management_capsule_header {
+ u32 version;
+ u16 embedded_driver_count;
+ u16 payload_item_count;
+ u64 item_offset_list[];
+} __packed;
+
+struct efi_firmware_management_capsule_image_header {
+ u32 version;
+ efi_guid_t update_image_type_id;
+ u8 update_image_index;
+ u8 reserved[3];
+ u32 update_image_size;
+ u32 update_vendor_code_size;
+ u64 update_hardware_instance;
+ u64 image_capsule_support;
+} __packed;
+
+struct efi_capsule_result_variable_fmp {
+ u16 version;
+ u8 payload_index;
+ u8 update_image_index;
+ efi_guid_t update_image_type_id;
+ // u16 capsule_file_name[];
+ // u16 capsule_target[];
+} __packed;
+
#define EFI_RT_SUPPORTED_GET_TIME 0x0001
#define EFI_RT_SUPPORTED_SET_TIME 0x0002
#define EFI_RT_SUPPORTED_GET_WAKEUP_TIME 0x0004
@@ -356,6 +419,10 @@ struct efi_runtime_services {
EFI_GUID(0x4006c0c1, 0xfcb3, 0x403e, \
0x99, 0x6d, 0x4a, 0x6c, 0x87, 0x24, 0xe0, 0x6d)
+#define EFI_TCG2_FINAL_EVENTS_TABLE_GUID \
+ EFI_GUID(0x1e2ed096, 0x30e2, 0x4254, 0xbd, \
+ 0x89, 0x86, 0x3b, 0xbe, 0xf8, 0x23, 0x25)
+
struct efi_configuration_table {
efi_guid_t guid;
void *table;
@@ -1746,6 +1813,24 @@ struct efi_variable_authentication_2 {
} __attribute__((__packed__));
/**
+ * efi_firmware_image_authentication - Capsule authentication method
+ * descriptor
+ *
+ * This structure describes an authentication information for
+ * a capsule with IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED set
+ * and should be included as part of the capsule.
+ * Only EFI_CERT_TYPE_PKCS7_GUID is accepted.
+ *
+ * @monotonic_count: Count to prevent replay
+ * @auth_info: Authentication info
+ */
+struct efi_firmware_image_authentication {
+ uint64_t monotonic_count;
+ struct win_certificate_uefi_guid auth_info;
+} __attribute__((__packed__));
+
+
+/**
* efi_signature_data - A format of signature
*
* This structure describes a single signature in signature database.
@@ -1779,4 +1864,107 @@ struct efi_signature_list {
/* struct efi_signature_data signatures[...][signature_size]; */
} __attribute__((__packed__));
+/*
+ * Firmware management protocol
+ */
+#define EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GUID \
+ EFI_GUID(0x86c77a67, 0x0b97, 0x4633, 0xa1, 0x87, \
+ 0x49, 0x10, 0x4d, 0x06, 0x85, 0xc7)
+
+#define EFI_FIRMWARE_IMAGE_TYPE_UBOOT_FIT_GUID \
+ EFI_GUID(0xae13ff2d, 0x9ad4, 0x4e25, 0x9a, 0xc8, \
+ 0x6d, 0x80, 0xb3, 0xb2, 0x21, 0x47)
+
+#define EFI_FIRMWARE_IMAGE_TYPE_UBOOT_RAW_GUID \
+ EFI_GUID(0xe2bb9c06, 0x70e9, 0x4b14, 0x97, 0xa3, \
+ 0x5a, 0x79, 0x13, 0x17, 0x6e, 0x3f)
+
+#define IMAGE_ATTRIBUTE_IMAGE_UPDATABLE 0x0000000000000001
+#define IMAGE_ATTRIBUTE_RESET_REQUIRED 0x0000000000000002
+#define IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED 0x0000000000000004
+#define IMAGE_ATTRIBUTE_IN_USE 0x0000000000000008
+#define IMAGE_ATTRIBUTE_UEFI_IMAGE 0x0000000000000010
+#define IMAGE_ATTRIBUTE_DEPENDENCY 0x0000000000000020
+
+#define IMAGE_COMPATIBILITY_CHECK_SUPPORTED 0x0000000000000001
+
+#define IMAGE_UPDATABLE_VALID 0x0000000000000001
+#define IMAGE_UPDATABLE_INVALID 0x0000000000000002
+#define IMAGE_UPDATABLE_INVALID_TYPE 0x0000000000000004
+#define IMAGE_UPDATABLE_INVALID_OLLD 0x0000000000000008
+#define IMAGE_UPDATABLE_VALID_WITH_VENDOR_CODE 0x0000000000000010
+
+#define PACKAGE_ATTRIBUTE_VERSION_UPDATABLE 0x0000000000000001
+#define PACKAGE_ATTRIBUTE_RESET_REQUIRED 0x0000000000000002
+#define PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED 0x0000000000000004
+
+#define EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION 4
+
+typedef struct efi_firmware_image_dependencies {
+ u8 dependencies[0];
+} efi_firmware_image_dep_t;
+
+struct efi_firmware_image_descriptor {
+ u8 image_index;
+ efi_guid_t image_type_id;
+ u64 image_id;
+ u16 *image_id_name;
+ u32 version;
+ u16 *version_name;
+ efi_uintn_t size;
+ u64 attributes_supported;
+ u64 attributes_setting;
+ u64 compatibilities;
+ u32 lowest_supported_image_version;
+ u32 last_attempt_version;
+ u32 last_attempt_status;
+ u64 hardware_instance;
+ efi_firmware_image_dep_t *dependencies;
+};
+
+struct efi_firmware_management_protocol {
+ efi_status_t (EFIAPI *get_image_info)(
+ struct efi_firmware_management_protocol *this,
+ efi_uintn_t *image_info_size,
+ struct efi_firmware_image_descriptor *image_info,
+ u32 *descriptor_version,
+ u8 *descriptor_count,
+ efi_uintn_t *descriptor_size,
+ u32 *package_version,
+ u16 **package_version_name);
+ efi_status_t (EFIAPI *get_image)(
+ struct efi_firmware_management_protocol *this,
+ u8 image_index,
+ void *image,
+ efi_uintn_t *image_size);
+ efi_status_t (EFIAPI *set_image)(
+ struct efi_firmware_management_protocol *this,
+ u8 image_index,
+ const void *image,
+ efi_uintn_t image_size,
+ const void *vendor_code,
+ efi_status_t (*progress)(efi_uintn_t completion),
+ u16 **abort_reason);
+ efi_status_t (EFIAPI *check_image)(
+ struct efi_firmware_management_protocol *this,
+ u8 image_index,
+ const void *image,
+ efi_uintn_t *image_size,
+ u32 *image_updatable);
+ efi_status_t (EFIAPI *get_package_info)(
+ struct efi_firmware_management_protocol *this,
+ u32 *package_version,
+ u16 **package_version_name,
+ u32 *package_version_name_maxlen,
+ u64 *attributes_supported,
+ u64 *attributes_setting);
+ efi_status_t (EFIAPI *set_package_info)(
+ struct efi_firmware_management_protocol *this,
+ const void *image,
+ efi_uintn_t *image_size,
+ const void *vendor_code,
+ u32 package_version,
+ const u16 *package_version_name);
+};
+
#endif