drivers/usb/acpi: Don't add GPIOs to _CRS for Intel Bluetooth
[coreboot2.git] / src / soc / amd / common / fsp / fsp-acpi.c
blobd30456ddf49c48e5e28f65fbd31b073c706bd17a
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <acpi/acpi.h>
4 #include <amdblocks/acpi.h>
5 #include <console/console.h>
6 #include <fsp/util.h>
7 #include <FspGuids.h>
8 #include <string.h>
9 #include <types.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;
15 uint16_t reserved;
16 uint16_t hob_payload[0xffc8]; /* maximum payload size */
17 } __packed;
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;
24 size_t hob_size;
26 data = fsp_find_extension_hob_by_guid(guid.b, &hob_size);
27 if (data == NULL) {
28 printk(BIOS_ERR, "AGESA %s ACPI table was not found.\n", name);
29 return current;
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 "
34 "size.\n", name);
35 return current;
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);
46 return 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);
55 return current;