acpi.c: Fill in >4G FADT entries correctly

Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Change-Id: I84ab0068e8409a5e525ddc781347087680d80640
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76179
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
This commit is contained in:
Arthur Heymans 2023-06-29 20:26:39 +02:00 committed by Lean Sheng Tan
parent 28857ce317
commit 8473e8fd5f
1 changed files with 10 additions and 6 deletions

View File

@ -1086,13 +1086,17 @@ static void acpi_create_fadt(acpi_header_t *header, void *arg1)
return;
fadt->FADT_MinorVersion = get_acpi_fadt_minor_version();
fadt->firmware_ctrl = (unsigned long)facs;
fadt->x_firmware_ctl_l = (unsigned long)facs;
fadt->x_firmware_ctl_h = 0;
if ((uintptr_t)facs <= UINT32_MAX)
fadt->firmware_ctrl = (uintptr_t)facs;
else
fadt->x_firmware_ctl_h = (uint32_t)((uint64_t)(uintptr_t)facs >> 32);
fadt->x_firmware_ctl_l = (uint32_t)(uintptr_t)facs;
fadt->dsdt = (unsigned long)dsdt;
fadt->x_dsdt_l = (unsigned long)dsdt;
fadt->x_dsdt_h = 0;
if ((uintptr_t)dsdt <= UINT32_MAX)
fadt->dsdt = (uintptr_t)dsdt;
else
fadt->x_dsdt_h = (uint32_t)((uint64_t)(uintptr_t)dsdt >> 32);
fadt->x_dsdt_l = (uint32_t)(uintptr_t)dsdt;
/* should be 0 ACPI 3.0 */
fadt->reserved = 0;