From patchwork Fri Jul 20 18:09:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: acpi: acpidump + acpi headers: Add basic dump of RASF X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 172319 Message-Id: <1342807758-13022-1-git-send-email-colin.king@canonical.com> To: fwts-devel@lists.ubuntu.com Date: Fri, 20 Jul 2012 11:09:18 -0700 From: Colin King List-Id: Firmware Test Suite Development From: Colin Ian King ACPI 5.0 has introduced the RASF, so add some simple acpidump support for the RASF. This will be expanded once we're sure of the RASF PCC sub channel identifier records (and we have some real world examples to check this works). Signed-off-by: Colin Ian King Acked-by: Keng-Yu Lin Acked-by: Ivan Hu --- src/acpi/acpidump/acpidump.c | 23 +++++++++++++++++++++++ src/lib/include/fwts_acpi.h | 5 +++++ 2 files changed, 28 insertions(+) diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c index ef7c79d..9b65703 100644 --- a/src/acpi/acpidump/acpidump.c +++ b/src/acpi/acpidump/acpidump.c @@ -1571,6 +1571,28 @@ static void acpidump_fpdt(fwts_framework *fw, fwts_acpi_table_info *table) } } +/* + * acpidump_rasf() + * dump RASF, see 5.2.20 ACPI RAS FeatureTable (RASF) + * of version 5.0 ACPI spec. + */ +static void acpidump_rasf(fwts_framework *fw, fwts_acpi_table_info *table) +{ + uint8_t *data = (uint8_t *)table->data; + size_t length = table->length; + + static fwts_acpidump_field rasf_fields[] = { + FIELD_UINTS("Comm. Channel ID", fwts_acpi_table_rasf, platform_cc_id), + FIELD_END + }; + + acpi_dump_table_fields(fw, data, rasf_fields, length, length); + + /* No idea how to dump rest of table, spec is a rather poor */ + acpi_dump_raw_table(fw, table); +} + + typedef struct { char *name; void (*func)(fwts_framework *fw, fwts_acpi_table_info *table); @@ -1603,6 +1625,7 @@ static acpidump_table_vec table_vec[] = { { "MCFG", acpidump_mcfg, 1 }, { "MSCT", acpidump_msct, 1 }, { "PSDT", acpidump_amlcode, 1 }, + { "RASF", acpidump_rasf, 1 }, { "RSDT", acpidump_rsdt, 1 }, { "RSD PTR ", acpidump_rsdp, 0 }, { "SBST", acpidump_sbst, 1 }, diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h index 5e9a24a..ec085aa 100644 --- a/src/lib/include/fwts_acpi.h +++ b/src/lib/include/fwts_acpi.h @@ -638,6 +638,11 @@ typedef struct { uint32_t non_secure_PL2_timer_flags; } __attribute__ ((packed)) fwts_acpi_table_gtdt; +/* 5.2.20 ACPI RAS FeatureTable (RASF) */ +typedef struct { + uint8_t platform_cc_id[12]; +} __attribute__ ((packed)) fwts_acpi_table_rasf; + void fwts_acpi_table_get_header(fwts_acpi_table_header *hdr, uint8_t *data); #endif