summaryrefslogtreecommitdiff
path: root/src/soc/amd/common/block
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/amd/common/block')
-rw-r--r--src/soc/amd/common/block/acpi/Kconfig6
-rw-r--r--src/soc/amd/common/block/acpi/Makefile.inc1
-rw-r--r--src/soc/amd/common/block/acpi/madt.c20
3 files changed, 27 insertions, 0 deletions
diff --git a/src/soc/amd/common/block/acpi/Kconfig b/src/soc/amd/common/block/acpi/Kconfig
index 9355f7d455..0f0a371111 100644
--- a/src/soc/amd/common/block/acpi/Kconfig
+++ b/src/soc/amd/common/block/acpi/Kconfig
@@ -30,6 +30,12 @@ config SOC_AMD_COMMON_BLOCK_ACPI_GPIO
config SOC_AMD_COMMON_BLOCK_ACPI_IVRS
bool
+config SOC_AMD_COMMON_BLOCK_ACPI_MADT
+ bool
+ help
+ Select this to add the common AMD acpi_fill_madt implementation to
+ the build which adds the MADT entries for all non-FCH IOAPICs.
+
config ACPI_SSDT_PSD_INDEPENDENT
bool "Allow core p-state independent transitions"
default y
diff --git a/src/soc/amd/common/block/acpi/Makefile.inc b/src/soc/amd/common/block/acpi/Makefile.inc
index a0d92907a4..763a3bc61a 100644
--- a/src/soc/amd/common/block/acpi/Makefile.inc
+++ b/src/soc/amd/common/block/acpi/Makefile.inc
@@ -12,6 +12,7 @@ ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI_CPPC) += cppc.c
ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI_CPU_POWER_STATE) += cpu_power_state.c
ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI_GPIO) += gpio.c
ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI_IVRS) += ivrs.c
+ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI_MADT) += madt.c
romstage-y += elog.c
ramstage-y += elog.c
diff --git a/src/soc/amd/common/block/acpi/madt.c b/src/soc/amd/common/block/acpi/madt.c
new file mode 100644
index 0000000000..14fab74b84
--- /dev/null
+++ b/src/soc/amd/common/block/acpi/madt.c
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <acpi/acpi.h>
+#include <amdblocks/data_fabric.h>
+#include <device/device.h>
+
+unsigned long acpi_fill_madt(unsigned long current)
+{
+ struct device *dev = NULL;
+ while ((dev = dev_find_path(dev, DEVICE_PATH_DOMAIN)) != NULL) {
+ struct resource *res = probe_resource(dev, IOMMU_IOAPIC_IDX);
+ if (!res)
+ continue;
+
+ current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current,
+ res->base);
+ }
+
+ return current;
+}