acpi/acpi.c: Move setting FADT SCI INT to arch specific code

Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Change-Id: Ic1533cb520a057b29fc8f926db38338cd3401b18
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76295
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Sridhar Siricilla <sridhar.siricilla@intel.com>
This commit is contained in:
Arthur Heymans 2023-07-05 14:24:01 +02:00 committed by Lean Sheng Tan
parent cd46e5f63a
commit eb988dfcba
2 changed files with 18 additions and 25 deletions

View File

@ -27,11 +27,6 @@
#include <types.h> #include <types.h>
#include <version.h> #include <version.h>
#if ENV_X86
#include <arch/ioapic.h>
#include <arch/smp/mpspec.h>
#endif
static acpi_rsdp_t *valid_rsdp(acpi_rsdp_t *rsdp); static acpi_rsdp_t *valid_rsdp(acpi_rsdp_t *rsdp);
u8 acpi_checksum(u8 *table, u32 length) u8 acpi_checksum(u8 *table, u32 length)
@ -139,24 +134,6 @@ static int acpi_create_mcfg_mmconfig(acpi_mcfg_mmconfig_t *mmconfig, u32 base,
return sizeof(acpi_mcfg_mmconfig_t); return sizeof(acpi_mcfg_mmconfig_t);
} }
static u16 acpi_sci_int(void)
{
#if ENV_X86
u8 gsi, irq, flags;
ioapic_get_sci_pin(&gsi, &irq, &flags);
/* ACPI Release 6.5, 5.2.9 and 5.2.15.5. */
if (!CONFIG(ACPI_HAVE_PCAT_8259))
return gsi;
assert(irq < 16);
return irq;
#else
return 0;
#endif
}
static void acpi_create_madt(acpi_header_t *header, void *unused) static void acpi_create_madt(acpi_header_t *header, void *unused)
{ {
acpi_madt_t *madt = (acpi_madt_t *)header; acpi_madt_t *madt = (acpi_madt_t *)header;
@ -1103,8 +1080,6 @@ static void acpi_create_fadt(acpi_header_t *header, void *arg1)
fadt->preferred_pm_profile = acpi_get_preferred_pm_profile(); fadt->preferred_pm_profile = acpi_get_preferred_pm_profile();
fadt->sci_int = acpi_sci_int();
arch_fill_fadt(fadt); arch_fill_fadt(fadt);
acpi_fill_fadt(fadt); acpi_fill_fadt(fadt);

View File

@ -1,12 +1,30 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <arch/ioapic.h>
#include <cf9_reset.h> #include <cf9_reset.h>
#include <cpu/x86/smm.h> #include <cpu/x86/smm.h>
#include <pc80/mc146818rtc.h> #include <pc80/mc146818rtc.h>
static u16 acpi_sci_int(void)
{
u8 gsi, irq, flags;
ioapic_get_sci_pin(&gsi, &irq, &flags);
/* ACPI Release 6.5, 5.2.9 and 5.2.15.5. */
if (!CONFIG(ACPI_HAVE_PCAT_8259))
return gsi;
assert(irq < 16);
return irq;
}
void arch_fill_fadt(acpi_fadt_t *fadt) void arch_fill_fadt(acpi_fadt_t *fadt)
{ {
fadt->sci_int = acpi_sci_int();
if (CONFIG(HAVE_CF9_RESET)) { if (CONFIG(HAVE_CF9_RESET)) {
fadt->reset_reg.space_id = ACPI_ADDRESS_SPACE_IO; fadt->reset_reg.space_id = ACPI_ADDRESS_SPACE_IO;
fadt->reset_reg.bit_width = 8; fadt->reset_reg.bit_width = 8;