From: Emmanuel Vadot Date: Fri, 4 May 2018 08:26:55 +0000 (+0200) Subject: video: sunxi: de2: Reserve the fb region in the EFI memory map X-Git-Tag: v2018.07-rc1~10^2~20 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d9b63ea9876d9bac4e1c137a0b66a111fb2b03c7;hp=d73c8bc052f9b5f472b59ccd3c88e3ecc6359075;p=u-boot video: sunxi: de2: Reserve the fb region in the EFI memory map If compile with support for the efi loader we need to mark the pages allocated for the framebuffer as reserved so the kernel won't attempt to use them for other uses. Signed-off-by: Emmanuel Vadot Acked-by: Heinrich Schuchardt Signed-off-by: Alexander Graf --- diff --git a/drivers/video/sunxi/sunxi_de2.c b/drivers/video/sunxi/sunxi_de2.c index a2303db9af..4ed035d556 100644 --- a/drivers/video/sunxi/sunxi_de2.c +++ b/drivers/video/sunxi/sunxi_de2.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -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; }