The first-stage bootloader runs directly on the board from power-up. I don't know the

+

name of this bootloader(From [http://processors.wiki.ti.com/index.php/Boot_Sequence 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.

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.

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.

Line 7:

Line 31:

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

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

+

+

Note: This is for Pandaboard, not Pandaboard ES.

+

If you have a Pandaboard ES try [[PandaBoard_ES_uboot_howto]] instead.

== u-boot (linaro) ==

== u-boot (linaro) ==

Line 28:

Line 55:

make CROSS_COMPILE=arm-none-linux-gnueabi-

make CROSS_COMPILE=arm-none-linux-gnueabi-

−

This should produce the files MLO and u-boot.img in the u-boot directory. Copy both files to your sd card.

+

This should produce the files MLO and u-boot.img in the u-boot directory.

+

Copy both files to your sd card, you now should be able to boot.

== u-boot (mainline) ==

== u-boot (mainline) ==

Line 40:

Line 68:

git checkout v2011.09

git checkout v2011.09

−

Note: Tag v2011.09 from mainline might fail on some Pandaboard revisions, see http://lists.denx.de/pipermail/u-boot/2011-October/104842.html

+

You now should be able to boot.

−

You can use Linaro instead.

+

+

Note: Tag v2011.09 from mainline might fail to boot on some Pandaboard revisions, see http://lists.denx.de/pipermail/u-boot/2011-October/104842.html

+

If this Image fails, you can try the Linaro version from above instead.

=== boot.scr ===

=== boot.scr ===

+

+

This is optional, do this if you want to change Linux Bootargs or U-Boot settings without recompiling.

Copy the following code to boot_mmc.txt

Copy the following code to boot_mmc.txt

Line 126:

Line 158:

num_mbr == num_bpb ? "PASS" : "FAIL!" );

num_mbr == num_bpb ? "PASS" : "FAIL!" );

−

return num_mbr == num_bpb;

+

return num_mbr == num_bpb;}

+

Revision as of 03: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.