]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
x86: fsp: Add FSP_GRAPHICS_INFO_HOB
authorBin Meng <bmeng.cn@gmail.com>
Wed, 16 Aug 2017 05:41:52 +0000 (22:41 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Sat, 16 Sep 2017 06:57:44 +0000 (14:57 +0800)
This adds a new HOB type for graphics information introduced in FSP
spec 1.1. When graphics capability is included in FSP and enabled,
FSP produces an FSP_GRAPHICS_INFO_HOB as described in the EFI PI
specification which provides information about the graphics mode and
framebuffer.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/x86/include/asm/fsp/fsp_hob.h
arch/x86/include/asm/fsp/fsp_support.h
arch/x86/lib/fsp/fsp_support.c

index 8ce665e512f7393114db28b287b33f13fa082f8c..244f86ef3d40b139cf0503f039b9b68c92c121d7 100644 (file)
@@ -127,6 +127,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
  *
@@ -250,4 +270,10 @@ static inline u16 get_guid_hob_data_size(const struct hob_header *hdr)
        { 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
index 61d811f70e0acbf6a1dae511c4e294fd5c9bf9d9..97a50b0a73d69b947988eda1d91ee9263d2c5b0e 100644 (file)
@@ -190,6 +190,18 @@ void *fsp_get_nvs_data(const void *hob_list, u32 *len);
  */
 void *fsp_get_bootloader_tmp_mem(const void *hob_list, u32 *len);
 
+/**
+ * This function retrieves graphics information.
+ *
+ * @hob_list:      A HOB list pointer.
+ * @len:           A pointer to the graphics info HOB length.
+ *                 If the HOB is located, the length will be updated.
+ *
+ * @retval NULL:   Failed to find the graphics info HOB.
+ * @retval others: A pointer to struct hob_graphics_info.
+ */
+void *fsp_get_graphics_info(const void *hob_list, u32 *len);
+
 /**
  * This function overrides the default configurations of FSP.
  *
index ab8340c8715ac411c4ee246d86db69059ce1da27..e0c49be6357b7663dc348b5bc3f236326eed39b8 100644 (file)
@@ -425,3 +425,10 @@ void *fsp_get_bootloader_tmp_mem(const void *hob_list, u32 *len)
 
        return fsp_get_guid_hob_data(hob_list, len, (struct efi_guid *)&guid);
 }
+
+void *fsp_get_graphics_info(const void *hob_list, u32 *len)
+{
+       const struct efi_guid guid = FSP_GRAPHICS_INFO_HOB_GUID;
+
+       return fsp_get_guid_hob_data(hob_list, len, (struct efi_guid *)&guid);
+}