From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnaud Patard (Rtp) Date: Fri, 05 Mar 2021 11:27:49 +0100 Subject: [patch v4 4/9] Rockchip: video: vop: Reserve efi fb memory References: <20210305102745.078091129@rtp-net.org> Message-ID: <20210305103307.175518624@rtp-net.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 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 #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); /*