Wednesday, January 14, 2009

omap peripheral boot - what the heck is it?

Kinda got a few questions on how omap uboot utils works.. so here is my attempt to try and summarize what omap3 TRM says(for details TRM is the best place to go - yes, it is beautifully written ;) ):
ARM is a useless unless we have some software to run on it, so OMAP has a special piece of ROM code which gets the initial control of things. Now, ROM code is capable of:
a) booting off a memory device such as NOR, NAND, OneNAND, MMC etc.. kind of devices.
b) booting off a peripheral such as UART, USB etc..
Before anyone asks, yep ROMCode is a software code within OMAP. And, yep, and yeah it's got all kind of drivers for devices it supports, and further yeah, it is a tiny optimized code and finally NO - you cant modify it since it is Read Only Memory.

Now, in the world of OMAP s/w guys, (a) is called memory boot and (b) is called peripheral boot.. Now, how does ROM Code know what kind of device you have and which mode you want to boot from? This is called the SYSBOOT(again read the TRM for details). in short, SYSBOOT tells OMAP ROM Code, ok dude.. now please boot from USB cable, if that fails - try UART, then MMC1 else try NAND, else assume the user(me) is really confused and just get stuck in a loop.

How does peripheral boot work?
It is rather simple if you look at it: when OMAP wakesup in USB/UART mode, it shouts out "hey I am awake"(not literally) by throwing out what is called ASIC ID. The guy on the other end of the cable keeps watching the link(UART/USB) for this message and responds with a predetermined command back saying - "Oh great Rom Code, please recieve and execute the file I am sending you next.. it's file size is xyz"(again not literally, but you get the picture).. in the case of USB, well USB Gadget is what OMAP acts as (you can check the TRM for the exact class and USB descriptors it throws out) - MUSB is used in OMAP3. Now, ROMCode will wait for a short duration of times for slow pokes like me to respond back.

Now, If I dont send a file request to it within a predetermined time(details in TRM), it switches to the next boot device.

The file which is downloaded is put in SRAM and executed.

Well that is the short story.. pusb and pserial essentially explain the above in code.. Hope it helped..

5 comments:

Unknown said...

Hi Nishanth,
I purchased BeagleBoard from Mouser and I just can't get it to work. When I boot it up, it stops at the beagle image on screen. When it is wiping the image, it stops at the pawns and just hangs.
I tried to rewrite NAND with your script "recover_beagle.sh", but it won't start.

please send any info for me to petri.koppinen@gmail.com

I'm also in Dallas, very close to TI !

Nishanth Menon said...

Hi,
I think you need to discuss this on http://groups.google.com/group/beagleboard -> it is possibly the USR switches.. but the groups can guide you with previous experience..
Regards,
NM

Unknown said...

Hi Nishanth,

I'm puzzled about one aspect of serial boot: the port is setup with even parity, and pserial seems to be writing raw binary data - why doesn't the high bit of each byte get mangled by parity?

-- Richard

Krishnan said...
This comment has been removed by the author.
Krishnan said...

Hi Nishanth,

I have been using omap3evm for sometime. My requirement is to configure UART3 port so that I can send data from a terminal emulator like teraterm and display it on the omap3evm lcd display. Basically, UART3 should act like a keyboard port. Should I have to configure the kernel to accomplish this? I am using OpenEmbedded with kernel version 2.6.32. Any help would be appreciated.

Thanks,
Krishnan.