path: root/payloads
diff options
authorAaron Durbin <adurbin@chromium.org>2014-11-18 11:55:33 -0600
committerPatrick Georgi <pgeorgi@google.com>2015-03-21 13:42:55 +0100
commit584e048185f2e456bc67a86cb54feac4dda8084c (patch)
tree08f57d31ee50b64091b0e2ef189194843355893f /payloads
parentbe1b4f171ec00dd636733b853f48ba537ac2fbc5 (diff)
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>
Diffstat (limited to 'payloads')
1 files changed, 11 insertions, 2 deletions
diff --git a/payloads/libpayload/arch/arm64/mmu.c b/payloads/libpayload/arch/arm64/mmu.c
index 41fb10b54..86d9fc5ee 100644
--- a/payloads/libpayload/arch/arm64/mmu.c
+++ b/payloads/libpayload/arch/arm64/mmu.c
@@ -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)
- /* 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;