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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D783C433F5 for ; Sun, 26 Sep 2021 01:45:29 +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 BCC676108B for ; Sun, 26 Sep 2021 01:45:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BCC676108B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9158F83571; Sun, 26 Sep 2021 03:45:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="CmLNfCrc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 26D1B835B6; Sun, 26 Sep 2021 03:44:08 +0200 (CEST) Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) (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 0DB3583582 for ; Sun, 26 Sep 2021 03:43:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-ot1-x32a.google.com with SMTP id l16-20020a9d6a90000000b0053b71f7dc83so18918268otq.7 for ; Sat, 25 Sep 2021 18:43:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hFcTjCMXmfKDL37vRbsx+nbY5JiyJxblg4AJreJziFQ=; b=CmLNfCrc3V7PBaHrbR776ONgxzTX2sXw7vOzd680GarVnr/6FbteQL2hBySAlKTqR4 WUA9AyHg0OVdutZ3Maw+1NysgOnmsT/0BD6vWlgapUqaz4JB0aEdseOvDbZxMiHmSoLh 7WIpGggpBmSo0kX8OSIjWruNRc8RM8qRmGnyQ= 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:mime-version:content-transfer-encoding; bh=hFcTjCMXmfKDL37vRbsx+nbY5JiyJxblg4AJreJziFQ=; b=SdrxcB2BPUuiczChDurXu9pU1rvgiAAgxsjbMZTZeAssgBk8ocF9O5hDtZZZ8bCGUi h+UvvmbrFTlT04VsXGzBQRtrNR4HwPoqIQvYabikM3NH3BmDZ/yIibisy/ik80xsekHo z0Zeju+a/+k60F/w+/IBsWOG0P+CZBpwG18x2rvA4FNr3crjhbuZtBh6HbJEWrodekXh SMuv93h1E/e0rPjK9S9gv9rUPCPrSnV1Ryw0VuFr0jRerK5FvaOrJpVheqwe52P31j/T xDHVDuu9K7dQl448QxWGiewhAxWsRPa0VHSsujGfilO0z1vphbK17SyKLnLAKjprtiqx npzQ== X-Gm-Message-State: AOAM531v2Tm/lPhiK+g3fWp/qivvIU8G2SMcjiNMxO31HLkZlJk4IcgY P5xaQXMb4MqjlcHwY7Wy4RSL+5qbJthrAA== X-Google-Smtp-Source: ABdhPJw8UT9aprSqjzUQmjF2HKdJTVk7u7MfldXDD4rBW143VzjTcty+9w354dhY2n5XNfSSa1TEvg== X-Received: by 2002:a9d:2f28:: with SMTP id h37mr10720643otb.196.1632620632594; Sat, 25 Sep 2021 18:43:52 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id c18sm330378otr.72.2021.09.25.18.43.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 18:43:52 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Alexandru Gagniuc , Andre Przywara , Rasmus Villemoes , Robert Marko , Masahiro Yamada , Tom Rini , Simon Glass , Joe Hershberger , Marek Vasut Subject: [PATCH v5 03/29] image: Add Kconfig options for FIT in the tools build Date: Sat, 25 Sep 2021 19:43:16 -0600 Message-Id: <20210925194327.v5.3.I64826ed33219988294468df7b95dfa3fffd7a0a1@changeid> X-Mailer: git-send-email 2.33.0.685.g46640cef36-goog In-Reply-To: <20210926014342.127913-1-sjg@chromium.org> References: <20210926014342.127913-1-sjg@chromium.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 In preparation for enabling CONFIG_IS_ENABLED() on the host build, add some options to enable the various FIT options expected in these tools. This will ensure that the code builds correctly when CONFIG_TOOLS_xxx is distinct from CONFIG_xxx. Drop some #ifdefs which are immediately unnecessary (many more are in later patches). Signed-off-by: Simon Glass --- Changes in v5: - Drop changes to tools/Makefile since they already use TOOLS_ Kconfigs - Use TOOLS_ instead of HOST_ common/image-fit-sig.c | 3 ++- common/image-fit.c | 4 ++-- tools/Kconfig | 25 +++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/common/image-fit-sig.c b/common/image-fit-sig.c index b979cd2a4b6..e95e64bd2fe 100644 --- a/common/image-fit-sig.c +++ b/common/image-fit-sig.c @@ -72,11 +72,12 @@ static int fit_image_setup_verify(struct image_sign_info *info, char *algo_name; const char *padding_name; +#ifndef USE_HOSTCC if (fdt_totalsize(fit) > CONFIG_FIT_SIGNATURE_MAX_SIZE) { *err_msgp = "Total size too large"; return 1; } - +#endif if (fit_image_hash_get_algo(fit, noffset, &algo_name)) { *err_msgp = "Can't get hash algo property"; return -1; diff --git a/common/image-fit.c b/common/image-fit.c index 6f8e67e4158..17c6d4e7813 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -170,7 +170,7 @@ int fit_get_subimage_count(const void *fit, int images_noffset) return count; } -#if CONFIG_IS_ENABLED(FIT_PRINT) || CONFIG_IS_ENABLED(SPL_FIT_PRINT) +#if CONFIG_IS_ENABLED(FIT_PRINT) /** * fit_image_print_data() - prints out the hash node details * @fit: pointer to the FIT format image header @@ -578,7 +578,7 @@ void fit_image_print(const void *fit, int image_noffset, const char *p) #else void fit_print_contents(const void *fit) { } void fit_image_print(const void *fit, int image_noffset, const char *p) { } -#endif /* CONFIG_IS_ENABLED(FIR_PRINT) || CONFIG_IS_ENABLED(SPL_FIT_PRINT) */ +#endif /* CONFIG_IS_ENABLED(FIT_PRINT) */ /** * fit_get_desc - get node description property diff --git a/tools/Kconfig b/tools/Kconfig index d6f82cd949b..ea986ab0479 100644 --- a/tools/Kconfig +++ b/tools/Kconfig @@ -20,4 +20,29 @@ config TOOLS_LIBCRYPTO This selection does not affect target features, such as runtime FIT signature verification. +config TOOLS_FIT + def_bool y + help + Enable FIT support in the tools builds. + +config TOOLS_FIT_FULL_CHECK + def_bool y + help + Do a full check of the FIT before using it in the tools builds + +config TOOLS_FIT_PRINT + def_bool y + help + Print the content of the FIT verbosely in the tools builds + +config TOOLS_FIT_SIGNATURE + def_bool y + help + Enable signature verification of FIT uImages in the tools builds + +config TOOLS_FIT_SIGNATURE_MAX_SIZE + hex + depends on TOOLS_FIT_SIGNATURE + default 0x10000000 + endmenu -- 2.33.0.685.g46640cef36-goog