acpi: Move MCFG implementation to common lib
MCFG tables are used on multiple arches. Move to common ACPI lib.
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Moritz Fischer <moritzf@google.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Use sizeof(*mcfg) instead of sizeof(*header)
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/arch/x86/cpu/tangier/acpi.c b/arch/x86/cpu/tangier/acpi.c
index 12f9289..e3a2fce 100644
--- a/arch/x86/cpu/tangier/acpi.c
+++ b/arch/x86/cpu/tangier/acpi.c
@@ -68,14 +68,17 @@
return current;
}
-u32 acpi_fill_mcfg(u32 current)
+int acpi_fill_mcfg(struct acpi_ctx *ctx)
{
- /* TODO: Derive parameters from SFI MCFG table */
- current += acpi_create_mcfg_mmconfig
- ((struct acpi_mcfg_mmconfig *)current,
- MCFG_BASE_ADDRESS, 0x0, 0x0, 0x0);
+ size_t size;
- return current;
+ /* TODO: Derive parameters from SFI MCFG table */
+ size = acpi_create_mcfg_mmconfig
+ ((struct acpi_mcfg_mmconfig *)ctx->current,
+ MCFG_BASE_ADDRESS, 0x0, 0x0, 0x0);
+ acpi_inc(ctx, size);
+
+ return 0;
}
static u32 acpi_fill_csrt_dma(struct acpi_csrt_group *grp)