* Copyright 2019 Google LLC
*/
-#include <common.h>
#include <command.h>
#include <display_options.h>
+#include <log.h>
#include <mapmem.h>
#include <acpi/acpi_table.h>
#include <asm/acpi_table.h>
#include <asm/global_data.h>
+#include <linux/errno.h>
#include <dm/acpi.h>
DECLARE_GLOBAL_DATA_PTR;
if (has_hdr) {
printf(" v%02d %.6s %.8s %x %.4s %x\n", hdr->revision,
hdr->oem_id, hdr->oem_table_id, hdr->oem_revision,
- hdr->aslc_id, hdr->aslc_revision);
+ hdr->creator_id, hdr->creator_revision);
} else {
printf("\n");
}
if (!hdr)
return -ENOENT;
printf("%.*s @ %16lx\n", ACPI_NAME_LEN, hdr->signature,
- (ulong)map_to_sysmem(hdr));
+ (ulong)nomap_to_sysmem(hdr));
print_buffer(0, hdr, 1, hdr->length, 0);
return 0;
static void list_fadt(struct acpi_fadt *fadt)
{
- if (fadt->dsdt)
- dump_hdr(map_sysmem(fadt->dsdt, 0));
- if (fadt->firmware_ctrl)
- dump_hdr(map_sysmem(fadt->firmware_ctrl, 0));
+ if (fadt->header.revision >= 3 && fadt->x_dsdt)
+ dump_hdr(nomap_sysmem(fadt->x_dsdt, 0));
+ else if (fadt->dsdt)
+ dump_hdr(nomap_sysmem(fadt->dsdt, 0));
+ if (!IS_ENABLED(CONFIG_X86) &&
+ !(fadt->flags & ACPI_FADT_HW_REDUCED_ACPI))
+ log_err("FADT not ACPI-hardware-reduced-compliant\n");
+ if (fadt->header.revision >= 3 && fadt->x_firmware_ctrl)
+ dump_hdr(nomap_sysmem(fadt->x_firmware_ctrl, 0));
+ else if (fadt->firmware_ctrl)
+ dump_hdr(nomap_sysmem(fadt->firmware_ctrl, 0));
}
static void list_rsdt(struct acpi_rsdp *rsdp)
struct acpi_xsdt *xsdt;
if (rsdp->rsdt_address) {
- rsdt = map_sysmem(rsdp->rsdt_address, 0);
+ rsdt = nomap_sysmem(rsdp->rsdt_address, 0);
dump_hdr(&rsdt->header);
}
if (rsdp->xsdt_address) {
- xsdt = map_sysmem(rsdp->xsdt_address, 0);
+ xsdt = nomap_sysmem(rsdp->xsdt_address, 0);
dump_hdr(&xsdt->header);
len = xsdt->header.length - sizeof(xsdt->header);
count = len / sizeof(u64);
entry = rsdt->entry[i];
if (!entry)
break;
- hdr = map_sysmem(entry, 0);
+ hdr = nomap_sysmem(entry, 0);
dump_hdr(hdr);
if (!memcmp(hdr->signature, "FACP", ACPI_NAME_LEN))
list_fadt((struct acpi_fadt *)hdr);