Home > tech foo > Buildroot Linux on the Pandaboard Rev. 3

Buildroot Linux on the Pandaboard Rev. 3

At my work I have to develop software for the Pandaboard. Unfortunately there are a lot of false or incomplete information on how to build/run U-Boot and/or the Linux kernel on the Pandaboard. Most of the false information is due to the fact, that a lot of people own a Pandaboard ES and just write something like: “How to build Linux for the Pandaboard”, when it should state “…for the Pandaboard ES.
This tutorial is all about booting Linux on the Pandaboard Rev. 3 with the TI Omap 4430. You can easily check which version of the Pandaboard you have, by flipping it over to the backside. In the picture below you see a photo of my Pandaboard Rev. 3.

Pandaboard Rev. 3

Pandaboard Rev. 3

Builroot GIT
Unfortunately the GIT repository of Buildroot is incredibly slow, but once you have cloned the repository with

git clone git://git.buildroot.net/buildroot

you are ready to go.

Linux .config
Before we start configuring our target system, we have to fetch a working configuration for the Linux kernel. I have prepared a .config for the Linux kernel 3.9.11 which boots on my Pandaboard Rev.3.

cd buildroot
wget http://pastebin.com/raw.php?i=pEY0SwCq -O panda_config

Now we have a working config and can start setting up the rest of our target system.

Buildroot configuration for the Pandaboard
First we have to configure Buildroot to build an uImage (Linux Kernel), a MLO binary (second stage bootloader) and an u-boot.bin (third stage bootloader). To start the configuration we have to change into the newly created directory and call the following

make menuconfig

Once we are in the settings we can start configuring our system.

Target options
The Target options menu defines the overall target architecture (and some additional settings). The entries should look like

    Target Architecture (ARM (little endian)) —>
    Target Architecture Variant (cortex-A9) —>
    Target ABI (EABI) —>
[ ] Enable NEON SIMD extension support
    Floating point strategy (Soft float) —>
    ARM instruction set (ARM) —>

Kernel
The Kernel menu allows us to customize our Linux kernel. In the entry Configuration file path we specify our previously downloaded Linux Kernel configuration. The target binary should be an uImage, because that’s the image type U-Boot can easly recognize and load. The load address is somewhere in the RAM of the Pandaboard (start of RAM is 0x80000000). Everything else can be taken from below

[*] Linux Kernel
      Kernel version (Custom version) —>
(3.9.11) Kernel version
()   Custom kernel patches
      Kernel configuration (Using a custom config file) —>
(panda_config) Configuration file path
      Kernel binary format (uImage) —>
(0x80008000) load address (for 3.7+ multi-platform image)
[ ]  Device tree support
      Linux Kernel Extensions —>

Filesystem images
To make the boot process easier we link a RAM disk into the Linux kernel. This increases the size of the uImage but adds the convenience that we only have to load one image.

[ ] cloop root filesystem for the target device
-*- cpio the root filesystem (for use as an initial RAM filesystem)
      Compression method (no compression) —>
[ ]   Create U-Boot image of the root filesystem
[ ] cramfs root filesystem
[ ] ext2/3/4 root filesystem
[*] initial RAM filesystem linked into linux kernel
[ ] jffs2 root filesystem
[ ] romfs root filesystem
[ ] squashfs root filesystem
[ ] tar the root filesystem
[ ] ubifs root filesystem

U-Boot
Newer U-Boot versions can create the second stage bootloader for the Pandaboard, in addition to the actual third stage bootloader (U-Boot). So we don’t have to enable X-loader in the Buildroot configuration. As a source for U-Boot we use Linaro’s customized U-Boot repository. We check out the required branch and load the correct Board definition (omap4_panda).

[ ] Barebox
*** gummiboot needs a toolchain w/ largefile, wchar ***
[ ] mxs-bootlets
[*] U-Boot
(omap4_panda) U-Boot board name
      U-Boot Version (Custom Git repository) —>
(git://git.linaro.org/boot/u-boot-linaro-stable.git) URL of custom reposito
(2011.11.2) Custom repository version
()    custom patch dir
U-Boot binary format (u-boot.bin) —>
[ ]   produce a .ift signed image (OMAP)
[ ]   Custom Network Settings —-
[ ]   U-Boot SPL support
[ ]   Environment image —-
[ ] X-loader

Build
Once we are done with the configuration we save the settings…

Saving the menuconfig

…and then we can build everything, by calling

make

When everything is done, we can find the binaries in the following folders

  1. uImage - output/images
  2. u-boot.bin - build/uboot-2011.11.2
  3. MLO - build/uboot-2011.11.2

U-Boot boot script
Before we copy everything to an SD card we create a small U-Boot script to automate the boot process. Just copy the below text into a file called boot_mmc.txt.

setenv bootargs ‘root=/dev/mmcblk0p2 rw rootwait rootfstype=ext3 console=ttyO2,115200n8 vram=16M’
fatload mmc 0 82000000 uImage
bootm start 82000000
bootm loados
bootm go 82000000

Afterwards execute the following command to create the boot.scr script

mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n “Panda SD Boot” -d boot_mmc.txt boot.scr

Now we put an SD card into our PC, format it to FAT32 and enable the boot flag. For this job I usually use gparted. But feel free to use the tool of your choice.

Afterwards we copy all files to the SD card

mount /dev/sdc1 /media/sd_card
cp /output/build/uboot-2011.11.2/MLO /media/sd_card
cp /output/build/uboot-2011.11.2/u-boot /media/sd_card
cp /output/images/uImage /media/sd_card
cp /boot.scr /media/sd_card

Finally put in the SD card and see the system boot.

My Pandaboard in action

My Pandaboard in action

That’s it now you should have a running Linux setup for the Pandaboard.

Have fun & Happy hacking!

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: