]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
video: simplefb: Map framebuffer region on probe on ARM64
authorLuca Weiss <luca.weiss@fairphone.com>
Wed, 8 Apr 2026 12:04:28 +0000 (14:04 +0200)
committerTom Rini <trini@konsulko.com>
Sat, 30 May 2026 13:44:08 +0000 (07:44 -0600)
The framebuffer buffer might not be mapped on some devices.

This is #ifdef'ed for ARM64 since mmu_map_region() is not defined for
any other architecture.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Acked-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
drivers/video/simplefb.c

index 8d0772d4e51ebba3d8a66cd35ae2660d3ac859c1..4d238b936acd4dc1bf8eb4bb1d06555c0075d71c 100644 (file)
@@ -9,6 +9,8 @@
 #include <log.h>
 #include <video.h>
 #include <asm/global_data.h>
+#include <asm/system.h>
+#include <linux/sizes.h>
 
 static int simple_video_probe(struct udevice *dev)
 {
@@ -37,6 +39,13 @@ static int simple_video_probe(struct udevice *dev)
        plat->base = base;
        plat->size = size;
 
+#ifdef CONFIG_ARM64
+       /* The framebuffer buffer might not be mapped on some devices */
+       if (plat->base % SZ_4K)
+               log_warning("Framebuffer base %lx is not 4k aligned!\n", plat->base);
+       mmu_map_region((phys_addr_t)plat->base, (phys_addr_t)ALIGN(plat->size, SZ_4K), false);
+#endif
+
        video_set_flush_dcache(dev, true);
 
        debug("%s: Query resolution...\n", __func__);