From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ravi Babu Date: Thu, 27 Apr 2017 17:45:21 +0530 Subject: [U-Boot] [PATCH v2 3/3] spl: dfu: reduce spl-dfu MLO size In-Reply-To: <1493295321-15498-1-git-send-email-ravibabu@ti.com> References: <1493295321-15498-1-git-send-email-ravibabu@ti.com> Message-ID: <1493295321-15498-4-git-send-email-ravibabu@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Since spl-dfu does not dfu-reset, there is no need of run_command_cli, hence compiling out cli.c and cli_hush.c to reduce the spl-dfu memory foot print. Signed-off-by: Ravi Babu --- need better way for how to compile out CONFIG_DFU_MMC common/Makefile | 3 +-- drivers/dfu/Makefile | 2 ++ include/dfu.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/common/Makefile b/common/Makefile index 86225f1..8976cbc 100644 --- a/common/Makefile +++ b/common/Makefile @@ -11,6 +11,7 @@ obj-y += init/ obj-y += main.o obj-y += exports.o obj-y += hash.o +obj-y += cli.o obj-$(CONFIG_HUSH_PARSER) += cli_hush.o obj-$(CONFIG_AUTOBOOT) += autoboot.o @@ -90,7 +91,6 @@ endif # !CONFIG_SPL_BUILD ifdef CONFIG_SPL_BUILD obj-$(CONFIG_SPL_DFU_SUPPORT) += dfu.o -obj-$(CONFIG_SPL_DFU_SUPPORT) += cli_hush.o obj-$(CONFIG_SPL_HASH_SUPPORT) += hash.o obj-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o obj-$(CONFIG_SPL_YMODEM_SUPPORT) += xyzModem.o @@ -171,7 +171,6 @@ endif # We always have this since drivers/ddr/fs/interactive.c needs it obj-$(CONFIG_CMDLINE) += cli_simple.o -obj-y += cli.o obj-$(CONFIG_CMDLINE) += cli_readline.o obj-$(CONFIG_CMD_DFU) += dfu.o obj-y += command.o diff --git a/drivers/dfu/Makefile b/drivers/dfu/Makefile index 61f2b71..5628734 100644 --- a/drivers/dfu/Makefile +++ b/drivers/dfu/Makefile @@ -6,7 +6,9 @@ # obj-$(CONFIG_USB_FUNCTION_DFU) += dfu.o +ifndef CONFIG_SPL_BUILD obj-$(CONFIG_DFU_MMC) += dfu_mmc.o +endif obj-$(CONFIG_DFU_NAND) += dfu_nand.o obj-$(CONFIG_DFU_RAM) += dfu_ram.o obj-$(CONFIG_DFU_SF) += dfu_sf.o diff --git a/include/dfu.h b/include/dfu.h index f39d3f1..70eeaef 100644 --- a/include/dfu.h +++ b/include/dfu.h @@ -203,7 +203,7 @@ static inline void dfu_set_defer_flush(struct dfu_entity *dfu) int dfu_write_from_mem_addr(struct dfu_entity *dfu, void *buf, int size); /* Device specific */ -#ifdef CONFIG_DFU_MMC +#if defined(CONFIG_DFU_MMC) && !defined(CONFIG_SPL_BUILD) extern int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s); #else static inline int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, -- 1.9.1