From patchwork Fri Jun 4 19:47:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1488070 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FxYG80yLBz9sRK for ; Sat, 5 Jun 2021 05:47:58 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lpFnM-0000ve-C2; Fri, 04 Jun 2021 19:47:52 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lpFnH-0000vL-8Z for fwts-devel@lists.ubuntu.com; Fri, 04 Jun 2021 19:47:47 +0000 Received: from d75-158-101-9.abhsia.telus.net ([75.158.101.9] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lpFnG-0003Mv-53; Fri, 04 Jun 2021 19:47:47 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH 1/2] acpi: remove SBBR mandatory tests in various tables Date: Fri, 4 Jun 2021 13:47:42 -0600 Message-Id: <20210604194743.580256-1-alex.hung@canonical.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 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: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" The SBBR table mandatory requirement is tested in "acpi_sbbr" test. Signed-off-by: Alex Hung Acked-by: Ivan Hu Acked-by: Colin Ian King --- src/acpi/dbg2/dbg2.c | 24 ++---------------------- src/acpi/gtdt/gtdt.c | 21 ++------------------- src/acpi/spcr/spcr.c | 9 ++------- src/acpi/xsdt/xsdt.c | 21 ++------------------- 4 files changed, 8 insertions(+), 67 deletions(-) diff --git a/src/acpi/dbg2/dbg2.c b/src/acpi/dbg2/dbg2.c index 3c8105a1..6004dc61 100644 --- a/src/acpi/dbg2/dbg2.c +++ b/src/acpi/dbg2/dbg2.c @@ -33,27 +33,7 @@ #define SBBR_DBG2_ARM_PL011_UART 0x0003 static fwts_acpi_table_info *table; - -static int dbg2_init(fwts_framework *fw) -{ - if (fwts_acpi_find_table(fw, "DBG2", 0, &table) != FWTS_OK) { - fwts_log_error(fw, "Cannot read ACPI tables."); - return FWTS_ERROR; - } - if (table == NULL || (table && table->length == 0)) { - if (fw->flags & FWTS_FLAG_SBBR) { - fwts_log_error(fw, - "ACPI DBG2 table does not exist"); - return FWTS_ERROR; - } else { - fwts_log_error(fw, - "ACPI DBG2 table does not exist, skipping test"); - return FWTS_SKIP; - } - } - - return FWTS_OK; -} +acpi_table_init(DBG2, &table) static int dbg2_test2(fwts_framework *fw) { @@ -385,7 +365,7 @@ static fwts_framework_minor_test dbg2_tests[] = { static fwts_framework_ops dbg2_ops = { .description = "DBG2 (Debug Port Table 2) test.", - .init = dbg2_init, + .init = DBG2_init, .minor_tests = dbg2_tests }; diff --git a/src/acpi/gtdt/gtdt.c b/src/acpi/gtdt/gtdt.c index 8cd41632..f7fcaa54 100644 --- a/src/acpi/gtdt/gtdt.c +++ b/src/acpi/gtdt/gtdt.c @@ -27,24 +27,7 @@ #include static fwts_acpi_table_info *table; - -static int gtdt_init(fwts_framework *fw) -{ - if (fwts_acpi_find_table(fw, "GTDT", 0, &table) != FWTS_OK) { - fwts_log_error(fw, "Cannot read ACPI tables."); - return FWTS_ERROR; - } - if (table == NULL || (table && table->length == 0)) { - if (fw->flags & FWTS_FLAG_SBBR) { - fwts_log_error(fw, "ACPI GTDT table does not exist"); - return FWTS_ERROR; - } else { - fwts_log_error(fw, "ACPI GTDT table does not exist, skipping test"); - return FWTS_SKIP; - } - } - return FWTS_OK; -} +acpi_table_init(GTDT, &table) /* * GTDT Generic Timer Description Table @@ -272,7 +255,7 @@ static fwts_framework_minor_test gtdt_tests[] = { static fwts_framework_ops gtdt_ops = { .description = "GTDT Generic Timer Description Table test.", - .init = gtdt_init, + .init = GTDT_init, .minor_tests = gtdt_tests }; diff --git a/src/acpi/spcr/spcr.c b/src/acpi/spcr/spcr.c index a1318f02..9e3b5cbe 100644 --- a/src/acpi/spcr/spcr.c +++ b/src/acpi/spcr/spcr.c @@ -37,13 +37,8 @@ static int spcr_init(fwts_framework *fw) return FWTS_ERROR; } if (table == NULL || (table && table->length == 0)) { - if (fw->flags & FWTS_FLAG_SBBR) { - fwts_log_error(fw, "ACPI SPCR table does not exist"); - return FWTS_ERROR; - } else { - fwts_log_error(fw, "ACPI SPCR table does not exist, skipping test"); - return FWTS_SKIP; - } + fwts_log_error(fw, "ACPI SPCR table does not exist, skipping test"); + return FWTS_SKIP; } spcr = (const fwts_acpi_table_spcr*)table->data; diff --git a/src/acpi/xsdt/xsdt.c b/src/acpi/xsdt/xsdt.c index 31ede781..17c06eb0 100644 --- a/src/acpi/xsdt/xsdt.c +++ b/src/acpi/xsdt/xsdt.c @@ -27,24 +27,7 @@ #include static fwts_acpi_table_info *table; - -static int xsdt_init(fwts_framework *fw) -{ - if (fwts_acpi_find_table(fw, "XSDT", 0, &table) != FWTS_OK) { - fwts_log_error(fw, "Cannot read ACPI tables."); - return FWTS_ERROR; - } - if (table == NULL || (table && table->length == 0)) { - if (fw->flags & FWTS_FLAG_SBBR) { - fwts_log_error(fw, "ACPI XSDT table does not exist"); - return FWTS_ERROR; - } else { - fwts_log_error(fw, "ACPI XSDT table does not exist, skipping test"); - return FWTS_SKIP; - } - } - return FWTS_OK; -} +acpi_table_init(XSDT, &table) /* * XSDT Extended System Description Table @@ -96,7 +79,7 @@ static fwts_framework_minor_test xsdt_tests[] = { static fwts_framework_ops xsdt_ops = { .description = "XSDT Extended System Description Table test.", - .init = xsdt_init, + .init = XSDT_init, .minor_tests = xsdt_tests }; From patchwork Fri Jun 4 19:47:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1488071 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FxYG84mS3z9sT6 for ; Sat, 5 Jun 2021 05:48:00 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lpFnR-0000wK-Ei; Fri, 04 Jun 2021 19:47:57 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lpFnK-0000vR-0L for fwts-devel@lists.ubuntu.com; Fri, 04 Jun 2021 19:47:50 +0000 Received: from d75-158-101-9.abhsia.telus.net ([75.158.101.9] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lpFnJ-0003N3-E0; Fri, 04 Jun 2021 19:47:49 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH 2/2] acpi: sbbr: add mcfg and pptt to --sbbr option Date: Fri, 4 Jun 2021 13:47:43 -0600 Message-Id: <20210604194743.580256-2-alex.hung@canonical.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210604194743.580256-1-alex.hung@canonical.com> References: <20210604194743.580256-1-alex.hung@canonical.com> MIME-Version: 1.0 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: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" Both tables are SBBR mandatory Signed-off-by: Alex Hung Acked-by: Ivan Hu Acked-by: Colin Ian King --- src/acpi/mcfg/mcfg.c | 3 ++- src/acpi/pptt/pptt.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/acpi/mcfg/mcfg.c b/src/acpi/mcfg/mcfg.c index 7cef0f43..1c8b4b13 100644 --- a/src/acpi/mcfg/mcfg.c +++ b/src/acpi/mcfg/mcfg.c @@ -252,6 +252,7 @@ static fwts_framework_ops mcfg_ops = { .minor_tests = mcfg_tests }; -FWTS_REGISTER("mcfg", &mcfg_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_BATCH | FWTS_FLAG_ROOT_PRIV | FWTS_FLAG_ACPI) +FWTS_REGISTER("mcfg", &mcfg_ops, FWTS_TEST_ANYTIME, + FWTS_FLAG_BATCH | FWTS_FLAG_ROOT_PRIV | FWTS_FLAG_ACPI | FWTS_FLAG_SBBR) #endif diff --git a/src/acpi/pptt/pptt.c b/src/acpi/pptt/pptt.c index 56394660..1d25798a 100644 --- a/src/acpi/pptt/pptt.c +++ b/src/acpi/pptt/pptt.c @@ -189,6 +189,6 @@ static fwts_framework_ops pptt_ops = { .minor_tests = pptt_tests }; -FWTS_REGISTER("pptt", &pptt_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_BATCH | FWTS_FLAG_ACPI) +FWTS_REGISTER("pptt", &pptt_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_BATCH | FWTS_FLAG_ACPI | FWTS_FLAG_SBBR) #endif