[patch v4 4/9] Rockchip: video: vop: Reserve efi fb memory

Arnaud Patard (Rtp) arnaud.patard at rtp-net.org
Fri Mar 5 11:27:49 CET 2021

When booting with EFI and graphics, the memory used for framebuffer
has to be reserved, otherwise it may leads to kernel memory

Signed-off-by: Arnaud Patard <arnaud.patard at rtp-net.org>
Tested-by: Peter Robinson <pbrobinson at gmail.com>
Index: u-boot/drivers/video/rockchip/rk_vop.c
--- u-boot.orig/drivers/video/rockchip/rk_vop.c
+++ u-boot/drivers/video/rockchip/rk_vop.c
@@ -21,6 +21,8 @@
 #include <asm/arch-rockchip/vop_rk3288.h>
 #include <dm/device-internal.h>
 #include <dm/uclass-internal.h>
+#include <efi.h>
+#include <efi_loader.h>
 #include <linux/bitops.h>
 #include <linux/err.h>
 #include <power/regulator.h>
@@ -395,6 +397,11 @@ int rk_vop_probe(struct udevice *dev)
 	if (!(gd->flags & GD_FLG_RELOC))
 		return 0;
+#if defined(CONFIG_EFI_LOADER)
+	debug("Adding to EFI map %d @ %lx\n", plat->size, plat->base);
+	efi_add_memory_map(plat->base, plat->size, EFI_RESERVED_MEMORY_TYPE);
 	priv->regs = (struct rk3288_vop *)dev_read_addr(dev);

More information about the U-Boot mailing list