diff options
author | Patrick Georgi <patrick@georgi-clan.de> | 2016-04-28 06:03:57 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2016-05-09 08:30:56 +0200 |
commit | 5dc87fe470498824ceca80b5e0140eab3f803cc3 (patch) | |
tree | f9b37345f75989480b656cb386d0f281e76f0d94 /payloads/libpayload/arch/arm64 | |
parent | 934c68393346af66fbd832cfb9f74e1db6cb6f4b (diff) | |
download | coreboot-5dc87fe470498824ceca80b5e0140eab3f803cc3.tar.xz |
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 <pgeorgi@chromium.org>
Original-Commit-Id: 889e8358a0f2f504abd9910549aa68f3992bb4e8
Original-Change-Id: I7ba79151ccc1eb605f82e1869a74b539a6be5e99
Original-Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Original-Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
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 <stefan.reinauer@coreboot.org>
Diffstat (limited to 'payloads/libpayload/arch/arm64')
-rw-r--r-- | payloads/libpayload/arch/arm64/mmu.c | 18 |
1 files changed, 12 insertions, 6 deletions
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) |