soc/intel: Set IO APIC DMAR entry based on hw

This avoids the need to hardcode the IOAPIC ID.

Change-Id: I0965b511e71c58f1c31433bc54595a5fabb1c206
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70268
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-by: Sean Rhodes <sean@starlabs.systems>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
This commit is contained in:
Arthur Heymans 2022-12-02 13:27:35 +01:00 committed by Felix Held
parent f1e78a1349
commit d90154c8de
10 changed files with 27 additions and 19 deletions

View File

@ -3,6 +3,7 @@
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <acpi/acpi_gnvs.h> #include <acpi/acpi_gnvs.h>
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
#include <arch/ioapic.h>
#include <device/mmio.h> #include <device/mmio.h>
#include <arch/smp/mpspec.h> #include <arch/smp/mpspec.h>
#include <console/console.h> #include <console/console.h>
@ -388,8 +389,8 @@ static unsigned long soc_fill_dmar(unsigned long current)
current += acpi_create_dmar_drhd(current, current += acpi_create_dmar_drhd(current,
DRHD_INCLUDE_PCI_ALL, 0, vtvc0bar); DRHD_INCLUDE_PCI_ALL, 0, vtvc0bar);
current += acpi_create_dmar_ds_ioapic(current, current += acpi_create_dmar_ds_ioapic_from_hw(current,
2, V_P2SB_CFG_IBDF_BUS, V_P2SB_CFG_IBDF_DEV, IO_APIC_ADDR, V_P2SB_CFG_IBDF_BUS, V_P2SB_CFG_IBDF_DEV,
V_P2SB_CFG_IBDF_FUNC); V_P2SB_CFG_IBDF_FUNC);
current += acpi_create_dmar_ds_msi_hpet(current, current += acpi_create_dmar_ds_msi_hpet(current,
0, V_P2SB_CFG_HBDF_BUS, V_P2SB_CFG_HBDF_DEV, 0, V_P2SB_CFG_HBDF_BUS, V_P2SB_CFG_HBDF_DEV,

View File

@ -3,6 +3,7 @@
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <acpi/acpi_gnvs.h> #include <acpi/acpi_gnvs.h>
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
#include <arch/ioapic.h>
#include <console/console.h> #include <console/console.h>
#include <device/device.h> #include <device/device.h>
#include <device/mmio.h> #include <device/mmio.h>
@ -142,8 +143,8 @@ static unsigned long soc_fill_dmar(unsigned long current)
current += acpi_create_dmar_drhd(current, current += acpi_create_dmar_drhd(current,
DRHD_INCLUDE_PCI_ALL, 0, defvtbar); DRHD_INCLUDE_PCI_ALL, 0, defvtbar);
current += acpi_create_dmar_ds_ioapic(current, current += acpi_create_dmar_ds_ioapic_from_hw(current,
2, ibdf.bus, ibdf.dev, ibdf.fn); IO_APIC_ADDR, ibdf.bus, ibdf.dev, ibdf.fn);
current += acpi_create_dmar_ds_msi_hpet(current, current += acpi_create_dmar_ds_msi_hpet(current,
0, hbdf.bus, hbdf.dev, hbdf.fn); 0, hbdf.bus, hbdf.dev, hbdf.fn);
acpi_dmar_drhd_fixup(tmp, current); acpi_dmar_drhd_fixup(tmp, current);

View File

@ -49,8 +49,8 @@ static unsigned long acpi_fill_dmar(unsigned long current)
const unsigned long tmp = current; const unsigned long tmp = current;
current += acpi_create_dmar_drhd(current, current += acpi_create_dmar_drhd(current,
DRHD_INCLUDE_PCI_ALL, 0, vtvc0bar); DRHD_INCLUDE_PCI_ALL, 0, vtvc0bar);
current += acpi_create_dmar_ds_ioapic(current, current += acpi_create_dmar_ds_ioapic_from_hw(current,
2, PCH_IOAPIC_PCI_BUS, PCH_IOAPIC_PCI_SLOT, 0); IO_APIC_ADDR, PCH_IOAPIC_PCI_BUS, PCH_IOAPIC_PCI_SLOT, 0);
size_t i; size_t i;
for (i = 0; i < 8; ++i) for (i = 0; i < 8; ++i)
current += acpi_create_dmar_ds_msi_hpet(current, current += acpi_create_dmar_ds_msi_hpet(current,

View File

@ -3,6 +3,7 @@
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <acpi/acpi_gnvs.h> #include <acpi/acpi_gnvs.h>
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
#include <arch/ioapic.h>
#include <arch/smp/mpspec.h> #include <arch/smp/mpspec.h>
#include <console/console.h> #include <console/console.h>
#include <device/mmio.h> #include <device/mmio.h>
@ -222,8 +223,8 @@ static unsigned long soc_fill_dmar(unsigned long current)
current += acpi_create_dmar_drhd(current, current += acpi_create_dmar_drhd(current,
DRHD_INCLUDE_PCI_ALL, 0, vtvc0bar); DRHD_INCLUDE_PCI_ALL, 0, vtvc0bar);
current += acpi_create_dmar_ds_ioapic(current, current += acpi_create_dmar_ds_ioapic_from_hw(current,
2, V_P2SB_CFG_IBDF_BUS, V_P2SB_CFG_IBDF_DEV, IO_APIC_ADDR, V_P2SB_CFG_IBDF_BUS, V_P2SB_CFG_IBDF_DEV,
V_P2SB_CFG_IBDF_FUNC); V_P2SB_CFG_IBDF_FUNC);
current += acpi_create_dmar_ds_msi_hpet(current, current += acpi_create_dmar_ds_msi_hpet(current,
0, V_P2SB_CFG_HBDF_BUS, V_P2SB_CFG_HBDF_DEV, 0, V_P2SB_CFG_HBDF_BUS, V_P2SB_CFG_HBDF_DEV,

View File

@ -3,6 +3,7 @@
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <acpi/acpi_gnvs.h> #include <acpi/acpi_gnvs.h>
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
#include <arch/ioapic.h>
#include <arch/smp/mpspec.h> #include <arch/smp/mpspec.h>
#include <cpu/cpu.h> #include <cpu/cpu.h>
#include <cpu/x86/smm.h> #include <cpu/x86/smm.h>
@ -188,8 +189,8 @@ static unsigned long acpi_fill_dmar(unsigned long current)
current += acpi_create_dmar_drhd(current, current += acpi_create_dmar_drhd(current,
DRHD_INCLUDE_PCI_ALL, 0, vtbar); DRHD_INCLUDE_PCI_ALL, 0, vtbar);
current += acpi_create_dmar_ds_ioapic(current, current += acpi_create_dmar_ds_ioapic_from_hw(current,
2, PCH_IOAPIC_PCI_BUS, PCH_IOAPIC_PCI_SLOT, 0); IO_APIC_ADDR, PCH_IOAPIC_PCI_BUS, PCH_IOAPIC_PCI_SLOT, 0);
current += acpi_create_dmar_ds_msi_hpet(current, current += acpi_create_dmar_ds_msi_hpet(current,
0, PCH_HPET_PCI_BUS, PCH_HPET_PCI_SLOT, 0); 0, PCH_HPET_PCI_BUS, PCH_HPET_PCI_SLOT, 0);

View File

@ -3,6 +3,7 @@
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <acpi/acpi_gnvs.h> #include <acpi/acpi_gnvs.h>
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
#include <arch/ioapic.h>
#include <arch/smp/mpspec.h> #include <arch/smp/mpspec.h>
#include <console/console.h> #include <console/console.h>
#include <device/device.h> #include <device/device.h>
@ -191,8 +192,8 @@ static unsigned long soc_fill_dmar(unsigned long current)
current += acpi_create_dmar_drhd(current, current += acpi_create_dmar_drhd(current,
DRHD_INCLUDE_PCI_ALL, 0, vtvc0bar); DRHD_INCLUDE_PCI_ALL, 0, vtvc0bar);
current += acpi_create_dmar_ds_ioapic(current, current += acpi_create_dmar_ds_ioapic_from_hw(current,
2, V_P2SB_CFG_IBDF_BUS, V_P2SB_CFG_IBDF_DEV, IO_APIC_ADDR, V_P2SB_CFG_IBDF_BUS, V_P2SB_CFG_IBDF_DEV,
V_P2SB_CFG_IBDF_FUNC); V_P2SB_CFG_IBDF_FUNC);
current += acpi_create_dmar_ds_msi_hpet(current, current += acpi_create_dmar_ds_msi_hpet(current,
0, V_P2SB_CFG_HBDF_BUS, V_P2SB_CFG_HBDF_DEV, 0, V_P2SB_CFG_HBDF_BUS, V_P2SB_CFG_HBDF_DEV,

View File

@ -3,6 +3,7 @@
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <acpi/acpi_gnvs.h> #include <acpi/acpi_gnvs.h>
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
#include <arch/ioapic.h>
#include <device/device.h> #include <device/device.h>
#include <device/mmio.h> #include <device/mmio.h>
#include <arch/smp/mpspec.h> #include <arch/smp/mpspec.h>
@ -202,8 +203,8 @@ static unsigned long soc_fill_dmar(unsigned long current)
current += acpi_create_dmar_drhd(current, current += acpi_create_dmar_drhd(current,
DRHD_INCLUDE_PCI_ALL, 0, vtvc0bar); DRHD_INCLUDE_PCI_ALL, 0, vtvc0bar);
current += acpi_create_dmar_ds_ioapic(current, current += acpi_create_dmar_ds_ioapic_from_hw(current,
2, V_P2SB_CFG_IBDF_BUS, V_P2SB_CFG_IBDF_DEV, IO_APIC_ADDR, V_P2SB_CFG_IBDF_BUS, V_P2SB_CFG_IBDF_DEV,
V_P2SB_CFG_IBDF_FUNC); V_P2SB_CFG_IBDF_FUNC);
current += acpi_create_dmar_ds_msi_hpet(current, current += acpi_create_dmar_ds_msi_hpet(current,
0, V_P2SB_CFG_HBDF_BUS, V_P2SB_CFG_HBDF_DEV, 0, V_P2SB_CFG_HBDF_BUS, V_P2SB_CFG_HBDF_DEV,

View File

@ -3,6 +3,7 @@
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <acpi/acpi_gnvs.h> #include <acpi/acpi_gnvs.h>
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
#include <arch/ioapic.h>
#include <device/mmio.h> #include <device/mmio.h>
#include <arch/smp/mpspec.h> #include <arch/smp/mpspec.h>
#include <console/console.h> #include <console/console.h>
@ -191,8 +192,8 @@ static unsigned long soc_fill_dmar(unsigned long current)
tmp = current; tmp = current;
current += acpi_create_dmar_drhd(current, current += acpi_create_dmar_drhd(current,
DRHD_INCLUDE_PCI_ALL, 0, VTVC0_BASE_ADDRESS); DRHD_INCLUDE_PCI_ALL, 0, VTVC0_BASE_ADDRESS);
current += acpi_create_dmar_ds_ioapic(current, current += acpi_create_dmar_ds_ioapic_from_hw(current,
2, V_P2SB_CFG_IBDF_BUS, V_P2SB_CFG_IBDF_DEV, IO_APIC_ADDR, V_P2SB_CFG_IBDF_BUS, V_P2SB_CFG_IBDF_DEV,
V_P2SB_CFG_IBDF_FUNC); V_P2SB_CFG_IBDF_FUNC);
current += acpi_create_dmar_ds_msi_hpet(current, current += acpi_create_dmar_ds_msi_hpet(current,
0, V_P2SB_CFG_HBDF_BUS, V_P2SB_CFG_HBDF_DEV, 0, V_P2SB_CFG_HBDF_BUS, V_P2SB_CFG_HBDF_DEV,

View File

@ -208,7 +208,7 @@ static unsigned long soc_fill_dmar(unsigned long current)
current += acpi_create_dmar_drhd(current, DRHD_INCLUDE_PCI_ALL, 0, vtvc0bar); current += acpi_create_dmar_drhd(current, DRHD_INCLUDE_PCI_ALL, 0, vtvc0bar);
current += acpi_create_dmar_ds_ioapic(current, 2, V_P2SB_IBDF_BUS, current += acpi_create_dmar_ds_ioapic_from_hw(current, IO_APIC_ADDR, V_P2SB_IBDF_BUS,
V_P2SB_IBDF_DEV, V_P2SB_IBDF_FUN); V_P2SB_IBDF_DEV, V_P2SB_IBDF_FUN);
current += acpi_create_dmar_ds_msi_hpet(current, 0, V_P2SB_HBDF_BUS, current += acpi_create_dmar_ds_msi_hpet(current, 0, V_P2SB_HBDF_BUS,

View File

@ -3,6 +3,7 @@
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <acpi/acpi_gnvs.h> #include <acpi/acpi_gnvs.h>
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
#include <arch/ioapic.h>
#include <device/mmio.h> #include <device/mmio.h>
#include <arch/smp/mpspec.h> #include <arch/smp/mpspec.h>
#include <console/console.h> #include <console/console.h>
@ -217,8 +218,8 @@ static unsigned long soc_fill_dmar(unsigned long current)
current += acpi_create_dmar_drhd(current, current += acpi_create_dmar_drhd(current,
DRHD_INCLUDE_PCI_ALL, 0, vtvc0bar); DRHD_INCLUDE_PCI_ALL, 0, vtvc0bar);
current += acpi_create_dmar_ds_ioapic(current, current += acpi_create_dmar_ds_ioapic_from_hw(current,
2, V_P2SB_CFG_IBDF_BUS, V_P2SB_CFG_IBDF_DEV, IO_APIC_ADDR, V_P2SB_CFG_IBDF_BUS, V_P2SB_CFG_IBDF_DEV,
V_P2SB_CFG_IBDF_FUNC); V_P2SB_CFG_IBDF_FUNC);
current += acpi_create_dmar_ds_msi_hpet(current, current += acpi_create_dmar_ds_msi_hpet(current,
0, V_P2SB_CFG_HBDF_BUS, V_P2SB_CFG_HBDF_DEV, 0, V_P2SB_CFG_HBDF_BUS, V_P2SB_CFG_HBDF_DEV,