aboutsummaryrefslogtreecommitdiff
path: root/lib/acpi
diff options
context:
space:
mode:
authorSimon Glass2020-04-26 09:19:46 -0600
committerBin Meng2020-04-30 17:16:12 +0800
commit93f7f82782cb3d2bd55215ce984887efc6cddfed (patch)
tree6dede3cc6b74da87d67b67cffd6675de6bf03b15 /lib/acpi
parentfa04cef6443eab008b99f6439ec8a3b9939253b4 (diff)
acpi: Add a method to write tables for a device
A device may want to write out ACPI tables to describe itself to Linux. Add a method to permit this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
Diffstat (limited to 'lib/acpi')
-rw-r--r--lib/acpi/acpi_table.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/acpi/acpi_table.c b/lib/acpi/acpi_table.c
index 4633dcb9488..372f19b16d5 100644
--- a/lib/acpi/acpi_table.c
+++ b/lib/acpi/acpi_table.c
@@ -9,9 +9,8 @@
#include <acpi/acpi_table.h>
#include <dm.h>
#include <cpu.h>
+#include <version.h>
-/* Temporary change to ensure bisectability */
-#ifndef CONFIG_SANDBOX
int acpi_create_dmar(struct acpi_dmar *dmar, enum dmar_flags flags)
{
struct acpi_table_header *header = &dmar->header;
@@ -37,7 +36,6 @@ int acpi_create_dmar(struct acpi_dmar *dmar, enum dmar_flags flags)
return 0;
}
-#endif
int acpi_get_table_revision(enum acpi_tables table)
{
@@ -91,3 +89,12 @@ int acpi_get_table_revision(enum acpi_tables table)
return -EINVAL;
}
}
+
+void acpi_fill_header(struct acpi_table_header *header, char *signature)
+{
+ memcpy(header->signature, signature, 4);
+ memcpy(header->oem_id, OEM_ID, 6);
+ memcpy(header->oem_table_id, OEM_TABLE_ID, 8);
+ header->oem_revision = U_BOOT_BUILD_DATE;
+ memcpy(header->aslc_id, ASLC_ID, 4);
+}