From patchwork Wed Aug 25 15:27:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1520841 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 4Gvqgw5Bbtz9sW4 for ; Thu, 26 Aug 2021 01:31:08 +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 1mIurp-0002E7-I6; Wed, 25 Aug 2021 15:31:05 +0000 Received: from mail-ot1-f41.google.com ([209.85.210.41]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mIuoG-0001sA-Fs for fwts-devel@lists.ubuntu.com; Wed, 25 Aug 2021 15:27:24 +0000 Received: by mail-ot1-f41.google.com with SMTP id g66-20020a9d12c8000000b0051aeba607f1so46857592otg.11 for ; Wed, 25 Aug 2021 08:27:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dFvrZeZSpqO2O3aRUaw2fpbxF2FtY2tv7uMVvwQjpJw=; b=Z6HsW/cQv6S2a85Nasgh9NZHZ/V3UgjG5Ig3sOM0nhAp0G5VbA0Jv+Zz7+V2hidd6+ q6MjY/+2ADEoRbBdBRlDqYW8FBzjZ0rgH8pdCZtyF4IF8yPQCobpt8BMLiETEhOp35Ku nMdXu3jr+itoGrmhx2F8brzkD7PUQ1PVZ2xauyzHtfBj1pe3L0R75OQE8M9nNVwALmso ZiOKvPZEGENpzSB5GXRJdCc2CnCJH0APrcMYYDdJNGCmmra13djci7eoPNS/+f3mzN2g avNNEozYCXbyqmsFfysldKxFQKgx2HD1ObmNtXhQqbZucuTudvhyQQ38c5/LawS/T55/ LqvA== X-Gm-Message-State: AOAM530+tEDfNm3zcpq+EWW6MOjQPQ3AZcLOE7jlRTHzcO5/DAC9ClZK uzlgtQlQOLtgyJoCA+QP5F80af2xCg== X-Google-Smtp-Source: ABdhPJxwW0frsL8uzA3xU99N9dl5C5PUeqelxknA9sOQLoN+5ywUq5UG89k+/u/EhCmHO6KP/9qvTA== X-Received: by 2002:a9d:5548:: with SMTP id h8mr17391995oti.370.1629905242494; Wed, 25 Aug 2021 08:27:22 -0700 (PDT) Received: from xps15.herring.priv (66-90-148-213.dyn.grandenetworks.net. [66.90.148.213]) by smtp.googlemail.com with ESMTPSA id o8sm19294oiw.55.2021.08.25.08.27.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Aug 2021 08:27:21 -0700 (PDT) From: Rob Herring To: fwts-devel@lists.ubuntu.com Subject: [PATCH 1/3] Enable dt_sysinfo test for Power only Date: Wed, 25 Aug 2021 10:27:19 -0500 Message-Id: <20210825152721.2818305-1-robh@kernel.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.210.41; envelope-from=robherring2@gmail.com; helo=mail-ot1-f41.google.com X-Mailman-Approved-At: Wed, 25 Aug 2021 15:31:04 +0000 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: Grant Likely Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" The dt_sysinfo test is pretty specific to certain Power systems and wouldn't scale to more DT based systems, so just enable it for Power only. Signed-off-by: Rob Herring Acked-by: Alex Hung Acked-by: Ivan Hu --- src/devicetree/dt_sysinfo/dt_sysinfo.c | 4 ++++ src/lib/include/fwts.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/devicetree/dt_sysinfo/dt_sysinfo.c b/src/devicetree/dt_sysinfo/dt_sysinfo.c index 7c3fae6f33f8..8d8380555837 100644 --- a/src/devicetree/dt_sysinfo/dt_sysinfo.c +++ b/src/devicetree/dt_sysinfo/dt_sysinfo.c @@ -26,6 +26,8 @@ #include "fwts.h" +#ifdef FWTS_ARCH_PPC + static const char op_powernv[] = "ibm,powernv"; static const char opal_firmware[] = "/ibm,opal/firmware"; static const char platform_firmware[] = "/ibm,firmware-versions"; @@ -380,3 +382,5 @@ static fwts_framework_ops dt_sysinfo_ops = { FWTS_REGISTER_FEATURES("dt_sysinfo", &dt_sysinfo_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_BATCH, FWTS_FW_FEATURE_DEVICETREE); + +#endif diff --git a/src/lib/include/fwts.h b/src/lib/include/fwts.h index c118b82d372a..551a4e092246 100644 --- a/src/lib/include/fwts.h +++ b/src/lib/include/fwts.h @@ -114,6 +114,7 @@ #endif #if defined(__PPC64__) +#define FWTS_ARCH_PPC 1 #undef FWTS_HAS_ACPI #undef FWTS_HAS_UEFI #define FWTS_USE_DEVMEM 1 From patchwork Wed Aug 25 15:27:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1520840 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 4Gvqgw53K6z9sRf for ; Thu, 26 Aug 2021 01:31:08 +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 1mIurp-0002EG-KP; Wed, 25 Aug 2021 15:31:05 +0000 Received: from mail-ot1-f42.google.com ([209.85.210.42]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mIuoH-0001sD-8Z for fwts-devel@lists.ubuntu.com; Wed, 25 Aug 2021 15:27:25 +0000 Received: by mail-ot1-f42.google.com with SMTP id k12-20020a056830150c00b0051abe7f680bso50302971otp.1 for ; Wed, 25 Aug 2021 08:27:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fCBBKPsY3z6glZXTxDrHkXKwdx1aKIzZvSrN0uWQAiI=; b=WAFRTFwhiOK5TNEHMwqAy2jqU48yqx3lBJW+p5+nicwLD2xuBr6CquEyrApKcFWQs7 Jo3TwEo4ZOn8JpnxvjfYApNOHaUZKl0uSr7jtKVxnJ9tyg+OUdzX4zV1ItBuu810QenK cfqmPEu9AlbvHAaCD9SH9k07VQeeMc508uc21VhmZwmxicxqppVBH80dWSkG7oR9jFEe 1i1UUwLtsrA9UDMzKBC+eyRVgN+0rN0wiGclbW2DouKqYWO9bfG/4kgF2c0COh4ktlF0 r+FH+5rxq7wz/9+zf6nh5xuE4PYVmIC5N6UAH5g6TrrzSimqb374wsNiE/0CLkaWy9bO 2ScQ== X-Gm-Message-State: AOAM531gqhyxgfHbVOpKfQfPn0cf4wjiWBVHQKPvH6nbnyJga03jRJID bBOjZc9mAM87lmvGeUfgDkkuXQ3r7g== X-Google-Smtp-Source: ABdhPJzLqCqmflRukZOTvyERCLkwlU9kRsTVR4bAY7n5O6urBlIzyY8dBqivLeOPt5vA5A0uo+QQXg== X-Received: by 2002:a9d:6c04:: with SMTP id f4mr32687104otq.185.1629905243523; Wed, 25 Aug 2021 08:27:23 -0700 (PDT) Received: from xps15.herring.priv (66-90-148-213.dyn.grandenetworks.net. [66.90.148.213]) by smtp.googlemail.com with ESMTPSA id o8sm19294oiw.55.2021.08.25.08.27.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Aug 2021 08:27:22 -0700 (PDT) From: Rob Herring To: fwts-devel@lists.ubuntu.com Subject: [PATCH 2/3] fwts_firmware: Rework Devicetree firmware detection Date: Wed, 25 Aug 2021 10:27:20 -0500 Message-Id: <20210825152721.2818305-2-robh@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210825152721.2818305-1-robh@kernel.org> References: <20210825152721.2818305-1-robh@kernel.org> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.210.42; envelope-from=robherring2@gmail.com; helo=mail-ot1-f42.google.com X-Mailman-Approved-At: Wed, 25 Aug 2021 15:31:04 +0000 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: Grant Likely Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" Currently, ACPI is assumed for UEFI based systems, but Arm based UEFI systems may use ACPI or DT for hardware description. It's also possible to have DT without UEFI or OPAL such as non-UEFI u-boot. Rework the feature detection to ignore the firmware type and just check sysfs. As Arm systems always have a DT for boot parameters even with ACPI, check for ACPI firmware first. Signed-off-by: Rob Herring Acked-by: Alex Hung Acked-by: Ivan Hu --- src/lib/src/fwts_firmware.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/lib/src/fwts_firmware.c b/src/lib/src/fwts_firmware.c index ba0b939c09ba..b249f00a9917 100644 --- a/src/lib/src/fwts_firmware.c +++ b/src/lib/src/fwts_firmware.c @@ -54,22 +54,15 @@ fwts_firmware_type fwts_firmware_detect(void) int fwts_firmware_features(void) { int features = 0; - struct stat ipmi_statbuf; - - switch (fwts_firmware_detect()) { - case FWTS_FIRMWARE_BIOS: - case FWTS_FIRMWARE_UEFI: - features = FWTS_FW_FEATURE_ACPI; - break; - case FWTS_FIRMWARE_OPAL: - features = FWTS_FW_FEATURE_DEVICETREE; - break; - default: - break; - } + struct stat statbuf; + + if (!stat("/sys/firmware/acpi", &statbuf)) + features |= FWTS_FW_FEATURE_ACPI; + else if (!stat("/sys/firmware/devicetree/base", &statbuf)) + features |= FWTS_FW_FEATURE_DEVICETREE; /* just check for IPMI device presence */ - if (!stat("/dev/ipmi0", &ipmi_statbuf)) + if (!stat("/dev/ipmi0", &statbuf)) features |= FWTS_FW_FEATURE_IPMI; return features; From patchwork Wed Aug 25 15:27:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1520842 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 4Gvqgw66cCz9sW8 for ; Thu, 26 Aug 2021 01:31:08 +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 1mIurp-0002EQ-MW; Wed, 25 Aug 2021 15:31:05 +0000 Received: from mail-ot1-f44.google.com ([209.85.210.44]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mIuoJ-0001sg-2j for fwts-devel@lists.ubuntu.com; Wed, 25 Aug 2021 15:27:27 +0000 Received: by mail-ot1-f44.google.com with SMTP id m7-20020a9d4c87000000b0051875f56b95so55338987otf.6 for ; Wed, 25 Aug 2021 08:27:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GUyFPbxypDod9Bgax1WpWaioZCli7mK6clpunwfhx4c=; b=tMb6yeaLYMQWd09Y3y1x5zxas44aPxcy8CVHDSfXXdBsTvRgl+6/a3wWvgBsA9lE4r FDeHQC1attLtoBFoz3T/vvWERIxeF/0XFDBZ9dh0AsZUrKNwvyufssmtgxfb3u9wCpHc M0jrgoYa1zG++eQRt5gpv1l+vXqZWnmCQXUhVPCAXED++WrRYBkUMjPtQBrgsrk32Yfu xOTIURLZ4LdqkTs3oJT5veabTyB3+ku+oGePvsgQDMrgM0+so3fZccl7E+IsaGmR4z36 vSfL3IMNzkgRCU0z07d2eu60pJRzFgnu435nJmHp2Jqtgr6DGXeIjwVQXg/bLdMeO6L5 wmRQ== X-Gm-Message-State: AOAM531vnvCiw0j+E2Y+a2vRVQfbOlzT7BnEGmc0gxcTyBEKRB1c6g1p Lfe/6qsRut8+x0JYc9Z+dC0rtj8PMQ== X-Google-Smtp-Source: ABdhPJwPOMSRK3twPw67WyOwlIDXoJ7xXHCswkstsIC03kX0PwJK4ANI7OtWB03JdBjPZBI6zNaw7Q== X-Received: by 2002:a9d:4785:: with SMTP id b5mr37338792otf.188.1629905245209; Wed, 25 Aug 2021 08:27:25 -0700 (PDT) Received: from xps15.herring.priv (66-90-148-213.dyn.grandenetworks.net. [66.90.148.213]) by smtp.googlemail.com with ESMTPSA id o8sm19294oiw.55.2021.08.25.08.27.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Aug 2021 08:27:24 -0700 (PDT) From: Rob Herring To: fwts-devel@lists.ubuntu.com Subject: [PATCH 3/3] debian/control: Add device-tree-compiler as dependency for armel/armhf/arm64 Date: Wed, 25 Aug 2021 10:27:21 -0500 Message-Id: <20210825152721.2818305-3-robh@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210825152721.2818305-1-robh@kernel.org> References: <20210825152721.2818305-1-robh@kernel.org> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.210.44; envelope-from=robherring2@gmail.com; helo=mail-ot1-f44.google.com X-Mailman-Approved-At: Wed, 25 Aug 2021 15:31:04 +0000 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: Grant Likely Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" Other than SBSA compliant systems using ACPI, many Arm based platforms use Devicetree, so make device-tree-compiler a dependency for Arm architectures too. Signed-off-by: Rob Herring Acked-by: Alex Hung Acked-by: Ivan Hu --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 9325c96eae61..576829eef07a 100644 --- a/debian/control +++ b/debian/control @@ -28,7 +28,7 @@ Depends: libfwtsiasl1 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}, pciutils, - device-tree-compiler [ppc64el powerpc] + device-tree-compiler [armel armhf arm64 ppc64el powerpc] Suggests: dmidecode Description: FirmWare Test Suite This is a firmware test suite that performs sanity checks on system