From patchwork Mon Feb 12 07:47:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 772034 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp2000695wre; Sun, 11 Feb 2024 23:49:41 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUcyG6reU1oNj1wu+EZTTRmtSWRW6COsLDIFjTVtbS7wqTivEV2Ns5PRzl09ZMBPf15AL2qjWub8ev3meWP6quh X-Google-Smtp-Source: AGHT+IEDhPQB/sPd6bx3Hc2Y0aSvIy0lfjxPaWqJkc+nnObcTk2Jdz7uvsD+vqBPVJQWnaR/Dv+m X-Received: by 2002:a17:906:d79b:b0:a3c:d669:648e with SMTP id pj27-20020a170906d79b00b00a3cd669648emr30477ejb.16.1707724181308; Sun, 11 Feb 2024 23:49:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707724181; cv=none; d=google.com; s=arc-20160816; b=LJGqYV0mFAqid1D5rpXFm8o1s3Yn4/0++jYsgEyXCVRDByqLcCAPfwPazKIkK8MyAg sZ9ygG2r9uhWiPAQpLM4oIdOeahfj+5XSef3g3xxqTQOzRpTcPr1H91vuF5V1FcQdbS+ l0WqHN3TWfdob8394mG/6KOuytwo9VqQ4z8Uqbalutv+7TVdtiNOK2v0eWyxSgWCLJQj TXiGUhC3IiuCVbk80qljRDRXkPID4DWw+hMn94eYHRAu3F3istdJCOA0pcj+gBQqswsf N17wqWyf0xIGb2ePEvsrlcTParfB9r8YkH97imLcGXX4AuIV/czDZP0+uh+nAxP2GCGe 7WDg== 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; bh=6dTfX3T/fzKLmXNKrhikrLjgpNsSVllz0jeu7/hYWB4=; fh=aMrBxOJtx7G6Wdb1F9P9GwUflynnJIk9KvO7AsKsxGQ=; b=dJYUdO1vt1NplhJ6hCV+6ixsTkx9qXSbwMpkqX/zz7pjp+9UwjtYxR0SXyQH51EeVd b1qDFnVOguKJtsHVxNqZ+DYVFatSuxQsIyW/AZ72QVrSKV8RCwm2gejlZbjfxo8kKxTf EFORr5kbOUDUhZOapquuf6mu6NRhRGNjLmog70O5A5akTK/YS5KCfq77t9KvTpSU10kt SFcM38kzQO0vk5NTwUeFRcziNS+q867Wavi5z1JWb2K2Hm0TlP3xZQyEpQNeJQ1KReMx cKWAkv9Pvwuwgz9tkAtePJesUzF6l5TxVJNAbEhzPwRi5wtb99d5Vemm6+euYUI0kscq eqog==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=1; AJvYcCUf0l1SCeO5c4e8cr/nAu74KrfAEVYBYPfLb8Ia1+BT0FqMmoscH43wdBux1CidU1zVbJOkJiyJSKjpLXp6e43fI4BCAhYw5/sN3M0EyFzb+NSqxgkW3gt5cgDjAE7t+w9V9ibpRqnGq8PJM28ur/bEZYOW05Hu+MooCt/+fkhj9GjS+yDmt2cqRWfq8o5RtXlAkQnAhM3s/PSxd+wT7BsO8HjTPBIRAsa5wCv2CMt5URj0TVINzRv9pOUqAirkzJeA549nfkOTM6zRhqZr6xr/6dX/Dga0ZGvO9pcQymIyV1B/IW87uTPxsyAazn1eQzH3L5LMVqZRigPpCgbO6trRMU+mpj4gnaT6axnAdPzo2NoEgYOn1R5/h/rey1qDX8XNISpK3zwWQe2WmxJ/p/RF+QkRkCZXgi697b+H2x+APdFOTuwwoSsPwGihfuubvFA/4ULvpxWEGDh+tbeteV191/XaMpKgm3WFgu7svzzxuYJAE9XaoYF6P8eEibYbV9EX7BalcLN54OyO5VV/KLy7a16NQdasH6Yz2LAIMNvQIanKSzpHsaxMcwbQbD2S+xtR0Ovg/eq+dWTA5F2zWK74tqFjH1rpnOF7Mk+AP2Qp4M3WpmdRGUg8Ojyq0cd++4wlX1KmvcyKsF5rf+WUW1wIpCzV+GjMKW1A0ktYl+hBaR4Y/Xyl0+rhePzcQG8SPLbADi95eB9i9SdstPbrky5kHQm54WS704V4pJt7+Vj4au9FzhSziEnMzkrRswaGYhwNeSDM9+c1CsuX3vnzSdRLHYtneK7G/heF14LarZzpKikAp2+V9JrOBK5SFlZcqYE2lqEyPlkTV6fDdTaocTWeBWM7dJEt8x1ccTHf0WKJj/s= 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 k19-20020a17090646d300b00a3bf0da9219si3265334ejs.1020.2024.02.11.23.49.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 23:49:41 -0800 (PST) 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; 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=fail (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 089BA87E52; Mon, 12 Feb 2024 08:48:22 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 852D787E52; Mon, 12 Feb 2024 08:48:21 +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=-1.2 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 84ED587EFD for ; Mon, 12 Feb 2024 08:48:19 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 92CF6DA7; Sun, 11 Feb 2024 23:49:00 -0800 (PST) Received: from a079122.blr.arm.com (a079122.arm.com [10.162.17.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C6A543F762; Sun, 11 Feb 2024 23:48:15 -0800 (PST) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Masahisa Kojima , Patrice Chotard , Patrick Delaunay , Yann Gautier , Etienne Carriere , Michal Simek , Jassi Brar , Sughosh Ganu Subject: [PATCH v2 12/21] efi_firmware: fwu: do not read FWU metadata on sandbox Date: Mon, 12 Feb 2024 13:17:03 +0530 Message-Id: <20240212074712.3657076-13-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240212074712.3657076-1-sughosh.ganu@linaro.org> References: <20240212074712.3657076-1-sughosh.ganu@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 The FWU metadata is being read for populating the firmware image's version information. The sandbox platform does not have the FWU metadata on any of it's storage devices. Skip attempting to read the FWU metadata on the sandbox platform. Signed-off-by: Sughosh Ganu --- Changes since V1: None lib/efi_loader/efi_firmware.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/efi_loader/efi_firmware.c b/lib/efi_loader/efi_firmware.c index ba5aba098c..c742e23268 100644 --- a/lib/efi_loader/efi_firmware.c +++ b/lib/efi_loader/efi_firmware.c @@ -223,7 +223,8 @@ void efi_firmware_fill_version_info(struct efi_firmware_image_descriptor *image_ /* get the fw_version */ efi_create_indexed_name(varname, sizeof(varname), "FmpState", fw_array->image_index); - if (IS_ENABLED(CONFIG_FWU_MULTI_BANK_UPDATE)) { + if (!IS_ENABLED(CONFIG_SANDBOX) && + IS_ENABLED(CONFIG_FWU_MULTI_BANK_UPDATE)) { ret = fwu_get_active_index(&active_index); if (ret) return; @@ -391,7 +392,8 @@ efi_status_t efi_firmware_set_fmp_state_var(struct fmp_state *state, u8 image_in efi_create_indexed_name(varname, sizeof(varname), "FmpState", image_index); - if (IS_ENABLED(CONFIG_FWU_MULTI_BANK_UPDATE)) { + if (!IS_ENABLED(CONFIG_SANDBOX) && + IS_ENABLED(CONFIG_FWU_MULTI_BANK_UPDATE)) { ret = fwu_plat_get_update_index(&update_bank); if (ret) return EFI_INVALID_PARAMETER;