Edward O'Callaghan (eocallaghan@alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5552
-gerrit
commit 275cd426d736505932a2f156b54dbf775cb965e8 Author: Edward O'Callaghan eocallaghan@alterapraxis.com Date: Sun Apr 20 04:19:58 2014 +1000
arch/x86: Provide rudimentary ACPI debugging facilities
NOTFORMERGE
Change-Id: I90b153698fefeb28c0ed0693c18d91d85fc3717b Signed-off-by: Edward O'Callaghan eocallaghan@alterapraxis.com --- src/arch/x86/boot/acpi.c | 60 ++++++++++++++++++++++++++++++++++++++++ src/arch/x86/include/arch/acpi.h | 15 ++++++++++ 2 files changed, 75 insertions(+)
diff --git a/src/arch/x86/boot/acpi.c b/src/arch/x86/boot/acpi.c index 0e09ec5..954acb8 100644 --- a/src/arch/x86/boot/acpi.c +++ b/src/arch/x86/boot/acpi.c @@ -42,6 +42,66 @@ #define CONFIG_HPET_MIN_TICKS 0x1000 #endif
+#include <lib.h> /* used for hexdump for CONFIG_DEBUG_ACPI */ + +/* + * Dump ACPI tables + */ +void acpi_dump_tables(acpi_debug_t * t) +{ + if (t == NULL) return; + + if (t->rsdp != NULL) { + printk(BIOS_DEBUG, "rsdp\n"); + hexdump(t->rsdp, sizeof(acpi_rsdp_t)); + } + + if (t->rsdt != NULL) { + printk(BIOS_DEBUG, "rsdt\n"); + hexdump(t->rsdt, sizeof(acpi_rsdt_t)); + } + + if (t->madt != NULL) { + printk(BIOS_DEBUG, "madt\n"); + hexdump(t->madt, t->madt->header.length); + } + + if (t->srat != NULL) { + printk(BIOS_DEBUG, "srat\n"); + hexdump(t->srat, t->srat->header.length); + } + + if (t->slit != NULL) { + printk(BIOS_DEBUG, "slit\n"); + hexdump(t->slit, t->slit->header.length); + } + + if (t->alib != NULL) { + printk(BIOS_DEBUG, "alib\n"); + hexdump(t->ssdt, t->alib->length); + } + + if (t->ssdt != NULL) { + printk(BIOS_DEBUG, "ssdt\n"); + hexdump(t->ssdt, t->ssdt->length); + } + + if (t->ssdt2 != NULL) { + printk(BIOS_DEBUG, "ssdt2\n"); + hexdump(t->ssdt2, t->ssdt2->length); + } + + if (t->fadt != NULL) { + printk(BIOS_DEBUG, "fadt\n"); + hexdump(t->fadt, t->fadt->header.length); + } + + if (t->hest != NULL) { + printk(BIOS_DEBUG, "hest\n"); + hexdump(t->hest, t->hest->header.length); + } +} + u8 acpi_checksum(u8 *table, u32 length) { u8 ret = 0; diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h index d73c046..31547c7 100644 --- a/src/arch/x86/include/arch/acpi.h +++ b/src/arch/x86/include/arch/acpi.h @@ -498,6 +498,21 @@ void acpi_create_fadt(acpi_fadt_t *fadt,acpi_facs_t *facs, void *dsdt); void update_ssdt(void *ssdt); void update_ssdtx(void *ssdtx, int i);
+typedef struct { + acpi_rsdp_t *rsdp; + acpi_rsdt_t *rsdt; + acpi_madt_t *madt; + acpi_srat_t *srat; + acpi_slit_t *slit; + acpi_header_t *alib; + acpi_header_t *ssdt; + acpi_header_t *ssdt2; + acpi_fadt_t *fadt; + acpi_hest_t *hest; +} acpi_debug_t; + +void acpi_dump_tables(acpi_debug_t * t); + /* These can be used by the target port. */ u8 acpi_checksum(u8 *table, u32 length);