From patchwork Tue Jun 6 09:40:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 689690 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp2538030wru; Tue, 6 Jun 2023 02:43:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7zUoU5jg7qIazmRlO8E3CQhEFoEbXser4BmgGkANuc4o8HZZoDFOfA2kxoNzPu8nY9F2Vx X-Received: by 2002:a17:903:489:b0:1b0:25ab:a9eb with SMTP id jj9-20020a170903048900b001b025aba9ebmr1787355plb.8.1686044599601; Tue, 06 Jun 2023 02:43:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686044599; cv=none; d=google.com; s=arc-20160816; b=iVGfANMsyOd+HIg0pc25s9f8phls6dyQ4aohF2gzTi7alMEKfVeBNKt3nDcs3thyvt q0or4MH/0i2bZe/FnPvQWg3wkwVgeAiio6g5h/ziP65DWbDhcUUpiE+XxGBqI6Ae1s8m sjlNXYxv/zltIvrnVptgB9RKzw3kz29CLgBN7Il9zTR//YhQtJSxpA8XHnsvNa7ujocf 1AT/hjpRlOv4UtDtFJhygmabWyJIdjn2uK5IrSmz14Gr+XFmsEqMIdESmCO/N3I5PhEm ZnheoZcT6BNc1IiM/hYN3o1uPzhoNIMTQllEUk8IiEMWjPvU9hVX8SCzQhgY/WGIVn/R oKIg== 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=wpAuzXybesQ4q0ZvgBdaQUxa4pCDDA1PyFNgzZMcKC4rejMMgaSL/YcdrZgQW35gxa aQhtfMEyXUet/bKQPbFnjSpdNhT4il1Ch/9k7xcf71O7ya3jFiRUfA2s6eqs6EGMYF3D 6/q2hawvlRweHeLgW2blIRhc++hbKOvzVJjx8KnREbWyZyHc63zx705Q5R+CNVuD/1d/ gXmM0twN0zmPLjOPKotSGEk9q08JDVjRgXX10Ure2KGP3Z6KE2Q6zqWhdC+2I+WoDTMd SLkf46r+aKloX0+rPA0yF/uD9GGqhyAGQTcaFZm3BomoaH7LOh1WhgR5WGAV3oGxGpw2 KKpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XwBAF5dl; 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=pass (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 jj9-20020a170903048900b001b039d82f9csi6904029plb.30.2023.06.06.02.43.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 02:43:19 -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; dkim=pass header.i=@linaro.org header.s=google header.b=XwBAF5dl; 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=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 4B73C85FD2; Tue, 6 Jun 2023 11:42:09 +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="XwBAF5dl"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CA6DF85F4F; Tue, 6 Jun 2023 11:41:58 +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-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) (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 BE85885EEB for ; Tue, 6 Jun 2023 11:41:54 +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-pf1-x435.google.com with SMTP id d2e1a72fcca58-652dd220d67so4777180b3a.3 for ; Tue, 06 Jun 2023 02:41:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686044513; x=1688636513; 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=XwBAF5dlsLhrsWZxMRNUQIKiwmJCihp3Qpkl6O/wx37e6ay4ZBvQ59HHpw9+vdHEBj tW8k61hbIkQTu/+jzyJyKoFgk+6P0PXiU4B6emR7I6PS5P5q93RWq2PhlSdsQ6k4fsYY M8MNjABbcblK8byh0Sx/MOz/QlX6vM7sQYQFbbiyaZeDprY1Uvt8tiINpXrRk+e8TR7i koqQWlmSutrgx3e7qEgRYAph7ttmclv9WmgDXnZQRlVS145v5431rJPX4sG/jinp+UsG Wsd9oqJ2LU8/pNhB75JUUraZO68j3/gpog7CDngIK7TnNbo7bWRmng58SqfM3VibduZE cdHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686044513; x=1688636513; 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=fWSebvKnFzjUQx298os6xtm24iCu9ibLgeSiq0k6IkHvxdb95uswl2xYfnluNtgr9B S3D4aRFZUXutSJoaJqfyq7+feIPwziYwfZvI2KSeaV/ItF+jgYy1W783OoQwU+q8LzZk F0LT7AXZVY6x71GjdvVCxOjZ84b9fWaY5vtxjCmdmm7YAnbQ9cZRBSqgSjhhvg67ZMRf iDkqh4SX1XQsvza20nVzmiuoBNryrQ1JynOIzcnoTuOYk2EeMqeHE2+k7BVqMPke2flQ k/ukM8S7WpLbgdC/UC47hva80PA+3//aRMDNERSH0M6CexxPcBJmNxvb1ONPYZbj9VRE IKHQ== X-Gm-Message-State: AC+VfDzy5uXeHfMgxzO0bugnMrjYLlJLzmyy9JvjukShvIN8xfsLS1HA tazihk/mEqiPpp+ynhbkFAcq05Uu4A9HjAJMZq4= X-Received: by 2002:a05:6a00:1a8b:b0:652:542c:ad8d with SMTP id e11-20020a056a001a8b00b00652542cad8dmr1834780pfv.9.1686044513020; Tue, 06 Jun 2023 02:41:53 -0700 (PDT) Received: from ubuntu-SVE15129CJS.. ([240d:1a:cf7:5800:d3c2:bf07:d08b:b72d]) by smtp.gmail.com with ESMTPSA id u25-20020aa78399000000b00627ed4e23e0sm6542809pfm.101.2023.06.06.02.41.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 02:41:52 -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 v8 07/10] doc: uefi: add firmware versioning documentation Date: Tue, 6 Jun 2023 18:40:31 +0900 Message-Id: <20230606094035.28990-8-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230606094035.28990-1-masahisa.kojima@linaro.org> References: <20230606094035.28990-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 *********************