diff options
author | Simon Glass <sjg@chromium.org> | 2020-07-07 13:12:08 -0600 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2020-07-17 14:32:24 +0800 |
commit | 01694589af589212d6f2a6241821896ef9e334d3 (patch) | |
tree | 54085627056cd2bc0c8e89adcf7361af5bd80870 /include/dm | |
parent | 351fef5c579b4cabbd2976e61d1f8a9ef7c06b53 (diff) | |
download | u-boot-01694589af589212d6f2a6241821896ef9e334d3.tar.gz |
acpi: Add support for DSDT generation
Some devices need to inject extra code into the Differentiated System
Descriptor Table (DSDT). 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>
[bmeng: correct one typo in inject_dsdt() comments]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'include/dm')
-rw-r--r-- | include/dm/acpi.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/dm/acpi.h b/include/dm/acpi.h index e956e49680..fceb1ae95c 100644 --- a/include/dm/acpi.h +++ b/include/dm/acpi.h @@ -82,11 +82,31 @@ struct acpi_ops { * whatever ACPI code is needed by this device. It will end up in the * SSDT table. * + * Note that this is called 'fill' because the entire contents of the + * SSDT is build by calling this method on all devices. + * * @dev: Device to write * @ctx: ACPI context to use * @return 0 if OK, -ve on error */ int (*fill_ssdt)(const struct udevice *dev, struct acpi_ctx *ctx); + + /** + * inject_dsdt() - Generate DSDT code for a device + * + * This is called to create the DSDT code. The method should write out + * whatever ACPI code is needed by this device. It will end up in the + * DSDT table. + * + * Note that this is called 'inject' because the output of calling this + * method on all devices is injected into the DSDT, the bulk of which + * is written in .asl files for the board. + * + * @dev: Device to write + * @ctx: ACPI context to use + * @return 0 if OK, -ve on error + */ + int (*inject_dsdt)(const struct udevice *dev, struct acpi_ctx *ctx); }; #define device_get_acpi_ops(dev) ((dev)->driver->acpi_ops) @@ -141,6 +161,16 @@ int acpi_write_dev_tables(struct acpi_ctx *ctx); */ int acpi_fill_ssdt(struct acpi_ctx *ctx); +/** + * acpi_inject_dsdt() - Generate ACPI tables for DSDT + * + * This is called to create the DSDT code for all devices. + * + * @ctx: ACPI context to use + * @return 0 if OK, -ve on error + */ +int acpi_inject_dsdt(struct acpi_ctx *ctx); + #endif /* __ACPI__ */ #endif |