From patchwork Mon Mar 21 13:37:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masami Hiramatsu X-Patchwork-Id: 553339 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:1248:0:0:0:0 with SMTP id z8csp1510680mag; Mon, 21 Mar 2022 06:38:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwspwB/3B0JAKzaPbVF/5G+01OHXc9qBECrf56YmsM0v5k4yeJg4A9iPso4QfgVVE2Du274 X-Received: by 2002:a17:906:c111:b0:6db:cf0e:3146 with SMTP id do17-20020a170906c11100b006dbcf0e3146mr21025791ejc.280.1647869882436; Mon, 21 Mar 2022 06:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647869882; cv=none; d=google.com; s=arc-20160816; b=ZHR4iIACpcoxum/4aij+AkShLi37BcVCZWU+/rzr9fDPAoZ4mAfHsUxxqKVRV5DCVg UMEtZGos1IL7vWzVvG0hDskByl3P7IXBlwYv6/wZqBQoIThMp/NhfADWdZXGTJAdd6i1 WDLHsVzgyA7sXcLOQRrbcIWjSDlcHBkmEtSg2TYyUh8WzJ6jfVWRFGKBn3Kw59zxgmNd tay189tLdLgCxWVDwCf2FMGRmN723BMjZNweP/mIUPj7arA/KTe9h2lIJxfSczxqmFEn bRBbOHAmxs5sf1wy0VdaQemVioL6HS7ayxELOIPhg3Foe/t14QpA9RTvGTIY0+4CmEdu n6wA== 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=NAtfbNoiWIqOvID50l3qL1i+x8tOY5Kw0eMptFIz+Rg=; b=tONa2RRPOVYR4POzzw3/w2AbIwM+5PCOsfipATIj+Uxno9kJvzymviblGlypwScUS9 lCUxtc5N/HuhY2xy4KG5Ca5MTCggfsj4JbmaVi3mOJgkTvxPGRHvVGWclVvQKi6ou2kb KlXeGXzX73DUQhH/KDMKDzpEZpRV2THYTgk90pVpw3minuMU48pZQ0fXH2JGbY30tfnA PyrR3VxaiQvBfpUGle5YSYn4Zi8fCvvULZk6d3bu7EmuoL+JvcMsBQEsemI1GUk/ZNQQ 6kaqV1Z3EikcFuA9HhU1CL8ENafyyhiTCflz9DO/mythsXd8UY2l5OBS71Uheur+XpXC glfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qk1udowk; 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 hr29-20020a1709073f9d00b006df76385c74si8462696ejc.276.2022.03.21.06.38.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 06:38:02 -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=qk1udowk; 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 4AA7383B19; Mon, 21 Mar 2022 14:37:58 +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="qk1udowk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 507AF83B15; Mon, 21 Mar 2022 14:37:56 +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-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) (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 5D30F83AC8 for ; Mon, 21 Mar 2022 14:37:52 +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=masami.hiramatsu@linaro.org Received: by mail-pj1-x102e.google.com with SMTP id mz9-20020a17090b378900b001c657559290so14013794pjb.2 for ; Mon, 21 Mar 2022 06:37:52 -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 :user-agent:mime-version:content-transfer-encoding; bh=NAtfbNoiWIqOvID50l3qL1i+x8tOY5Kw0eMptFIz+Rg=; b=qk1udowkMJ9wRjKzYrTenwONXS+z+smEKo6O/MClWgspG7YalYpznraKFvctFkR/KL kU7iF0ldGGgi9/TWyVj0X0H/I1iEHTt4ShWcVipluhR5+CmSY9PHHVPwCoZUoT7bY2ME YjDAfOwIFryPjKMkkyyaDDnIgy4uHcTGyu5VTkWsF68os7+e5BsJOB/AcvwSOvOJcXHu ZAXWdkOCZ8V5pvpRxyhZvWFX2zdBLiTIDj3+Yd27glWiuLJw74EqOYVuWllO5fdTHArC nMUiVRDyJFiko/mpFxhcTlvQ/TMxOaiZYQ0eRvWVfTMXPG0k2x24FNN8N4CotIuYq+00 fheg== 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=NAtfbNoiWIqOvID50l3qL1i+x8tOY5Kw0eMptFIz+Rg=; b=p7CJwvLaNPXgqGchyIdYHs2BGKw9BwYSQuxQ/uk/qoLHnrYsbsq1aKeExHoFmBhd1m kafcXmAFlOu9VIsFqDPejQ8mqLxNSaXB68c67WHuzl+MN5Vbm4n0HIjIf5iusUkdpzg+ La7goi/ucEq+qrMxfo3hH1xZcvDIkEazQxKVevp7vPsCYqs9wtAdGzbErfGMtve1/6m0 WZJeKcrE6dprgaVKqgruddPPOgbtf/x4CXMtr4hs1dMTWQPasaJ/oOx9p9/phCFKnQ9A nbo1ipDlBCK3YbOXcf3CWnr5vUb047Nevuk2S83bF4GCEFl/0eyyxWzqn2m8YrSPZp6J 377g== X-Gm-Message-State: AOAM530O10Mi2WDbkw+r4NOAb/6610uny3Dw34149S348u+gZAsyIr7t gT9Wxmhw4hmGFVOPy37IT9WVR+CbwDI2FA== X-Received: by 2002:a17:90a:7181:b0:1bf:a024:ab61 with SMTP id i1-20020a17090a718100b001bfa024ab61mr26169515pjk.200.1647869870564; Mon, 21 Mar 2022 06:37:50 -0700 (PDT) Received: from localhost.localdomain (113x37x226x201.ap113.ftth.ucom.ne.jp. [113.37.226.201]) by smtp.gmail.com with ESMTPSA id lp4-20020a17090b4a8400b001bedba2df04sm17316491pjb.30.2022.03.21.06.37.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 06:37:50 -0700 (PDT) From: Masami Hiramatsu To: u-boot@lists.denx.de, Simon Glass Cc: Masami Hiramatsu , Patrick Delaunay , Patrice Chotard , Heinrich Schuchardt , Alexander Graf , AKASHI Takahiro , Bin Meng , Ilias Apalodimas , Jose Marinho , Grant Likely , Tom Rini , Etienne Carriere , Sughosh Ganu , Paul Liu Subject: [PATCH v3 2/3] efi_loader: Make efi_load_capsule_drivers() available even if EFI_CAPSULE_ON_DISK=n Date: Mon, 21 Mar 2022 22:37:45 +0900 Message-Id: <164786986566.412493.9219227328802655993.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <164786984495.412493.4209842889853239285.stgit@localhost> References: <164786984495.412493.4209842889853239285.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 Make efi_load_capsule_drivers() available even if EFI_CAPSULE_ON_DISK is disabled because the caller (efi_init_obj_list()) expects it only relays on EFI_HAVE_CAPSULE_SUPPORT. Signed-off-by: Masami Hiramatsu Suggested-by: Heinrich Schuchardt --- lib/efi_loader/efi_capsule.c | 60 +++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index 613b531b82..9fd6f78ad9 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -619,6 +619,36 @@ out: return EFI_EXIT(ret); } +/** + * efi_load_capsule_drivers - initialize capsule drivers + * + * Generic FMP drivers backed by DFU + * + * Return: status code + */ +efi_status_t __weak efi_load_capsule_drivers(void) +{ + __maybe_unused efi_handle_t handle; + efi_status_t ret = EFI_SUCCESS; + + if (IS_ENABLED(CONFIG_EFI_CAPSULE_FIRMWARE_FIT)) { + handle = NULL; + ret = EFI_CALL(efi_install_multiple_protocol_interfaces( + &handle, &efi_guid_firmware_management_protocol, + &efi_fmp_fit, NULL)); + } + + if (IS_ENABLED(CONFIG_EFI_CAPSULE_FIRMWARE_RAW)) { + handle = NULL; + ret = EFI_CALL(efi_install_multiple_protocol_interfaces( + &handle, + &efi_guid_firmware_management_protocol, + &efi_fmp_raw, NULL)); + } + + return ret; +} + #ifdef CONFIG_EFI_CAPSULE_ON_DISK /** * get_dp_device - retrieve a device path from boot variable @@ -1007,36 +1037,6 @@ static void efi_capsule_scan_done(void) bootdev_root = NULL; } -/** - * efi_load_capsule_drivers - initialize capsule drivers - * - * Generic FMP drivers backed by DFU - * - * Return: status code - */ -efi_status_t __weak efi_load_capsule_drivers(void) -{ - __maybe_unused efi_handle_t handle; - efi_status_t ret = EFI_SUCCESS; - - if (IS_ENABLED(CONFIG_EFI_CAPSULE_FIRMWARE_FIT)) { - handle = NULL; - ret = EFI_CALL(efi_install_multiple_protocol_interfaces( - &handle, &efi_guid_firmware_management_protocol, - &efi_fmp_fit, NULL)); - } - - if (IS_ENABLED(CONFIG_EFI_CAPSULE_FIRMWARE_RAW)) { - handle = NULL; - ret = EFI_CALL(efi_install_multiple_protocol_interfaces( - &handle, - &efi_guid_firmware_management_protocol, - &efi_fmp_raw, NULL)); - } - - return ret; -} - /** * check_run_capsules() - check whether capsule update should run *