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 F2648C433F5 for ; Tue, 5 Oct 2021 18:17:57 +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 70BEA61130 for ; Tue, 5 Oct 2021 18:17:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 70BEA61130 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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 D986B82D7E; Tue, 5 Oct 2021 20:17:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="UB1F/V+n"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6BE4882EA5; Tue, 5 Oct 2021 20:17:54 +0200 (CEST) Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) (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 78AF182D5B for ; Tue, 5 Oct 2021 20:17:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mr.nuke.me@gmail.com Received: by mail-ot1-x32d.google.com with SMTP id 97-20020a9d006a000000b00545420bff9eso27014763ota.8 for ; Tue, 05 Oct 2021 11:17:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=1oV/IdO2I+AEdVvfGQ8RFe7mmMYu993CG7bjvpsrcvw=; b=UB1F/V+nxGqpb7DeGLF92qJW4HEWplny+8BKjHcr+Onbmu82KimaLtHDAgHaW+l+Bh PWPNgjK8deCWeVxToeeQ1H62EE0tqZoX3XKFGk6w8gK2TIG+YhQhBplaH04l0ks5A2bD 5KpdKjhnOGUIv45A0RjfQlsA629BrDo7WRAIObVKPSnesVLCS/d3vNqBhERKy13UYiby OpdNfcFxlPonyq9AlwHeajievAz1Vxe4L++j4qhdhrbY5l3j7AI/fhDmr67k6uc7UjuB 3wlWmGx+4dhqwGupl4Nwko0Hvo9Qc9JrM287s3nznk69WGVvZri05esG2FufJwAyeyR0 9Mhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1oV/IdO2I+AEdVvfGQ8RFe7mmMYu993CG7bjvpsrcvw=; b=bGlog2ddGkTI4tOS/Ld+yqNtrnBh43doLBPchPxV5sMCUkF+FShvtCN3nkmBn0HMK7 eVvBOcWeAcdOTl2nhuMVw6zJy82tlCdbG2qlpoFWn2vtW/A89HIHMpk6w0bNHqKH2Y7L ocVMHeTvjClHFk4Dx8Gax9HshqcLL1R/rf+2dfFISZVMiWS9l2NNceVBbpK1BV7qudeL XWIr7WrCG4EviKjDjJfjK5qMfECh7tIWK1ZTlmT2qSq3u4owoL93oLJ8mm+N4sc7yGvh Ldr4Cg6SgB3jGiYoacFLQFv/Wc6Mj4NIka6YWblw8x+BQa+Oa88RJfT44btaAaJYlTud LVKQ== X-Gm-Message-State: AOAM533RhkTjIqMuBZ3e8GpU1XASdlLJ+hf9DmK+k8bptMVR4s4qsyyh xvXKJL9F2BuoQts29Av4vC8= X-Google-Smtp-Source: ABdhPJwfj5nw6f0TJorIpo1ziprKW+rIz1UEfoGKPPo9OLTUYzj8TS7cJnIS83YnqDnrUVYqfrbE0w== X-Received: by 2002:a9d:610e:: with SMTP id i14mr15148498otj.46.1633457868186; Tue, 05 Oct 2021 11:17:48 -0700 (PDT) Received: from nuclearis3.gtech (c-98-195-139-126.hsd1.tx.comcast.net. [98.195.139.126]) by smtp.gmail.com with ESMTPSA id bj33sm3741755oib.31.2021.10.05.11.17.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Oct 2021 11:17:44 -0700 (PDT) Subject: Re: [PATCH v5 03/29] image: Add Kconfig options for FIT in the tools build To: Simon Glass , U-Boot Mailing List Cc: Andre Przywara , Rasmus Villemoes , Robert Marko , Masahiro Yamada , Tom Rini , Joe Hershberger , Marek Vasut References: <20210926014342.127913-1-sjg@chromium.org> <20210925194327.v5.3.I64826ed33219988294468df7b95dfa3fffd7a0a1@changeid> From: "Alex G." Message-ID: <4c1e0d13-2d90-a909-165e-b6197ddb2534@gmail.com> Date: Tue, 5 Oct 2021 13:17:40 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210925194327.v5.3.I64826ed33219988294468df7b95dfa3fffd7a0a1@changeid> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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 On 9/25/21 8:43 PM, Simon Glass wrote: > 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 Under protest, Reviewed-by: Alexandru Gagniuc > --- > > 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) { If you set CONFIG_FIT_SIGNATURE_MAX_SIZE to 0x10000000, then this comparison will always be false. > *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 > +config TOOLS_FIT_FULL_CHECK > +config TOOLS_FIT_PRINT > +config TOOLS_FIT_SIGNATURE Besides FIT_PRINT, I'm confused as to where the others are used by the tools build. > + > +config TOOLS_FIT_SIGNATURE_MAX_SIZE On the other hand, if you #ifdef out the check in image-fit-sig.c, then it doesn't make sense to have this config on the tools. > + hex > + depends on TOOLS_FIT_SIGNATURE > + default 0x10000000 > + > endmenu >