From patchwork Fri Jun 29 17:14:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 168219 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 98B2DB6F5A for ; Sat, 30 Jun 2012 03:14:23 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Skelx-0002rY-Tz for incoming@patchwork.ozlabs.org; Fri, 29 Jun 2012 17:14:21 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Skelw-0002rJ-Mo for fwts-devel@lists.ubuntu.com; Fri, 29 Jun 2012 17:14:20 +0000 Received: from cpc19-craw6-2-0-cust5.croy.cable.virginmedia.com ([77.102.228.6] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Skelw-0002rd-Ic for fwts-devel@lists.ubuntu.com; Fri, 29 Jun 2012 17:14:20 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH 2/2] acpi: acpidump: Add ACPI 5.0 GTDT support. Date: Fri, 29 Jun 2012 18:14:18 +0100 Message-Id: <1340990059-30259-3-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1340990059-30259-1-git-send-email-colin.king@canonical.com> References: <1340990059-30259-1-git-send-email-colin.king@canonical.com> X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: fwts-devel-bounces@lists.ubuntu.com Errors-To: fwts-devel-bounces@lists.ubuntu.com From: Colin Ian King Adding support to ACPI 5.0 Generic Timer Description Table (GTDT) Signed-off-by: Colin Ian King Acked-by: Alex Hung Acked-by: Keng-Yu Lin --- src/acpi/acpidump/acpidump.c | 28 ++++++++++++++++++++++++++++ src/lib/include/fwts_acpi.h | 14 ++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c index 9fc5204..2768563 100644 --- a/src/acpi/acpidump/acpidump.c +++ b/src/acpi/acpidump/acpidump.c @@ -1460,6 +1460,33 @@ static void acpidump_bgrt(fwts_framework *fw, fwts_acpi_table_info *table) acpi_dump_table_fields(fw, data, bgrt_fields, length, length); } +/* + * acpidump_gtdt() + * dump GTDT, see 5.2.24 Generic Timer Description Table (GTDT) + * of version 5.0 ACPI spec. + */ +static void acpidump_gtdt(fwts_framework *fw, fwts_acpi_table_info *table) +{ + uint8_t *data = (uint8_t *)table->data; + size_t length = table->length; + + static fwts_acpidump_field gtdt_fields[] = { + FIELD_UINT("Physical Address", fwts_acpi_table_gtdt, phys_addr), + FIELD_UINT("Global Flags", fwts_acpi_table_gtdt, global_flags), + FIELD_UINT("Secure PL1 Timer GSIV", fwts_acpi_table_gtdt, secure_PL1_timer_GSIV), + FIELD_UINT("Secure PL1 Timer Flags", fwts_acpi_table_gtdt, secure_PL1_timer_flags), + FIELD_UINT("Non-Secure PL1 Timer GSIV", fwts_acpi_table_gtdt, non_secure_PL1_timer_GSIV), + FIELD_UINT("Non-Secure PL1 Timer Flags", fwts_acpi_table_gtdt, non_secure_PL1_timer_flags), + FIELD_UINT("Virtual Timer GSIV", fwts_acpi_table_gtdt, virtual_timer_GSIV), + FIELD_UINT("Virtual Timer flags", fwts_acpi_table_gtdt, virtual_timer_flags), + FIELD_UINT("Non-Secure PL2 Timer GSIV", fwts_acpi_table_gtdt, non_secure_PL2_timer_GSIV), + FIELD_UINT("Non-Secure PL2 Timer Flags", fwts_acpi_table_gtdt, non_secure_PL2_timer_flags), + FIELD_END + }; + + acpi_dump_table_fields(fw, data, gtdt_fields, length, length); +} + typedef struct { char *name; void (*func)(fwts_framework *fw, fwts_acpi_table_info *table); @@ -1485,6 +1512,7 @@ static acpidump_table_vec table_vec[] = { { "ERST", acpidump_erst, 1 }, { "FACP", acpidump_fadt, 1 }, { "FACS", acpidump_facs, 0 }, + { "GTDT", acpidump_gtdt, 1 }, { "HEST", acpidump_hest, 1 }, { "HPET", acpidump_hpet, 1 }, { "MCFG", acpidump_mcfg, 1 }, diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h index 29a506d..bea2982 100644 --- a/src/lib/include/fwts_acpi.h +++ b/src/lib/include/fwts_acpi.h @@ -601,6 +601,20 @@ typedef struct { uint32_t image_offset_t; } __attribute__ ((packed)) fwts_acpi_table_bgrt; +/* 5.2.24 Generic Timer Description Table (GTDT) ACPI 5.0 Spec */ +typedef struct { + uint64_t phys_addr; + uint32_t global_flags; + uint32_t secure_PL1_timer_GSIV; + uint32_t secure_PL1_timer_flags; + uint32_t non_secure_PL1_timer_GSIV; + uint32_t non_secure_PL1_timer_flags; + uint32_t virtual_timer_GSIV; + uint32_t virtual_timer_flags; + uint32_t non_secure_PL2_timer_GSIV; + uint32_t non_secure_PL2_timer_flags; +} __attribute__ ((packed)) fwts_acpi_table_gtdt; + void fwts_acpi_table_get_header(fwts_acpi_table_header *hdr, uint8_t *data); #endif