From patchwork Wed Jul 22 13:17:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 498529 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 8495D1402C3; Wed, 22 Jul 2015 23:17:25 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1ZHtti-0005co-A6; Wed, 22 Jul 2015 13:17:22 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1ZHttT-0005bh-Cu for fwts-devel@lists.ubuntu.com; Wed, 22 Jul 2015 13:17:07 +0000 Received: from 123-204-121-110.adsl.dynamic.seed.net.tw ([123.204.121.110] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1ZHttS-0003k0-EH; Wed, 22 Jul 2015 13:17:07 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH][v2] acpi: update MADT GICC Structure and related tests Date: Wed, 22 Jul 2015 21:17:01 +0800 Message-Id: <1437571021-30467-1-git-send-email-alex.hung@canonical.com> X-Mailer: git-send-email 2.1.4 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: fwts-devel-bounces@lists.ubuntu.com Signed-off-by: Alex Hung Acked-by: Colin Ian King Acked-by: Ivan Hu --- src/acpi/acpidump/acpidump.c | 58 ++++++++++++++++++++++++++++++++------------ src/acpi/madt/madt.c | 12 +++++++++ src/lib/include/fwts_acpi.h | 2 ++ 3 files changed, 56 insertions(+), 16 deletions(-) diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c index 9ff28cb..2bd2ce5 100644 --- a/src/acpi/acpidump/acpidump.c +++ b/src/acpi/acpidump/acpidump.c @@ -953,22 +953,48 @@ static void acpidump_madt(fwts_framework *fw, const fwts_acpi_table_info *table) } break; case FWTS_ACPI_MADT_GIC_C_CPU_INTERFACE: { - static const fwts_acpidump_field fields_madt_gic[] = { - FIELD_UINT(" Reserved", fwts_acpi_madt_gic, reserved), - FIELD_UINT(" GIC ID", fwts_acpi_madt_gic, gic_id), - FIELD_UINT(" Processor UID", fwts_acpi_madt_gic, processor_uid), - FIELD_UINT(" Flags", fwts_acpi_madt_gic, flags), - FIELD_UINT(" Parking Protocol",fwts_acpi_madt_gic, parking_protocol_version), - FIELD_UINT(" Perf. Int. GSIV", fwts_acpi_madt_gic, performance_interrupt_gsiv), - FIELD_UINT(" Parked Address", fwts_acpi_madt_gic, parked_address), - FIELD_UINT(" Phys. Base. Addr",fwts_acpi_madt_gic, physical_base_address), - FIELD_UINT(" GICV", fwts_acpi_madt_gic, gicv), - FIELD_UINT(" GICH", fwts_acpi_madt_gic, gich), - FIELD_UINT(" VGIC Interrupt", fwts_acpi_madt_gic, vgic), - FIELD_UINT(" GICR Base. Addr", fwts_acpi_madt_gic, gicr_base_address), - FIELD_UINT(" MPIDR", fwts_acpi_madt_gic, mpidr), - }; - __acpi_dump_table_fields(fw, data, fields_madt_gic, offset); + /* ACPI 5.1 */ + if (table->length == 76) { + static const fwts_acpidump_field fields_madt_gic[] = { + FIELD_UINT(" Reserved", fwts_acpi_madt_gic, reserved), + FIELD_UINT(" GIC ID", fwts_acpi_madt_gic, gic_id), + FIELD_UINT(" Processor UID", fwts_acpi_madt_gic, processor_uid), + FIELD_UINT(" Flags", fwts_acpi_madt_gic, flags), + FIELD_UINT(" Parking Protocol",fwts_acpi_madt_gic, parking_protocol_version), + FIELD_UINT(" Perf. Int. GSIV", fwts_acpi_madt_gic, performance_interrupt_gsiv), + FIELD_UINT(" Parked Address", fwts_acpi_madt_gic, parked_address), + FIELD_UINT(" Phys. Base. Addr",fwts_acpi_madt_gic, physical_base_address), + FIELD_UINT(" GICV", fwts_acpi_madt_gic, gicv), + FIELD_UINT(" GICH", fwts_acpi_madt_gic, gich), + FIELD_UINT(" VGIC Interrupt", fwts_acpi_madt_gic, vgic), + FIELD_UINT(" GICR Base. Addr", fwts_acpi_madt_gic, gicr_base_address), + FIELD_UINT(" MPIDR", fwts_acpi_madt_gic, mpidr), + }; + __acpi_dump_table_fields(fw, data, fields_madt_gic, offset); + } + + /* ACPI 6.0 */ + if (table->length == 80) { + static const fwts_acpidump_field fields_madt_gic[] = { + FIELD_UINT(" Reserved", fwts_acpi_madt_gic, reserved), + FIELD_UINT(" GIC ID", fwts_acpi_madt_gic, gic_id), + FIELD_UINT(" Processor UID", fwts_acpi_madt_gic, processor_uid), + FIELD_UINT(" Flags", fwts_acpi_madt_gic, flags), + FIELD_UINT(" Parking Protocol",fwts_acpi_madt_gic, parking_protocol_version), + FIELD_UINT(" Perf. Int. GSIV", fwts_acpi_madt_gic, performance_interrupt_gsiv), + FIELD_UINT(" Parked Address", fwts_acpi_madt_gic, parked_address), + FIELD_UINT(" Phys. Base. Addr",fwts_acpi_madt_gic, physical_base_address), + FIELD_UINT(" GICV", fwts_acpi_madt_gic, gicv), + FIELD_UINT(" GICH", fwts_acpi_madt_gic, gich), + FIELD_UINT(" VGIC Interrupt", fwts_acpi_madt_gic, vgic), + FIELD_UINT(" GICR Base. Addr", fwts_acpi_madt_gic, gicr_base_address), + FIELD_UINT(" MPIDR", fwts_acpi_madt_gic, mpidr), + FIELD_UINT(" Processor Power Efficiency Class", fwts_acpi_madt_gic, processor_power_efficiency_class), + FIELD_UINTS(" Reserved", fwts_acpi_madt_gic, reserved2), + }; + __acpi_dump_table_fields(fw, data, fields_madt_gic, offset); + } + skip = sizeof(fwts_acpi_madt_gic); } break; diff --git a/src/acpi/madt/madt.c b/src/acpi/madt/madt.c index 8afceb6..f776745 100644 --- a/src/acpi/madt/madt.c +++ b/src/acpi/madt/madt.c @@ -235,6 +235,18 @@ static int madt_test1(fwts_framework *fw) gic->flags & 0xfffffffc); } skip = sizeof(fwts_acpi_madt_gic); + + // new in ACPI 6.0 + if (table->length == 80) { + uint32_t gic_reserve2 = gic->reserved2[0] + (gic->reserved2[1] << 4) + (gic->reserved2[2] << 8); + if (gic_reserve2) { + passed = false; + fwts_failed(fw, LOG_LEVEL_LOW, + "MADTGICCReserved2NonZero", + "MADT GICC Structure second reserved field should be zero, " + "instead got 0x%" PRIx32 ".", gic_reserve2); + } + } } break; case FWTS_ACPI_MADT_GIC_D_GOC_DISTRIBUTOR: { diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h index e78af1c..37cc879 100644 --- a/src/lib/include/fwts_acpi.h +++ b/src/lib/include/fwts_acpi.h @@ -472,6 +472,8 @@ typedef struct { uint32_t vgic; uint64_t gicr_base_address; uint64_t mpidr; + uint8_t processor_power_efficiency_class; + uint8_t reserved2[3]; } __attribute__ ((packed)) fwts_acpi_madt_gic; /* New in ACPI 5.0, GICD, section 5.2.12.15 */