[PATCH] video: simplefb: Map framebuffer region on probe on ARM64
Casey Connolly
casey.connolly at linaro.org
Thu Mar 26 16:15:42 CET 2026
On 24/03/2026 07:02, Sumit Garg wrote:
> Hi Luca,
>
> On Wed, Mar 18, 2026 at 04:07:17PM +0100, Luca Weiss wrote:
>> 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.
>
> This isn't an appropriate fix to the problem.
>
>>
>> Signed-off-by: Luca Weiss <luca.weiss at fairphone.com>
>> ---
>> Map 0x1000 extra due to unknown reason, but otherwise it's not enough
>> and we still get a "Synchronous Abort" when drawing at the bottom of the
>> framebuffer.
>>
>> For milos-fairphone-fp6 the framebuffer is reg=0xe3940000
>> size=0xa932c0 (2484*1116*4).
>>
>> When just calling mmu_map_region with plat->size, then it's crashing at
>> 0xe43d3000 even though everything up to 0xe43d32c0 should be mapped.
>> With size+0x800 (or less) it was also still crashing, only size+0x1000
>> then worked.
>>
>> Possible I just don't know enough about memory mapping things, so
>> suggestions welcome! :)
>
> This sounds more likely the synchronous aborts caused by cache prefetch
> of nearby reserved memory regions. I see there are some reserved mememory
> regions around the address space you have mentioned on Milos.
I don't think so, more likely mmu_map_region() is doing an ALIGN_DOWN()
somewhere.
Luca: I think you should do ALIGN(plat->size, SZ_4K) and assert that
plat->stat is 4k aligned as well (or at least WARN if it's not). That
will round up the size 0xa932c0 to 0xa94000.
>
> On Qcom platforms, the default memory map strategy is to map the overall
> DRAM space without excluding reserved reqions. One can exclude reserved
> regions in a SoC specific manner here [1] but it adds some runtime
> overhead. Give it a try for Milos as well in case it resolves your
> issue.
>
> I think we still need to revisit that reserved memory strategy where
> default should rather be we unmap the reserved regions.
>
> [1] https://github.com/u-boot/u-boot/blob/master/arch/arm/mach-snapdragon/board.c#L743
>
> -Sumit
>
>> ---
>> drivers/video/simplefb.c | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/drivers/video/simplefb.c b/drivers/video/simplefb.c
>> index 8d0772d4e51..e144fde697b 100644
>> --- a/drivers/video/simplefb.c
>> +++ b/drivers/video/simplefb.c
>> @@ -9,6 +9,7 @@
>> #include <log.h>
>> #include <video.h>
>> #include <asm/global_data.h>
>> +#include <asm/system.h>
>>
>> static int simple_video_probe(struct udevice *dev)
>> {
>> @@ -37,6 +38,11 @@ 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 */
>> + mmu_map_region((phys_addr_t)plat->base, (phys_addr_t)plat->size + 0x1000, false);
>> +#endif
>> +
>> video_set_flush_dcache(dev, true);
>>
>> debug("%s: Query resolution...\n", __func__);
>>
>> ---
>> base-commit: ba7bf918dafcd093ad733b07ba490baeb20cf5da
>> change-id: 20260318-simplefb-map-abb9dba0eed1
>>
>> Best regards,
>> --
>> Luca Weiss <luca.weiss at fairphone.com>
>>
--
// Casey (she/her)
More information about the U-Boot
mailing list