From patchwork Wed Jun 7 05:41:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 690172 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp139980wru; Tue, 6 Jun 2023 22:44:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7nmo6QYFoCW5p4vLZRGHtGoQowuBc+0ncQi6FCJ0uVxleZcVf72GBCB1EWhQ+PpdSoyLYF X-Received: by 2002:a17:902:7b8c:b0:1a1:f5dd:2dce with SMTP id w12-20020a1709027b8c00b001a1f5dd2dcemr4336033pll.6.1686116655178; Tue, 06 Jun 2023 22:44:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686116655; cv=none; d=google.com; s=arc-20160816; b=r3DNORXz5kzcD3+xdRoU7eNO0v6MwXFfmuJKJ3A7hhf7xhHGwmb3Bqct1FQUjAJUwH GDIQRavzrMea/ZsLVxuN7/9rjk6t6X3IgSh7QuVuSqRIYmOB8dIHfO3rBg7KiAv9Mj/V qYCK7VbBcT5yNRMwczSk1mRjNPMbZvLYUce6mwHHP9m93d6t12U1I0l2fwwwJFyrLCpd xLDVnPJtYZw8IYskkAYvXbjfTYNhaOtYR8izPvnot+MZZkIH8H1QnHysVlDH/t2vtRb5 ZEFnPVNr0/YhwWpwMaMMztYq9TtSzjNZo3UwFOVNlhKZQPh8YZzgBVYwztVJhvBGyUi4 Imww== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DKnt3wjagfXjw4oYKhw2ai69OJDQPbCIAY/vH4tA8j0=; b=UREbMPg2DjFFzK3J7kd3OTbdudgCKfeJ0wxn2osH3XVigN2sYlW1+RRuCrYxPnTcx5 EcLx5Gdju3fs7hiT2kJ4rfM1Pu0W5jYYRZ6GRSttfXk23cAd2b98u6MsIFGzmYo6AIyt ryytT1gX9QjR0ssKuMmLIOidi9zSFVpDXG7X2AWW9QgqmrW2/oqDO1eM0Ak8xtZSzFOe mgLBqPylQbG7ppJwbvgz0vDqA3uNEd2EPJzJWikWjBgDAtmqKo4BXcyPVJiFuxJb3ciE thu6gIrm2QkfjaRR9JJvK5CCZD2lVzpBgP4O+Buq4g6Uw4BS7XT4SQSH+wFbz9G5xt7i rUcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vFE+jHpY; 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 bc8-20020a170902930800b001ae8c22791asi8018041plb.477.2023.06.06.22.44.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 22:44:15 -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=vFE+jHpY; 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 2041686081; Wed, 7 Jun 2023 07:43:05 +0200 (CEST) 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="vFE+jHpY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4F7BF86073; Wed, 7 Jun 2023 07:43:02 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) (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 155B186014 for ; Wed, 7 Jun 2023 07:42:59 +0200 (CEST) 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-x1033.google.com with SMTP id 98e67ed59e1d1-256712e2be3so5987357a91.2 for ; Tue, 06 Jun 2023 22:42:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686116577; x=1688708577; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DKnt3wjagfXjw4oYKhw2ai69OJDQPbCIAY/vH4tA8j0=; b=vFE+jHpYax/6p6Gr4xRQZgJo5bd8dKwVMWoi+Qge7XZIUlpXtZ5oQVVIOjYCEDOMmx 2SDQwRnAvO1lE10+bUzM4V/P686lTz9xjjDuwen4H92EBY6tBMMAHSz8zUNwth6an/qS 0gC4zd39xJxT1EUZNFj+3afWyLBH3Ywe6TRfc9hU4pbSbVIixD7wp/klIOK4W8vWY2BP 2Av5WF+jhHZmfE/VrHGBRNjNCAGUh+U+1bFNxCQeypE0itgHphjDOawugL22H+V3aQXx p1+5DCY0WGfDzEEnhxNsr9zlBVGbwGE4oWIJ9AhdLw8jda6mYWcZ7A1FCTWK19H7eprS sMdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686116577; x=1688708577; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DKnt3wjagfXjw4oYKhw2ai69OJDQPbCIAY/vH4tA8j0=; b=eWrBAFTT44idGh4NpyKLqPibXy8KWf38EbEFDlSW5tUcq/fUuGJyBy5HUO5YGWlCVA qD+k3ccE6gjeffyuv65r6HexboBu5l0IITEbXjbQFZWONjvmraMpWPpdWPPpS7xDlZTc g2DZX7M29N4/W3H/SB1GNEevAUIYvZRx/0XS8f73gIY6SbMKfnVugZyv/dtPYXkvkZK9 I199TTvtzCg8PQTJ+w0gFmRF0X8fCDlJ8SC9D6fBkyYaeWpae2lqKVq+wfoEkjF28LCM LtNvo8Np7R7qa9mRVmsYEjb95M0gW5IbeUgcIBkvg8v7DdozVVLG3QMZMoUrutYeCcHW YzRg== X-Gm-Message-State: AC+VfDzXPEs0YP7QWJMYgHPer1/RXX6GUyZ6LQN4VMBF588jMKHtMxn6 mz/L4LfGwuTa8XUs12LBS6cCjI1p7lxFPOY1LWU= X-Received: by 2002:a17:90a:fd8c:b0:256:d4a:ea4c with SMTP id cx12-20020a17090afd8c00b002560d4aea4cmr3877298pjb.30.1686116577257; Tue, 06 Jun 2023 22:42:57 -0700 (PDT) Received: from ubuntu-SVE15129CJS.. ([240d:1a:cf7:5800:d3c2:bf07:d08b:b72d]) by smtp.gmail.com with ESMTPSA id fh2-20020a17090b034200b0024df2b712a7sm469033pjb.52.2023.06.06.22.42.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 22:42:56 -0700 (PDT) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Takahiro Akashi , malte.schmidt-oss@weidmueller.com, Masahisa Kojima Subject: [PATCH v9 07/10] doc: uefi: add firmware versioning documentation Date: Wed, 7 Jun 2023 14:41:57 +0900 Message-Id: <20230607054201.42702-8-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230607054201.42702-1-masahisa.kojima@linaro.org> References: <20230607054201.42702-1-masahisa.kojima@linaro.org> 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 This commit describes the procedure to add the firmware version into the capsule file. Signed-off-by: Masahisa Kojima --- No update since v7 Changes in v7: - move documentation into "Creating a capsule file" - cleary describe the --fw-version option Newly created in v6 doc/develop/uefi/uefi.rst | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/doc/develop/uefi/uefi.rst b/doc/develop/uefi/uefi.rst index ffe25ca231..30b90a09d5 100644 --- a/doc/develop/uefi/uefi.rst +++ b/doc/develop/uefi/uefi.rst @@ -318,6 +318,33 @@ Run the following command --guid \ +The UEFI specification does not define the firmware versioning mechanism. +EDK II reference implementation inserts the FMP Payload Header right before +the payload. It coutains the fw_version and lowest supported version, +EDK II reference implementation uses these information to implement the +firmware versioning and anti-rollback protection, the firmware version and +lowest supported version is stored into EFI non-volatile variable. + +In U-Boot, the firmware versioning is implemented utilizing +the FMP Payload Header same as EDK II reference implementation, +reads the FMP Payload Header and stores the firmware version into +"FmpStateXXXX" EFI non-volatile variable. XXXX indicates the image index, +since FMP protocol handles multiple image indexes. + +To add the fw_version into the FMP Payload Header, +add --fw-version option in mkeficapsule tool. + +.. code-block:: console + + $ mkeficapsule \ + --index --instance 0 \ + --guid \ + --fw-version 5 \ + + +If the --fw-version option is not set, FMP Payload Header is not inserted +and fw_version is set as 0. + Performing the update *********************