1 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <amdblocks/acpi.h>
5 #include <console/console.h>
11 struct amd_fsp_acpi_hob_info
{
12 uint32_t table_size_in_bytes
;
13 uint8_t total_hobs_for_table
;
14 uint8_t sequence_number
;
16 uint16_t hob_payload
[0xffc8]; /* maximum payload size */
19 static unsigned long add_agesa_fsp_acpi_table(guid_t guid
, const char *name
, acpi_rsdp_t
*rsdp
,
20 unsigned long current
)
22 const struct amd_fsp_acpi_hob_info
*data
;
23 void *table
= (void *)current
;
26 data
= fsp_find_extension_hob_by_guid(guid
.b
, &hob_size
);
28 printk(BIOS_ERR
, "AGESA %s ACPI table was not found.\n", name
);
32 if (data
->table_size_in_bytes
> sizeof(data
->hob_payload
)) {
33 printk(BIOS_ERR
, "AGESA %s ACPI table size larger than maximum HOB payload "
38 printk(BIOS_INFO
, "ACPI: * %s (AGESA).\n", name
);
40 memcpy(table
, data
->hob_payload
, data
->table_size_in_bytes
);
42 current
+= data
->table_size_in_bytes
;
43 acpi_add_table(rsdp
, table
);
44 current
= acpi_align_current(current
);
49 unsigned long acpi_add_fsp_tables(unsigned long current
, acpi_rsdp_t
*rsdp
)
51 /* add ALIB SSDT from HOB */
52 current
= acpi_align_current(current
);
53 current
= add_agesa_fsp_acpi_table(AMD_FSP_ACPI_ALIB_HOB_GUID
, "ALIB", rsdp
, current
);