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>
This commit is contained in:
parent
934c683933
commit
5dc87fe470
|
@ -655,18 +655,24 @@ static void mmu_add_fb_range(struct mmu_ranges *mmu_ranges)
|
||||||
struct cb_framebuffer *framebuffer = lib_sysinfo.framebuffer;
|
struct cb_framebuffer *framebuffer = lib_sysinfo.framebuffer;
|
||||||
uint32_t fb_size;
|
uint32_t fb_size;
|
||||||
|
|
||||||
/*
|
/* Check whether framebuffer is needed */
|
||||||
* Check whether framebuffer is needed
|
|
||||||
* or framebuffer address has been set already
|
|
||||||
*/
|
|
||||||
if (framebuffer == NULL)
|
if (framebuffer == NULL)
|
||||||
return;
|
return;
|
||||||
if (framebuffer->physical_address)
|
|
||||||
return;
|
|
||||||
fb_size = framebuffer->bytes_per_line * framebuffer->y_resolution;
|
fb_size = framebuffer->bytes_per_line * framebuffer->y_resolution;
|
||||||
if (!fb_size)
|
if (!fb_size)
|
||||||
return;
|
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 */
|
/* Allocate framebuffer */
|
||||||
fb_range = _mmu_add_fb_range(fb_size, mmu_ranges);
|
fb_range = _mmu_add_fb_range(fb_size, mmu_ranges);
|
||||||
if (fb_range == NULL)
|
if (fb_range == NULL)
|
||||||
|
|
Loading…
Reference in New Issue