From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3ACB9C433F5 for ; Mon, 21 Mar 2022 13:38:02 +0000 (UTC) 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) 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-Google-Smtp-Source: ABdhPJyH8boq2xdKnTkANZ3uFwCwIlJWuAPf9CApzopPpRaPUB/8LiOjRheLo3m4xAk0wYp7AOs1Fg== 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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 *