From patchwork Wed Oct 4 11:27:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 729281 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp287479wrs; Wed, 4 Oct 2023 04:28:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG5QcNlxnFELyJoqNCAGUK7jECVyIsPNzJQA2LO22oCXWwOmHtBArCX6fMEvBlRB7w3DOt2 X-Received: by 2002:a05:600c:2304:b0:405:367d:4656 with SMTP id 4-20020a05600c230400b00405367d4656mr2004857wmo.29.1696418881410; Wed, 04 Oct 2023 04:28:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696418881; cv=none; d=google.com; s=arc-20160816; b=00EqAW5VCd3hvTzDemEScIPnKv4y8d+UDvIuWeaa5NkC5PlHCRLtwu86IYoL75mF22 v/jj4DMG6rfNqhYkEfKTgZeUpged1G1DFuJZqlZxA1YZPs2V7sItBvypv/vDQaMWc/M6 UG/CeMxKux9IfGLBPUJQy8KDrZZBd+rFxOQB7zfQmNOnx9BMmQiwEdjUJkClF6WUgPan ytqrWKGGsOcO1mN+ZXfjJdNFCVvYZ9zqD0djn/WSm4Dj6xAZAqwy9iqGEkcf4NIMFzVT wNdgpX0Uj6uXPDSeBHpmNfOa/qpITrk1vgYISDl4YYUXfPZcGEaQ9APXUaG0i2JqgUO0 Ovgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=6cukut1L8UJZdEOpMSj2nm8ydgPWe936MMPoLX8ToGw=; fh=9Ibi1qL39tpLE9uNA395sqKM1l+0iUV56jVqPR8MVCc=; b=lhN3OlJJZxSIxh59CoCPVkKzOv+BzXLRDDWZ8s9b84tizGzi7pNDmbUK2oLjlkCdHF kklHv5FLWBNC0vjPvurjEzfeyr2jy/AhV7m6D8zuxie4ZmGBoMZJmQZCgtiRMXbZ73ln reW9Df5oUJab3uqET2PGUSRpZEBXqDHiOTZO7DCwP7nNOPUQ/7sZfO0WG2P0E1VEWIzC f6VwK/ly8y5RZ/4PBT+XeS3ApqyZlGNVBSvCM/mG1L+94vvEvFDz6U2LDEgk2LMUjMTz Bof4QJjg12JnCLhtSlR1VD++f2H7EnWCfIXQ5a1DcI/6BMkIdFY3JLDhtPUUIjA04akB fzfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id n14-20020a5d51ce000000b003248a58caf5si1885113wrv.144.2023.10.04.04.27.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 04:28:01 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 00228874D1; Wed, 4 Oct 2023 13:27:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 9CAA1874DB; Wed, 4 Oct 2023 13:27:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 197DD8722D for ; Wed, 4 Oct 2023 13:27:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AA4D5DA7; Wed, 4 Oct 2023 04:28:18 -0700 (PDT) Received: from a079122.blr.arm.com (a079122.arm.com [10.162.17.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 16A083F762; Wed, 4 Oct 2023 04:27:37 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Simon Glass , Heinrich Schuchardt , Ilias Apalodimas , Takahiro Akashi , Tom Rini Subject: [PATCH 0/5] Support for dumping capsule headers and empty capsules Date: Wed, 4 Oct 2023 16:57:17 +0530 Message-Id: <20231004112722.416877-1-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean These set of patches are intended for two tasks. The first set of patches are adding support for dumping capsule header information, which is then being used in the binman test framework for testing the capsule generation. This replaces the current hardcoding of offsets used for verifying the capsule contents in the binman tests. Patch 1 introduces this functionality in the mkeficapsule tool. Patch 3 is using this functionality in the binman tests for capsules. The other set of patches, 4 and 5 are for adding support for generation of empty capsules in binman. The empty capsules are used for the FWU A/B update functionality. Sughosh Ganu (5): tools: mkeficapsule: Add support to print capsule headers doc: capsule: Add documentation for the capsule dump feature binman: capsule: Use dumped capsule header contents for verification btool: mkeficapsule: Add support for EFI empty capsule generation binman: capsule: Add support for generating EFI empty capsules doc/develop/uefi/uefi.rst | 17 ++ tools/binman/btool/mkeficapsule.py | 29 +++ tools/binman/etype/efi_empty_capsule.py | 91 +++++++ tools/binman/ftest.py | 145 ++++++++--- tools/binman/test/319_capsule_accept.dts | 16 ++ tools/binman/test/320_capsule_revert.dts | 14 ++ .../test/321_capsule_accept_missing_guid.dts | 14 ++ .../binman/test/322_capsule_accept_revert.dts | 17 ++ tools/eficapsule.h | 2 + tools/mkeficapsule.c | 229 +++++++++++++++++- 10 files changed, 533 insertions(+), 41 deletions(-) create mode 100644 tools/binman/etype/efi_empty_capsule.py create mode 100644 tools/binman/test/319_capsule_accept.dts create mode 100644 tools/binman/test/320_capsule_revert.dts create mode 100644 tools/binman/test/321_capsule_accept_missing_guid.dts create mode 100644 tools/binman/test/322_capsule_accept_revert.dts