Re: [U-Boot] SPL support and secondary image size

On Thu, Nov 3, 2011 at 7:08 PM, jonsmirl@gmail.com jonsmirl@gmail.com wrote:
On Thu, Nov 3, 2011 at 7:00 PM, Scott Wood scottwood@freescale.com wrote:
On 11/03/2011 05:20 PM, jonsmirl@gmail.com wrote:
My primary SPL image needs the size of the secondary image built into it. How do I access that size while building the primary SPL image?
Does it need to be exact? Usually we just hardcode something that should be big enough.
NXP has written custom out of tree support for SPL on the lpc3130/31. I am reworking it to use the in-tree SPL code. lpc3130 supports six boot modes but I have 64K of SRAM to work with. One of those modes is to read the next image over the serial line, the existing NXP code wants to know the length to read.
http://git.lpclinux.com/?p=uboot-2009.11-lpc313x.git;a=summary
The way they implemented SPL was to build it and main uboot into a single image file. Then they used dd to cut it into two pieces. Building it as a single image allows the initial loader to get at things like the length of the second image.
I will have to go through all of their code to see if the length require is exact.
-Scott
-- Jon Smirl jonsmirl@gmail.com

Some more info on the out of tree NXP code... I didn't write it, I am just trying to get it working on a current uboot since the NXP u-boot code is too old for ARM device tree support.
Most u-boot images are around 250KB.
lpc3130 has 96K of SRAM. The ARM ROM on the chip can IPL from six sources: NAND, SPI, DFU USB, SD, NOR FLASH, UART. A header at the front of the IPL image tells the ROM how much to load.
96KB is large enough to build a single SPL image that can then continue loading from all six different sources. I have ported enough of the code to the new SPL system to build a SPL image derived off from the NXP code. For my application I want NAND and USB DFU. I am testing with UART.
The secondary NXP loaders all want to know the length of what they are loading. NXP was able to get this length by building both the SPL and the main u-boot into a single image file. They then used dd to chop it up into the two files: u-boot-spl.bin and u-boot.bin
participants (1)
-
jonsmirl@gmail.com