Linaro is an engineering organization providing useful tools and open-source software optimized for ARM architectures, such as the Linux kernel, the GNU Compiler Collection (GCC), power management, graphics and multimedia interfaces. We’re going to use the Linaro Toolchain to compile u-boot for the i.MX 6 Quad Core ARM Cortex A9 on the VAR SOM MX6 in a Linux environment.
Download the toolchain at
https://www.linaro.org/downloads/. The version that we need is “linaro-toolchain-binaries (little-endian)” under the “Linaro Toolchain for Cortex-A”section, and it comes as a TAR archive.
Untar the archive in
$ cd /opt/ $ sudo mkdir linaro $ cd linaro $ sudo mv < path-to-tar-archive > . $ sudo tar xvf gcc-linaro-4.9-2015.02-3-x86_64_arm-linux-gnueabihf.tar.xz
- Using your favorite text editor, open .bashrc and append the path of the toolchain bin folder to the end of the file:
Now you can use the linaro tools from every folder. To list all the available tools you can start typing
$ arm-linaro-gnueabihf- and press TAB for auto-complete.
Das U-Boot is an open-source boot loader, used in embedded devices to allow the device’s operating system kernel to boot. Different versions of the U-Boot image are available from the following repositories:
- Repository of Variscite
- Repository of Freescale (official)
- Repository of Freescale’s community
We’re going to use the first repository, supported by Variscite.
Open a terminal and type:
$ git clone https://github.com/varigit/uboot-imx.git
This will checkout the latest available branch of the bootloader.
Compile U-Boot for the VAR SOM MX6 board:
$ cd uboot-imx/ $ export ARCH=arm $ export CROSS_COMPILE=arm-linux-gnueabihf- $ make mrproper
If you want to build for SD-Card: (following make targets are used to configure the package)
$ make mx6var_som_sd_config
otherwise, for NAND Flash:
$ make mx6var_som_nand_config
And finally we can instruct make to build u-boot with:
- Flash U-Boot to the SD-Card:
$ sudo dd if=SPL of=/dev/sdxxx bs=1K seek=1; sync $ sudo dd if=u-boot.img of=/dev/sdxxx bs=1K seek=69; sync
NOTE Pay attention to use
syncin order to commit buffer cache to disk.
The first instruction will flash the SPL, a small bootloader that allows the VAR SOM MX6 to be recognized and to initialize the proper bootloader configuration for the module. The second instruction will flash the actual U-Boot image, that will be loaded right after the SPL. You need to replace /dev/sdxxx with your SD-Card device.
- Boot the Amber board from SD-Card and verify U-Boot version:
To boot from SD you need to plug it in the card reader and power on the board while pressing the dedicated button (located right near the switch to power on the board). You just need to keep the button pressed for a few instants while the board powers up.
The board will load the SPL first, to actually recognize the VAR SOM MX6 chip, and then it will load the U-Boot image. You can press a key right before the kernel is loaded to freeze the bootloader and play with U-Boot options.
On the first lines prompted you can find the U-Boot version, the date and time when it’s been compiled.