]> git.sur5r.net Git - u-boot/blobdiff - arch/x86/include/asm/fsp/fsp_hob.h
SPDX: Convert all of our single license tags to Linux Kernel style
[u-boot] / arch / x86 / include / asm / fsp / fsp_hob.h
index 6cca7f5654192db293c6a2af7db48ec22fa92245..00657b62c76df2b45b9b4c8629d1f9c9d6ea31b6 100644 (file)
@@ -1,13 +1,14 @@
+/* SPDX-License-Identifier: Intel */
 /*
  * Copyright (C) 2013, Intel Corporation
  * Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com>
- *
- * SPDX-License-Identifier:    Intel
  */
 
 #ifndef __FSP_HOB_H__
 #define __FSP_HOB_H__
 
+#include <efi.h>
+
 /* Type of HOB Header */
 #define HOB_TYPE_MEM_ALLOC     0x0002
 #define HOB_TYPE_RES_DESC      0x0003
@@ -25,63 +26,6 @@ struct hob_header {
        u32     reserved;       /* always zero */
 };
 
-/* Enumeration of memory types introduced in UEFI */
-enum efi_mem_type {
-       EFI_RESERVED_MEMORY_TYPE,
-       /*
-        * The code portions of a loaded application.
-        * (Note that UEFI OS loaders are UEFI applications.)
-        */
-       EFI_LOADER_CODE,
-       /*
-        * The data portions of a loaded application and
-        * the default data allocation type used by an application
-        * to allocate pool memory.
-        */
-       EFI_LOADER_DATA,
-       /* The code portions of a loaded Boot Services Driver */
-       EFI_BOOT_SERVICES_CODE,
-       /*
-        * The data portions of a loaded Boot Serves Driver and
-        * the default data allocation type used by a Boot Services
-        * Driver to allocate pool memory.
-        */
-       EFI_BOOT_SERVICES_DATA,
-       /* The code portions of a loaded Runtime Services Driver */
-       EFI_RUNTIME_SERVICES_CODE,
-       /*
-        * The data portions of a loaded Runtime Services Driver and
-        * the default data allocation type used by a Runtime Services
-        * Driver to allocate pool memory.
-        */
-       EFI_RUNTIME_SERVICES_DATA,
-       /* Free (unallocated) memory */
-       EFI_CONVENTIONAL_MEMORY,
-       /* Memory in which errors have been detected */
-       EFI_UNUSABLE_MEMORY,
-       /* Memory that holds the ACPI tables */
-       EFI_ACPI_RECLAIM_MEMORY,
-       /* Address space reserved for use by the firmware */
-       EFI_ACPI_MEMORY_NVS,
-       /*
-        * Used by system firmware to request that a memory-mapped IO region
-        * be mapped by the OS to a virtual address so it can be accessed by
-        * EFI runtime services.
-        */
-       EFI_MMAP_IO,
-       /*
-        * System memory-mapped IO region that is used to translate
-        * memory cycles to IO cycles by the processor.
-        */
-       EFI_MMAP_IO_PORT,
-       /*
-        * Address space reserved by the firmware for code that is
-        * part of the processor.
-        */
-       EFI_PAL_CODE,
-       EFI_MAX_MEMORY_TYPE
-};
-
 /*
  * Describes all memory ranges used during the HOB producer phase that
  * exist outside the HOB list. This HOB type describes how memory is used,
@@ -182,6 +126,26 @@ struct hob_guid {
        /* GUID specific data goes here */
 };
 
+enum pixel_format {
+       pixel_rgbx_8bpc,        /* RGB 8 bit per color */
+       pixel_bgrx_8bpc,        /* BGR 8 bit per color */
+       pixel_bitmask,
+};
+
+struct __packed hob_graphics_info {
+       phys_addr_t fb_base;    /* framebuffer base address */
+       u32 fb_size;            /* framebuffer size */
+       u32 version;
+       u32 width;
+       u32 height;
+       enum pixel_format pixel_format;
+       u32 red_mask;
+       u32 green_mask;
+       u32 blue_mask;
+       u32 reserved_mask;
+       u32 pixels_per_scanline;
+};
+
 /**
  * get_next_hob() - return a pointer to the next HOB in the HOB list
  *
@@ -194,7 +158,7 @@ struct hob_guid {
  */
 static inline const struct hob_header *get_next_hob(const struct hob_header *hdr)
 {
-       return (const struct hob_header *)((u32)hdr + hdr->len);
+       return (const struct hob_header *)((uintptr_t)hdr + hdr->len);
 }
 
 /**
@@ -227,7 +191,7 @@ static inline bool end_of_hob(const struct hob_header *hdr)
  */
 static inline void *get_guid_hob_data(const struct hob_header *hdr)
 {
-       return (void *)((u32)hdr + sizeof(struct hob_guid));
+       return (void *)((uintptr_t)hdr + sizeof(struct hob_guid));
 }
 
 /**
@@ -297,4 +261,18 @@ static inline u16 get_guid_hob_data_size(const struct hob_header *hdr)
        { 0x82, 0xb9, 0x56, 0xa5, 0xf3, 0xe6, 0x2a, 0x07 } \
        }
 
+/* The following GUIDs are newly introduced in FSP spec 1.1 */
+
+#define FSP_HOB_RESOURCE_OWNER_BOOTLOADER_TOLUM_GUID \
+       { \
+       0x73ff4f56, 0xaa8e, 0x4451, \
+       { 0xb3, 0x16, 0x36, 0x35, 0x36, 0x67, 0xad, 0x44 } \
+       }
+
+#define FSP_GRAPHICS_INFO_HOB_GUID \
+       { \
+       0x39f62cce, 0x6825, 0x4669, \
+       { 0xbb, 0x56, 0x54, 0x1a, 0xba, 0x75, 0x3a, 0x07 } \
+       }
+
 #endif