summaryrefslogtreecommitdiff
path: root/src/soc/amd/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/amd/common')
-rw-r--r--src/soc/amd/common/block/include/amdblocks/acpi.h3
-rw-r--r--src/soc/amd/common/fsp/Makefile.inc1
-rw-r--r--src/soc/amd/common/fsp/fsp-acpi.c40
3 files changed, 44 insertions, 0 deletions
diff --git a/src/soc/amd/common/block/include/amdblocks/acpi.h b/src/soc/amd/common/block/include/amdblocks/acpi.h
index 215d6682cb..eec5a3fc17 100644
--- a/src/soc/amd/common/block/include/amdblocks/acpi.h
+++ b/src/soc/amd/common/block/include/amdblocks/acpi.h
@@ -56,4 +56,7 @@ unsigned long southbridge_write_acpi_tables(const struct device *device, unsigne
unsigned long acpi_fill_madt_irqoverride(unsigned long current);
void acpi_fill_root_complex_tom(const struct device *device);
+uintptr_t add_agesa_fsp_acpi_table(guid_t guid, const char *name, acpi_rsdp_t *rsdp,
+ uintptr_t current);
+
#endif /* AMD_BLOCK_ACPI_H */
diff --git a/src/soc/amd/common/fsp/Makefile.inc b/src/soc/amd/common/fsp/Makefile.inc
index 5523876a7e..3ba6ea5b4a 100644
--- a/src/soc/amd/common/fsp/Makefile.inc
+++ b/src/soc/amd/common/fsp/Makefile.inc
@@ -1,4 +1,5 @@
ifeq ($(CONFIG_PLATFORM_USES_FSP2_0),y)
romstage-y += fsp_reset.c
ramstage-y += fsp_reset.c
+ramstage-$(CONFIG_HAVE_ACPI_TABLES) += fsp-acpi.c
endif # CONFIG_PLATFORM_USES_FSP2_0
diff --git a/src/soc/amd/common/fsp/fsp-acpi.c b/src/soc/amd/common/fsp/fsp-acpi.c
new file mode 100644
index 0000000000..b530688c03
--- /dev/null
+++ b/src/soc/amd/common/fsp/fsp-acpi.c
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <acpi/acpi.h>
+#include <amdblocks/acpi.h>
+#include <console/console.h>
+#include <fsp/util.h>
+#include <string.h>
+#include <types.h>
+
+struct amd_fsp_acpi_hob_info {
+ uint32_t table_size_in_bytes;
+ uint8_t total_hobs_for_table;
+ uint8_t sequence_number;
+ uint16_t reserved;
+ uint16_t hob_payload[0xffc8]; /* maximum payload size */
+} __packed;
+
+uintptr_t add_agesa_fsp_acpi_table(guid_t guid, const char *name, acpi_rsdp_t *rsdp,
+ uintptr_t current)
+{
+ const struct amd_fsp_acpi_hob_info *data;
+ void *table = (void *)current;
+ size_t hob_size;
+
+ data = fsp_find_extension_hob_by_guid(guid.b, &hob_size);
+ if (!data) {
+ printk(BIOS_ERR, "AGESA %s ACPI table was not found.\n", name);
+ return current;
+ }
+
+ printk(BIOS_INFO, "ACPI: * %s (AGESA).\n", name);
+
+ memcpy(table, data->hob_payload, data->table_size_in_bytes);
+
+ current += data->table_size_in_bytes;
+ acpi_add_table(rsdp, table);
+ current = acpi_align_current(current);
+
+ return current;
+}