aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/Kconfig2
-rw-r--r--cmd/acpi.c44
-rw-r--r--cmd/x86/cbsysinfo.c9
-rw-r--r--cmd/x86/mtrr.c3
4 files changed, 17 insertions, 41 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 65957da..87291e2 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 d0fc062..e70913e 100644
--- a/cmd/acpi.c
+++ b/cmd/acpi.c
@@ -36,49 +36,11 @@ static void dump_hdr(struct acpi_table_header *hdr)
}
}
-/**
- * find_table() - Look up an ACPI table
- *
- * @sig: Signature of table (4 characters, upper case)
- * Return: pointer to table header, or NULL if not found
- */
-struct acpi_table_header *find_table(const char *sig)
-{
- struct acpi_rsdp *rsdp;
- struct acpi_rsdt *rsdt;
- int len, i, count;
-
- rsdp = map_sysmem(gd_acpi_start(), 0);
- if (!rsdp)
- return NULL;
- rsdt = map_sysmem(rsdp->rsdt_address, 0);
- len = rsdt->header.length - sizeof(rsdt->header);
- count = len / sizeof(u32);
- for (i = 0; i < count; i++) {
- struct acpi_table_header *hdr;
-
- hdr = map_sysmem(rsdt->entry[i], 0);
- if (!memcmp(hdr->signature, sig, ACPI_NAME_LEN))
- return hdr;
- if (!memcmp(hdr->signature, "FACP", ACPI_NAME_LEN)) {
- struct acpi_fadt *fadt = (struct acpi_fadt *)hdr;
-
- if (!memcmp(sig, "DSDT", ACPI_NAME_LEN) && fadt->dsdt)
- return map_sysmem(fadt->dsdt, 0);
- if (!memcmp(sig, "FACS", ACPI_NAME_LEN) &&
- fadt->firmware_ctrl)
- return map_sysmem(fadt->firmware_ctrl, 0);
- }
- }
-
- return NULL;
-}
-
static int dump_table_name(const char *sig)
{
struct acpi_table_header *hdr;
- hdr = find_table(sig);
+ hdr = acpi_find_table(sig);
if (!hdr)
return -ENOENT;
printf("%.*s @ %08lx\n", ACPI_NAME_LEN, hdr->signature,
@@ -162,6 +124,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;
diff --git a/cmd/x86/cbsysinfo.c b/cmd/x86/cbsysinfo.c
index 34fdaf5..2b8d3b0 100644
--- a/cmd/x86/cbsysinfo.c
+++ b/cmd/x86/cbsysinfo.c
@@ -363,6 +363,15 @@ static void show_table(struct sysinfo_t *info, bool verbose)
print_hex("MTC size", info->mtc_size);
print_ptr("Chrome OS VPD", info->chromeos_vpd);
+ print_ptr("RSDP", info->rsdp);
+ printf("%-12s: ", "Unimpl.");
+ if (info->unimpl_count) {
+ for (i = 0; i < info->unimpl_count; i++)
+ printf("%02x ", info->unimpl[i]);
+ printf("\n");
+ } else {
+ printf("(none)\n");
+ }
}
static int do_cbsysinfo(struct cmd_tbl *cmdtp, int flag, int argc,
diff --git a/cmd/x86/mtrr.c b/cmd/x86/mtrr.c
index b213a94..b1691d8 100644
--- a/cmd/x86/mtrr.c
+++ b/cmd/x86/mtrr.c
@@ -148,7 +148,8 @@ static int do_mtrr(struct cmd_tbl *cmdtp, int flag, int argc,
printf("CPU %d:\n", i);
ret = do_mtrr_list(reg_count, i);
if (ret) {
- printf("Failed to read CPU %d (err=%d)\n", i,
+ printf("Failed to read CPU %s (err=%d)\n",
+ i < MP_SELECT_ALL ? simple_itoa(i) : "",
ret);
return CMD_RET_FAILURE;
}