From 5dc87fe470498824ceca80b5e0140eab3f803cc3 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Thu, 28 Apr 2016 06:03:57 +0200 Subject: libpayload/arm64: Mark existing framebuffer as DMAable If a framebuffer is already configured by coreboot, libpayload's MMU tables didn't mark its memory DMAable (unlike when libpayload set up its own framebuffer memory). BRANCH=none BUG=chrome-os-partner:52826 TEST=depthcharge's recovery screen is not corrupted anymore on kevin Change-Id: I228a861b3fdcf1298a3cfa0a054214c78ed55e70 Signed-off-by: Patrick Georgi Original-Commit-Id: 889e8358a0f2f504abd9910549aa68f3992bb4e8 Original-Change-Id: I7ba79151ccc1eb605f82e1869a74b539a6be5e99 Original-Signed-off-by: Patrick Georgi Original-Signed-off-by: Vadim Bendebury Original-Reviewed-on: https://chromium-review.googlesource.com/341092 Reviewed-on: https://review.coreboot.org/14685 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- payloads/libpayload/arch/arm64/mmu.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'payloads/libpayload') diff --git a/payloads/libpayload/arch/arm64/mmu.c b/payloads/libpayload/arch/arm64/mmu.c index 553b2d5fc2..50e7f6cd17 100644 --- a/payloads/libpayload/arch/arm64/mmu.c +++ b/payloads/libpayload/arch/arm64/mmu.c @@ -655,18 +655,24 @@ static void mmu_add_fb_range(struct mmu_ranges *mmu_ranges) struct cb_framebuffer *framebuffer = lib_sysinfo.framebuffer; uint32_t fb_size; - /* - * Check whether framebuffer is needed - * or framebuffer address has been set already - */ + /* Check whether framebuffer is needed */ if (framebuffer == NULL) return; - if (framebuffer->physical_address) - return; + fb_size = framebuffer->bytes_per_line * framebuffer->y_resolution; if (!fb_size) return; + /* framebuffer address has been set already, so just add it as DMA */ + if (framebuffer->physical_address) { + if (mmu_add_memrange(mmu_ranges, + framebuffer->physical_address, + fb_size, + TYPE_DMA_MEM) == NULL) + mmu_error(); + return; + } + /* Allocate framebuffer */ fb_range = _mmu_add_fb_range(fb_size, mmu_ranges); if (fb_range == NULL) -- cgit v1.2.3