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 292D0C4338F for ; Sun, 22 Aug 2021 04:47: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 409C5611C8 for ; Sun, 22 Aug 2021 04:47:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 409C5611C8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sholland.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 6E6A282E03; Sun, 22 Aug 2021 06:47:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.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=sholland.org header.i=@sholland.org header.b="p6UM401/"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="kcWdvpcN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8566D82E68; Sun, 22 Aug 2021 06:47:06 +0200 (CEST) Received: from new1-smtp.messagingengine.com (new1-smtp.messagingengine.com [66.111.4.221]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CCA6382E03 for ; Sun, 22 Aug 2021 06:47:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel@sholland.org Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 7F57F580BE3; Sun, 22 Aug 2021 00:46:59 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 22 Aug 2021 00:46:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=KX18TDxjoKY7B wKh4YjoEjdT3drQYczgsTiTMyBJcdQ=; b=p6UM401/C1EDedjzASHWhDJmpluXI CnaSD9/8HO+ZoDzYnE0Ycf8H4KvKoR0hTEIJ6pCgjFtNWi5efy/boFRkPN+3L68g jz36W76ku80szm8/Qhr7ClxM5KK0yOrdsGxPb12zabnGgF2GKyhZj7Up+Tc3RY// 0zgDy4mDSQZ216vrvbpuZ6rmI3Qf6CsQNHCzr9EU9OBF0+FSzSqnY3OM4pfPiooN iN7V5dI/1VXC4hDNH+bs8uC858D9EW4qieG/SDesmCBuvk3RcO24gV1XeY/hHj2s uM2sdxUvcs9KgtTiZd4HkQM0csGd8dGoXU5+Gi0DrDub0Zh1ngY12t9MA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=KX18TDxjoKY7BwKh4YjoEjdT3drQYczgsTiTMyBJcdQ=; b=kcWdvpcN 3mUkx6qfSf8W6gp+FCtOAJx+p6lf+whOuFeJdPGP4GA4FeRMWTfVNEwHMPzF9oTS zGZIkCBE5qdfYonERI3xwVhe5R5NLYO+SXtx234bEvCg+97h81AE8SHRX6+QLjpn aULqq2iRe+rZ0Q1BSuPx6qqwmW58JFqDgLNGwW7heHF6APjiRqiQQjx2wimmLkbH z7ecxslQr04FfsN1fW/pQgZHQtPdJeTI5pHI0sd6MzwdCK3zRkEAUpFR82TDyaS3 HkSCVARRd0OQkCuCrzW0WVd0T7fVja73pp7WwtP30UTDqXRSVpDWUsTSt/6dcZKS Ijq9a+lVDrNXgQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddtvddgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpeduhfejfedvhffgfeehtefghfeiiefgfeehgfdvvdevfeegjeehjedv gfejheeuieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 22 Aug 2021 00:46:57 -0400 (EDT) From: Samuel Holland To: u-boot@lists.denx.de, Jagan Teki , Andre Przywara Cc: Samuel Holland , AKASHI Takahiro , Alexandru Gagniuc , Baruch Siach , Bharat Gooty , Chris Packham , Fabio Estevam , Frieder Schrempf , Jernej Skrabec , =?UTF-8?q?Marek=20Beh=C3=BAn?= , "NXP i.MX U-Boot Team" , Naoki Hayama , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Patrick Delaunay , Priyanka Jain , Rayagonda Kokatanur , Simon Glass , Stefan Roese , Stefano Babic , Sughosh Ganu , Trevor Woerner , lauri.hintsala@silabs.com Subject: [PATCH v2 1/4] tools: Separate image types which depend on OpenSSL Date: Sat, 21 Aug 2021 23:46:45 -0500 Message-Id: <20210822044649.13585-2-samuel@sholland.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210822044649.13585-1-samuel@sholland.org> References: <20210822044649.13585-1-samuel@sholland.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 Some image types always depend on OpenSSL, so they can only be included in mkimage when TOOLS_LIBCRYPTO is selected. Instead of using arbitrary preprocessor definitions, conditionally link the files. When building for platforms which use those image types, automatically select TOOLS_LIBCRYPTO, it is required for the build to complete. Signed-off-by: Samuel Holland --- Changes in v2: - Refactored the first patch on top of TOOLS_LIBCRYPTO arch/arm/mach-imx/mxs/Kconfig | 2 ++ arch/arm/mach-mvebu/Kconfig | 1 + scripts/config_whitelist.txt | 1 - tools/Makefile | 19 +++++-------------- tools/mxsimage.c | 3 --- 5 files changed, 8 insertions(+), 18 deletions(-) diff --git a/arch/arm/mach-imx/mxs/Kconfig b/arch/arm/mach-imx/mxs/Kconfig index 9f48ffda414..24d452942a5 100644 --- a/arch/arm/mach-imx/mxs/Kconfig +++ b/arch/arm/mach-imx/mxs/Kconfig @@ -3,6 +3,7 @@ if ARCH_MX23 config MX23 bool default y + select TOOLS_LIBCRYPTO choice prompt "MX23 board select" @@ -34,6 +35,7 @@ if ARCH_MX28 config MX28 bool default y + select TOOLS_LIBCRYPTO choice prompt "MX28 board select" diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig index 89737a37ad9..c02521c71bc 100644 --- a/arch/arm/mach-mvebu/Kconfig +++ b/arch/arm/mach-mvebu/Kconfig @@ -29,6 +29,7 @@ config ARMADA_38X bool select ARMADA_32BIT select HAVE_MVEBU_EFUSE + select TOOLS_LIBCRYPTO config ARMADA_38X_HS_IMPEDANCE_THRESH hex "Armada 38x USB 2.0 High-Speed Impedance Threshold (0x0 - 0x7)" diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 2d70bf5da7c..5caaad0c3dc 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -1000,7 +1000,6 @@ CONFIG_MXC_UART_BASE CONFIG_MXC_USB_FLAGS CONFIG_MXC_USB_PORT CONFIG_MXC_USB_PORTSC -CONFIG_MXS CONFIG_MXS_AUART CONFIG_MXS_AUART_BASE CONFIG_MXS_OCOTP diff --git a/tools/Makefile b/tools/Makefile index 4a86321f646..ad0e9cf9490 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -94,9 +94,11 @@ ECDSA_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := $(addprefix lib/ecdsa/, ecdsa-libcrypto. AES_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := $(addprefix lib/aes/, \ aes-encrypt.o aes-decrypt.o) -# Cryptographic helpers that depend on openssl/libcrypto -LIBCRYPTO_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := $(addprefix lib/, \ - fdt-libcrypto.o) +# Cryptographic helpers and image types that depend on openssl/libcrypto +LIBCRYPTO_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := \ + lib/fdt-libcrypto.o \ + kwbimage.o \ + mxsimage.o ROCKCHIP_OBS = lib/rc4.o rkcommon.o rkimage.o rksd.o rkspi.o @@ -117,10 +119,8 @@ dumpimage-mkimage-objs := aisimage.o \ imximage.o \ imx8image.o \ imx8mimage.o \ - kwbimage.o \ lib/md5.o \ lpc32xximage.o \ - mxsimage.o \ omapimage.o \ os_support.o \ pblimage.o \ @@ -155,22 +155,13 @@ fit_info-objs := $(dumpimage-mkimage-objs) fit_info.o fit_check_sign-objs := $(dumpimage-mkimage-objs) fit_check_sign.o file2include-objs := file2include.o -ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_TOOLS_LIBCRYPTO),) -# Add CONFIG_MXS into host CFLAGS, so we can check whether or not register -# the mxsimage support within tools/mxsimage.c . -HOSTCFLAGS_mxsimage.o += -DCONFIG_MXS -endif - ifdef CONFIG_TOOLS_LIBCRYPTO # This affects include/image.h, but including the board config file # is tricky, so manually define this options here. HOST_EXTRACFLAGS += -DCONFIG_FIT_SIGNATURE HOST_EXTRACFLAGS += -DCONFIG_FIT_SIGNATURE_MAX_SIZE=0xffffffff HOST_EXTRACFLAGS += -DCONFIG_FIT_CIPHER -endif -# MXSImage needs LibSSL -ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_ARMADA_38X)$(CONFIG_TOOLS_LIBCRYPTO),) HOSTCFLAGS_kwbimage.o += \ $(shell pkg-config --cflags libssl libcrypto 2> /dev/null || echo "") HOSTLDLIBS_mkimage += \ diff --git a/tools/mxsimage.c b/tools/mxsimage.c index 002f4b525aa..2bfbb421eb6 100644 --- a/tools/mxsimage.c +++ b/tools/mxsimage.c @@ -5,8 +5,6 @@ * Copyright (C) 2012-2013 Marek Vasut */ -#ifdef CONFIG_MXS - #include #include #include @@ -2363,4 +2361,3 @@ U_BOOT_IMAGE_TYPE( NULL, mxsimage_generate ); -#endif -- 2.31.1