Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -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> |
Elyes Haouas | 898176a | 2022-10-14 10:01:05 +0200 | [diff] [blame] | 7 | #include <commonlib/bsd/helpers.h> |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 8 | #include <device/device.h> |
| 9 | #include <FspGuids.h> |
| 10 | #include <soc/acpi.h> |
| 11 | #include <types.h> |
| 12 | |
| 13 | uintptr_t agesa_write_acpi_tables(const struct device *device, uintptr_t current, |
| 14 | acpi_rsdp_t *rsdp) |
| 15 | { |
| 16 | acpi_ivrs_t *ivrs; |
| 17 | |
Felix Held | 5c56b16 | 2023-01-17 02:52:03 +0100 | [diff] [blame] | 18 | /* TODO: look into adding CRAT */ |
| 19 | |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 20 | /* add ALIB SSDT from HOB */ |
Felix Held | 192945e | 2023-01-17 02:50:06 +0100 | [diff] [blame] | 21 | current = acpi_align_current(current); |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 22 | current = add_agesa_fsp_acpi_table(AMD_FSP_ACPI_ALIB_HOB_GUID, "ALIB", rsdp, current); |
| 23 | |
| 24 | /* IVRS */ |
Felix Held | 192945e | 2023-01-17 02:50:06 +0100 | [diff] [blame] | 25 | current = acpi_align_current(current); |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 26 | ivrs = (acpi_ivrs_t *)current; |
| 27 | acpi_create_ivrs(ivrs, acpi_fill_ivrs); |
| 28 | current += ivrs->header.length; |
| 29 | acpi_add_table(rsdp, ivrs); |
| 30 | |
| 31 | return current; |
| 32 | } |