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 X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D6C6C2B9F4 for ; Tue, 22 Jun 2021 14:39:12 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 37FB861361 for ; Tue, 22 Jun 2021 14:39:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 37FB861361 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de 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) 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-Google-Smtp-Source: ABdhPJxevGRiLiYm8XdRL+keRm3naqxhKLHihHPp4ndUqHfnrt2aS1NvAvIBigfPsll1/V2zpR/f2A== 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 Content-Transfer-Encoding: 8bit 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(-) 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 -- 2.32.0.rc0