Compiling latest U-Boot for i.MX6 (2015 edition)

Published on October 10, 2015

Archived Notice

This article has been archived and may contain broken links, photos and out-of-date information. If you have any questions, please Contact Us.

If you've updated to our most recent kernel >= 3.14.28_1.0.0_ga then you'll be needing our new u-boot to accompany it. This will require you to pull and compile our u-boot branch and deploy it to your board.

Please take your time. Doing this incorrectly will brick your board. Triple check the u-boot binary matches the board you have. If you're not sure, ask!

For the impatient

I took the liberty of compiling nearly all the versions of u-boot for nearly all our boards. These are built against their respective defconfig as of revision 440d481 on branch boundary-v2015.07.

You'll also need this 6x_upgrade script. Instructions on how to upgrade are after the compiling instructions below.

UPDATE: an archive containing all the binaries for our boards will be regularly updated at this address:

As part of the archive, a file named "boundary-v2015.07_" contains the exact commit ID of the repo for this build. 


The usual compilation disclaimers apply for this. I highly recommend the gcc-arm-linux-gnueabihf package available on Ubuntu. I use this package and target CROSS_COMPILE at that compiler in my example below.

~$ sudo apt-get install gcc-arm-linux-gnueabihf

First, clone our u-boot git repository. This is the branch you'll need to compile and install to work with the new kernel.

~$ git clone -b boundary-v2015.07 ~$ cd u-boot-imx6

Here you'll need to find and make the relevant defconfig for your board. To see all the defconfigs, use this command and pick the one that is right for you.

~/u-boot-imx6$ find . -name "nit*defconfig" ./configs/nitrogen6qp_max_defconfig ./configs/nitrogen6q2g_defconfig ./configs/nitrogen6s_defconfig ./configs/nitrogen6_lum_dl1_defconfig ./configs/nit6xlite1g_defconfig ./configs/nitrogen6sx_defconfig ./configs/nitrogen6q_fl_defconfig ./configs/nit6xlite_defconfig ./configs/nitrogen6_max_defconfig ./configs/nitrogen6_vm1g_defconfig ./configs/nitrogen6dl2g_defconfig ./configs/nitrogen6dl_defconfig ./configs/nitrogen6_vm_defconfig ./configs/nitrogen6q_defconfig ./configs/nitrogen6s1g_defconfig

 Now compile that defconfig, here I'll use nitrogen6q_defconfig as an example.

~/u-boot-imx6$ export ARCH=arm ~/u-boot-imx6$ export CROSS_COMPILE=arm-linux-gnueabihf- ~/u-boot-imx6$ make nitrogen6q_defconfig ~/u-boot-imx6$ make all

Now you'll have a u-boot.imx file compiled. Rename the u-boot.imx file to u-boot.{uboot_defconfig} (see below), then move that and the 6x_upgrade script to the Boot partition of the image you created (see here for instructions on creating a Fido Yocto image). Interrupt u-boot and run the u-boot commands below.

In the u-boot just built, the environment variable uboot_defconfig is defined to show which defconfig was used in the build process. Unless you're already on a 2015.07 or later u-boot, you won't have this yet, so for the 1st upgrade you need to set it manually.

You will need to rename u-boot.imx when copying to the SD card, ie.

~/u-boot-imx6/$ cp u-boot.imx /dev/sdd1/u-boot.nitrogen6q

We changed this so that the next time you upgrade, there will be little risk of accidentally using the wrong u-boot.imx file.

If your u-boot prompt is "U-boot >" then run:

Hit any key to stop autoboot: 0 U-Boot > setenv uboot_defconfig nitrogen6q U-Boot > run upgradeu

Otherwise just run:

Hit any key to stop autoboot: 0 => run upgradeu

This will run the 6x_upgrade script and look for a file u-boot.{uboot_defconfig} and burn it. At this point it might be worth while to clear your envionment variables, this will set you up with the default environment variables and no more.

Hit any key to stop autoboot: 0 => run clearenv

Then as a final note, if you've somehow managed to brick your board through this process and need help. Well, we already wrote a blog post here about that topic.

New Features

One of the more important features of the new u-boot is improved display detection and selection. To see the available displays, run the "fbpanel" command from u-boot prompt

Hit any key to stop autoboot: 0 => fbpanel

Then four variables control which panels you'd like to select:
fb_hdmi controls HDMI display selection
fb_lcd controls LCD display selection
fb_lvds controls LVDS display selection
fb_lvds2 controls LVDS2 display selection

An example selection would look like this:

Hit any key to stop autoboot: 0 => setenv fb_hdmi 1280x720M@60 => setenv fb_lcd CLAA-WVGA => setenv fb_lvds hannstar7 => setenv fb_lvds2 hannstar => saveenv

Booting with these variables set would pass the appropriate boot parameters to use those display settings if a display is detected on that port.