Files
system76-coreboot/src/arch/x86/acpi.c
Felix Held dfad318095 acpi/acpi_apic;arch/x86/acpi: better document ACPI_NO_PCAT_8259 case
Both acpi_create_madt_sci_override and acpi_sci_int have special
handling for the ACPI_NO_PCAT_8259 case, but those cases weren't exactly
obvious, so add a comment with the reason for that.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Ia6dcf59d5ab9226c61e9c4af95a73a07771b71d1
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82643
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-05-27 14:49:22 +00:00

58 lines
1.3 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
#include <acpi/acpi.h>
#include <arch/ioapic.h>
#include <cf9_reset.h>
#include <cpu/x86/smm.h>
#include <pc80/mc146818rtc.h>
static u16 acpi_sci_int(void)
{
u8 gsi, irq, flags;
ioapic_get_sci_pin(&gsi, &irq, &flags);
/* In systems without 8259, the SCI_INT field in the FADT contains the SCI GSI number
instead of the 8259 IRQ number */
if (!CONFIG(ACPI_HAVE_PCAT_8259))
return gsi;
assert(irq < 16);
return irq;
}
void arch_fill_fadt(acpi_fadt_t *fadt)
{
fadt->sci_int = acpi_sci_int();
if (CONFIG(HAVE_CF9_RESET)) {
fadt->reset_reg.space_id = ACPI_ADDRESS_SPACE_IO;
fadt->reset_reg.bit_width = 8;
fadt->reset_reg.bit_offset = 0;
fadt->reset_reg.access_size = ACPI_ACCESS_SIZE_BYTE_ACCESS;
fadt->reset_reg.addrl = RST_CNT;
fadt->reset_reg.addrh = 0;
fadt->reset_value = RST_CPU | SYS_RST;
fadt->flags |= ACPI_FADT_RESET_REGISTER;
}
if (permanent_smi_handler()) {
fadt->smi_cmd = pm_acpi_smi_cmd_port();
fadt->acpi_enable = APM_CNT_ACPI_ENABLE;
fadt->acpi_disable = APM_CNT_ACPI_DISABLE;
}
if (CONFIG(PC80_SYSTEM)) {
/* Currently these are defined to support date alarm only. */
fadt->day_alrm = RTC_DATE_ALARM;
fadt->mon_alrm = RTC_MONTH_ALARM;
}
/* Careful with USE_OPTION_TABLE. */
if (CONFIG(USE_PC_CMOS_ALTCENTURY))
fadt->century = RTC_CLK_ALTCENTURY;
}