Difference between revisions of "Panda How to Barebox"
(Created page with "== Introduction == 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 s...") |
KenMcGuire (Talk | contribs) (I tried the original instructions and found some problems, I also added the warning for 4460. ...km...) |
||
| Line 2: | Line 2: | ||
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. | 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. | ||
| + | |||
| + | == What is Barebox? == | ||
| + | |||
| + | Barebox is what was once u-boot V2, see the homepage for more details. | ||
| + | |||
| + | http://barebox.org/ | ||
| + | |||
| + | You can get the sources from: http://git.pengutronix.de/?p=barebox.git;a=summary | ||
| + | |||
| + | |||
| + | === Warning === | ||
| + | There is no 4460 specific code as yet in Barebox and the 4430 code that sets up the CPU dpll and the VCORE1/3 is not correct for the 4460. | ||
| + | |||
== MLO == | == MLO == | ||
| Line 12: | Line 25: | ||
mkdir MLO | mkdir MLO | ||
| − | make CROSS_COMPILE=Path_to_your/arm-2009q3/bin/arm-none-linux-gnueabi- O=MLO panda_xload_defconfig | + | make mrproper |
| + | make ARCH=arm CROSS_COMPILE=Path_to_your/arm-2009q3/bin/arm-none-linux-gnueabi- O=MLO panda_xload_defconfig | ||
Now compile MLO: | Now compile MLO: | ||
| − | make CROSS_COMPILE=Path_to_your/arm-2009q3/bin/arm-none-linux-gnueabi- O=MLO | + | make ARCH=arm CROSS_COMPILE=Path_to_your/arm-2009q3/bin/arm-none-linux-gnueabi- O=MLO |
This should produce the MLO file as MLO/barebox.bin. | This should produce the MLO file as MLO/barebox.bin. | ||
| Line 26: | Line 40: | ||
mkdir boot | mkdir boot | ||
| − | make CROSS_COMPILE=Path_to_your/arm-2009q3/bin/arm-none-linux-gnueabi- O=boot panda_defconfig | + | make ARCH=arm CROSS_COMPILE=Path_to_your/arm-2009q3/bin/arm-none-linux-gnueabi- O=boot panda_defconfig |
Now compile Barebox: | Now compile Barebox: | ||
| − | make CROSS_COMPILE=Path_to_your/arm-2009q3/bin/arm-none-linux-gnueabi- O=boot | + | make ARCH=arm CROSS_COMPILE=Path_to_your/arm-2009q3/bin/arm-none-linux-gnueabi- O=boot |
This should produce boot/barebox.bin | This should produce boot/barebox.bin | ||
Revision as of 17:19, 12 November 2011
Contents |
Introduction
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.
What is Barebox?
Barebox is what was once u-boot V2, see the homepage for more details.
http://barebox.org/
You can get the sources from: http://git.pengutronix.de/?p=barebox.git;a=summary
Warning
There is no 4460 specific code as yet in Barebox and the 4430 code that sets up the CPU dpll and the VCORE1/3 is not correct for the 4460.
MLO
First, let's get the x-loader source code and build it. But the difference with Barebox is that the x-loader is just a down size of Barebox it self
git clone git://git.pengutronix.de/git/barebox.git
Next, select the panda config:
mkdir MLO make mrproper make ARCH=arm CROSS_COMPILE=Path_to_your/arm-2009q3/bin/arm-none-linux-gnueabi- O=MLO panda_xload_defconfig
Now compile MLO:
make ARCH=arm CROSS_COMPILE=Path_to_your/arm-2009q3/bin/arm-none-linux-gnueabi- O=MLO
This should produce the MLO file as MLO/barebox.bin.
Barebox
Now for Barebox:
Next, select the panda config:
mkdir boot make ARCH=arm CROSS_COMPILE=Path_to_your/arm-2009q3/bin/arm-none-linux-gnueabi- O=boot panda_defconfig
Now compile Barebox:
make ARCH=arm CROSS_COMPILE=Path_to_your/arm-2009q3/bin/arm-none-linux-gnueabi- O=boot
This should produce boot/barebox.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.
#!/bin/sh
if [ ! "$1" = "/dev/sda" ] ; then
DRIVE=$1
if [ -b "$DRIVE" ] ; then
dd if=/dev/zero of=$DRIVE bs=1024 count=1024
SIZE=`fdisk -l $DRIVE | grep Disk | awk '{print $5}'`
echo DISK SIZE - $SIZE bytes
CYLINDERS=`echo $SIZE/255/63/512 | bc`
echo CYLINDERS - $CYLINDERS
{
echo ,9,0x0C,*
echo ,,,-
} | sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE
mkfs.vfat -F 32 -n "boot" ${DRIVE}1
mke2fs -j -L "rootfs" ${DRIVE}2
fi
fi
More to come....