From patchwork Fri Jun 18 10:51:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 463038 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp1348510jae; Fri, 18 Jun 2021 03:51:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyToUsDjSIRhtdiVHjbXrYhp9u7LCIg8ybUoO69FE2fibdFgrEiPGbhcObYfwHAzOAIf1T4 X-Received: by 2002:a17:907:a95:: with SMTP id by21mr10644490ejc.514.1624013488007; Fri, 18 Jun 2021 03:51:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624013488; cv=none; d=google.com; s=arc-20160816; b=C15IfpH1QIUS63fmgDHiWsT/EBMjCuRaNX1wiDgje3S66YmEEOvVS5hZv+uaQnE64c +pZurabZBQikRCHsOtdUNcK+j4lNJ1oIXtUjGFDhwHdhD9t8YvRGobb9+80ZKcVvIez8 zW8yIw4MpCj0Nh5c7Y8T4tRmLVJhqFxlslw4S5BhNz0720AezhpcAADe3ZUDIAkOdLhW CsaCjii2SivnUiHu2VQk+dCTbGXsQkgoapj8lkFp2EhTAkyJt8lNYsaazPsF5UrcR7YZ 4ZezjIkQCoJqcVWhrPsVJxokprvBWPwdSJoPtpMoZ6aN4QCz6p4ILRX7tdl4QTS8zChH EJ5Q== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=lYKkw/lKpjkWBOfHbDI3okXrGfg7APnrxtVVamH3fz0=; b=Gl4J2nyWuSIkQ3gPpz5jQd4mpcQMiEH0QJmDEpjrZLhafshQscHjQSfEbjP4h3bOgh oS1p52nZouVTO4/8sF1g14XdOvh3HWjGqxk7qgiBxlDEMqCOjNixlxrkWg31UPKCWhWj DLhOw7BijqMF16f6C0tMrjX7oA6JUEkoB1VASUGocALyD18AKf7RKPJSqMTZVeNTNE0q wX453daG5Zp1Ynbh1PziafwZ0iOg2jRufSnNu57jBqefhbkGRdutW6RjD0jjn40MT49d x5xngLtxQwrrVG1s/woqRJ/WTtZR81wvQVOX64DfJdz9Awq11bRTxd3Y4q/uWLI4sv/A pYfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cFwBsa9Z; 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 m19si2108953edd.117.2021.06.18.03.51.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 03:51:27 -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=cFwBsa9Z; 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 85BCD82B3D; Fri, 18 Jun 2021 12:51:23 +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="cFwBsa9Z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 90A3082B3D; Fri, 18 Jun 2021 12:51:22 +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-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) (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 51A4382B00 for ; Fri, 18 Jun 2021 12:51:19 +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-wm1-x332.google.com with SMTP id t4-20020a1c77040000b029019d22d84ebdso8391864wmi.3 for ; Fri, 18 Jun 2021 03:51:19 -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:mime-version :content-transfer-encoding; bh=lYKkw/lKpjkWBOfHbDI3okXrGfg7APnrxtVVamH3fz0=; b=cFwBsa9ZHAWkTjHCNGVvFyhJvMPl+No5OG8TNknCQMD41P8WAyNAkO1Roylj91i6bD SHNFZcRcXI9glC/mWiVjLLhHB5kWZlknSq1us7ZPCmJJRHO52DHZoNUR+iBBVEX+ZHzn mgQ4S5LasBlrnyiH7lY/hrKtk9nEO3x5jfEY3YSsCO666XLvaBUoldIgudQgveJ6ccwJ VJtwwSjSW2JsPVUOA8N5+rKVOPmtbIiiSJEHnNMq+16XbHeeIXbHYaAZW+/1pTgUGhNH x1HpSEB6LyZgNoty+J1K8DdO7CN8NDeRg4xaI+Xel587FG1MmtQ3aFeikzUHBRxey0Ui nlFg== 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:mime-version :content-transfer-encoding; bh=lYKkw/lKpjkWBOfHbDI3okXrGfg7APnrxtVVamH3fz0=; b=HhgLpjPokPG7O7FxnVg8GIBpufi4V/KrXzaC31zYuu27GAwdWunPOM18Z/5re8l9Yj jhTd3nGePKUfDAYEZjbTxJlW705l8RWiK0Iy63oPTz7a9Jp0aX+wrRM704aKt0ULcw9r 9PGXOeUSfc/tPeDuwByGuMnKKJVtum1XUCvYt08jPfbDaCDgNeyl0IL9EVoc7z7cSyVd LB/HOKZl85vRtuF/veGez3/9yoffP0yiSoa+ArqAna7QpwzNlfO7XauvNQySeZN/L0MV tEjuIZ5+ubjB67X3hrDfSj+FDdR4Jj5Vz4gXzYmpRDAnl+sXtixnblioddZwBzG0bKts GtBg== X-Gm-Message-State: AOAM533V+HOfKtfptuT0klXKMimWQNq+Lf3QtdxNE4YyZaisFzDR7Ily 1iPltkmmVJdQKxxo3jHoqtLJWQ== X-Received: by 2002:a05:600c:5128:: with SMTP id o40mr10516158wms.43.1624013478855; Fri, 18 Jun 2021 03:51:18 -0700 (PDT) Received: from localhost.localdomain (athedsl-269684.home.otenet.gr. [85.73.101.18]) by smtp.gmail.com with ESMTPSA id o18sm11377758wmq.23.2021.06.18.03.51.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 03:51:18 -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 1/3 v2] efi: Fix to use null handle to create new handle for efi_fmp_raw Date: Fri, 18 Jun 2021 13:51:12 +0300 Message-Id: <20210618105115.257938-1-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.32.0.rc0 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 From: Masami Hiramatsu When running the efidebug capsule disk-update command, the efi_fmp_raw protocol installation is failed with 2 (EFI_INVALID_PARAMETER) as below. This is because the code passes efi_root instaed of handle. => efidebug capsule disk-update EFI: Call: efi_install_multiple_protocol_interfaces( &handle, &efi_guid_firmware_management_protocol, &efi_fmp_fit, NULL) EFI: Entry efi_install_multiple_protocol_interfaces(00000000fbaf5988) EFI: Call: efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) EFI: Entry efi_install_protocol_interface(00000000fbaf5988, 86c77a67-0b97-4633-a187-49104d0685c7, 0, 00000000fbfa6ee8) EFI: new handle 00000000fbb37520 EFI: Exit: efi_install_protocol_interface: 0 EFI: 0 returned by efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) EFI: Exit: efi_install_multiple_protocol_interfaces: 0 EFI: 0 returned by efi_install_multiple_protocol_interfaces( &handle, &efi_guid_firmware_management_protocol, &efi_fmp_fit, NULL) EFI: Call: efi_install_multiple_protocol_interfaces( &efi_root, &efi_guid_firmware_management_protocol, &efi_fmp_raw, NULL) EFI: Entry efi_install_multiple_protocol_interfaces(00000000fbfec648) EFI: Call: efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) EFI: Entry efi_install_protocol_interface(00000000fbfec648, 86c77a67-0b97-4633-a187-49104d0685c7, 0, 00000000fbfa6f18) EFI: handle 00000000fbaf8520 EFI: Exit: efi_install_protocol_interface: 2 EFI: 2 returned by efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) EFI: Exit: efi_install_multiple_protocol_interfaces: 2 EFI: 2 returned by efi_install_multiple_protocol_interfaces( &efi_root, &efi_guid_firmware_management_protocol, &efi_fmp_raw, NULL) Command failed, result=1 To fix this issue, pass the handle variable as same as the efi_fmp_fit installation. Signed-off-by: Masami Hiramatsu Signed-off-by: Ilias Apalodimas --- v1 is at https://lists.denx.de/pipermail/u-boot/2021-June/452097.html changes since v1: - split patches - pick up Masami's patch fixing the efi_root issue - Don't use 'choice' on Kconfig sicne we need both of the FMPs installed for sandbox testing instead just make them mutually exclusive with 'depends on' - Only install the FMPs if CONFIG_EFI_HAVE_CAPSULE_SUPPORT is selected lib/efi_loader/efi_capsule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.32.0.rc0 diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index 9ead0d2c7816..71d3d1e523ce 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -939,7 +939,7 @@ efi_status_t __weak arch_efi_load_capsule_drivers(void) if (IS_ENABLED(CONFIG_EFI_CAPSULE_FIRMWARE_RAW)) { handle = NULL; ret = EFI_CALL(efi_install_multiple_protocol_interfaces( - &efi_root, + &handle, &efi_guid_firmware_management_protocol, &efi_fmp_raw, NULL)); } From patchwork Fri Jun 18 10:51:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 463039 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp1348594jae; Fri, 18 Jun 2021 03:51:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyXJQ937q0Tc5rgj73TKSO5vzXj7nDc8/41XVsqUuRdDZqsOQewWPATZ6wgx9CGpJ2avY6 X-Received: by 2002:a17:906:dc43:: with SMTP id yz3mr10519506ejb.323.1624013499117; Fri, 18 Jun 2021 03:51:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624013499; cv=none; d=google.com; s=arc-20160816; b=Zm0vx/E996p/npo0NVzYwd6ABiGPdekYoTgMRDO3iYX/IVAGrJ+Wl7D+kTYXh1+hGk uyWeFSfiUyTk4UESSwPB1hXT47rZxADL1MVUzrXRMFt8+Zpb4sQaQYU/jan5c+ZuXjd7 XoETmDbmiL9KCRqioUYEQXr6NaBtejM9mGZK37P0ibMmEqLNUpEbXMTKSiHWCRV0gOuN ZRIGkxOiJX5v4EAQnEsjy15HaeOVauHLNULEPfz2gICSHL5c57NKlacMRxspik5n4WYX rJS5SmpcfaAXOSLJZfPJzs3YCgRwlmEGQyyaUUmgcPant3JC+sWKe3+gH+ueQZEIrPuc gRFw== 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=63aMAa1ea3EuSM9LYnngVap96hEqcUchFZJhoaGbXGI=; b=YGFRB5dlyTXzkIIipKD5kuMUmp0gcY171+Yr9AiT9sqU0LsoLJDcB3+Xo73vkS5YVT YqXFkJndSiSq/3a+wxa/KhVgx4KO7P927sTG8kZEsGYMsbhpgDm0DngvSu8LX8kcsr/Q H3BE2wsyZbIkIFVw6W+qEh5tISK9IMwS0tfHf5ku6t0Ke77xlp4Oxlc9RQdQ1D23DlSI JwR47NXKFhMS/iB+EsWLUoAUDrLURAPGLe8z5+izJWAE2M1/CIR8fh1KpJCuosegTpPG xYJ1jNvIaRpAjF5FsR9UwjXYrMzHFk/LTmIOZmERoc1kkA4s+uV8PIRIt7dxjmsYbBkV a+Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NU0pvCgx; 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 cz9si5085341edb.398.2021.06.18.03.51.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 03:51:39 -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=NU0pvCgx; 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 9CBE382B55; Fri, 18 Jun 2021 12:51:29 +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="NU0pvCgx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 62AA082B89; Fri, 18 Jun 2021 12:51:24 +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-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) (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 2EB4182B33 for ; Fri, 18 Jun 2021 12:51:21 +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-x42b.google.com with SMTP id n7so10289370wri.3 for ; Fri, 18 Jun 2021 03:51:21 -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=63aMAa1ea3EuSM9LYnngVap96hEqcUchFZJhoaGbXGI=; b=NU0pvCgxD1PWWhj+v5w4Ksf0KFsPUxITEhuD7B8Aja3JxmF/WyjT2hOll/CzrFenJx ZqM+olhQEwnBROtd+6kEtg2ziu5PXLXYkWZzBRZmhW8GUKrTxA4F78D3BRHppCwhXCik 7IKnM5ab+28ZTvXOJzVXqubdhYl9mTgYY1grgNzS7rM4bFuEuAKcyQA9Fv7BVTnCaoAs dAIu4x2d5AnLeQNZkHMoQKD6bhLnWwKdGLTHlC7sFmf4VFT59fL4Ujgzyi5WFlNB6d54 joLtT+qtJU/ITRbDkgW+cMS0vC4kpowNbbxiv3dhOe448CO1nCUEUyTWVoPisOMBO4xn oACg== 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=63aMAa1ea3EuSM9LYnngVap96hEqcUchFZJhoaGbXGI=; b=WtOE+8PbLJENRRnybslbQXncnyEq3L/LJMvwzgasm+wldGz9i2zjj8JhMBBwGg8tvz jHFb/Rl2di1Km4pTDUTee5MFWtfT+dhR0DpbsKdnMcOTw31u/ltk5yj0w8BM64m2k4st /X6DataS7gTxJObEsGFHFxrn+ihN65B1KV/1WR//2jqXqTRuNHeVXUBRFODMjvkD2+qs 1Ei/YVxTtZNCDZfiah/s4gnwIAGhROYPnlo9kte58P/ctbq6atRGgUV5RyPKBu31vBrF cYrdgE548PL2Ab8pShK55jPXMN6CdLwY7SviSoH90ZfudJfk3cJ+U72OKgPfvzyVdgDQ IChA== X-Gm-Message-State: AOAM533jp50e7VhMw41BW3MifF6PsKuCZjlJomAi4gtNXfKvaDOnzywi QfyMwcfCsWoeXQkXhKdw9mGplw== X-Received: by 2002:a5d:6a82:: with SMTP id s2mr12154855wru.247.1624013480813; Fri, 18 Jun 2021 03:51:20 -0700 (PDT) Received: from localhost.localdomain (athedsl-269684.home.otenet.gr. [85.73.101.18]) by smtp.gmail.com with ESMTPSA id o18sm11377758wmq.23.2021.06.18.03.51.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 03:51:20 -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 2/3 v2] efi_loader: Force a sinlge FMP instance per hardware store Date: Fri, 18 Jun 2021 13:51:13 +0300 Message-Id: <20210618105115.257938-2-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210618105115.257938-1-ilias.apalodimas@linaro.org> References: <20210618105115.257938-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 Chapter 23 of the EFI spec (rev 2.9) says: "A specific updatable hardware firmware store must be represented by exactly one FMP instance". This is not the case for us, since both of our FMP protocols can be installed at the same time because they are controlled by a single 'dfu_alt_info' env variable. So make the config options depend on each other and allow the user to install one of them at any given time. If we fix the meta-data provided by the 'dfu_alt_info' in the future, to hint about the capsule type (fit or raw) we can revise this and enable both FMPs to be installed, as long as they target different firmware hardware stores Note that we are not using a Kconfig 'choice' on purpose, since we want to allow both of those to be installed and tested in sandbox Signed-off-by: Ilias Apalodimas --- configs/xilinx_zynqmp_virt_defconfig | 1 - lib/efi_loader/Kconfig | 45 ++++++++++++++-------------- lib/efi_loader/efi_capsule.c | 12 +++----- 3 files changed, 26 insertions(+), 32 deletions(-) -- 2.32.0.rc0 diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig index e939b04ef6a5..0c2d1a70a5a1 100644 --- a/configs/xilinx_zynqmp_virt_defconfig +++ b/configs/xilinx_zynqmp_virt_defconfig @@ -188,5 +188,4 @@ CONFIG_EFI_SET_TIME=y CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y CONFIG_EFI_CAPSULE_ON_DISK=y CONFIG_EFI_CAPSULE_ON_DISK_EARLY=y -CONFIG_EFI_CAPSULE_FIRMWARE_FIT=y CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index 6242caceb7f9..684adfb62379 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -161,6 +161,28 @@ config EFI_CAPSULE_FIRMWARE_MANAGEMENT Select this option if you want to enable capsule-based firmware update using Firmware Management Protocol. +config EFI_CAPSULE_FIRMWARE_FIT + bool "FMP driver for FIT images" + depends on FIT + depends on EFI_CAPSULE_FIRMWARE_MANAGEMENT + select UPDATE_FIT + select DFU + select EFI_CAPSULE_FIRMWARE + help + Select this option if you want to enable firmware management protocol + driver for FIT image + +config EFI_CAPSULE_FIRMWARE_RAW + bool "FMP driver for raw images" + depends on EFI_CAPSULE_FIRMWARE_MANAGEMENT + depends on SANDBOX || (!SANDBOX && !EFI_CAPSULE_FIRMWARE_FIT) + select DFU_WRITE_ALT + select DFU + select EFI_CAPSULE_FIRMWARE + help + Select this option if you want to enable firmware management protocol + driver for raw image + config EFI_CAPSULE_AUTHENTICATE bool "Update Capsule authentication" depends on EFI_CAPSULE_FIRMWARE @@ -181,29 +203,6 @@ config EFI_CAPSULE_AUTHENTICATE Select this option if you want to enable capsule authentication -config EFI_CAPSULE_FIRMWARE_FIT - bool "FMP driver for FIT image" - depends on EFI_CAPSULE_FIRMWARE_MANAGEMENT - depends on FIT - select UPDATE_FIT - select DFU - select EFI_CAPSULE_FIRMWARE - default n - help - Select this option if you want to enable firmware management protocol - driver for FIT image - -config EFI_CAPSULE_FIRMWARE_RAW - bool "FMP driver for raw image" - depends on EFI_CAPSULE_FIRMWARE_MANAGEMENT - select DFU - select DFU_WRITE_ALT - select EFI_CAPSULE_FIRMWARE - default n - help - Select this option if you want to enable firmware management protocol - driver for raw image - config EFI_DEVICE_PATH_TO_TEXT bool "Device path to text protocol" default y diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index 71d3d1e523ce..6d9f6aee237e 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -918,15 +918,15 @@ 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; + __maybe_unused efi_handle_t handle = NULL; efi_status_t ret = EFI_SUCCESS; if (IS_ENABLED(CONFIG_EFI_CAPSULE_FIRMWARE_FIT)) { @@ -975,10 +975,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. From patchwork Fri Jun 18 10:51:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 463040 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp1348715jae; Fri, 18 Jun 2021 03:51:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyteQGkYCSNP5UdoBiIUdvXYGuH47Lbclzhkv7JYhogqm+j43hTxVEKUPyNylOG61HhC5fW X-Received: by 2002:a05:6402:40c3:: with SMTP id z3mr4061322edb.187.1624013511564; Fri, 18 Jun 2021 03:51:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624013511; cv=none; d=google.com; s=arc-20160816; b=Az+t5n8bpdFwhUhvm4xlmos0FNeQ7LD/D6h3VpOkR6wa57D3Hs3VcAdGTbEPNOF8qe 8Zt6fqwkX3dH7XUzBrEL0g5JhKsd2myk3I1xs4OibCg0qSGaQvdEZjHNXBjqo/Oa0K5S a08Uvxzvg9hJGxk8z5xcmoB6uuraUtjqqtrTkeTOFuKsqdht0ImNUm4snN7aW6LBGkAo fdxGII7M/3dy5HoA3RQg1GnGZkL0vLfH6G+XJvaXv7YLbyl5HRY612sIAm4N8J+4h814 RtlQUoPaoiLXxkpUEj3bcb5jIlTD+lzRkXeg/xj0sA7T8boJIBMLTg7L1FYmwk7hjhrG /aOg== 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=C5YzjFH5XqJyiwkWT5k8bn4Pe6aS+19cYoDDl7cbd9c=; b=YL6XwsD2c2DLFJhesFnlHEcHYw1RnA4FttW+ksROPSNTOgHhHtTMmEfOtYzdE9Oq+b b56YEs+pVPQ2CRUmlZsPgUMlHqxJIvexg+U8YV0524Z8rY+Fc6wy3+Dy02BDFmKf2M9B kldiInwsqOfB5XsAeoixPW/zVMiwzhIpUzpmX3MLVmacT5/YGa2DVk+Ga+vJkOlFQkJ3 VlshMqgkU7sFGocT51ogfvYT3f5JPgLSDudDc+pDCL+DOmqHb9qV1wwXwbzEt/oDEpNQ O2RkHnTWi4Z70yqvcB/FtWLs9tDdg6faslb7xNX33jPl4f6TIbXMFV+MT6qJgK2eJxOh X/Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oIZz+V75; 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 t9si1112286edr.204.2021.06.18.03.51.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 03:51:51 -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=oIZz+V75; 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 AB4A082BBD; Fri, 18 Jun 2021 12:51:32 +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="oIZz+V75"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CDDA882B89; Fri, 18 Jun 2021 12:51:26 +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-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) (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 3509282B00 for ; Fri, 18 Jun 2021 12:51:23 +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-x42b.google.com with SMTP id r9so10257711wrz.10 for ; Fri, 18 Jun 2021 03:51:23 -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=C5YzjFH5XqJyiwkWT5k8bn4Pe6aS+19cYoDDl7cbd9c=; b=oIZz+V75k2EiMk8j5b7FHQjHROazuxd2v8aCWIuW0e6f09ywCAr1Cbdht0PyjVqeSm B9Xff9vG8kJKZanUb5fBAicqAEab1WqxdHQKzC80ewsBFBF8QzbkAtfnzsZg5UV2OJez RAf7XoNXtx+ch4AgEpAP8cTG5FjiKBTvPckGEtrfVSRCeD127EgkPcMSkZU64nEXJM/a rqEOVLOMatIi74mSjX1WvEsycSTDF6OXs07fjdLlVVPlf7h+YTNR/WcGUnuNL8kW6yNr ram3YkZhdmX01BhR/j78W1XcPFnVOyDki1zqYjxcukwN79JDmLKd2o4gObIm6XbivqVx XGDQ== 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=C5YzjFH5XqJyiwkWT5k8bn4Pe6aS+19cYoDDl7cbd9c=; b=Luh7fKFJpL5Ntlq5vfje44rrfVM90OToAs7zNdJiqH82eJ6o2i+CisW5S96ul+0ch+ sAQORbbuvJeMB2QjJJCNmd6pIYwUNwvo9dyZr05wHHctWHDPSt+ULx9TKcXspQhUxqTP bfvXSCshVFiPe8a7B9Zq3p5asEHjIuk/Z2hiKRD4+ahHc50+MkDNDFXr0LcNjla8NEVZ wydcKph6x4cJDCegTMtoEhNdHlXpU+yMQ1660Mn6TLnuo6xhsIbgZ7unStJnPaq/XZfE CgrnaiB5UeVn6YqZnHgHp3iTjsLXXcxynA4/gnjS5aT/opcyQ2ObRwZqWWaaZh5N7D47 U19w== X-Gm-Message-State: AOAM533cT8lwSn1LSdT2oTvPRUw5LJQogwtKkPkqKSOpUptHYqIkpdql TPoFkuae8Re2ftHxjAZ1a7DyHw== X-Received: by 2002:adf:de12:: with SMTP id b18mr4824372wrm.322.1624013482828; Fri, 18 Jun 2021 03:51:22 -0700 (PDT) Received: from localhost.localdomain (athedsl-269684.home.otenet.gr. [85.73.101.18]) by smtp.gmail.com with ESMTPSA id o18sm11377758wmq.23.2021.06.18.03.51.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 03:51:22 -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 v2] efi_loader: Always install FMPs Date: Fri, 18 Jun 2021 13:51:14 +0300 Message-Id: <20210618105115.257938-3-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210618105115.257938-1-ilias.apalodimas@linaro.org> References: <20210618105115.257938-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 --- include/efi_loader.h | 1 + lib/efi_loader/efi_setup.c | 6 ++++++ 2 files changed, 7 insertions(+) -- 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_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)