summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-05-04 16:54:57 -0600
committerBin Meng <bmeng@tinylab.org>2023-05-11 10:25:29 +0800
commit0992a90daa80a17f9e7e33a56fd3f9660ee84c97 (patch)
tree0ab7deffbdd3c6b5c81eec013b6d0de47d8b5b00 /cmd
parentd8062e950367fab0f219a889e8f2fbfade90108c (diff)
downloadu-boot-0992a90daa80a17f9e7e33a56fd3f9660ee84c97.tar.gz
acpi: Create a new Kconfig for ACPI
We have several Kconfig options for ACPI, but all relate to specific functions, such as generating tables and AML code. Add a new option which controls including basic ACPI library code, including the lib/acpi directory. This will allow us to add functions which are available even if table generation is not supported. Adjust the command to avoid a build error when ACPIGEN is not enabled. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/Kconfig2
-rw-r--r--cmd/acpi.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 65957da7f5..87291e2d84 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -109,7 +109,7 @@ menu "Info commands"
config CMD_ACPI
bool "acpi"
- depends on ACPIGEN
+ depends on ACPI
default y
help
List and dump ACPI tables. ACPI (Advanced Configuration and Power
diff --git a/cmd/acpi.c b/cmd/acpi.c
index d0fc062ef8..991b5235e2 100644
--- a/cmd/acpi.c
+++ b/cmd/acpi.c
@@ -162,6 +162,10 @@ static int do_acpi_items(struct cmd_tbl *cmdtp, int flag, int argc,
bool dump_contents;
dump_contents = argc >= 2 && !strcmp("-d", argv[1]);
+ if (!IS_ENABLED(CONFIG_ACPIGEN)) {
+ printf("Not supported (enable ACPIGEN)\n");
+ return CMD_RET_FAILURE;
+ }
acpi_dump_items(dump_contents ? ACPI_DUMP_CONTENTS : ACPI_DUMP_LIST);
return 0;