From 714497e327e7304a2b67d5f780f415c6e1c300d0 Mon Sep 17 00:00:00 2001 From: Michael Walle Date: Sun, 17 May 2020 12:29:19 +0200 Subject: efi_loader: round the memory area in efi_add_memory_map() Virtually all callers of this function do the rounding on their own. Some do it right, some don't. Instead of doing this in each caller, do the rounding in efi_add_memory_map(). Change the size parameter to bytes instead of pages and remove aligning and size calculation in all callers. There is no more need to make the original efi_add_memory_map() (which takes pages as size) available outside the module. Thus rename it to efi_add_memory_map_pg() and make it static to prevent further misuse outside the module. Signed-off-by: Michael Walle Add missing comma in sunxi_display.c. Reviewed-by: Heinrich Schuchardt --- drivers/video/meson/meson_vpu.c | 4 ++-- drivers/video/sunxi/sunxi_de2.c | 6 +++--- drivers/video/sunxi/sunxi_display.c | 6 ++---- 3 files changed, 7 insertions(+), 9 deletions(-) (limited to 'drivers') diff --git a/drivers/video/meson/meson_vpu.c b/drivers/video/meson/meson_vpu.c index aa8c0a962f..ed47192bf6 100644 --- a/drivers/video/meson/meson_vpu.c +++ b/drivers/video/meson/meson_vpu.c @@ -195,8 +195,8 @@ void meson_vpu_rsv_fb(void *fdt) return; #if defined(CONFIG_EFI_LOADER) - efi_add_memory_map(meson_fb.base, meson_fb.fb_size >> EFI_PAGE_SHIFT, - EFI_RESERVED_MEMORY_TYPE, false); + efi_add_memory_map(meson_fb.base, meson_fb.fb_size, + EFI_RESERVED_MEMORY_TYPE); #endif #if defined(CONFIG_VIDEO_DT_SIMPLEFB) meson_vpu_setup_simplefb(fdt); diff --git a/drivers/video/sunxi/sunxi_de2.c b/drivers/video/sunxi/sunxi_de2.c index 8333ddc44c..c6e7a35338 100644 --- a/drivers/video/sunxi/sunxi_de2.c +++ b/drivers/video/sunxi/sunxi_de2.c @@ -224,9 +224,9 @@ static int sunxi_de2_init(struct udevice *dev, ulong fbbase, #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); + timing.hactive.typ * timing.vactive.typ * + (1 << l2bpp) / 8, + EFI_RESERVED_MEMORY_TYPE); #endif return 0; diff --git a/drivers/video/sunxi/sunxi_display.c b/drivers/video/sunxi/sunxi_display.c index 40ee009f62..c4c1d1b8d3 100644 --- a/drivers/video/sunxi/sunxi_display.c +++ b/drivers/video/sunxi/sunxi_display.c @@ -1196,10 +1196,8 @@ void *video_hw_init(void) sunxi_engines_init(); #ifdef CONFIG_EFI_LOADER - efi_add_memory_map(gd->fb_base, - ALIGN(sunxi_display.fb_size, EFI_PAGE_SIZE) >> - EFI_PAGE_SHIFT, - EFI_RESERVED_MEMORY_TYPE, false); + efi_add_memory_map(gd->fb_base, sunxi_display.fb_size, + EFI_RESERVED_MEMORY_TYPE); #endif fb_dma_addr = gd->fb_base - CONFIG_SYS_SDRAM_BASE; -- cgit v1.2.1