Professional Documents
Culture Documents
Bootloader Project
From OMAPpedia
Contents
1 OMAP Bootloader Overview 2 OMAP Boot Sequence 2.1 SYSBOOT Pins 2.2 First Stage Boot 2.3 Second Stage Boot 3 x-loader overview 4 u-boot overview 5 Building the Bootloaders 5.1 u-boot 5.1.1 Downloading u-boot source 5.1.2 Building u-boot 5.1.3 u-boot config files 5.2 x-loader 5.2.1 Accessing x-loader source 5.2.2 Building x-loader 5.2.3 x-loader config files 6 Flashing 7 Upstreaming U-boot
omapedia.org/wiki/Bootloader_Project#OMAP_Bootloader_Overview
1/7
5/22/12
The Bootloader Project covers specifically the x-loader and the u-boot: a code overview, and how to obtain and build the code. Why are there two bootloaders? The first bootloader, x-loader, is a stripped-down version of the u-boot, designed to run in OMAP's small on-chip SRAM. It initializes the main off-chip memory of the system and other necessary device drivers, and then loads the larger bootloader for Linux, u-boot.
SYSBOOT Pins
The internal ROM Code can attempt to boot from several different peripheral and memory devices, including, but not limited to: Serial (UART3), SD Card, eMMC, NAND, and USB. The order in which these devices are searched for a valid first-stage booting image (x-loader) is determine by a set of GPIO configuration pins referred to as SYSBOOT. The TRM includes a table that shows the booting device list that each combination of the SYSBOOT pins refers to. The SYSBOOT value can be read from physical address 0x480022f0, either using JTAG, or if you have linux running, use devmem2:
#dve20402f b emm x8020 /e/e oee. dvmm pnd Mmr mpe a ades04000. eoy apd t drs x0200 Vlea ades0402F (x0220:02 au t drs x8020 0400f) xF
For OMAP34xx, there is also a tool to show the boot order: omap34xx-boot-order (http://linux.fjfi.cvut.cz/~zub/omap34xx-boot-order/)
Serial Boot For 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 read from the serial port and transfer the data to the internal SRAM. Control is passed to the start of SDRAM if no errors are detected. UART3 is the only uart for which the ROM will attempt to load from. SD Card Boot If MMC is included in the booting device list, 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" (which is the x-loader binary with a header containing the memory location to load the file to and the size of the file). Assuming all is well with the file, it is transfered into the internal SRAM and control is passed to it. Both MMC1 and MMC2 can be used for booting. NAND / eMMC Boot
omapedia.org/wiki/Bootloader_Project#OMAP_Bootloader_Overview 2/7
5/22/12
If NAND is included in the booting device list, 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. (The same steps are performed for eMMC if eMMC is included in the booting device list instead of NAND.)
SD Card Boot In the case of loading the u-boot via the SD card, the SD card 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 / eMMC Boot In the case of a u-boot stored in NAND, the x-loader expects the u-boot to be located at the 5th sector (offset 0x00800000). It transfers the image from NAND into main memory and transfers control to it. In the case of a u-boot stored in eMMC, the x-loader expects the u-boot to be located at the offset 0x200.
x-loader overview
The x-loader is a small first stage bootloader derived from the u-boot base code. It is loaded into the internal static RAM by the OMAP ROM code. Due to the small size of the internal static RAM, the x-loader is stripped down to the essentials. The x-loader configures the pin muxing, clocks, DDR, and serial console, so that it can access and load the second stage bootloader (u-boot) into the DDR. This figure shows the code flow in the x-loader, beginning in start.S.
omapedia.org/wiki/Bootloader_Project#OMAP_Bootloader_Overview
3/7
5/22/12
u-boot overview
The u-boot is a second stage bootloader that is loaded by the x-loader into DDR. It comes from Das U-Boot (http://www.denx.de/wiki/U-Boot) . The u-boot can perform CPU dependent and board dependent initialization and configuration not done in the x-loader. The u-boot also includes fastboot functionality for partitioning and flashing the eMMC. The u-boot runs on the Master CPU (CPU ID 0), which is responsible for the initialization and booting; at the same time, the Slave CPU (CPU ID 1) is held in the wait for event state. This figure shows the code flow in the u-boot, beginning in start.S.
omapedia.org/wiki/Bootloader_Project#OMAP_Bootloader_Overview
4/7
5/22/12
u-boot
Downloading u-boot source
Clone the u-boot git tree and checkout the source code corresponding to this release:
#mdrubo ki -ot #c ubo d -ot #gtcoegt/gtoazo.r/eoubo.i i ln i:/i.mpomogrp/-otgt #gtceku <cmi_Dfruoti_hsrlae> i hcot <omtI_o_bo_nti_ees>
Building u-boot
Make the u-boot source code using the correct config file depending on your platform:
#c ubo d -ot #mk dscen ae itla
omapedia.org/wiki/Bootloader_Project#OMAP_Bootloader_Overview
5/7
5/22/12
x-loader
Accessing x-loader source
Clone the x-loader git tree and checkout the source code corresponding to this release:
#c xlae d -odr #gtcoe gt/gtoazo.r/eoxlae.i i ln i:/i.mpomogrp/-odrgt #gtceku <cmi_Dfrxodri_hsrlae> i hcot <omtI_o_lae_nti_ees>
Building x-loader
Make the x-loader source code using the correct config file depending on your platform:
#c xlae d -odr #mk dscen ae itla #mk COSCMIEamnn-iu-neb-<cni_iedpnigo_orpafr> ae RS_OPL=r-oelnxguai <ofgfl_eedn_nyu_ltom> #mk COSCMIEamnn-iu-neb-it ae RS_OPL=r-oelnxguai f
omapedia.org/wiki/Bootloader_Project#OMAP_Bootloader_Overview
6/7
5/22/12
To build x-loader to boot over a serial connection for OMAP3, use "omap3430labradordownload_config" The resulting MLO is located in the top-level of your x-loader directory. Note: If you are using an HS (High Security) OMAP device, an extra step is required. First, build x-load.bin using the steps above. Then, download the MShield signing tool and use the commands below. Contact your TI representative to get access to this tool.
#c mhedd-otfle d sil-kro-odr #.gnrt_L <OA tp> xla.i /eeaeMO <MP ye> -odbn
Flashing
Refer to Android_Fastboot to review flashing methods for Blaze and Blaze Tablet using Fastboot. Refer to Zoom Flashing to review flashing methods for Zoom1/Zoom2/Zoom3. Refer to 3630SDP Flashing to review flashing methods for 3630SDP board. Refer to eMMC Boot to review flashing and boot methods from eMMC device. Refer to [[1] (http://pandaboard.org/content/usb-downloader-and-usb-second-stage-bootloader-omap4) ] for a USB downloader for PandaBoard.
Upstreaming U-boot
U-boot upstreaming is being carried out as a separate project. Please refer to the following link for more details. U-boot Upstreaming Project Retrieved from "http://www.omappedia.org/wiki/Bootloader_Project" Categories: Android | Angstrom | Bootloader | Poky | Linux This page was last modified on 3 April 2012, at 13:52. This page has been accessed 73,582 times. Content is available under Creative Commons Attribution-Share Alike 3.0 license.. Privacy policy About OMAPpedia Disclaimers
omapedia.org/wiki/Bootloader_Project#OMAP_Bootloader_Overview
7/7