acpi: Add fill_madt to acpi_ops
Add a new method to acpi_ops to let drivers fill out ACPI MADT.
The code is unused for now until drivers implement the new ops.
TEST: Booted on QEMU sbsa using driver model generated MADT.
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Cc: Simon Glass <sjg@chromium.org>
diff --git a/lib/acpi/acpi_table.c b/lib/acpi/acpi_table.c
index 639d781..5b9b4d2 100644
--- a/lib/acpi/acpi_table.c
+++ b/lib/acpi/acpi_table.c
@@ -257,11 +257,11 @@
header->revision = ACPI_MADT_REV_ACPI_3_0;
acpi_inc(ctx, sizeof(struct acpi_madt));
+ /* TODO: Get rid of acpi_fill_madt and use driver model */
current = acpi_fill_madt(madt, ctx);
/* (Re)calculate length and checksum */
header->length = (uintptr_t)current - (uintptr_t)madt;
-
header->checksum = table_compute_checksum((void *)madt, header->length);
acpi_add_table(ctx, madt);
ctx->current = (void *)madt + madt->header.length;