From patchwork Mon Dec 11 10:17:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakar Arora X-Patchwork-Id: 846881 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3ywJmP35dBz9s7f; Mon, 11 Dec 2017 21:17:25 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1eOL9I-0007qZ-2h; Mon, 11 Dec 2017 10:17:24 +0000 Received: from foss.arm.com ([217.140.101.70]) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1eOL9G-0007qI-Dr for fwts-devel@lists.ubuntu.com; Mon, 11 Dec 2017 10:17:22 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8F0BD1529; Mon, 11 Dec 2017 02:17:21 -0800 (PST) Received: from u201365.usa.Arm.com (a75592.asiapac.arm.com [10.162.22.99]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 64CB53F24A; Mon, 11 Dec 2017 02:17:20 -0800 (PST) From: Sakar Arora To: fwts-devel@lists.ubuntu.com Subject: [PATCH] acpi: sbbr: relax a few test pass conditions Date: Mon, 11 Dec 2017 15:47:14 +0530 Message-Id: <1512987434-9390-1-git-send-email-sakar.arora@arm.com> X-Mailer: git-send-email 2.7.4 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: prasanth.pulla@arm.com, Charles.Garcia-Tobin@arm.com MIME-Version: 1.0 Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" DBG2: Allow PL011 UART SPCR: Allow IO-APIC interrupt type _CRS: Relax failures to warnings for mif/maf tests Signed-off-by: Sakar Arora --- src/acpi/dbg2/dbg2.c | 8 +- src/acpi/spcr/spcr.c | 6 +- src/lib/src/fwts_acpi_object_eval.c | 149 ++++++++++++++++++++++++------------ 3 files changed, 111 insertions(+), 52 deletions(-) diff --git a/src/acpi/dbg2/dbg2.c b/src/acpi/dbg2/dbg2.c index b826c27..f1301de 100644 --- a/src/acpi/dbg2/dbg2.c +++ b/src/acpi/dbg2/dbg2.c @@ -28,8 +28,9 @@ #include "fwts_acpi_object_eval.h" -#define SBBR_DBG2_PORT_SERIAL 0x8000 -#define SBBR_DBG2_ARM_SBSA_UART 0x000E +#define SBBR_DBG2_PORT_SERIAL 0x8000 +#define SBBR_DBG2_ARM_SBSA_UART 0x000E +#define SBBR_DBG2_ARM_PL011_UART 0x0003 static fwts_acpi_table_info *table; @@ -72,7 +73,8 @@ static int dbg2_test2(fwts_framework *fw) if (((uint8_t*)info + info->length) >= ((uint8_t*)table + table->length)) break; if ((info->port_type == SBBR_DBG2_PORT_SERIAL) && - (info->port_subtype == SBBR_DBG2_ARM_SBSA_UART)) { + (info->port_subtype == SBBR_DBG2_ARM_SBSA_UART || + info->port_subtype == SBBR_DBG2_ARM_PL011_UART)) { fwts_passed(fw, "DBG2 provides a standard serial debug " "port and describes ARM SBSA Generic UART"); diff --git a/src/acpi/spcr/spcr.c b/src/acpi/spcr/spcr.c index 2f37e3f..6a9ac3a 100644 --- a/src/acpi/spcr/spcr.c +++ b/src/acpi/spcr/spcr.c @@ -74,9 +74,11 @@ static int spcr_sbbr_gsiv_test(fwts_framework *fw) { if (fw->flags & FWTS_FLAG_TEST_SBBR) { const uint8_t ARMH_GIC_INTR_MASK = 0x08; + const uint8_t IO_APIC_INTR_MASK = 0x02; - if ( (spcr->interrupt_type == ARMH_GIC_INTR_MASK) && - (spcr->gsi != 0x0000000000000000) ) + if ((spcr->interrupt_type == ARMH_GIC_INTR_MASK || + spcr->interrupt_type == IO_APIC_INTR_MASK) && + spcr->gsi != 0x0000000000000000) fwts_passed(fw, "SPCR appears to be populated with correct GSIV interrupt" "routing information for ARM PL011 UART Device"); else diff --git a/src/lib/src/fwts_acpi_object_eval.c b/src/lib/src/fwts_acpi_object_eval.c index b356441..b3537b0 100644 --- a/src/lib/src/fwts_acpi_object_eval.c +++ b/src/lib/src/fwts_acpi_object_eval.c @@ -1270,32 +1270,51 @@ static void method_test_CRS_mif_maf( if (len == 0) { if ((mif == 1) && (maf == 1)) { snprintf(tmp, sizeof(tmp), "Method%s%sMifMafBothOne", objname, tag); - fwts_failed(fw, LOG_LEVEL_MEDIUM, - tmp, - "%s %s _MIF and _MAF flags are both " - "set to one which is invalid when " - "the length field is 0.", - name, type); + if (fw->flags & FWTS_FLAG_TEST_SBBR) + fwts_warning(fw, tmp, + "%s %s _MIF and _MAF flags are both " + "set to one which is invalid when " + "the length field is 0.", + name, type); + else + fwts_failed(fw, LOG_LEVEL_MEDIUM, + tmp, + "%s %s _MIF and _MAF flags are both " + "set to one which is invalid when " + "the length field is 0.", + name, type); fwts_advice(fw, "%s", mif_maf_advice); *passed = false; } if ((mif == 1) && (min % (granularity + 1) != 0)) { snprintf(tmp, sizeof(tmp), "Method%s%sMinNotMultipleOfGran", objname, tag); - fwts_failed(fw, LOG_LEVEL_MEDIUM, - tmp, - "%s %s _MIN address is not a multiple " - "of the granularity when _MIF is 1.", - name, type); + if (fw->flags & FWTS_FLAG_TEST_SBBR) + fwts_warning(fw, tmp, + "%s %s _MIN address is not a multiple " + "of the granularity when _MIF is 1.", + name, type); + else + fwts_failed(fw, LOG_LEVEL_MEDIUM, + tmp, + "%s %s _MIN address is not a multiple " + "of the granularity when _MIF is 1.", + name, type); fwts_advice(fw, "%s", mif_maf_advice); *passed = false; } if ((maf == 1) && (max % (granularity - 1) != 0)) { snprintf(tmp, sizeof(tmp), "Method%s%sMaxNotMultipleOfGran", objname, tag); - fwts_failed(fw, LOG_LEVEL_MEDIUM, - tmp, - "%s %s _MAX address is not a multiple " - "of the granularity when _MAF is 1.", - name, type); + if (fw->flags & FWTS_FLAG_TEST_SBBR) + fwts_warning(fw, tmp, + "%s %s _MAX address is not a multiple " + "of the granularity when _MAF is 1.", + name, type); + else + fwts_failed(fw, LOG_LEVEL_MEDIUM, + tmp, + "%s %s _MAX address is not a multiple " + "of the granularity when _MAF is 1.", + name, type); fwts_advice(fw, "%s", mif_maf_advice); *passed = false; } @@ -1303,58 +1322,94 @@ static void method_test_CRS_mif_maf( if ((mif == 0) && (maf == 0) && (len % (granularity + 1) != 0)) { snprintf(tmp, sizeof(tmp), "Method%s%sLenNotMultipleOfGran", objname, tag); - fwts_failed(fw, LOG_LEVEL_MEDIUM, - tmp, - "%s %s length is not a multiple " - "of the granularity when _MIF " - "and _MIF are 0.", - name, type); + if (fw->flags & FWTS_FLAG_TEST_SBBR) + fwts_warning(fw, tmp, + "%s %s length is not a multiple " + "of the granularity when _MIF " + "and _MIF are 0.", + name, type); + else + fwts_failed(fw, LOG_LEVEL_MEDIUM, + tmp, + "%s %s length is not a multiple " + "of the granularity when _MIF " + "and _MIF are 0.", + name, type); fwts_advice(fw, "%s", mif_maf_advice); *passed = false; } if (((mif == 0) && (maf == 1)) || ((mif == 1) && (maf == 0))) { snprintf(tmp, sizeof(tmp), "Method%s%sMifMafInvalid", objname, tag); - fwts_failed(fw, LOG_LEVEL_MEDIUM, - tmp, - "%s %s _MIF and _MAF flags are either " - "0 and 1 or 1 and 0 which is invalid when " - "the length field is non-zero.", - name, type); + if (fw->flags & FWTS_FLAG_TEST_SBBR) + fwts_warning(fw, tmp, + "%s %s _MIF and _MAF flags are either " + "0 and 1 or 1 and 0 which is invalid when " + "the length field is non-zero.", + name, type); + else + fwts_failed(fw, LOG_LEVEL_MEDIUM, + tmp, + "%s %s _MIF and _MAF flags are either " + "0 and 1 or 1 and 0 which is invalid when " + "the length field is non-zero.", + name, type); fwts_advice(fw, "%s", mif_maf_advice); *passed = false; } if ((mif == 1) && (maf == 1)) { if (granularity != 0) { snprintf(tmp, sizeof(tmp), "Method%s%sGranularityNotZero", objname, tag); - fwts_failed(fw, LOG_LEVEL_MEDIUM, - tmp, - "%s %s granularity 0x%" PRIx64 - " is not zero as expected when " - "_MIF and _MAF are both 1.", - name, type, granularity); + if (fw->flags & FWTS_FLAG_TEST_SBBR) + fwts_warning(fw, tmp, + "%s %s granularity 0x%" PRIx64 + " is not zero as expected when " + "_MIF and _MAF are both 1.", + name, type, granularity); + else + fwts_failed(fw, LOG_LEVEL_MEDIUM, + tmp, + "%s %s granularity 0x%" PRIx64 + " is not zero as expected when " + "_MIF and _MAF are both 1.", + name, type, granularity); fwts_advice(fw, "%s", mif_maf_advice); *passed = false; } if (min > max) { snprintf(tmp, sizeof(tmp), "Method%s%sMaxLessThanMin", objname, tag); - fwts_failed(fw, LOG_LEVEL_MEDIUM, - tmp, - "%s %s minimum address range 0x%" PRIx64 - " is greater than the maximum address " - "range 0x%" PRIx64 ".", - name, type, min, max); + if (fw->flags & FWTS_FLAG_TEST_SBBR) + fwts_warning(fw, tmp, + "%s %s minimum address range 0x%" PRIx64 + " is greater than the maximum address " + "range 0x%" PRIx64 ".", + name, type, min, max); + else + fwts_failed(fw, LOG_LEVEL_MEDIUM, + tmp, + "%s %s minimum address range 0x%" PRIx64 + " is greater than the maximum address " + "range 0x%" PRIx64 ".", + name, type, min, max); fwts_advice(fw, "%s", mif_maf_advice); *passed = false; } if (max - min + 1 != len) { snprintf(tmp, sizeof(tmp), "Method%s%sLengthInvalid", objname, tag); - fwts_failed(fw, LOG_LEVEL_MEDIUM, - tmp, - "%s %s length 0x%" PRIx64 - " does not match the difference between " - "the minimum and maximum address ranges " - "0x%" PRIx64 "-0x%" PRIx64 ".", - name, type, len, min, max); + if (fw->flags & FWTS_FLAG_TEST_SBBR) + fwts_warning(fw, tmp, + "%s %s length 0x%" PRIx64 + " does not match the difference between " + "the minimum and maximum address ranges " + "0x%" PRIx64 "-0x%" PRIx64 ".", + name, type, len, min, max); + else + fwts_failed(fw, LOG_LEVEL_MEDIUM, + tmp, + "%s %s length 0x%" PRIx64 + " does not match the difference between " + "the minimum and maximum address ranges " + "0x%" PRIx64 "-0x%" PRIx64 ".", + name, type, len, min, max); fwts_advice(fw, "%s", mif_maf_advice); *passed = false; }