When coreboot calls payloads it passes a pointer to the coreboot tables as an argument. SeaBIOS does not make use of this functionality and instead tries to find the coreboot tables via a pointer placed in lower memory. To improve compatibility when calling payloads from SeaBIOS call payloads with the coreboot table as an argument.
This fixes Tianocore with UefiPayloadPkg not booting when loaded from SeaBIOS.
Signed-off-by: Arthur Heymans arthur@aheymans.xyz
diff --git a/src/fw/coreboot.c b/src/fw/coreboot.c index 7c0954b..25317ca 100644 --- a/src/fw/coreboot.c +++ b/src/fw/coreboot.c @@ -518,9 +518,10 @@ cbfs_run_payload(struct cbfs_file *fhdr) memset(dest, 0, dest_len); break; case PAYLOAD_SEGMENT_ENTRY: { - dprintf(1, "Calling addr %p\n", dest); - void (*func)(void) = dest; - func(); + void *arg = find_cb_table(); + dprintf(1, "Calling addr %p(%p)\n", dest, arg); + void (*func)(void *) = dest; + func(arg); return; } default: