]> git.sur5r.net Git - u-boot/blobdiff - drivers/video/sunxi/sunxi_de2.c
video: sunxi: de2: Reserve the fb region in the EFI memory map
[u-boot] / drivers / video / sunxi / sunxi_de2.c
index a2303db9af57bb93e48f38a14173db26465c0307..4ed035d556a852d49903374a1d19bdf92838a772 100644 (file)
@@ -9,6 +9,7 @@
 #include <display.h>
 #include <dm.h>
 #include <edid.h>
+#include <efi_loader.h>
 #include <fdtdec.h>
 #include <fdt_support.h>
 #include <video.h>
@@ -221,6 +222,13 @@ static int sunxi_de2_init(struct udevice *dev, ulong fbbase,
        uc_priv->bpix = l2bpp;
        debug("fb=%lx, size=%d %d\n", fbbase, uc_priv->xsize, uc_priv->ysize);
 
+#ifdef CONFIG_EFI_LOADER
+       efi_add_memory_map(fbbase,
+                          ALIGN(timing.hactive.typ * timing.vactive.typ *
+                          (1 << l2bpp) / 8, EFI_PAGE_SIZE) >> EFI_PAGE_SHIFT,
+                          EFI_RESERVED_MEMORY_TYPE, false);
+#endif
+
        return 0;
 }