aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-07-07 13:12:03 -0600
committerBin Meng <bmeng.cn@gmail.com>2020-07-17 14:32:24 +0800
commitb5183172f031603c5d861c34389f88a3c493cfd7 (patch)
treebfb50e7104eaf813cb457d757d5658346f52f4e0 /drivers
parent740630ba73768667a2f87326f2a237d373a5093d (diff)
downloadu-boot-b5183172f031603c5d861c34389f88a3c493cfd7.zip
u-boot-b5183172f031603c5d861c34389f88a3c493cfd7.tar.gz
u-boot-b5183172f031603c5d861c34389f88a3c493cfd7.tar.bz2
acpi: Add support for SSDT generation
Some devices need to generate code for the Secondary System Descriptor Table (SSDT). Add a method to handle this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/core/acpi.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/core/acpi.c b/drivers/core/acpi.c
index 8ae6157..4497b5c 100644
--- a/drivers/core/acpi.c
+++ b/drivers/core/acpi.c
@@ -18,6 +18,7 @@
/* Type of method to call */
enum method_t {
METHOD_WRITE_TABLES,
+ METHOD_FILL_SSDT,
};
/* Prototype for all methods */
@@ -51,6 +52,8 @@ acpi_method acpi_get_method(struct udevice *dev, enum method_t method)
switch (method) {
case METHOD_WRITE_TABLES:
return aops->write_tables;
+ case METHOD_FILL_SSDT:
+ return aops->fill_ssdt;
}
}
@@ -84,6 +87,17 @@ int acpi_recurse_method(struct acpi_ctx *ctx, struct udevice *parent,
return 0;
}
+int acpi_fill_ssdt(struct acpi_ctx *ctx)
+{
+ int ret;
+
+ log_debug("Writing SSDT tables\n");
+ ret = acpi_recurse_method(ctx, dm_root(), METHOD_FILL_SSDT);
+ log_debug("Writing SSDT finished, err=%d\n", ret);
+
+ return ret;
+}
+
int acpi_write_dev_tables(struct acpi_ctx *ctx)
{
int ret;