From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Thu, 27 Apr 2017 08:31:29 -0400 Subject: [U-Boot] [PATCH 3/3] spl: dfu: reduce spl-dfu MLO size In-Reply-To: <6C6B28D4DC342643927BEAFCE8707BF6C0B6E052@DBDE04.ent.ti.com> References: <1493212449-26863-1-git-send-email-ravibabu@ti.com> <1493212449-26863-4-git-send-email-ravibabu@ti.com> <20170426133556.GX12511@bill-the-cat> <6C6B28D4DC342643927BEAFCE8707BF6C0B6E052@DBDE04.ent.ti.com> Message-ID: <20170427123129.GP12511@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Apr 27, 2017 at 07:22:29AM +0000, B, Ravi wrote: > Hi Tom > > >> 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 > [snip] > >> diff --git a/drivers/dfu/Makefile b/drivers/dfu/Makefile index > >> 61f2b71..ef48f36 100644 > >> --- a/drivers/dfu/Makefile > >> +++ b/drivers/dfu/Makefile > >> @@ -6,8 +6,10 @@ > >> # > >> > >> obj-$(CONFIG_USB_FUNCTION_DFU) += dfu.o > >> +ifndef CONFIG_SPL_BUILD > >> obj-$(CONFIG_DFU_MMC) += dfu_mmc.o > >> obj-$(CONFIG_DFU_NAND) += dfu_nand.o > >> -obj-$(CONFIG_DFU_RAM) += dfu_ram.o > >> obj-$(CONFIG_DFU_SF) += dfu_sf.o > >> obj-$(CONFIG_DFU_TFTP) += dfu_tftp.o > >> +endif > >> +obj-$(CONFIG_DFU_RAM) += dfu_ram.o > > >We should discard at link time the unreachable parts here in SPL, no? > > Yes you are correct. > But what is happening here is, the CONFIG_DFU_ selected through Kconfig/Menuconfig is applicable for both SPL and U-Boot. > Hence CONFIG_DFU_MMC/NAND/SF gets compiled for SPL as well, which needs run_command(). Actually CONFIG_DFU_MMC/NAND/etc is not scoped for SPL-DFU. > As we have aligned, not to increase the SPL size, user shall use SPL-DFU feature to boot to u-boot, then utilize the full featured DFU to flash MMC/NAND/SF. > > I get undefined reference to common function run_command(), "dfu_fill_entitiy_" in driver/dfu/dfu.c. > The dfu.c is common for both SPL-DFU and U-boot. OK. I think we need to introduce SPL_DFU_xxx Kconfig options, and use CONFIG_IS_ENABLED(DFU_xxx) so that we will get things enabled/disabled (and discarded) as needed. -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: