From patchwork Tue Jun 22 14:38:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 465168 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp715396jao; Tue, 22 Jun 2021 07:39:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWWF13aLwjHJY7loAywAz3TIJ71/0ySU9LFHDTMJANwx+vO68o9k42wIEFlli9aI1iXkMF X-Received: by 2002:a17:906:d1d1:: with SMTP id bs17mr4399657ejb.492.1624372752616; Tue, 22 Jun 2021 07:39:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624372752; cv=none; d=google.com; s=arc-20160816; b=QdJs59AFuUyOJl0wx/B39ycJMnMWmrjupYc7PLaj3BT5rrbvCUZOl5NJ/TsJg36XVM sMFCRZUSw2wUwOcz5+4Ta2tb5M1hmJ8NWiKhVkTP8FhAWLS8R7FotqurgyH1RdAeGNYF HbxZr4t+5qYVapK+1RXLf0l1Ti0l0UL8JQ9MOIlSBsZQzrkWw+FSZ7wisEdoG5snBFG/ Uqz8ykWINN0+MQ7+S548PfZr7ffjYFqUV7eFX3ZIn2cT4NDzyfj9Biwjpi9nGJuiPU+l QxnFuo2d64bx3SxRUjSX+LgxeGAwDOuF+cp2Ejotwj7g7K3u0iBVMHUqWsJUe7N7fQ0i R1BA== 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=scL/5FgjbZG4+3lf4Tw6ZqLEe03kxfKL5qTLzaYJwTk=; b=XMhSbReIYnBxMzJAbZRIotTKab6JLhK/5LuWIs1zApabdM5/5MJUn4BLUXI/r6h88C fLY5udfc5W0hrFg1oO3IpOL0n+nHCJ+tfWNFWHS9SQBuANMeny/p1lyRixzlwYBPsc26 M1ffKuqhSGFbFfRKJSMTUDfCXH79O8fQ8lR0gpHtxGCHPVvNuDHEfprx1ibSal2mZR0Y 6EPdo4L3huJ64ybHVs7qEIFJ2Snh8a9fZ8vwGtOSp5RH406FZvZtW/4YA7OjNtXbjSnk TlqOmokDWI9eMHPW+h6bglRqdgV+wjR7ZzXsrEOrVdwCbay8EN7MsAvNnXwCTTjzsrkn vzZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="W5PDBEJ/"; 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 mc3si5630513ejb.354.2021.06.22.07.39.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Jun 2021 07:39:12 -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="W5PDBEJ/"; 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 98F77829B7; Tue, 22 Jun 2021 16:39:08 +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="W5PDBEJ/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DF6DB829BC; Tue, 22 Jun 2021 16:39:05 +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-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) (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 45B2281E1C for ; Tue, 22 Jun 2021 16:39:00 +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-x432.google.com with SMTP id y7so23860912wrh.7 for ; Tue, 22 Jun 2021 07:39:00 -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=scL/5FgjbZG4+3lf4Tw6ZqLEe03kxfKL5qTLzaYJwTk=; b=W5PDBEJ/3fBpwDlxO+doKRBcEfvEC3ljbAQM4dz8fdpejt59WuW2Tannh92HRnRhZy xhC4/iLDC1U3L+/5jNgk/d5tRZrOvgjkiT1fYskobtF4AaHXvEvE47qXxwthYJ1F1jUD lUJ9IDYlyDE9DRuX4pp7pptz+VV5fy8EzlJyzREV4GtXeaMbKjsICwfiUBFuFFCZFGv/ BkO3QVf3yVbnr7DUSZGlZf1eYKchPCCcwKRRPjPydVQN4/N8qbqo6vbCJS8QZQ6FW3wG 8u/ea0eEBZjoN28ndaFK+1QmZD/4mIkFPsow3OxlmKXmEjSwXKyfxI/Ro2UlH/EnMudF h0ew== 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=scL/5FgjbZG4+3lf4Tw6ZqLEe03kxfKL5qTLzaYJwTk=; b=uje7mg/JWaHLcd/8EKvfKxpV+tl3rGRaMS46udA5/Pq7u6IPN4Z9LsC3oaOAxWvLUu exeELP5woxG8H28RpKsczoR6wao83TrSR0zooQvcrI67sa+WVgQB9+avJPLaWSbyjKvd dZGuTFLkV6fhuQiTFQ36WklDpvyidayc/m/dk9N/Ni1jDDz6a3QYAdELJaeLPW7s+1sc Uf4iU3yLihOUqCfQzV7S8+s3gi2rl8lOHyqjPkoXYLfG9ew8RRgWVYn8N/Njo4Ndn/Bs gThsx2hRmAunsfqUsLMaKicUUZnkPLKvKODsApeDi2JN9wBUAaF2MaP8X2SBLy4y5rPZ 95hg== X-Gm-Message-State: AOAM532a6gg+DX3lUseM/MM3tZoW55ORi+bYq/1SAKppacQm0ogNGTVi ga80rGcYHuLRUnPvwKdv+vYQMw== X-Received: by 2002:adf:e652:: with SMTP id b18mr5128313wrn.379.1624372739843; Tue, 22 Jun 2021 07:38:59 -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.38.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Jun 2021 07:38:59 -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 v3] efi_loader: Force a sinlge FMP instance per hardware store Date: Tue, 22 Jun 2021 17:38:52 +0300 Message-Id: <20210622143854.15682-2-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 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 --- Changes since v2: - Changes since v1: - 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' configs/xilinx_zynqmp_virt_defconfig | 1 - lib/efi_loader/Kconfig | 45 ++++++++++++++-------------- 2 files changed, 22 insertions(+), 24 deletions(-) -- 2.32.0.rc0 Reviewed-by: Masami Hiramatsu diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig index 6adbe987cb7f..4d34e6c4cba5 100644 --- a/configs/xilinx_zynqmp_virt_defconfig +++ b/configs/xilinx_zynqmp_virt_defconfig @@ -187,5 +187,4 @@ CONFIG_OF_LIBFDT_OVERLAY=y CONFIG_EFI_SET_TIME=y CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y CONFIG_EFI_CAPSULE_ON_DISK=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