From patchwork Sun May 8 15:06:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 619683 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3r2tbQ3W9Zz9snl for ; Mon, 9 May 2016 04:00:33 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6A134A7534; Sun, 8 May 2016 20:00:27 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id b04NF3cbRNTV; Sun, 8 May 2016 20:00:27 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D82EEA74C5; Sun, 8 May 2016 20:00:11 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AE140A74C5 for ; Sun, 8 May 2016 17:11:40 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id m_DDl9sn7QKO for ; Sun, 8 May 2016 17:11:40 +0200 (CEST) X-Greylist: delayed 319 seconds by postgrey-1.34 at theia; Sun, 08 May 2016 17:11:36 CEST X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail.datacom.ind.br (mx.datacom.ind.br [177.66.5.10]) by theia.denx.de (Postfix) with ESMTPS id 38915A7498 for ; Sun, 8 May 2016 17:11:36 +0200 (CEST) Received: from mail.datacom.ind.br (localhost [127.0.0.1]) by mail.datacom.ind.br (Postfix) with ESMTPS id 61F5717711E3 for ; Sun, 8 May 2016 12:06:02 -0300 (BRT) Received: from localhost (localhost [127.0.0.1]) by mail.datacom.ind.br (Postfix) with ESMTP id 0CD1D17711DC for ; Sun, 8 May 2016 12:06:02 -0300 (BRT) Received: from mail.datacom.ind.br ([127.0.0.1]) by localhost (mail.datacom.ind.br [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id b58YWblrueFA for ; Sun, 8 May 2016 12:06:01 -0300 (BRT) Received: from p7-1130br.casantos.org (unknown [179.181.79.33]) by mail.datacom.ind.br (Postfix) with ESMTPSA id D212317711E4 for ; Sun, 8 May 2016 12:06:01 -0300 (BRT) From: Carlos Santos To: u-boot@lists.denx.de Date: Sun, 8 May 2016 12:06:00 -0300 Message-Id: <1462719960-12229-1-git-send-email-casantos@datacom.ind.br> X-Mailer: git-send-email 2.7.4 X-Mailman-Approved-At: Sun, 08 May 2016 19:59:57 +0200 Subject: [U-Boot] [PATCH 4/4] Make FIT support really optional X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Due to some mistakes in the source code, it was not possible to really turn FIT support off. This commit fixes the problem by means of the following changes: - Enclose "bootm_host_load_image" and "bootm_host_load_images" between checks for CONFIG_FIT_SIGNATURE, in common/bootm.c. - Enclose the declaration of "bootm_host_load_images" between checks for CONFIG_FIT_SIGNATURE, in common/bootm.h. - Condition the compilation and linking of fit_common.o fit_image.o image-host.o common/image-fit.o to CONFIG_FIT=y, in tools/Makefile. Signed-off-by: Carlos Santos --- common/bootm.c | 2 ++ include/bootm.h | 2 ++ tools/Makefile | 6 ++---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/common/bootm.c b/common/bootm.c index c965326..ab477ba 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -891,6 +891,7 @@ void memmove_wd(void *to, void *from, size_t len, ulong chunksz) memmove(to, from, len); } +#if defined(CONFIG_FIT_SIGNATURE) static int bootm_host_load_image(const void *fit, int req_image_type) { const char *fit_uname_config = NULL; @@ -955,5 +956,6 @@ int bootm_host_load_images(const void *fit, int cfg_noffset) /* Return the first error we found */ return err; } +#endif #endif /* ndef USE_HOSTCC */ diff --git a/include/bootm.h b/include/bootm.h index 4981377..94d62a1 100644 --- a/include/bootm.h +++ b/include/bootm.h @@ -41,7 +41,9 @@ void lynxkdi_boot(image_header_t *hdr); boot_os_fn *bootm_os_get_boot_func(int os); +#if defined(CONFIG_FIT_SIGNATURE) int bootm_host_load_images(const void *fit, int cfg_noffset); +#endif int boot_selected_os(int argc, char * const argv[], int state, bootm_headers_t *images, boot_os_fn *boot_fn); diff --git a/tools/Makefile b/tools/Makefile index da50e1b..0a3d279 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -54,6 +54,7 @@ mkenvimage-objs := mkenvimage.o os_support.o lib/crc32.o hostprogs-y += dumpimage mkimage hostprogs-$(CONFIG_FIT_SIGNATURE) += fit_info fit_check_sign +FIT_OBJS-$(CONFIG_FIT) := fit_common.o fit_image.o image-host.o common/image-fit.o FIT_SIG_OBJS-$(CONFIG_FIT_SIGNATURE) := common/image-sig.o # Flattened device tree objects LIBFDT_OBJS := $(addprefix lib/libfdt/, \ @@ -68,18 +69,15 @@ ROCKCHIP_OBS = lib/rc4.o rkcommon.o rkimage.o rksd.o rkspi.o # common objs for dumpimage and mkimage dumpimage-mkimage-objs := aisimage.o \ atmelimage.o \ + $(FIT_OBJS-y) \ $(FIT_SIG_OBJS-y) \ common/bootm.o \ lib/crc32.o \ default_image.o \ lib/fdtdec_common.o \ lib/fdtdec.o \ - fit_common.o \ - fit_image.o \ gpimage.o \ gpimage-common.o \ - common/image-fit.o \ - image-host.o \ common/image.o \ imagetool.o \ imximage.o \