Martin Roth | f95a11e | 2022-10-21 16:43:08 -0600 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | /* TODO: Make common? */ |
| 4 | |
| 5 | #include <acpi/acpi.h> |
| 6 | #include <amdblocks/acpi.h> |
| 7 | #include <device/device.h> |
| 8 | #include <FspGuids.h> |
| 9 | #include <soc/acpi.h> |
| 10 | #include <types.h> |
| 11 | |
| 12 | uintptr_t agesa_write_acpi_tables(const struct device *device, uintptr_t current, |
| 13 | acpi_rsdp_t *rsdp) |
| 14 | { |
| 15 | acpi_ivrs_t *ivrs; |
| 16 | |
Felix Held | 5c56b16 | 2023-01-17 02:52:03 +0100 | [diff] [blame] | 17 | /* TODO: look into adding CRAT */ |
| 18 | |
Martin Roth | f95a11e | 2022-10-21 16:43:08 -0600 | [diff] [blame] | 19 | /* add ALIB SSDT from HOB */ |
Felix Held | 4235fb6 | 2023-01-17 02:51:11 +0100 | [diff] [blame] | 20 | current = acpi_align_current(current); |
Martin Roth | f95a11e | 2022-10-21 16:43:08 -0600 | [diff] [blame] | 21 | current = add_agesa_fsp_acpi_table(AMD_FSP_ACPI_ALIB_HOB_GUID, "ALIB", rsdp, current); |
| 22 | |
| 23 | /* IVRS */ |
Felix Held | 4235fb6 | 2023-01-17 02:51:11 +0100 | [diff] [blame] | 24 | current = acpi_align_current(current); |
Martin Roth | f95a11e | 2022-10-21 16:43:08 -0600 | [diff] [blame] | 25 | ivrs = (acpi_ivrs_t *)current; |
| 26 | acpi_create_ivrs(ivrs, acpi_fill_ivrs); |
| 27 | current += ivrs->header.length; |
| 28 | acpi_add_table(rsdp, ivrs); |
| 29 | |
| 30 | return current; |
| 31 | } |