OMAP Zoom

BootingAndFlashing

Booting Introduction

The OMAP processor follows a 2 stage boot process. The first stage is loaded into the internal static ram by the ROM code. Because the internal static ram is very small (64k), the first stage loader is needed to initialize memory and enough of the peripheral devices to access and load the second stage loader into main memory. It is the job of the second stage loader to initialize the remaining hardware and prepare the system for kernel boot.

First Stage Boot

The internal ROM Code will attempt to boot from 3 different peripherals in the following order: serial, SD Card, and Nand.

Serial Boot

A simple ID is written out of the serial port. If the host responds correctly within a short window of time, the ROM will will read from the serial port and transfer the data to the internal sram. Control is passed to the start of sram if no errors are detected.

SD Card Boot

Assuming there was no answer from the host during serial boot, the ROM looks for an SD Card on the first MMC controller. If a card is found, the ROM then looks for the first FAT32 partition within the partition table. Once the partition is found, the root directory is scanned for a special signed file called "MLO". Assuming all is well with the file, it is transfered into the internal sram and control is passed to it.

Nand Boot

Assuming the SD Card boot was unable to complete successfully, the ROM attempts to load the first sector of Nand. If the sector is bad, corrupt, or blank, the ROM will try the next sector (up to 4) before exiting. Once a good sector is found, the ROM transfers the contents to sram and transfers control to it.

Second Stage Boot

The second stage of the boot is done by the x-loader installed from the first stage. There are different versions of the x-loader corresponding to each of the devices that can be loaded from. It is the job of the x-loader to transfer the 2nd stage loader into main memory. Usually you will use the x-loader that corresponds to the type of boot you are attempting - i.e. you would use the serial x-loader for a serial boot and the nand x-loader for a nand boot. However, you don't have to. For example, you could flash the serial x-loader into the nand. The rom will load from nand and transfer control to the x-loader which will wait for the 2nd stage to be downloaded from the serial port.

Serial Boot

The serial x-loader waits for the host to initiate a kermit connection to reliably transfer large files into main memory. Once the file transfer is completed successfully, control is transfered.

SD Card Boot

The SDCard x-loader looks for a FAT32 partition on the first MMC controller and scans the top level directory for a file named "u-boot.bin". It then transfers the file into main memory and transfers control to it.

Nand Boot

The nand x-loader expects u-boot to be loaded at the 5th sector (offset 0x00800000). It transfers the image from nand into main memory and transfers control to it.

Serial Boot Procedure

Software & Tools

You will need the following software:

X-loader built to load a 2nd stage bootloader over a serial connection. Instructions found here.

The u-boot boot-loader for the Zoom. Instruction to build and pre-built images can be found here.

The serial-boot.pl script from the Zoom support-tools project. Please note that this perl script is dependent on the perl Device::SerialPort? module which may or may not be included in your Linux host distribution. You can download and install the module manually from here or use your Linux host's package manager to install it. For example...

A Linux host with a serial port that supports the UART Status IOCTL (TIOCSERGETLSR) otherwise the serial-boot.pl script will not work. It was found that some usb-to-serial adaptors do not support this.

Downloading U-boot Over A Serial Connection

Power-off the Zoom

Connect the Zoom to the host's serial port.

Execute the serial-boot.pl script as follows:

./serial-boot.pl -p <serial-device> -s <path>/x-load-serial.bin

For example:

./serial-boot.pl -p /dev/ttyS0 -s /home/user/x-load-serial.bin

Power-on the Zoom and the x-loader download should start.

Once x-loaded has been downloaded successfully, execute the following command to start the kermit transfer of u-boot.

Once the kermit transfer has completed, you should see u-boot start-up. At this point you can follow the nand flashing procedure below to flash an x-loader and u-boot into the nand.

Nand Boot / Flashing Procedure

Setup

This procedure assumes you have a working u-boot up and running in memory either via JTAG, the Serial Boot procedure above, SD card boot procedure below or an older version installed in the on-board Nand.

SD Card Boot Procedure

Time to go "old school" here and remember back to the days where disks used Cylinder, Head, and Sector (CHS) formatting. For the OMAP to find and boot off the SD Card, the first primary partition must contain a FAT32 partition formatted with 255 heads and 63 sectors. It is very specific, but not hard to setup.

Formatting the SD Card

Since putting a Linux file system on a FAT32 partition is problematic, it is recommended to create 2 partitions. The first partition is a boot partition between 64-128 Megabytes and the second partition is a Linux partition consuming the rest of the card.
Plug your SD card into your Linux box - do not mount it. For this example, we will assume the card shows up as /dev/sdc - substitute this for the real device on your specific machine.
Fdisk the drive and print the partition information

Look for the size in bytes of the device and calculate the number of cylinders, dropping factions, if we have 255 heads and 63 sectors.

new_cylinders = Size / 8225280 (for this example we will have 993001472 / 8225280 which equals 120.725 or 120 cylinders)

Since we are changing the underlying geometry of the disk, we must clear the partition table before doing it. So delete all partitions using the fdisk 'd' command - yes, you will lose all data on the card. Once that is done, we can set the new geometry in expert mode. We will set the # of heads to 255, # of sectors to 63, and # of cylinders to new_cylinders.

The partition table should look something like the following. Notice the heads, sectors, and cylinders. Make sure partition 1 is active and FAT32. If it looks good - write the new partition information out.