From patchwork Mon Mar 20 05:54:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 665175 Delivered-To: patch@linaro.org Received: by 2002:a5d:5602:0:0:0:0:0 with SMTP id l2csp957967wrv; Sun, 19 Mar 2023 22:55:11 -0700 (PDT) X-Google-Smtp-Source: AK7set/hmR4sLDWDii+PcyLVTQFn8ZJflamt/dm7TqAzfdqlKGLMBkg9ec5iJ0J6frEpJZecbZah X-Received: by 2002:a05:622a:1211:b0:3d4:205e:be4e with SMTP id y17-20020a05622a121100b003d4205ebe4emr16625841qtx.13.1679291711352; Sun, 19 Mar 2023 22:55:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679291711; cv=none; d=google.com; s=arc-20160816; b=QnUGHQrI73fUsuEb70yL6MHcsaBj1qimP1ns+adGsDFIEwk3TAF74IJK1ZR6bZPIS2 39VrfaLu6kFufxl4G2/6K/1pm6ra+ICNtWOi9NAfl5Qo913ohVO+miV2vQREPdgGMt5h DnXxXXrcs6Ku5UQ0p5jDjJk5vJS654bj4cOT1E0DVasDjOcVyskKbCVeFxEynUfRZOhs yEyjYBywvhcc5YH48RvCzCRUDNGNItLjuE/9f64k36xsygnpCgE5VKPR43NQlIVtVkVw BIgzVYyQNX85SgXZzqLnUsAN5Vr5jZ30vjP6MsdREupqcP3YeC9uDJysP3a1e3V9vraI M6gg== 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=wBL6t0gWc0lDWJLWcrALe5wuU5mk9yBNZfYF+yHg/F4=; b=0197EzJv25/KG5YI2yojr8muIJlWBn9vcvN0FhTys0PPwr4LcFUb2m9QhnafwptjW/ A58vLcRG3qLbaFTEZmokKt1mbOs0EXKI6VURBKSmdVsy98Cir8L3zlEe8EB+ge0dd+ji mjq6jkUIL5t4W3seo6gdNafwTuQb1ew3VblaysBc+0YDL5IWuDLI4fu2lAEW0Kpx4b2h eaZNuMO59+MKsNh7LVsMttrrbNzgIvlfKnkp6TvRb+8UqGhLAfDv6xFMLhH6lNeKssIY V94KdbWpTf5fyndeozhaytAdWWk29HoPr7ckfZ9kE4ojpJxROTrEkxUOffar8LQOm4n2 mLWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WCj1plXM; 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 s1-20020a05620a0bc100b006ff0ad77de8si5970174qki.154.2023.03.19.22.55.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Mar 2023 22:55:11 -0700 (PDT) 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=WCj1plXM; 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 7F4E885A62; Mon, 20 Mar 2023 06:55:03 +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="WCj1plXM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A8B438584D; Mon, 20 Mar 2023 06:54:59 +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-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) (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 D2988859FF for ; Mon, 20 Mar 2023 06:54:56 +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-pl1-x634.google.com with SMTP id h8so11301699plf.10 for ; Sun, 19 Mar 2023 22:54:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679291695; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wBL6t0gWc0lDWJLWcrALe5wuU5mk9yBNZfYF+yHg/F4=; b=WCj1plXM89Lxpm6Zbytay8Bi0iJxcyey9poMjK0RxHihxeTe2Z2AN5nQGKDhPCYE4q vrF57bT+YGZk6Q9Vo3//gYQVK36EA/LCjFltgj56m0Cgni6ZP1MjqBw3Ddzmv88a4TQL Cn4fhZBcUsnJJJk6eZTXAwOmxIYPDIcvVilkxzM1pTvARBrhL8R956YDkVTvsHcBNom+ z3gQFuVP42Uu6Qp6VHheS4V4OkXDc/PeqGstde1dX/GZnfg3r+tUs00VEHJB0B3cJBKl +hYDY+4CeUv5qLAa/Ppnu+Stvczcf/ErNYFsF8ZfMfN+vlv0TYpEKtzRkJgJdk0Bek61 K+mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679291695; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wBL6t0gWc0lDWJLWcrALe5wuU5mk9yBNZfYF+yHg/F4=; b=2RjSd47yumsVlvKbmYgMFqZFCLs8rr4LE4Zf5f94ozWK4ldSfAvCcbw2r5W/jJ13Va SaKyCH5Kp2YfmYCdkmzLKB0s3Pa4PUcudXhk7HmjpNzwATlMwRtbl+jKvqJ/OfbsG+jN J1sfZfaRJDx6XXj9uq6fhBeVt1JUNe9NBstDne8taBye97vzg4VdP3mKyMLINPAQhxSi i/qV+9KUbZ/no8Hwsm15ggdKxFelKnHX1lGB6DDGgSaUb/LG1uodKvZu25ufp8LuX2+q 9bkp5l2XNpQrY8K9skzM5LmdDDuTBMDwl/MjIS5VAVnWB2j1j5TykVi0QEACfIR17ziC Akpg== X-Gm-Message-State: AO0yUKU5qKdtP1fk01oFSFLP58ky8BkTlC6Pe6MHLe/n0eXjGZFDKbMz aenvzTJYPBboxvs9RkKLbLJGP0KtBUcsMLFn+hE= X-Received: by 2002:a17:902:cecb:b0:19e:416e:abf5 with SMTP id d11-20020a170902cecb00b0019e416eabf5mr11449854plg.34.1679291695028; Sun, 19 Mar 2023 22:54:55 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id h6-20020a170902eec600b0019cb131b89csm4826718plb.254.2023.03.19.22.54.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Mar 2023 22:54:54 -0700 (PDT) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Takahiro Akashi , Masahisa Kojima Subject: [PATCH v3 0/4] FMP versioning support Date: Mon, 20 Mar 2023 14:54:43 +0900 Message-Id: <20230320055448.12439-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.8 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. Python based test will follow later. 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 v3: - exclude CONFIG_FWU_MULTI_BANK_UPDATE case 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 doc/mkeficapsule.1 | 16 ++ lib/efi_loader/efi_firmware.c | 302 +++++++++++++++++++++++++++++++--- tools/eficapsule.h | 32 ++++ tools/mkeficapsule.c | 51 +++++- 4 files changed, 369 insertions(+), 32 deletions(-)