public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Vladimir Zapolskiy <vz@mleia.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] arm: lpc32xx: switch SPL builds to driver model
Date: Thu, 17 Dec 2015 04:30:17 +0200	[thread overview]
Message-ID: <56721E39.6080007@mleia.com> (raw)
In-Reply-To: <CAPnjgZ2T-iPq3r3nFdm-+m-XDRjj4qu5iiCehZz0gSm_hiBmVQ@mail.gmail.com>

Hi Simon,

On 15.12.2015 20:57, Simon Glass wrote:
> Hi Vladimir,
> 
> On 12 December 2015 at 17:48, Vladimir Zapolskiy <vz@mleia.com> 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 <vz@mleia.com>
>> ---
>>  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

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)

--
With best wishes,
Vladimir

      reply	other threads:[~2015-12-17  2:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-13  0:48 [U-Boot] [PATCH 0/2] arm: lpc32xx: use driver model serial console drivers Vladimir Zapolskiy
2015-12-13  0:48 ` [U-Boot] [PATCH 1/2] arm: lpc32xx: switch serial console to driver model Vladimir Zapolskiy
2015-12-19 20:30   ` Simon Glass
2015-12-19 20:50     ` Vladimir Zapolskiy
2015-12-13  0:48 ` [U-Boot] [PATCH 2/2] arm: lpc32xx: switch SPL builds " Vladimir Zapolskiy
2015-12-15 18:57   ` Simon Glass
2015-12-17  2:30     ` Vladimir Zapolskiy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56721E39.6080007@mleia.com \
    --to=vz@mleia.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox