powerpc: Remove ARCH= references from documentation
[oweals/u-boot.git] / include / efi.h
index 7e7c1cafc28fa90801cf24da54f90270f4fc3837..f986aad8777757c2e1deef4a9c0c847d37334f19 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Extensible Firmware Interface
  * Based on 'Extensible Firmware Interface Specification' version 0.9,
 #define efi_va_end va_end
 #endif /* __x86_64__ */
 
+#define EFI32_LOADER_SIGNATURE "EL32"
+#define EFI64_LOADER_SIGNATURE "EL64"
+
 struct efi_device_path;
 
 typedef struct {
        u8 b[16];
-} efi_guid_t;
+} efi_guid_t __attribute__((aligned(8)));
 
 #define EFI_BITS_PER_LONG      (sizeof(long) * 8)
 
@@ -87,12 +91,18 @@ typedef struct {
 #define EFI_IP_ADDRESS_CONFLICT                (EFI_ERROR_MASK | 34)
 #define EFI_HTTP_ERROR                 (EFI_ERROR_MASK | 35)
 
-#define EFI_WARN_DELETE_FAILURE        2
+#define EFI_WARN_UNKNOWN_GLYPH         1
+#define EFI_WARN_DELETE_FAILURE                2
+#define EFI_WARN_WRITE_FAILURE         3
+#define EFI_WARN_BUFFER_TOO_SMALL      4
+#define EFI_WARN_STALE_DATA            5
+#define EFI_WARN_FILE_SYSTEM           6
+#define EFI_WARN_RESET_REQUIRED                7
 
 typedef unsigned long efi_status_t;
 typedef u64 efi_physical_addr_t;
 typedef u64 efi_virtual_addr_t;
-typedef void *efi_handle_t;
+typedef struct efi_object *efi_handle_t;
 
 #define EFI_GUID(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
        {{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, \
@@ -164,6 +174,10 @@ enum efi_mem_type {
         * part of the processor.
         */
        EFI_PAL_CODE,
+       /*
+        * Non-volatile memory.
+        */
+       EFI_PERSISTENT_MEMORY_TYPE,
 
        EFI_MAX_MEMORY_TYPE,
        EFI_TABLE_END,  /* For efi_build_mem_table() */
@@ -182,11 +196,12 @@ enum efi_mem_type {
 #define EFI_MEMORY_MORE_RELIABLE \
                                ((u64)0x0000000000010000ULL)    /* higher reliability */
 #define EFI_MEMORY_RO          ((u64)0x0000000000020000ULL)    /* read-only */
+#define EFI_MEMORY_SP          ((u64)0x0000000000040000ULL)    /* specific-purpose memory (SPM) */
 #define EFI_MEMORY_RUNTIME     ((u64)0x8000000000000000ULL)    /* range requires runtime mapping */
 #define EFI_MEM_DESC_VERSION   1
 
 #define EFI_PAGE_SHIFT         12
-#define EFI_PAGE_SIZE          (1UL << EFI_PAGE_SHIFT)
+#define EFI_PAGE_SIZE          (1ULL << EFI_PAGE_SHIFT)
 #define EFI_PAGE_MASK          (EFI_PAGE_SIZE - 1)
 
 struct efi_mem_desc {
@@ -248,6 +263,7 @@ enum efi_entry_t {
        EFIET_END,      /* Signals this is the last (empty) entry */
        EFIET_MEMORY_MAP,
        EFIET_GOP_MODE,
+       EFIET_SYS_TABLE,
 
        /* Number of entries */
        EFIET_MEMORY_COUNT,
@@ -338,6 +354,15 @@ struct efi_entry_gopmode {
        } info[];
 };
 
+/**
+ * struct efi_entry_systable - system table passed to U-Boot
+ *
+ * @sys_table: EFI system table address
+ */
+struct efi_entry_systable {
+       efi_physical_addr_t sys_table;
+};
+
 static inline struct efi_mem_desc *efi_get_next_mem_desc(
                struct efi_entry_memmap *map, struct efi_mem_desc *desc)
 {