From patchwork Wed May 31 03:35:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 687226 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp1054837wru; Tue, 30 May 2023 20:37:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ZisSg3p/12VSH0VmZ+I+n8TPb6OxPtroOlHz+I2NxMGzrKvP6j/M8D8gX32C8E9DI8oE8 X-Received: by 2002:a05:6870:7811:b0:18e:9101:733b with SMTP id hb17-20020a056870781100b0018e9101733bmr3644016oab.14.1685504251941; Tue, 30 May 2023 20:37:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685504251; cv=none; d=google.com; s=arc-20160816; b=jQaa+8sbSnV0VOYRC0xJe/4XLZaZANbPNOl0x9UrM4Sr8qhUHylkrw0n5SCLScsK8l IWRhgTzB+c50MoxwAmYFNdR3azu4LvUMaU44tpnafG9xWXi7MbXjqFshYevmIVD8sxzC SEmpI8XT2lW3T2ryJ0kB7z+dTiz+crPecGj7s/YI1T6DLo30OfmhRjBfM3BPGvj2sGWr ewWKUNOa5zjlHcqqkVYVPJLe1RXjmiJCF42C5dVw3PXrGrdup/xmn678dbijbVodbDJz wn+ysPyYDlWoPdwyKeXswopfVco5ogJLZHxj/YcGcV3zTdS+wwV16dbJv5HpMNRtV4b7 TcJA== 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=QqgSJOwm6GiaHr3eYjLepn+GTPMqA5HG3ixedQahIEs=; b=C5xwsmsIfI54U0Ez0dBV0QZviVQerRMY60iGRX25I4X3pbhIfYLATpFmFmbGUunfdw rYC7lhHbJtbjcQNVT1ca82ExQpj05JIXZB9Hvkf1COM3s4SsacnZ6JGAeHqs2nlKEiia VGc81roAL666Q/hO/bFNmR1Z57Ipl3LYLzU+ThWsoe1Ec7boSep8smTAfERb2C2dnWxS jYaP9MMnB5n47eHM6UhXrzRTTLzcVJ7OHAyWUkk4exU4GyFrUj4gzLuUpb1o0KHNHHij 9QKZqoFKWb7NyHHrDFa1yPR6TCRIPOGfVcNaqiTq/3353OXtM/AephO7bX7c5yl4byRc j5mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g7Lwz7ZQ; 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 h190-20020a636cc7000000b0053059dfafe4si248486pgc.86.2023.05.30.20.37.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 20:37:31 -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=g7Lwz7ZQ; 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 4390086116; Wed, 31 May 2023 05:36:24 +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="g7Lwz7ZQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AB034861C2; Wed, 31 May 2023 05:36:12 +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-oa1-x2f.google.com (mail-oa1-x2f.google.com [IPv6:2001:4860:4864:20::2f]) (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 B0C9086116 for ; Wed, 31 May 2023 05:36:08 +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-oa1-x2f.google.com with SMTP id 586e51a60fabf-19f6f8c8283so2097390fac.3 for ; Tue, 30 May 2023 20:36:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685504167; x=1688096167; 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=QqgSJOwm6GiaHr3eYjLepn+GTPMqA5HG3ixedQahIEs=; b=g7Lwz7ZQclmMrc7utHAsFGJEasRsntHumDsJBGApc0V0rKjIkdKWsKDNssHkQNdcea 7iCYilylg/xH1i87Orp70YE1t/KOpqVMIVah14BtKuBEEn3q++vWvZNt9jG0HWor0llA CDSVoK/Y6BnjW10CLQ1zGfzSLewCHMarg9/5sOuLmsL8baZh4hlYjg50xTVPqmzfc99s IoYn5moMscw3FW7eXxX/YPAuZB9peZG5LvXEly0m+XU+64wJhCqkDSj0EeHTLBu0NMQB +E8pAVSEHkH7E8DlGS2ptDru3VD/tMSwg3uKVGsm/RYw7/YxGCYd5li27H38asCfBBLm OqkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685504167; x=1688096167; 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=QqgSJOwm6GiaHr3eYjLepn+GTPMqA5HG3ixedQahIEs=; b=fjYz2TOh31FoM/6qxuB/oId8dK8SogMHjFJG1eygIn9x1y5ykeza46dxhiTPD2p4WU x3Ml8GVm9CUEJpAuS123WizAIFm3ycXGhd2QHGHs8l+k/g0oJyeYeBPOBr0N5L9YrEK9 7UfVpULaBzg8SnOaI681723Y7+KW2ZsYIZWvSHLwahZIpO+z8PtpvGXohn+3/9S1Txh0 O3UyiXZI6f8HQ4kghsQoqMEXnbn1I70sJ3fl3VUad/KwDdbBQsxstaAAbJU8E8Jgb8XP WZTThWylRx1xia8eW6YILSquwXW8PZhloVsQ0ahG+r1V4ud5XXN2u4Dj0mjPwKive97Q VwsQ== X-Gm-Message-State: AC+VfDxyqLi3j8U+OSzDXzuAdE9VSugmZxb6fCTwHYxi4/zXSMVGKJQ8 ZRniUrSpODY1OQyRwHt8xY72dte4Rzll3gy3JHQ= X-Received: by 2002:aca:100f:0:b0:398:50f1:ad17 with SMTP id 15-20020aca100f000000b0039850f1ad17mr2455632oiq.4.1685504167046; Tue, 30 May 2023 20:36:07 -0700 (PDT) Received: from ubuntu-SVE15129CJS.. ([240d:1a:cf7:5800:b037:3ab0:51c1:7dff]) by smtp.gmail.com with ESMTPSA id b4-20020a170902d30400b001b0395c3ffasm85709plc.180.2023.05.30.20.36.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 20:36:06 -0700 (PDT) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Takahiro Akashi , Masahisa Kojima Subject: [PATCH v7 07/10] doc: uefi: add firmware versioning documentation Date: Wed, 31 May 2023 12:35:20 +0900 Message-Id: <20230531033523.1581973-8-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230531033523.1581973-1-masahisa.kojima@linaro.org> References: <20230531033523.1581973-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 --- 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 *********************