aboutsummaryrefslogtreecommitdiff
path: root/src/arch/x86/acpi.c
diff options
context:
space:
mode:
authorPatrick Rudolph <siro@das-labor.org>2016-03-31 20:04:23 +0200
committerMartin Roth <martinroth@google.com>2017-02-04 23:01:37 +0100
commita5c2ac6256d0dae112b24c422d1270919acb6321 (patch)
tree4f887ff68858467e2bb03d316e85b696d758e8d9 /src/arch/x86/acpi.c
parent8a06cc7ec8094325b9f710870f646d2a5cb9eb22 (diff)
x86/acpi: Add VFCT table
Add VFCT table to provide PCI Optiom Rom for AMD graphic devices. Useful for GNU Linux payloads and embedded dual GPU systems. Tested on Lenovo T500 with AMD RV635 as secondary gpu. Original Change-Id: I3b4a587c71e7165338cad3aca77ed5afa085a63c Signed-off-by: Patrick Rudolph <siro@das-labor.org> Change-Id: I4dc00005270240c048272b2e4f52ae46ba1c9422 Reviewed-on: https://review.coreboot.org/18192 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/arch/x86/acpi.c')
-rw-r--r--src/arch/x86/acpi.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/arch/x86/acpi.c b/src/arch/x86/acpi.c
index 53c41359d6..703bfa1e9b 100644
--- a/src/arch/x86/acpi.c
+++ b/src/arch/x86/acpi.c
@@ -589,6 +589,31 @@ void acpi_create_hpet(acpi_hpet_t *hpet)
header->checksum = acpi_checksum((void *)hpet, sizeof(acpi_hpet_t));
}
+void acpi_create_vfct(struct device *device,
+ struct acpi_vfct *vfct,
+ unsigned long (*acpi_fill_vfct)(struct device *device, struct acpi_vfct *vfct_struct, unsigned long current))
+{
+ acpi_header_t *header = &(vfct->header);
+ unsigned long current = (unsigned long)vfct + sizeof(struct acpi_vfct);
+
+ memset((void *)vfct, 0, sizeof(struct acpi_vfct));
+
+ /* Fill out header fields. */
+ memcpy(header->signature, "VFCT", 4);
+ memcpy(header->oem_id, OEM_ID, 6);
+ memcpy(header->oem_table_id, ACPI_TABLE_CREATOR, 8);
+ memcpy(header->asl_compiler_id, ASLC, 4);
+
+ header->length = sizeof(struct acpi_vfct);
+ header->revision = 1; /* ACPI 1.0: N/A, ACPI 2.0/3.0/4.0: 1 */
+
+ current = acpi_fill_vfct(device, vfct, current);
+
+ /* (Re)calculate length and checksum. */
+ header->length = current - (unsigned long)vfct;
+ header->checksum = acpi_checksum((void *)vfct, header->length);
+}
+
void acpi_create_ivrs(acpi_ivrs_t *ivrs,
unsigned long (*acpi_fill_ivrs)(acpi_ivrs_t* ivrs_struct, unsigned long current))
{