From 5e0db58533c1d796129a0a29e03f1ca8e0e81063 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Sat, 18 Jul 2020 15:20:00 +0200 Subject: libpayload: Cache copy of `cb_framebuffer` struct Our AArch64 code supports dynamic framebuffer allocation which makes it necessary to change the framebuffer information during runtime. Having a pointer inside `libsysinfo` made a mess of it as the pointer would either refer to the original struct inside the coreboot table or to a new struct inside payload space. The latter would be unaffected by a relocation of the payload. Instead of the pointer, we'll always keep a copy of the whole struct, which can be altered on demand without affecting the coreboot table. To align the `video/graphics` driver with the console driver, we also replace `fbaddr` with a macro `FB` that calls phys_to_virt(). Change-Id: I3edc09cdb502a71516c1ee71457c1f8dcd01c119 Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/c/coreboot/+/43578 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons Reviewed-by: Julius Werner --- payloads/libpayload/libc/coreboot.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'payloads/libpayload/libc') diff --git a/payloads/libpayload/libc/coreboot.c b/payloads/libpayload/libc/coreboot.c index 5ecdd51fab..43d9df4147 100644 --- a/payloads/libpayload/libc/coreboot.c +++ b/payloads/libpayload/libc/coreboot.c @@ -186,8 +186,7 @@ static void cb_parse_checksum(void *ptr, struct sysinfo_t *info) #if CONFIG(LP_COREBOOT_VIDEO_CONSOLE) static void cb_parse_framebuffer(void *ptr, struct sysinfo_t *info) { - /* ptr points to a coreboot table entry and is already virtual */ - info->framebuffer = ptr; + info->framebuffer = *(struct cb_framebuffer *)ptr; } #endif -- cgit v1.2.3