[U-Boot] Info on NAND-SPL

Wolfgang Denk wd at denx.de
Sun Feb 27 19:11:28 CET 2011


Dear Hatim Ali,

In message <96382.60182.qm at web95116.mail.in2.yahoo.com> you wrote:
>
> I was trying to understand how NAND-SPL works. What I could understand after
> seeing the code is that 
> 1) NAND-SPL is a standalone application which will load the U-boot in the main memory. 

You probably mean the right thing, but use inappropriate terms.

In U-Boot context, a "standalone application" is a program that runs
under control of U-Boot, using U-Boot provided features like I/O
functions.

^The nand_spl code is no such application. It is a minimzed
configuration of U-Boot code.

> 2) After doing the clock and DRAM initialization it will relocate itself in
>  the DRAM. 

I'm not sure what you mean - the code does not relocate itself (keep
in mind that relocation and copying are two different things).

> 3) Then it will copy the u-boot from the nand into the RAM and execute the
> u-boot. 

This is the actual purposse.

> If my understanding is proper, then I have one doubt 
> 1) Since the nand_spl is making use of the same Start.S and lowlevel_init.S
> , the u-boot code will also perform relocation? So is it not a overhead doing
> relocation twice? 

nand_spl loads the U-Boot code into RAM, and then relocates it (which
includes copying it to the final location). There is no relocation
done twice, only the copying, and this cannot be avoided as the
bootstrap loader cannot determine the final position of the image
yet.  If you are sure that you have a static system with a fixed
memory map you can configure nand_spl such that it copies U-Boot to
the final location, one copy operation can be saved (you still need
the relocation, though).

> Also is there any similar implementation for MMC-SPL? 

Not yet. Patches welcome.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Suffocating together ... would create heroic camaraderie.
	-- Khan Noonian Singh, "Space Seed", stardate 3142.8


More information about the U-Boot mailing list