FreeBSD on Freescale i.MX6 systems

The Freescale i.MX6 family of SoCs is available in single, dual, and quad core versions. These SoCs are showing up in a growing number of development boards and small low power computer systems. FreeBSD has basic support for many of these boards and systems, including the following:


Development of FreeBSD i.MX6 support is active and ongoing. For the latest information or help with anything, please send an email to

What works

FreeBSD 11 is where active development happens for i.MX6 systems and ARMv7 in general. The FreeBSD 10-stable branch is also kept up to date, with changes being merged to it typically 30-60 days after they've been committed to 11.

The following device drivers are available:

What still needs to be done

Lots of device drivers still need to be written, including:

Building FreeBSD

The Crochet script supports Wandboard and is probably the easiest way to get started with FreeBSD on i.MX6. It creates images from scratch, ready to copy to an sdcard.

The i.MX6 boot process

The i.MX6 chip has a small on-chip rom and a small amount of on-chip sram. The rom code is able to boot from several different device types, based on how pullup and pulldown resistors are connected to some gpio pins. Most systems are set to boot from SD card. The on-chip rom tries to load a boot program from offset 1024 (the start of the third sector) on the SD card. If it can read from the card it loads the boot program into the internal sram, verifies that it's a valid boot program, and begins executing it.

Most i.MX6 systems use U-Boot as the boot program. Recent versions of U-Boot are split into a small first-stage loader called SPL and a main boot program. The SPL program for i.MX6 determines what type of chip it is (solo, dual, or quad) and how much ram it has, and sets up the main ram timing registers. It then loads the main U-Boot program from a fixed sector number on the SD card into ram and begins executing it. The fixed location on the SD card for the main U-Boot program can vary, but is usually in the neighborhood of 40-60K into the card. Following the main U-Boot program is the area of the card where U-Boot stores the saved environment data. In general, the first megabyte of the SD card is reserved for boot stuff.

The main U-Boot program can be configured with many different options for loading a kernel from SD card, USB drives, SATA drives, or the network. When booting FreeBSD the usual process is to have U-Boot start ubldr (a version of loader(8) tailored for use with U-Boot), and ubldr loads and starts the kernel. To use ubldr, U-Boot must be configured with the CONFIG_API option, and unfortunately, most i.MX6 system vendors do not include that option when they build U-Boot. For that reason, we generally end up building our own copy of U-Boot to use with FreeBSD. If you ever try to start ubldr from U-Boot and it exits with a status of 0xnnBADAB1 that's a sign that U-Boot was built without the API option.

Recently the customized versions of U-Boot have been turned into FreeBSD ports and packages. You can simply "pkg install u-boot-wandboard" and everything you need to get U-Boot onto an SD card is installed for you in /usr/local/share/u-boot, including a README file that tells you how to install the file(s) onto the SD card.

When an i.MX6 system has several models, such as a dual processor and quad processor model, a single version of U-Boot can typically boot both types of system. U-Boot will create environment variables that name the type of chip and system, and these can be used by U-Boot env scripts to create a filename for the FDT data, such as 'env set fdt_file ${soc}-${board}.dtb' which might set, for example, imx6q-wandboard.dtb, causing ubldr to load the correct dtb file and pass it to the kernel.

FreeBSD/arm/imx6 (last edited 2015-02-02 01:54:07 by IanLepore)