libpayload arm64: don't modify cbtable entries

The framebuffer structure lives in the coreboot tables. Those
tables have a checksum calculation applied over all the entries.
Therefore, one shouldnot be modifying fields within the coreboot
table entries because the calculated checksum would be wrong.

BRANCH=none
BUG=chrome-os-partner:31936
TEST=On ryu, confirmed dev screen still works as well as cbmem utility
     once booted.

Change-Id: I93830a8efe98aa848f2b0f8388688de0e93b2f82
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 6026ca5ad0254c14c30412882dc63550656c7d16
Original-Change-Id: Ic9c164ded03d10d6f6f3ce15e9b38b1f6ce61a91
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/230471
Original-Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Original-Commit-Queue: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: http://review.coreboot.org/8797
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Aaron Durbin 2014-11-18 11:55:33 -06:00 committed by Patrick Georgi
parent be1b4f171e
commit 584e048185
1 changed files with 11 additions and 2 deletions

View File

@ -675,6 +675,7 @@ static void mmu_extract_ranges(struct memrange *cb_ranges,
static void mmu_add_fb_range(struct mmu_ranges *mmu_ranges)
{
struct mmu_memrange *fb_range;
static struct cb_framebuffer modified_fb;
struct cb_framebuffer *framebuffer = lib_sysinfo.framebuffer;
uint32_t fb_size;
@ -695,8 +696,16 @@ static void mmu_add_fb_range(struct mmu_ranges *mmu_ranges)
if (fb_range == NULL)
mmu_error();
/* Set framebuffer address */
framebuffer->physical_address = fb_range->base;
/*
* Set framebuffer address. However, one needs to use a freshly
* allocated framebuffer structure because the one in the coreboot
* table is part of a checksum calculation. Therefore, one cannot
* modify a field without recomputing the necessary checksum
* calcuation.
*/
modified_fb = *framebuffer;
modified_fb.physical_address = fb_range->base;
lib_sysinfo.framebuffer = &modified_fb;
}
/*