Merge tag 'u-boot-rockchip-20200501' of https://gitlab.denx.de/u-boot/custodians...
[platform/kernel/u-boot.git] / arch / x86 / lib / fsp / fsp_graphics.c
index a19b067..98b7622 100644 (file)
@@ -1,7 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2017, Bin Meng <bmeng.cn@gmail.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -9,6 +8,7 @@
 #include <vbe.h>
 #include <video.h>
 #include <asm/fsp/fsp_support.h>
+#include <asm/mtrr.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -37,6 +37,10 @@ static int save_vesa_mode(struct vesa_mode_info *vesa)
        /*
         * If there is no graphics info structure, bail out and keep
         * running on the serial console.
+        *
+        * Note: on some platforms (eg: Braswell), the FSP will not produce
+        * the graphics info HOB unless you plug some cables to the display
+        * interface (eg: HDMI) on the board.
         */
        if (!ginfo) {
                debug("FSP graphics hand-off block not found\n");
@@ -74,6 +78,9 @@ static int fsp_video_probe(struct udevice *dev)
        struct vesa_mode_info *vesa = &mode_info.vesa;
        int ret;
 
+       if (!ll_boot_init())
+               return 0;
+
        printf("Video: ");
 
        /* Initialize vesa_mode_info structure */
@@ -94,6 +101,9 @@ static int fsp_video_probe(struct udevice *dev)
        if (ret)
                goto err;
 
+       mtrr_add_request(MTRR_TYPE_WRCOMB, vesa->phys_base_ptr, 256 << 20);
+       mtrr_commit(true);
+
        printf("%dx%dx%d\n", uc_priv->xsize, uc_priv->ysize,
               vesa->bits_per_pixel);