Friday, 5 December 2014

Building u-boot for Banana Pi

The u-boot for Banana pi is at LeMaker's github repo; clone it first:
 git clone
This will checkout a u-boot-bananapi directory, cd to it and

 make BananaPi_config  
The toolchain I use is  the arm-linux-gnueabihf in Ubuntu trusty, which gets installed as arm-linux-gnueabihf-* . This is the hard float toolchain as A20 device supports hardware floting point. To build u-boot :
 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
usually, U-boot gets built with minimum fuss; once done, the following will be present at the top level directory:
 -rwxrwxr-x  1 1000 1000 1333636 Dec 5 14:51 u-boot  
 -rw-rw-r--  1 1000 1000 238536 Dec 5 14:51 u-boot.bin  
 -rw-rw-r--  1 1000 1000 238600 Dec 5 14:51 u-boot.img  
 -rw-rw-r--  1 1000 1000  1272 Dec 5 14:51  
 -rw-rw-r--  1 1000 1000 277271 Dec 5 14:51  
 -rw-rw-r--  1 1000 1000 715730 Dec 5 14:51 u-boot.srec  
 -rw-rw-r--  1 1000 1000 271368 Dec 5 14:51 u-boot-sunxi-with-spl.bin  
u-boot is the ELF and u-boot-bin is the binary. What we need is the u-boot-sunxi-with-spl.bin. This integrates the secondary chainloader; Hence we only need to flash this to the SD card.
 dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8  
where /dev/sdb is the SD card on your development machine.

In order to see the boot sequence, we need a serial console - described in this post.

This is how the boot sequence looks like on banana pi. First few lines are from SPL, which then loads the proper u-boot.

click to enlarge

No comments:

Post a Comment