From 058fb9f5ffc422f987c33adb01f8fa6e4434eff8 Mon Sep 17 00:00:00 2001 From: Moritz Fischer Date: Sat, 5 Feb 2022 12:17:45 -0800 Subject: acpi: Move MCFG implementation to common lib MCFG tables are used on multiple arches. Move to common ACPI lib. Cc: Simon Glass Signed-off-by: Moritz Fischer Reviewed-by: Simon Glass Use sizeof(*mcfg) instead of sizeof(*header) Signed-off-by: Simon Glass --- arch/x86/cpu/intel_common/acpi.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'arch/x86/cpu/intel_common/acpi.c') diff --git a/arch/x86/cpu/intel_common/acpi.c b/arch/x86/cpu/intel_common/acpi.c index 15f19da2067..d94ec208f65 100644 --- a/arch/x86/cpu/intel_common/acpi.c +++ b/arch/x86/cpu/intel_common/acpi.c @@ -31,14 +31,17 @@ #include #include -u32 acpi_fill_mcfg(u32 current) +int acpi_fill_mcfg(struct acpi_ctx *ctx) { + size_t size; + /* PCI Segment Group 0, Start Bus Number 0, End Bus Number is 255 */ - current += acpi_create_mcfg_mmconfig((void *)current, - CONFIG_MMCONF_BASE_ADDRESS, 0, 0, - (CONFIG_SA_PCIEX_LENGTH >> 20) - - 1); - return current; + size = acpi_create_mcfg_mmconfig((void *)ctx->current, + CONFIG_MMCONF_BASE_ADDRESS, 0, 0, + (CONFIG_SA_PCIEX_LENGTH >> 20) - 1); + acpi_inc(ctx, size); + + return 0; } static int acpi_sci_irq(void) -- cgit v1.2.3