From patchwork Thu Jan 4 08:45:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ivanhu X-Patchwork-Id: 1882359 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4T5Ktk6kKYz1ydb for ; Thu, 4 Jan 2024 19:46:06 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1rLJMT-0001NF-FR; Thu, 04 Jan 2024 08:45:57 +0000 Received: from smtp-relay-canonical-0.internal ([10.131.114.83] helo=smtp-relay-canonical-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1rLJMM-0001N0-Vi for fwts-devel@lists.ubuntu.com; Thu, 04 Jan 2024 08:45:51 +0000 Received: from canonical.com (118-163-61-247.hinet-ip.hinet.net [118.163.61.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 9A2D03F20E for ; Thu, 4 Jan 2024 08:45:49 +0000 (UTC) From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 1/2] acpi: phat: add reset reason health record test (mantis 2294) Date: Thu, 4 Jan 2024 16:45:45 +0800 Message-Id: <20240104084546.65238-1-ivan.hu@canonical.com> X-Mailer: git-send-email 2.34.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" BugLink: https://bugs.launchpad.net/fwts/+bug/2047212 The new reset reason health record was added in ACPI 6.5 Signed-off-by: Ivan Hu --- src/acpi/phat/phat.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/acpi/phat/phat.c b/src/acpi/phat/phat.c index 57499c34..9312eacc 100644 --- a/src/acpi/phat/phat.c +++ b/src/acpi/phat/phat.c @@ -25,6 +25,8 @@ #include "fwts_uefi.h" +static const char reset_reason_guid[] = "7A014CE2-F263-4B77-B88A-E6336B782C14"; + static fwts_acpi_table_info *table; acpi_table_init(PHAT, &table) @@ -87,6 +89,7 @@ static void phat_health_test( char guid[37]; char buffer[2048]; + uint8_t supported_src, source; fwts_guid_buf_to_str(entry->data_signature, guid, sizeof(guid)); device_path = (uint16_t *)((char *)entry + sizeof(fwts_acpi_table_phat_health)); @@ -115,9 +118,17 @@ static void phat_health_test( *passed = false; } else { - fwts_log_info_verbatim(fw, " Vendor Data:"); + fwts_log_info_verbatim(fw, " Device-specific Data:"); fwts_hexdump_data_prefix_all(fw, (uint8_t *)entry + entry->data_offset, " ", entry->header.length - entry->data_offset); + + /* Check Reset Reason Health Record Supported Sources and source*/ + if (strcmp(reset_reason_guid, guid) == 0) { + supported_src = *((uint8_t *)entry + entry->data_offset); + source = *((uint8_t *)entry + entry->data_offset + 1); + fwts_acpi_reserved_bits("PHAT", "Supported Sources", supported_src, 5, 7, passed); + fwts_acpi_reserved_bits("PHAT", "Source", source, 5, 7, passed); + } } }