acpi: fpdt: Generate the table

Add an ACPI writer to automatically generate the FPDT table with boot
timing information when ACPI tables are created.

This allows the OS to read firmware boot-timing metrics from the FPDT
table.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-10-20 11:31:00 +01:00
parent 958e2ecf55
commit d9b81fa614

View File

@@ -785,3 +785,18 @@ int acpi_fix_fpdt_checksum(void)
return 0;
}
/* this board lacks the bootstage timer */
#ifndef CONFIG_TARGET_QEMU_VIRT
static int acpi_create_fpdt(struct acpi_ctx *ctx,
const struct acpi_writer *entry)
{
u64 uboot_start;
uboot_start = bootstage_get_time(BOOTSTAGE_ID_START_UBOOT_F);
return acpi_write_fpdt(ctx, uboot_start);
}
ACPI_WRITER(6fpdt, "FPDT", acpi_create_fpdt, 0);
#endif