From patchwork Thu Dec 17 02:30:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 558025 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 434831402A8 for ; Thu, 17 Dec 2015 13:30:39 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id ADC924BD2A; Thu, 17 Dec 2015 03:30:35 +0100 (CET) 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 0OszY_bD9UJV; Thu, 17 Dec 2015 03:30:35 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 33AEA4BC5E; Thu, 17 Dec 2015 03:30:35 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 130714BC5E for ; Thu, 17 Dec 2015 03:30:32 +0100 (CET) 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 qqbgUnV37mfe for ; Thu, 17 Dec 2015 03:30:31 +0100 (CET) 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.mleia.com (mleia.com [178.79.152.223]) by theia.denx.de (Postfix) with ESMTPS id C9D114BC5A for ; Thu, 17 Dec 2015 03:30:26 +0100 (CET) Received: from mail.mleia.com (localhost [127.0.0.1]) by mail.mleia.com (Postfix) with ESMTP id A8794400FF3; Thu, 17 Dec 2015 02:30:25 +0000 (GMT) Message-ID: <56721E39.6080007@mleia.com> Date: Thu, 17 Dec 2015 04:30:17 +0200 From: Vladimir Zapolskiy User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.6.0 MIME-Version: 1.0 To: Simon Glass , Albert Aribaud References: <1449967735-19882-1-git-send-email-vz@mleia.com> <1449967735-19882-3-git-send-email-vz@mleia.com> In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-49551924 X-CRM114-CacheID: sfid-20151217_023025_710929_ACA51B3E X-CRM114-Status: GOOD ( 24.77 ) Cc: U-Boot Mailing List Subject: Re: [U-Boot] [PATCH 2/2] arm: lpc32xx: switch SPL builds to driver model 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Hi Simon, On 15.12.2015 20:57, Simon Glass wrote: > Hi Vladimir, > > On 12 December 2015 at 17:48, Vladimir Zapolskiy wrote: >> For NXP LPC32xx boards the change enables SPL_DM option, this allows >> to use any driver model UART driver in SPL images, hence a restriction >> on HSUART in SPL image is removed and well as definitions for non-DM >> NS16550 driver, its DM version is used instead. >> >> Note, CONFIG_SPL_DM option noticeably increases SPL image, if just >> NAND SLC and DM version of NS16650 are included to the image, the size >> of SPL image is increased almost in two times from 10672 bytes to >> 19704 bytes. >> If SPL image is downloaded from a small page NAND device, then this >> can cause a problem, according to the LPC32xx User's Manual the >> maximum size of a secondary bootloader stored on small page NAND flash >> should not exceed 15.5KB (maximum size of a secondary bootloader on a >> large page NAND is 54KB). >> >> Because SPL_DM requires malloc(), enable CONFIG_SYS_MALLOC_SIMPLE for >> all LPC32xx boards in shared config.h file. >> >> Signed-off-by: Vladimir Zapolskiy >> --- >> arch/arm/cpu/arm926ejs/lpc32xx/devices.c | 2 +- >> arch/arm/include/asm/arch-lpc32xx/config.h | 24 ++++++------------------ >> configs/devkit3250_defconfig | 1 + >> configs/work_92105_defconfig | 1 + >> 4 files changed, 9 insertions(+), 19 deletions(-) > > You are bringing in the full malloc(). Try adding: > > CONFIG_SPL_SYS_MALLOC_SIMPLE=y > > to your defconfig. The should cut the size increment to just under > 5KB. thank you for the hint, I was not aware of this option. The size of SPL image dropped from 19704 down to 15608 bytes for devkit3250, and I verified that the new image works. I checked the difference with objdump (10672 -> 15608): * +3236 bytes of alloc/DM/uclass functions, * +320 bytes of static data, * +360 bytes of difference in non-DM/DM NS16550 drivers * +160 bytes memcpy(), strcmp(), * +144 bytes reset_cpu(), do_reset(), reset_misc() * etc, nothing outstanding. I think that the total size of DM/uclass functions about 3KB is pretty tight, let it remain. > That is still a lot. Are you able to use Thumb on your board? > Yes, ARM core of LPC32xx has ARMv5TE architecture. My board has a large page NAND device (Albert's board also has some large page NAND device I believe), so generally it is not a problem for me, if new SPL image is a bit larger, however I want to emphasize this in a commit message. Albert, what do you think about the change? Do be you prefer to add CONFIG_SPL_SYS_MALLOC_SIMPLE=y to defconfigs? I think it is better to do it in v2, plus I have to remove --- With best wishes, Vladimir diff --git a/arch/arm/include/asm/arch-lpc32xx/config.h b/arch/arm/include/asm/arch-lpc32xx/config.h index a9f057e..3b7f6bd 100644 --- a/arch/arm/include/asm/arch-lpc32xx/config.h +++ b/arch/arm/include/asm/arch-lpc32xx/config.h @@ -15,11 +15,6 @@ #define CONFIG_NR_DRAM_BANKS_MAX 2 -/* SPL build configuration */ -#if defined(CONFIG_SPL_BUILD) -#define CONFIG_SYS_MALLOC_SIMPLE -#endif - /* UART configuration */ #if (CONFIG_SYS_LPC32XX_UART == 1) || (CONFIG_SYS_LPC32XX_UART == 2) || \ (CONFIG_SYS_LPC32XX_UART == 7)