video: simplefb: Map framebuffer region on probe on ARM64
PATCH v2 1/1 video: simplefb: Map framebuffer region on probe on ARM64
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.
---
Changes in v2:
- Use ALIGN(plat->size, SZ_4K) instead of + 0x1000 (Casey)
- Add log_warning in case framebuffer base is not 4k aligned (Casey)
- Link to v1: https://lore.kernel.org/r/[email protected]
--- drivers/video/simplefb.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/video/simplefb.c +9 -0
@@ -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__);
---
base-commit: 88dc2788777babfd6322fa655df549a019aa1e69
change-id: 20260318-simplefb-map-abb9dba0eed1
Best regards,
Signature · 1 line
Luca Weiss <[email protected]>
Quoted 6 lines · Luca Weiss
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 <[email protected]>
Quoted 8 lines
---
Changes in v2:
- UseALIGN(plat->size, SZ_4K)instead of +0x1000(Casey)
- Addlog_warningin case framebuffer base is not 4k aligned (Casey)
- Link to v1: https://lore.kernel.org/r/[email protected]--- drivers/video/simplefb.c | 9 +++++++++ 1 file changed, 9 insertions(+)
-Sumit
Quoted 37 lines
drivers/video/simplefb.c +9
-1@@ -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__); ---base-commit:
88dc2788777babfd6322fa655df549a019aa1e69
change-id: 20260318-simplefb-map-abb9dba0eed1Best regards,
Signature · 1 line
Luca Weiss <[email protected]>
Quoted 6 lines · Luca Weiss
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.
Applied to u-boot/next, thanks!
[1/1] video: simplefb: Map framebuffer region on probe on ARM64
commit: 1c8b592611fc7b6bacf10226cfada6620ca19011
Signature · 1 line
Tom