Latest revision as of 11:49, 3 June 2012

Contents

Introduction

A Panda board does not have any onboard flash, where many other development or evaluation boards
keep their bootloader. Rather, code onboard the board (presumably in ROM) reads the second-stage
bootloaders from the MMC (SD card).

The first-stage bootloader runs directly on the board from power-up. I don't know the
name of this bootloader(From TI official wiki, it called Boot Rom). This bootloader initializes a minimal amount of CPU and board hardware,
then accesses the first partition of the SD card (which must be in FAT format), and loads
a file called "MLO", and executes it. "MLO" is the second-stage bootloader.

The second-stage bootloader can apparently be one of either the X-loader or SPL.
This bootloader apparently also just reads the first partition of the SD card, and
loads a file called "u-boot.bin", and executes it. "u-boot.bin" is the third-stage bootloader.

The third-stage bootloader is U-boot, which is a popular bootloader for many different
embedded boards and products. This bootloader has lots of different features, including
an interactive shell, variables, ability to access the SD card and show its contents, etc.
What happens next depends on the version of U-boot you have for the Panda board, and how
it is configured. In a very simple configuration, U-Boot will look for the file "uImage"
in the root of the first partition of the SD card (which, again, must be formatted as a FAT
partition), and execute that. This is the Linux kernel. U-Boot passes the kernel a
command line argument. Depending on how the kernel is configured it may accept the command
line from U-Boot, or use one that was compiled into it when it was built.

Newer kernels require that you use a recent MLO (SPL) and u-boot.
Note: New u-boot with SPL replaces x-loader which you might find in other howtos.

You can build these from source, or try to find binaries. One issue with the binary route is that you might want to alter the kernel command line embedded inside u-boot. Such as for experimenting with different partition formats, or different filesystem types (ext3 vs ext2), etc. Of course you could stop the autoboot and type it in yourself, but we will build from source. An even better solution is to use a boot.scr file to send parameters to u-boot, it's easy to create, see below.

For this How-to, we will use the Code Sourcery G++ version arm-2009q3. It should already be installed on your system. MLO, u-boot and kernels have also been successfully built with arm-2010q1.

You can get u-boot from either linaro or mainline. The linaro tree usually has the latest patches.

Edit the boot_mmc.txt file to suit your needs and re-run the mkimage command to generate a new boot.scr,
put it into the vfat partition along with MLO and uboot.bin.

Creating a working SD card

Use this script to prepare an SD card with the small vfat partition and the larger ext2/3 partition
(it has been posted many places, I take no credit for it btw, the card needs to be larger than 64Mbytes since this original script
wants to make a 64Mbyte vfat partition) You may need to be root for some of the following operations. For the feint of heart,
you can use sudo instead in the right places.