From decbc18ed2a9788fcaad3ca349def7bad36741f4 Mon Sep 17 00:00:00 2001 From: "Arnaud Patard (Rtp)" Date: Fri, 5 Mar 2021 11:27:49 +0100 Subject: [PATCH] Rockchip: video: vop: Reserve efi fb memory When booting with EFI and graphics, the memory used for framebuffer has to be reserved, otherwise it may leads to kernel memory overwrite. Signed-off-by: Arnaud Patard Tested-by: Peter Robinson --- drivers/video/rockchip/rk_vop.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/video/rockchip/rk_vop.c b/drivers/video/rockchip/rk_vop.c index 145a34084c..3eb5e8c25c 100644 --- a/drivers/video/rockchip/rk_vop.c +++ b/drivers/video/rockchip/rk_vop.c @@ -21,6 +21,8 @@ #include #include #include +#include +#include #include #include #include @@ -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); +#endif + priv->regs = (struct rk3288_vop *)dev_read_addr(dev); /* -- 2.39.5