sb,soc/amd,intel: Add and use ACPI_COMMON_MADT_LAPIC

Boards with SOC_INTEL_COMMON_BLOCK_ACPI_CPU_HYBRID have
special handling for the time being.

Change of aopen/dxplplusu is coupled with sb/intel/i82801dx.
Change of emulation/qemu-i440fx is coupled with intel/i82371eb.

For asus/p2b, this adds MADT LAPIC entries, even though platform
has ACPI_NO_MADT selected. Even previously ACPI_NO_MADT creates
the MADT, including an entry for LAPIC address.

Change-Id: I1f8d7ee9891553742d73a92b55a87c04fa95a132
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74316
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
This commit is contained in:
Kyösti Mälkki 2023-04-08 14:10:48 +03:00
parent 0854f67cae
commit 69a13964ea
33 changed files with 21 additions and 51 deletions

View File

@ -31,6 +31,9 @@ config ACPI_SOC_NVS
Set to indicate <soc/nvs.h> exists for the platform with a definition Set to indicate <soc/nvs.h> exists for the platform with a definition
for global_nvs. for global_nvs.
config ACPI_COMMON_MADT_LAPIC
bool
config ACPI_NO_MADT config ACPI_NO_MADT
bool bool
help help

View File

@ -312,6 +312,9 @@ void acpi_create_madt(acpi_madt_t *madt)
if (CONFIG(ACPI_HAVE_PCAT_8259)) if (CONFIG(ACPI_HAVE_PCAT_8259))
madt->flags |= 1; madt->flags |= 1;
if (CONFIG(ACPI_COMMON_MADT_LAPIC))
current = acpi_create_madt_lapics_with_nmis(current);
if (!CONFIG(ACPI_NO_MADT)) if (!CONFIG(ACPI_NO_MADT))
current = acpi_fill_madt(current); current = acpi_fill_madt(current);

View File

@ -8,8 +8,6 @@ unsigned long acpi_fill_madt(unsigned long current)
struct device *bdev, *dev = NULL; struct device *bdev, *dev = NULL;
struct resource *res = NULL; struct resource *res = NULL;
current = acpi_create_madt_lapics_with_nmis(current);
/* Southbridge IOAPIC */ /* Southbridge IOAPIC */
current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, 0xfec00000); current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, 0xfec00000);

View File

@ -10,9 +10,6 @@
unsigned long acpi_fill_madt(unsigned long current) unsigned long acpi_fill_madt(unsigned long current)
{ {
/* Local APICs */
current = acpi_create_madt_lapics_with_nmis(current);
/* IOAPIC */ /* IOAPIC */
current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR); current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR);

View File

@ -6,9 +6,6 @@
unsigned long acpi_fill_madt(unsigned long current) unsigned long acpi_fill_madt(unsigned long current)
{ {
/* create all subtables for processors */
current = acpi_create_madt_lapics_with_nmis(current);
/* Write SB800 IOAPIC, only one */ /* Write SB800 IOAPIC, only one */
current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR); current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR);

View File

@ -21,9 +21,6 @@
unsigned long acpi_fill_madt(unsigned long current) unsigned long acpi_fill_madt(unsigned long current)
{ {
/* create all subtables for processors */
current = acpi_create_madt_lapics_with_nmis(current);
current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR); current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR);
current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current,

View File

@ -2,6 +2,7 @@ config SOC_AMD_COMMON_BLOCK_ACPI
bool bool
depends on SOC_AMD_COMMON_BLOCK_ACPIMMIO depends on SOC_AMD_COMMON_BLOCK_ACPIMMIO
select ACPI_AMD_HARDWARE_SLEEP_VALUES select ACPI_AMD_HARDWARE_SLEEP_VALUES
select ACPI_COMMON_MADT_LAPIC
help help
Select this option to use the AcpiMmio ACPI registers. Select this option to use the AcpiMmio ACPI registers.

View File

@ -24,9 +24,6 @@
unsigned long acpi_fill_madt(unsigned long current) unsigned long acpi_fill_madt(unsigned long current)
{ {
/* create all subtables for processors */
current = acpi_create_madt_lapics_with_nmis(current);
current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR); current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR);
current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current,

View File

@ -23,9 +23,6 @@
unsigned long acpi_fill_madt(unsigned long current) unsigned long acpi_fill_madt(unsigned long current)
{ {
/* create all subtables for processors */
current = acpi_create_madt_lapics_with_nmis(current);
current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR); current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR);
current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current,

View File

@ -24,9 +24,6 @@
unsigned long acpi_fill_madt(unsigned long current) unsigned long acpi_fill_madt(unsigned long current)
{ {
/* create all subtables for processors */
current = acpi_create_madt_lapics_with_nmis(current);
current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR); current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR);
current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current,

View File

@ -28,9 +28,6 @@
unsigned long acpi_fill_madt(unsigned long current) unsigned long acpi_fill_madt(unsigned long current)
{ {
/* create all subtables for processors */
current = acpi_create_madt_lapics_with_nmis(current);
current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR); current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR);
current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current,

View File

@ -26,9 +26,6 @@
unsigned long acpi_fill_madt(unsigned long current) unsigned long acpi_fill_madt(unsigned long current)
{ {
/* create all subtables for processors */
current = acpi_create_madt_lapics_with_nmis(current);
/* Write Kern IOAPIC, only one */ /* Write Kern IOAPIC, only one */
current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR); current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR);

View File

@ -7,6 +7,7 @@ if SOC_INTEL_BAYTRAIL
config CPU_SPECIFIC_OPTIONS config CPU_SPECIFIC_OPTIONS
def_bool y def_bool y
select ACPI_COMMON_MADT_LAPIC
select ACPI_INTEL_HARDWARE_SLEEP_VALUES select ACPI_INTEL_HARDWARE_SLEEP_VALUES
select ARCH_X86 select ARCH_X86
select BOOT_DEVICE_SPI_FLASH_NO_EARLY_WRITES select BOOT_DEVICE_SPI_FLASH_NO_EARLY_WRITES

View File

@ -87,9 +87,6 @@ int acpi_sci_irq(void)
unsigned long acpi_fill_madt(unsigned long current) unsigned long acpi_fill_madt(unsigned long current)
{ {
/* Local APICs */
current = acpi_create_madt_lapics_with_nmis(current);
/* IOAPIC */ /* IOAPIC */
current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR); current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR);

View File

@ -7,6 +7,7 @@ if SOC_INTEL_BRASWELL
config CPU_SPECIFIC_OPTIONS config CPU_SPECIFIC_OPTIONS
def_bool y def_bool y
select ACPI_COMMON_MADT_LAPIC
select ACPI_INTEL_HARDWARE_SLEEP_VALUES select ACPI_INTEL_HARDWARE_SLEEP_VALUES
select ARCH_X86 select ARCH_X86
select BOOT_DEVICE_SUPPORTS_WRITES select BOOT_DEVICE_SUPPORTS_WRITES

View File

@ -328,9 +328,6 @@ static unsigned long acpi_madt_irq_overrides(unsigned long current)
unsigned long acpi_fill_madt(unsigned long current) unsigned long acpi_fill_madt(unsigned long current)
{ {
/* Local APICs */
current = acpi_create_madt_lapics_with_nmis(current);
/* IOAPIC */ /* IOAPIC */
current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR); current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR);

View File

@ -4,6 +4,7 @@ config INTEL_LYNXPOINT_LP
config PCH_SPECIFIC_OPTIONS config PCH_SPECIFIC_OPTIONS
def_bool y def_bool y
select ACPI_COMMON_MADT_LAPIC
select ACPI_INTEL_HARDWARE_SLEEP_VALUES select ACPI_INTEL_HARDWARE_SLEEP_VALUES
select ACPI_SOC_NVS select ACPI_SOC_NVS
select AZALIA_PLUGIN_SUPPORT select AZALIA_PLUGIN_SUPPORT

View File

@ -1,6 +1,7 @@
config SOC_INTEL_COMMON_BLOCK_ACPI config SOC_INTEL_COMMON_BLOCK_ACPI
depends on SOC_INTEL_COMMON_BLOCK_CPU depends on SOC_INTEL_COMMON_BLOCK_CPU
depends on SOC_INTEL_COMMON_BLOCK_PMC depends on SOC_INTEL_COMMON_BLOCK_PMC
select ACPI_COMMON_MADT_LAPIC if !SOC_INTEL_COMMON_BLOCK_ACPI_CPU_HYBRID
bool bool
help help
Intel Processor common code for ACPI Intel Processor common code for ACPI

View File

@ -87,11 +87,8 @@ unsigned long acpi_fill_madt(unsigned long current)
size_t ioapic_entries; size_t ioapic_entries;
/* Local APICs */ /* Local APICs */
if (!CONFIG(ACPI_COMMON_MADT_LAPIC))
if (CONFIG(SOC_INTEL_COMMON_BLOCK_ACPI_CPU_HYBRID))
current = acpi_create_madt_lapics_with_nmis_hybrid(current); current = acpi_create_madt_lapics_with_nmis_hybrid(current);
else
current = acpi_create_madt_lapics_with_nmis(current);
/* IOAPIC */ /* IOAPIC */
ioapic_entries = soc_get_ioapic_info(&ioapic_table); ioapic_entries = soc_get_ioapic_info(&ioapic_table);

View File

@ -10,6 +10,7 @@ if SOUTHBRIDGE_AMD_PI_AVALON || SOUTHBRIDGE_AMD_PI_KERN
config SOUTHBRIDGE_SPECIFIC_OPTIONS config SOUTHBRIDGE_SPECIFIC_OPTIONS
def_bool y def_bool y
select ACPI_COMMON_MADT_LAPIC
select HAVE_USBDEBUG_OPTIONS select HAVE_USBDEBUG_OPTIONS
select HAVE_CF9_RESET select HAVE_CF9_RESET
select HAVE_CF9_RESET_PREPARE select HAVE_CF9_RESET_PREPARE

View File

@ -10,6 +10,7 @@ if SOUTHBRIDGE_INTEL_BD82X6X || SOUTHBRIDGE_INTEL_C216
config SOUTH_BRIDGE_OPTIONS config SOUTH_BRIDGE_OPTIONS
def_bool y def_bool y
select ACPI_COMMON_MADT_LAPIC
select ACPI_INTEL_HARDWARE_SLEEP_VALUES select ACPI_INTEL_HARDWARE_SLEEP_VALUES
select ACPI_SOC_NVS select ACPI_SOC_NVS
select AZALIA_PLUGIN_SUPPORT select AZALIA_PLUGIN_SUPPORT

View File

@ -6,9 +6,6 @@
unsigned long acpi_fill_madt(unsigned long current) unsigned long acpi_fill_madt(unsigned long current)
{ {
/* Local APICs */
current = acpi_create_madt_lapics_with_nmis(current);
/* IOAPIC */ /* IOAPIC */
current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR); current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR);

View File

@ -1,4 +1,5 @@
config SOUTHBRIDGE_INTEL_I82371EB config SOUTHBRIDGE_INTEL_I82371EB
select ACPI_COMMON_MADT_LAPIC
select ACPI_INTEL_HARDWARE_SLEEP_VALUES select ACPI_INTEL_HARDWARE_SLEEP_VALUES
select SOUTHBRIDGE_INTEL_COMMON_SMBUS select SOUTHBRIDGE_INTEL_COMMON_SMBUS
select SOUTHBRIDGE_INTEL_COMMON_RTC select SOUTHBRIDGE_INTEL_COMMON_RTC

View File

@ -2,6 +2,7 @@
config SOUTHBRIDGE_INTEL_I82801DX config SOUTHBRIDGE_INTEL_I82801DX
bool bool
select ACPI_COMMON_MADT_LAPIC
select ACPI_INTEL_HARDWARE_SLEEP_VALUES select ACPI_INTEL_HARDWARE_SLEEP_VALUES
select HAVE_SMI_HANDLER select HAVE_SMI_HANDLER
select SOUTHBRIDGE_INTEL_COMMON_SMBUS select SOUTHBRIDGE_INTEL_COMMON_SMBUS

View File

@ -2,6 +2,7 @@
config SOUTHBRIDGE_INTEL_I82801GX config SOUTHBRIDGE_INTEL_I82801GX
bool bool
select ACPI_COMMON_MADT_LAPIC
select ACPI_INTEL_HARDWARE_SLEEP_VALUES select ACPI_INTEL_HARDWARE_SLEEP_VALUES
select ACPI_SOC_NVS select ACPI_SOC_NVS
select AZALIA_PLUGIN_SUPPORT select AZALIA_PLUGIN_SUPPORT

View File

@ -351,9 +351,6 @@ static void lpc_init(struct device *dev)
unsigned long acpi_fill_madt(unsigned long current) unsigned long acpi_fill_madt(unsigned long current)
{ {
/* Local APICs */
current = acpi_create_madt_lapics_with_nmis(current);
/* IOAPIC */ /* IOAPIC */
current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR); current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR);

View File

@ -2,6 +2,7 @@
config SOUTHBRIDGE_INTEL_I82801IX config SOUTHBRIDGE_INTEL_I82801IX
bool bool
select ACPI_COMMON_MADT_LAPIC
select ACPI_INTEL_HARDWARE_SLEEP_VALUES select ACPI_INTEL_HARDWARE_SLEEP_VALUES
select ACPI_SOC_NVS select ACPI_SOC_NVS
select AZALIA_PLUGIN_SUPPORT select AZALIA_PLUGIN_SUPPORT

View File

@ -6,9 +6,6 @@
unsigned long acpi_fill_madt(unsigned long current) unsigned long acpi_fill_madt(unsigned long current)
{ {
/* Local APICs */
current = acpi_create_madt_lapics_with_nmis(current);
/* IOAPIC */ /* IOAPIC */
current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR); current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR);

View File

@ -2,6 +2,7 @@
config SOUTHBRIDGE_INTEL_I82801JX config SOUTHBRIDGE_INTEL_I82801JX
bool bool
select ACPI_COMMON_MADT_LAPIC
select ACPI_INTEL_HARDWARE_SLEEP_VALUES select ACPI_INTEL_HARDWARE_SLEEP_VALUES
select AZALIA_PLUGIN_SUPPORT select AZALIA_PLUGIN_SUPPORT
select HAVE_POWER_STATE_AFTER_FAILURE select HAVE_POWER_STATE_AFTER_FAILURE

View File

@ -381,9 +381,6 @@ static void lpc_init(struct device *dev)
unsigned long acpi_fill_madt(unsigned long current) unsigned long acpi_fill_madt(unsigned long current)
{ {
/* Local APICs */
current = acpi_create_madt_lapics_with_nmis(current);
/* IOAPIC */ /* IOAPIC */
current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR); current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR);

View File

@ -7,6 +7,7 @@ if SOUTHBRIDGE_INTEL_IBEXPEAK
config SOUTH_BRIDGE_OPTIONS config SOUTH_BRIDGE_OPTIONS
def_bool y def_bool y
select ACPI_COMMON_MADT_LAPIC
select ACPI_INTEL_HARDWARE_SLEEP_VALUES select ACPI_INTEL_HARDWARE_SLEEP_VALUES
select AZALIA_PLUGIN_SUPPORT select AZALIA_PLUGIN_SUPPORT
select HAVE_SMI_HANDLER select HAVE_SMI_HANDLER

View File

@ -8,9 +8,6 @@
unsigned long acpi_fill_madt(unsigned long current) unsigned long acpi_fill_madt(unsigned long current)
{ {
/* Local APICs */
current = acpi_create_madt_lapics_with_nmis(current);
/* IOAPIC */ /* IOAPIC */
current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR); current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR);

View File

@ -7,6 +7,7 @@ if SOUTHBRIDGE_INTEL_LYNXPOINT
config SOUTH_BRIDGE_OPTIONS config SOUTH_BRIDGE_OPTIONS
def_bool y def_bool y
select ACPI_COMMON_MADT_LAPIC
select ACPI_INTEL_HARDWARE_SLEEP_VALUES select ACPI_INTEL_HARDWARE_SLEEP_VALUES
select ACPI_SOC_NVS select ACPI_SOC_NVS
select AZALIA_PLUGIN_SUPPORT select AZALIA_PLUGIN_SUPPORT