Merge branch 'master' into next
[platform/kernel/u-boot.git] / include / efi_loader.h
index 545ba06..7554f3b 100644 (file)
@@ -142,6 +142,11 @@ static inline efi_status_t efi_launch_capsules(void)
        EFI_GUID(0x63293792, 0xadf5, 0x9325, \
                 0xb9, 0x9f, 0x4e, 0x0e, 0x45, 0x5c, 0x1b, 0x1e)
 
+/* GUID for the auto generated boot menu entry */
+#define EFICONFIG_AUTO_GENERATED_ENTRY_GUID \
+       EFI_GUID(0x38c1acc1, 0x9fc0, 0x41f0, \
+                0xb9, 0x01, 0xfa, 0x74, 0xd6, 0xd6, 0xe4, 0xde)
+
 /* Use internal device tree when starting UEFI application */
 #define EFI_FDT_USE_INTERNAL NULL
 
@@ -156,7 +161,7 @@ extern bool efi_st_keep_devices;
 
 /* EFI system partition */
 extern struct efi_system_partition {
-       enum if_type if_type;
+       enum uclass_id if_type;
        int devnum;
        u8 part;
 } efi_system_partition;
@@ -226,6 +231,9 @@ const char *__efi_nesting_dec(void);
 #define EFI_CACHELINE_SIZE 128
 #endif
 
+/* max bootmenu title size for volume selection */
+#define BOOTMENU_DEVICE_NAME_MAX 16
+
 /* Key identifying current memory map */
 extern efi_uintn_t efi_memory_map_key;
 
@@ -249,6 +257,9 @@ extern const struct efi_hii_string_protocol efi_hii_string;
 
 uint16_t *efi_dp_str(struct efi_device_path *dp);
 
+/* GUID for the auto generated boot menu entry */
+extern const efi_guid_t efi_guid_bootmenu_auto_generated;
+
 /* GUID of the U-Boot root node */
 extern const efi_guid_t efi_u_boot_guid;
 #ifdef CONFIG_SANDBOX
@@ -314,6 +325,8 @@ extern const efi_guid_t efi_guid_firmware_management_protocol;
 extern const efi_guid_t efi_esrt_guid;
 /* GUID of the SMBIOS table */
 extern const efi_guid_t smbios_guid;
+/*GUID of console */
+extern const efi_guid_t efi_guid_text_input_protocol;
 
 extern char __efi_runtime_start[], __efi_runtime_stop[];
 extern char __efi_runtime_rel_start[], __efi_runtime_rel_stop[];
@@ -942,6 +955,22 @@ struct efi_signature_store {
 struct x509_certificate;
 struct pkcs7_message;
 
+/**
+ * struct eficonfig_media_boot_option - boot option for (removable) media device
+ *
+ * This structure is used to enumerate possible boot option
+ *
+ * @lo:                Serialized load option data
+ * @size:      Size of serialized load option data
+ * @exist:     Flag to indicate the load option already exists
+ *             in Non-volatile load option
+ */
+struct eficonfig_media_boot_option {
+       void *lo;
+       efi_uintn_t size;
+       bool exist;
+};
+
 bool efi_hash_regions(struct image_region *regs, int count,
                      void **hash, const char *hash_algo, int *len);
 bool efi_signature_lookup_digest(struct efi_image_regions *regs,
@@ -1073,4 +1102,28 @@ efi_status_t efi_esrt_populate(void);
 efi_status_t efi_load_capsule_drivers(void);
 
 efi_status_t platform_get_eventlog(struct udevice *dev, u64 *addr, u32 *sz);
+
+efi_status_t efi_locate_handle_buffer_int(enum efi_locate_search_type search_type,
+                                         const efi_guid_t *protocol, void *search_key,
+                                         efi_uintn_t *no_handles, efi_handle_t **buffer);
+
+efi_status_t efi_open_volume_int(struct efi_simple_file_system_protocol *this,
+                                struct efi_file_handle **root);
+efi_status_t efi_file_open_int(struct efi_file_handle *this,
+                              struct efi_file_handle **new_handle,
+                              u16 *file_name, u64 open_mode,
+                              u64 attributes);
+efi_status_t efi_file_close_int(struct efi_file_handle *file);
+efi_status_t efi_file_read_int(struct efi_file_handle *this,
+                              efi_uintn_t *buffer_size, void *buffer);
+efi_status_t efi_file_setpos_int(struct efi_file_handle *file, u64 pos);
+
+typedef efi_status_t (*efi_console_filter_func)(struct efi_input_key *key);
+efi_status_t efi_console_get_u16_string
+               (struct efi_simple_text_input_protocol *cin,
+                u16 *buf, efi_uintn_t count, efi_console_filter_func filer_func,
+                int row, int col);
+
+efi_status_t efi_disk_get_device_name(const efi_handle_t handle, char *buf, int size);
+
 #endif /* _EFI_LOADER_H */