Speed up NAND boot with Configuration header

101 views
Skip to first unread message

Nishanth Menon

unread,
May 6, 2009, 7:37:08 PM5/6/09
to BeagleBoard
Hi Folks,
For folks interested with bootup process, I have added a new utility
in omap-u-boot-utils called gpsign - this will now allow for signing
with something called Configuration header..
just a eddited copy from my blog post[1] to give you an idea:

What exactly is Configuration Header(CH)?
---------------------------------------------------------------
CH is a set of register values to the critical OMAP registers that
define how the clocks, sdram controller, gpmc controller, mmc
controllers are configured.. it is more like an array of register
values - you fill them up with the correct values, and store the load
address you would like the resultant image to load up, bingo, we have
the image booting off that location.. There are few of these
structures that are defined in the TRM[4] section 26.4.8.2(page 3427),
which has a detailed description on the sequence of operation..

By adding this data as a prefix to the real image, we can boot
u-boot(or for that matter, any image) straight from NAND flash into
sdram.. essentially this is what x-loader does, only that OMAP3430
ROMCode already has that feature..

What does Configuration Header save us?
-------------------------------------------------------------
Time :)! Traditional NAND boot has always been:

* ROMCode takes x-loader from NAND, put it in SRAM and boot it.
* x-loader goes ahead and configures clock, sdram etc.. then
proceeds to load u-boot from NAND to SDRAM and execute it

Instead we can now reduce this sequence to a single sequence:

* ROMCode takes u-boot from NAND, put it in SDRAM and boots it.

Infact, my measurement with my digital wristwatch showed a 2 second
saving of bootdelay! Okay, my measurement is an approximation ;)

Aaah.. I am excited with Configuration Header and want to use it.. How
do I do it?
----------------------------------------------------------------------------------------------------------------------
You are in luck :).. my recent commit[2] to omap u-boot-utils[3] has
the required code for signing a u-boot to use configuration header in
a GP device.. there is even a sample.cfg file with the settings that
worked for me on beagleboard :)..

Do a "gpsign -c conf/sample.cfg -f u-boot.bin" will generate a
u-boot.bin.ift file. flash this image using h/w ecc (the "nandecc hw"
command in u-boot) to offset 0x0 in nand and reset the board.. viola,
it should boot straight into u-boot skipping the x-loader step :)

Apologies that I do not (at the time of this post) have a prebuilt
omap-uboot-utils binaries, but hope to do it for v3.0 tag in the
future, esp if folks have some further fixes or improvements -> for
the time being it requires a git pull and a host machine build :(..

Caveat: there is some sort of a 128KiB limitation on MLO file signed
like this for MMC Card with FAT filesystem, so I still use x-loader in
MMC boot..

By the way, this feature is not available in the previous OMAP2 or
OMAP1 devices..

Regards,
Nishanth Menon

Ref:
[1] http://nishanthmenon.blogspot.com/2009/05/configuration-header-no-more-x-loader.html
[2] http://github.com/nmenon/omap-u-boot-utils/commit/d29bb1728e01ad8c74cec663bb2ec0b86db0881a
[3] http://code.google.com/p/omap-u-boot-utils/
[4] http://focus.ti.com/pdfs/wtbu/SWPU114Q_PrelimFinal_EPDF_03_05_2009.pd

Reply all
Reply to author
Forward
0 new messages