To compile the U-Boot bootloader for the Raspberry Pi, you must first have an ARM cross compiler installed. I use gcc-4.7.3-arm-linux-gnueabi that comes with Ubuntu 14.04. To install the compiler run:
apt-get install gcc-arm-linux-gnueabi
Download the latest version of U-Boot and extract the files to a working folder:
wget ftp://ftp.denx.de/pub/u-boot/u-boot-latest.tar.bz2 tar -xjf u-boot-latest.tar.bz2 cd u-boot-2014.04
Now cross compile U-Boot using the Raspberry Pi Model B configuration:
make CROSS_COMPILE=arm-linux-gnueabi- distclean make CROSS_COMPILE=arm-linux-gnueabi- rpi_b_config make CROSS_COMPILE=arm-linux-gnueabi- u-boot.bin
Once compiled, u-boot.bin can be copied to your SDCard and executed in place of kernel.img