From patchwork Tue Jun 22 14:38:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 465170 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp715725jao; Tue, 22 Jun 2021 07:39:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxQv/aJbnPFNkMVBuMVMKELK7YGPBjOZDHMpNqeglFC5fD+ek52PCDZYUGW/YREsOWOM6S X-Received: by 2002:a17:906:82cf:: with SMTP id a15mr4305967ejy.359.1624372773730; Tue, 22 Jun 2021 07:39:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624372773; cv=none; d=google.com; s=arc-20160816; b=0zUocrjkA5+q4Be29MzZ1iDakS/M4di/OTDCwvy7z8leTrTwY0DxcDFusFJPXSc/Jr 2jWFrm6wa2fAGWs9TBFUztU4QaZs/dG/7U8lTq7FTBJr0fIGzd+ZfQbOxgyJ2OGHbTdk knoTiweGf4BccpQsvT5tyyzupGqjOjb/O8q1rTy8JsvwfbW4Bz3hAeh4nWBfLP4UPaQL 9jbdMLg8TDGK1CdHMy7RTCFKCZ+tXsJqPHj+VPY4PI9bfjITfLwBNVwnPvwqYgGW9/Mo 7+J8XG8nxac8WuvjV0+LJE0Bzb8jnEiM0nyRDNTLsVDS1q0NkkC5MLuRzL5+pmQuV67u lv8w== 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=rpupr+k/yt0P3GX+hB+UHAUSqZjF5B/VtiJg7HWUyo8=; b=PdeNT9oNKMXm7HBmXjQT2A7Ox9mpnDxhRGaitAVMDKqp6TcH+pJ+lGMi50oQmPbWTe CXENP3oyA5uDAvMBBsKQiLEyX6pWaXE8ChgKP74g2gcR+EOuDG74kwqP+wH6GeSTbpvo 9Ah5X8/m7cxzZyM+nfjBwi8xojxPgB94pQMScJ9CjoAVd9r5wPlFXa+FKex/PcXsNqPf gsdeA4G1R9/8aXrQZzHK33f7r1H7z0SPwFYyLG/h3emW6kyNQnkG2EbBq33fV79w/BFF F0YOUUjF8vpwfrzHQw2tkEgfy57vfdx32mxNS6pk9OqXPPeVrfW7rt7qvXXR84Gpw9CF fsDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vZyHtUaV; 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 21si13401808eji.338.2021.06.22.07.39.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Jun 2021 07:39:33 -0700 (PDT) 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=vZyHtUaV; 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 2232882A01; Tue, 22 Jun 2021 16:39:17 +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="vZyHtUaV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0BE5B80F32; Tue, 22 Jun 2021 16:39:09 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) (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 51A5480F32 for ; Tue, 22 Jun 2021 16:39:02 +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=ilias.apalodimas@linaro.org Received: by mail-wr1-x434.google.com with SMTP id e22so20409384wrc.1 for ; Tue, 22 Jun 2021 07:39:02 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=rpupr+k/yt0P3GX+hB+UHAUSqZjF5B/VtiJg7HWUyo8=; b=vZyHtUaVUkcNCW//5H92o22mJ9YGwQrb0wMnU4psVspMO4pdEf7L7ndTsYbLaaqy24 pq6S4dysooTRsO77xcHWK0+nUXnFFcnA/Z19clF4cupjs0cXARl2rYS4LTd9z8Eq7E1s P0/0kYY+fLLhtXHZFLaXOSEwlSvi2uWf03IiYa2i6GyYXPv43FctxGWkPfnnROn+MDnE AkESKsgsoVKbiCxjQt+yhmWgH328RglSQkRuNEa22y168oiUvi1OGcXO0LOkegCDpMzn 8vY0ep2dmk1FqWkrqHbCA/B2IAl4pLnD8lKaRSRaADpt253VtktI362mehuxMAzvcvcc cEcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rpupr+k/yt0P3GX+hB+UHAUSqZjF5B/VtiJg7HWUyo8=; b=GwA49cOZ8eIsi89RZe9bQfkY6MnZ+OGBhiULcQWFzIsDSTXllQ5GYwulHGXV+KGSla WG9c5bfUFI6p7kEujuOCwt9nYrgLtd9MjXLEmjj1SSy/mXWXsaMOGBUrYK1y7N0Woylf lD4maQB2ca8pAXEdiaMI16bQYtEYz+FTODFRFtO/NdcgvFZu30gujcBvAfoE7sWZfd3Q NV6Gjjjd4Ir+4TbI3rH33jCIOTehJ9+ykTs8GzVE6fZQbw7+QOyvsE38hjrXu0v4CIQI eJNfTHg73Bf/gVcuHmPemDE0tloJjp1cyK16vWm7Tmioj25QPeseBWKWw1FTjYYhWyPH S0gw== X-Gm-Message-State: AOAM5339+ByvTa6WOKmIISnFEB3lRPuc44fXtkYBg7WEmw9FsNJOn40/ 2FUnn9baG0mKWXLafrcVF05Vzg== X-Received: by 2002:a5d:40c7:: with SMTP id b7mr5236307wrq.224.1624372741799; Tue, 22 Jun 2021 07:39:01 -0700 (PDT) Received: from localhost.localdomain (athedsl-419796.home.otenet.gr. [79.131.191.210]) by smtp.gmail.com with ESMTPSA id y17sm2615009wma.48.2021.06.22.07.39.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Jun 2021 07:39:01 -0700 (PDT) From: Ilias Apalodimas To: xypron.glpk@gmx.de Cc: masami.hiramatsu@linaro.org, takahiro.akashi@linaro.org, Ilias Apalodimas , Michal Simek , Alexander Graf , u-boot@lists.denx.de Subject: [PATCH 3/3 v3] efi_loader: Always install FMPs Date: Tue, 22 Jun 2021 17:38:53 +0300 Message-Id: <20210622143854.15682-3-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210622143854.15682-1-ilias.apalodimas@linaro.org> References: <20210622143854.15682-1-ilias.apalodimas@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean We only install FMPs if a CapsuleUpdate is requested. Since we now have an ESRT table which relies on FMPs to build the required information, it makes more sense to unconditionally install them. This will allow userspace applications (e.g fwupd) to make use of the ERST and provide us with files we can use to run CapsuleUpdate on-disk Signed-off-by: Ilias Apalodimas --- Changes since v2: - Changes since v1: - Only install the FMPs if CONFIG_EFI_HAVE_CAPSULE_SUPPORT is selected include/efi_loader.h | 1 + lib/efi_loader/efi_capsule.c | 11 +++-------- lib/efi_loader/efi_setup.c | 6 ++++++ 3 files changed, 10 insertions(+), 8 deletions(-) -- 2.32.0.rc0 diff --git a/include/efi_loader.h b/include/efi_loader.h index 0a9c82a257e1..b81180cfda8b 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -972,4 +972,5 @@ efi_status_t efi_esrt_register(void); * - error code otherwise. */ efi_status_t efi_esrt_populate(void); +efi_status_t efi_load_capsule_drivers(void); #endif /* _EFI_LOADER_H */ diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index cc6ed453ed21..d7136035d8f9 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -919,13 +919,13 @@ static void efi_capsule_scan_done(void) } /** - * arch_efi_load_capsule_drivers - initialize capsule drivers + * efi_load_capsule_drivers - initialize capsule drivers * - * Architecture or board specific initialization routine + * Generic FMP drivers backed by DFU * * Return: status code */ -efi_status_t __weak arch_efi_load_capsule_drivers(void) +efi_status_t __weak efi_load_capsule_drivers(void) { __maybe_unused efi_handle_t handle; efi_status_t ret = EFI_SUCCESS; @@ -976,11 +976,6 @@ efi_status_t efi_launch_capsules(void) index = get_last_capsule(); - /* Load capsule drivers */ - ret = arch_efi_load_capsule_drivers(); - if (ret != EFI_SUCCESS) - return ret; - /* * Find capsules on disk. * All the capsules are collected at the beginning because diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c index 3c5cf9a4357e..2dc6ba8337a7 100644 --- a/lib/efi_loader/efi_setup.c +++ b/lib/efi_loader/efi_setup.c @@ -254,6 +254,12 @@ efi_status_t efi_init_obj_list(void) if (ret != EFI_SUCCESS) goto out; + if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)) { + ret = efi_load_capsule_drivers(); + if (ret != EFI_SUCCESS) + goto out; + } + #if defined(CONFIG_LCD) || defined(CONFIG_DM_VIDEO) ret = efi_gop_register(); if (ret != EFI_SUCCESS)