From patchwork Wed Feb 2 13:54:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masami Hiramatsu X-Patchwork-Id: 539326 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp1582484imr; Wed, 2 Feb 2022 05:55:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzF462yZ/ACysp1+tn3sV7j2LLQMM3GhdkBYvyC//GBWRf8HYgcGDVvtdc1xf7T3Hm9L3y6 X-Received: by 2002:a05:6402:5144:: with SMTP id n4mr30105934edd.285.1643810102735; Wed, 02 Feb 2022 05:55:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643810102; cv=none; d=google.com; s=arc-20160816; b=yv+o5Tl6fJbHMCtwMm5mMn+wwfaPmcEr3iwgzuvjqF4SR1onKdo+6biLmQSxFEnd60 xMxrBfMbShMQr84NpmHIWoISKd+QQYDYe63VbIOxA0XVkkQHR+AOTZtWC1+tJkmbpTkw VqLzS+6pteens2V/+TIuLk2Hc3fwcbgc0bl5ABeNqUPQL7t03bbHuHgoSwahBXiYpazY 4DYH5uc94orQZNcNVtoE6tj2AyONrLWEFpVjRsyBxEfWqAPsxwJdKfCL3wpSDbGitzwq 2y3dVhVguDwHNXfzHM3xGyFo0nHo8G5C5nDG9Rjj9nh4/9llw5QUYyYsp8BD8UMTLhF0 Ko3A== 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:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=GdDnwWdEJ9nsmtC9/E9CFaZrlgdm/njU3nPmztsNGW4=; b=y6GZR7E78PUFn4s0fuiCnzyTGsPsvZao+bf3sSjVcOenSVi6N3ZBqoRteLww+tb8if 460T1qnt7vycev7avwJghALCiZIOPl2g37PlJpljOsP2XFmNaHFLedBcw3s33cmnGd5H iI0/N8UgHzUB2YsRl2x6pzyRRbvYz7SJGYGX1GeHoOJQtr+UhUK0+JfXGajIZe3CmZlJ ADNPBHAgYx4gJRC7iWsgRdMVnTO74P8PrmtrgAXN2D04MjwwtqlTlzP5eYEGhYZtSbYo /D1/y/3PHOE6/aMblNEjHVA4npTgPwr5Qa2ZujTfqkTbPxy09LAgc+phtTtvZLm03sqI /zcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uzkRlzJk; 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 p24si11824533ejn.56.2022.02.02.05.55.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Feb 2022 05:55: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; dkim=pass header.i=@linaro.org header.s=google header.b=uzkRlzJk; 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 D12D8838D3; Wed, 2 Feb 2022 14:54:43 +0100 (CET) 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="uzkRlzJk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8B2A4838D6; Wed, 2 Feb 2022 14:54:42 +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=-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-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) (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 5B412838D2 for ; Wed, 2 Feb 2022 14:54:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=masami.hiramatsu@linaro.org Received: by mail-pl1-x634.google.com with SMTP id c9so18271359plg.11 for ; Wed, 02 Feb 2022 05:54:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=GdDnwWdEJ9nsmtC9/E9CFaZrlgdm/njU3nPmztsNGW4=; b=uzkRlzJknGdT9V1e0fJuiJJkQGo6NTPoUAfuAi/WaiM3R0gwTKn8y19aIwHlFgusua 1J+EaZke7L3PxuGs5KcpDjPr4jsOTckp2K4DXwdFrZNtBKq48YHhsHJ0/exfsXGMqjk5 Z3KGbur6jj3ip8CpVxTabRfKpX4WyJcc6GienarGkbGQx8n5RQhFMJFLfVZBnV7JiZRR oTRXGgANNuYsyfGdHbs60+N0SEFUKyntR8ZzcFT8yKDVK2YRHF3ikTbxkT+QdMJ8uQyK 9Zu0Z1s1zoous5df8VWFjJCU3c4wScI6OSKX7+ozllQ/4xM8LuU5hfgV5RR/XG1tsdzy kv+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=GdDnwWdEJ9nsmtC9/E9CFaZrlgdm/njU3nPmztsNGW4=; b=gYSx8s7D9Sqhd/ztJNhJ9zyZf5+0R/oF2YIeHu/CIalMrilRXxm4Wrkvz/eiv0tumu iYXy6O0nZP23aFi5v9lOnhQsF8GPkn/3YssdtZp2b07qbDgB2/VMIJiuP7vuU/t4JHaJ BF68ZyJEuBqNvyroRtKpWfokadbobJS6mJzqlYp/fqYtTjOaHyW/NmhWWi2BS+iO2GW6 avl1rUbEQxB+QmkCcnOV6alrNa6/McIoPNnPhK34z9hdJmyKq4S7e0qcdeZJZArVhzua 5AvDkjlZs50HxHQoj9MJNEcw2LuBpaCbH4VRiGSZ1cxHc3ZWwR5zs9u5qHroYeWAxVXs 5lgA== X-Gm-Message-State: AOAM532Mj24XDfMo3/xmZh6KKSqBQKxPx5CBWm8tVHPsHdMlpXPiLx6D z9i/L7uLe5Nxffl4D7DtGyC+25ivsuxFZQ== X-Received: by 2002:a17:90a:564f:: with SMTP id d15mr8205514pji.238.1643810077633; Wed, 02 Feb 2022 05:54:37 -0800 (PST) Received: from localhost.localdomain (113x37x226x201.ap113.ftth.ucom.ne.jp. [113.37.226.201]) by smtp.gmail.com with ESMTPSA id g20sm4952833pfj.196.2022.02.02.05.54.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Feb 2022 05:54:37 -0800 (PST) From: Masami Hiramatsu To: u-boot@lists.denx.de Cc: Masami Hiramatsu , Patrick Delaunay , Patrice Chotard , Heinrich Schuchardt , Alexander Graf , AKASHI Takahiro , Simon Glass , Bin Meng , Ilias Apalodimas , Jose Marinho , Grant Likely , Tom Rini , Etienne Carriere , Sughosh Ganu , Paul Liu Subject: [PATCH v2 1/2] efi_loader: use efi_update_capsule_firmware() for capsule on disk Date: Wed, 2 Feb 2022 22:54:33 +0900 Message-Id: <164381007304.420956.13072455526097288152.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <164381006265.420956.16575397258903175632.stgit@localhost> References: <164381006265.420956.16575397258903175632.stgit@localhost> User-Agent: StGit/0.19 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.5 at phobos.denx.de X-Virus-Status: Clean Since the efi_update_capsule() represents the UpdateCapsule() runtime service, it has to handle the capsule flags and update ESRT. However, the capsule-on-disk doesn't need to care about such things. Thus, the capsule-on-disk should use the efi_capsule_update_firmware() directly instead of calling efi_update_capsule(). This means the roles of the efi_update_capsule() and capsule-on-disk are different. We have to keep the efi_update_capsule() for providing runtime service at boot time. Suggested-by: AKASHI Takahiro Signed-off-by: Masami Hiramatsu --- Changes in v3: - Update patch description. Changes in v2: - Fix to pass correct pointer to efi_capsule_update_firmware - Remove ESRT generation, because this part anyway will be removed next patch. --- lib/efi_loader/efi_capsule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index 4463ae00fd..1ec7ea29ff 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -1118,7 +1118,7 @@ efi_status_t efi_launch_capsules(void) index = 0; ret = efi_capsule_read_file(files[i], &capsule); if (ret == EFI_SUCCESS) { - ret = EFI_CALL(efi_update_capsule(&capsule, 1, 0)); + ret = efi_capsule_update_firmware(capsule); if (ret != EFI_SUCCESS) log_err("Applying capsule %ls failed\n", files[i]);