This page presents getting started instructions for cloning the git trees and building U-boot, Linux kernel and Yocto.

Build Toolchain

In case the U-boot or Linux kernel git trees are directly used, the build toolchain has to be manually downloaded. This section contains the instructions on how to download and setup the toolchain for this case.

Note that the build toolchain is provided with the Yocto Project Source Package (see Linux Getting Started on Altera SoC Development Board - Using Yocto Source Package). And In case the Yocto Project git tree is used, the recipes will download the build chain automatically.

The steps necessary to download and setup the build toolchain are:
$ cd ~
$ wget https://launchpad.net/linaro-toolchain-binaries/trunk/2012.11/+download/gcc-linaro-arm-linux-gnueabihf-4.7-2012.11-20121123_linux.tar.bz2
$ tar xjf gcc-linaro-arm-linux-gnueabihf-4.7-2012.11-20121123_linux.tar.bz2
$ export CROSS_COMPILE=~/gcc-linaro-arm-linux-gnueabihf-4.7-2012.11-20121123_linux/bin/arm-linux-gnueabihf-

U-Boot

This section presents instructions on how to clone the U-boot git tree and compile U-boot. It assumes that you have manually downloaded the build toolchain.
$ git clone git://git.rocketboards.org/u-boot-socfpga.git 
$ cd u-boot-socfpga
$ git checkout -b <test_branch_name> rel_13.02_RC10
$ export CROSS_COMPILE=~/gcc-linaro-arm-linux-gnueabihf-4.7-2012.11-20121123_linux/bin/arm-linux-gnueabihf-
$ make mrproper
$ ./MAKEALL socfpga_cyclone5

Note: replace <test_branch_name> with the name of the branch you want to use locally.

Some of the files that are created:
File Description
u-boot U-boot ELF file
u-boot.bin U-boot binary file
u-boot.img U-boot image file
spl/u-boot-spl SPL ELF file
spl/u-boot-spl.bin SPL binary file

Linux Kernel

This section presents instructions on how to clone the Linux kernel git tree and compile the Linux kernel. It assumes that you have manually downloaded the build toolchain.
$ git clone git://git.rocketboards.org/linux-socfpga.git 
$ cd linux-socfpga
$ git checkout -b <test_branch_name> rel_13.02_RC10
$ export CROSS_COMPILE=~/gcc-linaro-arm-linux-gnueabihf-4.7-2012.11-20121123_linux/bin/arm-linux-gnueabihf-
$ make ARCH=arm socfpga_defconfig
$ make ARCH=arm uImage LOADADDR=0x8000
$ make ARCH=arm dtbs
$ make ARCH=arm modules

Note: replace <test_branch_name>with the name of the branch you want to use locally.
The step ....
$ make ARCH=arm uImage LOADADDR=0x8000
May fail with...
"mkimage" command not found - U-Boot images will not be built
make[1]: *** [arch/arm/boot/uImage] Error 1
make: *** [uImage] Error 2

This tool is built as part of the uboot step.

This works around this failure..
PATH=../u-boot-socfpga/tools:$PATH make  ARCH=arm uImage LOADADDR=0x8000

Some of the files that are created:
File Description
vmlinux Linux Kernel ELF file
arch/arm/boot/uImage Linux Kernel image
arch/arm/boot/dts/socfpga_cyclone5.dtb Device Tree Binary

Yocto Project

This section presents how to clone the Yocto Project git tree and also how to build using it.

Note that in this case only the Yocto Project build system and the recipes are cloned, all the dependencies are downloaded from Internet during the build process.

Refer to Linux Getting Started on Altera SoC Development Board - Using Yocto Source Package for the Yocto Project Source Package instead if you do not have Internet access on the build machine, or if you want to avoid downloading the dependencies.

The instructions for cloning the Yocto Project git trees and building Yocto Project are:
$ git clone git://git.rocketboards.org/poky-socfpga.git  
$ cd  poky-socfpga/
$ git checkout -b <test_branch_name> origin/danny-altera
$ source ./altera-init build
$ bitbake virtual/kernel virtual/bootloader altera-image    

Note: replace <test_branch_name>with the name of the branch you want to use locally.

On Debian / Ubuntu, may have to first "sudo apt-get install chrpath".

If docbook fails to link, you may have hit https://bugzilla.yoctoproject.org/show_bug.cgi?id=2972 in which case you can patch the bitbake recipe as a workaround....https://lists.yoctoproject.org/pipermail/meta-freescale/2012-December/000597.html

This will build all the Linux items: SPL, U-boot, Device Tree, Linux kernel, root filesystem. See Linux Getting Started on Altera SoC Development Board - Using Yocto Source Package for a list of generated files.

© 1999-2024 RocketBoards.org by the contributing authors. All material on this collaboration platform is the property of the contributing authors.

Privacy Policy - Terms Of Use

This website is using cookies. More info. That's Fine