diff options
author | Simon Glass <sjg@chromium.org> | 2020-07-07 13:12:12 -0600 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2020-07-17 14:32:24 +0800 |
commit | a4f8208919a4458ebe93d46d43a7cb0a13f7a0d8 (patch) | |
tree | 5dfc4356dcc6ead5dcb7f819965216377207c274 /drivers | |
parent | fefac0b0643b14e72c356cf05dabcbe7512c4709 (diff) |
acpi: Add an acpi command to list/dump generated ACPI items
Add a command that shows the individual blocks of data generated by each
device, effectively splitting the full table into its component parts.
This can be helpful for debugging.
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.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/core/acpi.c b/drivers/core/acpi.c index 076fb4f1b4..b566f4f186 100644 --- a/drivers/core/acpi.c +++ b/drivers/core/acpi.c @@ -119,6 +119,22 @@ static int acpi_add_item(struct acpi_ctx *ctx, struct udevice *dev, return 0; } +void acpi_dump_items(enum acpi_dump_option option) +{ + int i; + + for (i = 0; i < item_count; i++) { + struct acpi_item *item = &acpi_item[i]; + + printf("dev '%s', type %d, size %x\n", item->dev->name, + item->type, item->size); + if (option == ACPI_DUMP_CONTENTS) { + print_buffer(0, item->buf, 1, item->size, 0); + printf("\n"); + } + } +} + static struct acpi_item *find_acpi_item(const char *devname) { int i; |