From patchwork Wed Mar 1 09:15:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 657795 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp3386450wrb; Wed, 1 Mar 2023 01:16:19 -0800 (PST) X-Google-Smtp-Source: AK7set+Z4jd/HKTB1U1WVUJz8EHEAYQJgb5zDKX8lXKoPnGHZ4uk2zOKTHQAsr0E7SOzIqTLxabH X-Received: by 2002:a05:6870:219c:b0:176:29f2:e35d with SMTP id l28-20020a056870219c00b0017629f2e35dmr616019oae.33.1677662179738; Wed, 01 Mar 2023 01:16:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677662179; cv=none; d=google.com; s=arc-20160816; b=B/T7/5mH4L6sM6QexKxLtNh3iemPJvdb0W5jtcYmaDF+E20D1BMNj9rd3x+lAE/i7F /Je4pVewjYXTcgoYOU9hI6uY44gHN2gfEFGZSs++NiLlQah2ACmKXiMY9Fnf4c9syYaQ mEzs0fAPEXM9kfr6tJVIUIXLkZYl/NrDOJXROIh7sdqdx3a0AXJYIvc3UgHEZvfEAPud zmQ/FbFppmy/HpKzUTAf3kHV78HnCfc5quR80OedZ8SJblsCUuWRjcFVnCUGd3ggBvPx 13HLu9KSYEpFQHbhIALDsBJTrEEqR+29pjJVH7JUzuDaMNQ9CeNXmJ08fWSdc7nw0wlw cJfQ== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=SXE4HOYOzb1gE7YBib7BTulVkbC+L4emVACqEY9Gxp0=; b=Ihx/VPJvuGstrcgdTMP/uBB3wlB1Kl3Qc4CFHr3pW+RsvcJcMy+zVI2HzxznY9POHP 4/5DM53bQ2FXBT+/NDz/4OMsZKr7MiNk40hUfDb0WUNjIg4RDEz4r+pmX5SlxQCEj/rg BG/Vp8JuNJXiMQYP9UUs+j3n3KE15j5Q480TT2MbxJ/GyGL2d6Y1Yvf+JstkxMyry4PN dUgeqhFMzc9sHMkxxYye1KkgitjvbFv7/GiJtAMesymENgRdiL3+p80ZJq4eeSoBIOp7 TTPCmsE+jASP8YhAiXh9F8exaO/AouRGyxmeLGhSnxTDr7/TsijwbEi/Btrbr+//LqlO 4WhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=skH9SjeD; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id zq6-20020a0568718e8600b00172d910fbe9si10691346oab.58.2023.03.01.01.16.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Mar 2023 01:16:19 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=skH9SjeD; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (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 3CA5385C10; Wed, 1 Mar 2023 10:15:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="skH9SjeD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ADD9A85C10; Wed, 1 Mar 2023 10:15:57 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E5F6B857B3 for ; Wed, 1 Mar 2023 10:15:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masahisa.kojima@linaro.org Received: by mail-pj1-x102a.google.com with SMTP id u3-20020a17090a450300b00239db6d7d47so5295625pjg.4 for ; Wed, 01 Mar 2023 01:15:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677662153; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SXE4HOYOzb1gE7YBib7BTulVkbC+L4emVACqEY9Gxp0=; b=skH9SjeDJ5nrQuD3mXJGaVamkSSdnxDBqT/sQQIDGgltLB5Z12kgq4t30Sp4Aq8Hna Cx/ZpP7w4ZNdxxYAtEG6h3mXxL/Fh4dsFqZ/Zi5LLSqka3mOArrti7GbARArARCCDf62 FwzUXTnjNd4LfSlpjmvnGa9qFXe0vAFM0Ndkej2YXlN0M1aYvHx6ax+cv6CHf0i2cOg5 v+Bo5P3YzliEOdVgRILw800Ebup702C7JDNhcntbHI37sottBxd1yHPt2BdI+qEm959c OCTEqCo0p2Gdu4eAU+CVmwH+ggh5cMaPSy0w0FOwoCqjyNMtmY6qjwKOrg+dUi68tYJN wwYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677662153; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SXE4HOYOzb1gE7YBib7BTulVkbC+L4emVACqEY9Gxp0=; b=vTrWKPAIH0yNyAAwbGZ44l597DAXxVBajqUv4ta1/O5Vp6vmEuPxjczIjbxWSMO71A Ye9eaVjIYr3PQt6D6+W2a6wsMtyZ3pXBpoDNh+xLMqa8ndMhvpE7aopNjqXV3TZVLQSM hI7V8vJw/2zCcthBlq859kXDsN7kD5482G0ZBzCNlryetWAxrjISx6g6l82fkWffm9l4 5DEPKGeWkTADPGErSuXYdNLgIp6budmWetwZL87JvrFw/w1LMvLiyBr8KPE8CSwTA5QK j19GYmxWOBzQVm/Ddaa4yw7bTUPCdYh3x1E4VpMhCOJhfrHDXob87xAvDOjn8eDXzZT+ o+1Q== X-Gm-Message-State: AO0yUKVQb4tOqXNRn6qflcf3sZAne2rUXD5RZNh+z94zdVLxlwR6P51p V/A+oiLNy4SULU0tHnpUYEdMcE5VF1OVn8zD X-Received: by 2002:a05:6a20:1592:b0:cd:7040:10d4 with SMTP id h18-20020a056a20159200b000cd704010d4mr8028512pzj.62.1677662152916; Wed, 01 Mar 2023 01:15:52 -0800 (PST) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id 13-20020aa7910d000000b005a8173829d5sm7466637pfh.66.2023.03.01.01.15.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Mar 2023 01:15:52 -0800 (PST) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Takahiro Akashi , Masahisa Kojima Subject: [PATCH v2 0/4] FMP versioning support Date: Wed, 1 Mar 2023 18:15:18 +0900 Message-Id: <20230301091523.18384-1-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 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.6 at phobos.denx.de X-Virus-Status: Clean Firmware version management is not implemented in the current FMP implementation. This series aims to add the versioning support in FMP. EDK2 reference implementation utilizes the FMP Payload Header inserted right before the capsule payload. With this series, U-Boot also follows the EDK2 implementation. Currently, there is no way to know the current running firmware version through the EFI interface. FMP->GetImageInfo() returns always 0 for the version number. So a user can not know that expected firmware is running after the capsule update. With this series applied, version number can be specified in the capsule file generation with mkeficapsule tool, then user can know the running firmware version through FMP->GetImageInfo() and ESRT. Note that this series does not mandate the FMP Payload Header, compatible with boards that are already using the existing U-Boot FMP implementation. If no FMP Payload Header is found in the capsule file, fw_version, lowest supported version, last attempt version and last attempt status is set to 0 and this is the same behavior as existing FMP implementation. Changes in v2: - add FMP Payload Header generation in mkeficapsule tool Masahisa Kojima (4): efi_loader: store firmware version into FmpState variable efi_loader: versioning support in GetImageInfo efi_loader: check lowest supported version in capsule update mkeficapsule: add FMP Payload Header lib/efi_loader/efi_firmware.c | 271 ++++++++++++++++++++++++++++++---- tools/mkeficapsule.c | 81 +++++++++- 2 files changed, 319 insertions(+), 33 deletions(-)