diff options
author | Moritz Fischer <moritzf@google.com> | 2022-02-05 12:17:45 -0800 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2022-02-09 12:30:13 -0700 |
commit | 058fb9f5ffc422f987c33adb01f8fa6e4434eff8 (patch) | |
tree | 74c1e5bf3e09f183f1f32cb6a0d21ac167b267aa /arch/x86/cpu | |
parent | ab2ffe735979b5e6ef417adbd6019fa603de1715 (diff) | |
download | u-boot-058fb9f5ffc422f987c33adb01f8fa6e4434eff8.zip u-boot-058fb9f5ffc422f987c33adb01f8fa6e4434eff8.tar.gz u-boot-058fb9f5ffc422f987c33adb01f8fa6e4434eff8.tar.bz2 |
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>
Diffstat (limited to 'arch/x86/cpu')
-rw-r--r-- | arch/x86/cpu/intel_common/acpi.c | 15 | ||||
-rw-r--r-- | arch/x86/cpu/tangier/acpi.c | 11 |
2 files changed, 16 insertions, 10 deletions
diff --git a/arch/x86/cpu/intel_common/acpi.c b/arch/x86/cpu/intel_common/acpi.c index 15f19da..d94ec20 100644 --- a/arch/x86/cpu/intel_common/acpi.c +++ b/arch/x86/cpu/intel_common/acpi.c @@ -31,14 +31,17 @@ #include <linux/err.h> #include <power/acpi_pmc.h> -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) 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 @@ u32 acpi_fill_madt(u32 current) return current; } -u32 acpi_fill_mcfg(u32 current) +int acpi_fill_mcfg(struct acpi_ctx *ctx) { + size_t size; + /* TODO: Derive parameters from SFI MCFG table */ - current += acpi_create_mcfg_mmconfig - ((struct acpi_mcfg_mmconfig *)current, + size = acpi_create_mcfg_mmconfig + ((struct acpi_mcfg_mmconfig *)ctx->current, MCFG_BASE_ADDRESS, 0x0, 0x0, 0x0); + acpi_inc(ctx, size); - return current; + return 0; } static u32 acpi_fill_csrt_dma(struct acpi_csrt_group *grp) |