From patchwork Mon Jan 22 11:54:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 764629 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp1059387wrx; Mon, 22 Jan 2024 03:57:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IGWtoZbujjXGZfW2mRZMdTHPeT9vyQoC+SGdR2M98K7BWzGZ0KzUxT0rS0k7TZnR6uLscj+ X-Received: by 2002:a05:600c:354e:b0:40e:9f3b:1de6 with SMTP id i14-20020a05600c354e00b0040e9f3b1de6mr1962140wmq.33.1705924622107; Mon, 22 Jan 2024 03:57:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705924622; cv=none; d=google.com; s=arc-20160816; b=IryUUAGYu2YyuaE4b9oJBgQsqoZFs7ITUtTVi65Ie4mvHgGyf4Kad8VRpkXVWkfgjd EGFSZSYludLV2ncgJJ3xCgAgypLpLlAJgyq8O2msWRHDZ5a3cbNPs2zr/M356caRIPYD 4H4Og50q3wVmnvArV5Ou7WoWBIDxy34t4vdNag6qebHAvnyxRRjbijO46ZO2iQj++9c4 SMlQbMizUhGIYs70zVyZiBJtWjunZDwl1teIqLVIYW4YppEssqANbeBCZuwbMHn8c16C B0YbbT6ziQNL1JCO77Ntrzs9ALsrWGZLrwicf+iAbjg6YhoewvIYf+11H0xxnan0kyVo PzGg== 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=uC+IGjDwJdEx1SYcRZX1ZssH1b1TMtVH/EcXUUvt95c=; fh=rhmJ78R78zNUSUA9Nt0a5TbZO4CVsI4vi5GcqSIe+nI=; b=PLThFhFlRoB3VZ90+TS3m1RGbCY4duwdBMst0dubUx1M+Dm1+/OvkloVXbJUAQZMnp pIJ5gGwdpbum/X8zNp12eMy3ZOeNxW9SYxDMlMuZT9AzcyzJEFRYov5A7cIkx8d5u2v/ 7YuKCNTbFAlItd3L/2yzXW+6N+DXKyO8oK6s05FmrLMfqDLnPelcs3CvVQFfvb85rIs8 5HRpMZdYs5qRL7yvTzZo291KCE0Xo5/4uZvOa/xmKp3K5/AawwSLHJHiNXAk2E2Sf0RD nfrDxB3n02eJoMjmb2wxR8GSSs4Cc5ZUIKSt3N7zYIMg5AVBgTqVwpDDh+8UZ0ceYsZM QYgw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 n4-20020adfe344000000b003393249d5dasi1335082wrj.467.2024.01.22.03.57.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 03:57:02 -0800 (PST) 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; 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=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 C6DCA87950; Mon, 22 Jan 2024 12:55:51 +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 3082D87950; Mon, 22 Jan 2024 12:55:49 +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 2C6A087B1D for ; Mon, 22 Jan 2024 12:55:47 +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 AC5111FB; Mon, 22 Jan 2024 03:56:32 -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 06CB53F73F; Mon, 22 Jan 2024 03:55:43 -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 , Sughosh Ganu Subject: [PATCH 11/18] efi_firmware: fwu: Do not read FWU metadata on sandbox Date: Mon, 22 Jan 2024 17:24:32 +0530 Message-Id: <20240122115439.653871-12-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240122115439.653871-1-sughosh.ganu@linaro.org> References: <20240122115439.653871-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 --- 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 9fd13297a6..51797a169f 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;