I.mx 6 SABRE-AI Linux Users Guide
I.mx 6 SABRE-AI Linux Users Guide
I.mx 6 SABRE-AI Linux Users Guide
User Guide
Document Number:IMX6LXUGSAI
Rev L3.10.17_1.0.0-ga, 05/2014
Contents
Introduction...............................................................2
1.1 Audience
1.2 References
i.MX 6 SABRE-AI Linux Reference Manual.
Introduction
2 Introduction
The i.MX 6 SABRE-AI Linux BSP is a collection of binary, source code, and support files that can be used to create U-Boot
boot loader, Linux kernel image, and a root file system for i.MX 6 SABRE-AI development systems For the steps on how to
run and configure Yocto Project rootfs, see the Freescale Yocto Project User's Guide (document IMXLXYOCTOUG).
u-boot-imx6qsabreauto_sd.imx (SD/MMC)
u-boot-imx6qsabreauto_spi-nor.imx (SPI-NOR)
u-boot-imx6qsabreauto_eim-nor.imx (Parallel NOR)
u-boot-imx6qsabreauto_nand.imx (NAND)
u-boot-imx6qsabreauto_sata.imx (SATA)
u-boot-imx6dlsabreauto.imx (SD/MMC)
u-boot-imx6dlsabreauto_spi-nor.imx (SPI-NOR)
u-boot-imx6dlsabreauto_eim-nor.imx (Parallel NOR)
u-boot-imx6dlsabreauto_nand.imx (NAND)
u-boot-imx6solosabreauto.imx (SD/MMC)
u-boot-imx6solosabreauto_spi-nor.imx (SPI-NOR)
u-boot-imx6solosabreauto_eim-nor.imx (Parallel NOR)
u-boot-imx6solosabreauto_nand.imx (NAND)
uImage-imx6q-sabreauto-gpmi-weim.dtb
uImage-3.10.17-r0-imx6q-sabreauto-flexcan1.dtb
i.MX 6DualLite SABRE-AI, i.MX 6Solo SABRE-AI:
uImage_imx_v7_defconfig
uImage-imx6dl-sabreauto.dtb
uImage-imx6dl-sabreauto-ecspi.dtb
uImage-imx6dl-sabreauto-gpmi-weim.dtb
uImage-imx6dl-sabreauto-flexcan1.dtb
fsl-image-dfb-imx6qdlsolo.ext3
fsl-image-fb-imx6qdlsolo.ext3
fsl-image-weston-imx6qdlsolo.ext3
fsl-image-x11-imx6qdlsolo.sdcard
The file system includes Freescale specific libraries and QT GUI. It can be mounted as NFS, or its contents can be stored on
a boot media such as Secure Digital (SD) card.
D1
D2
D3
D4
S3
OFF
ON
OFF
OFF
D1
D2
D3
D4
D5
D6
D7
D8
S1
OFF
ON
S2
OFF
ON
OFF
S3
OFF
OFF
ON
OFF
The following table shows the dip settings for MMC boot on CPU board:
D1
D2
D3
D4
D5
D6
D7
D8
S1
OFF
ON
S2
ON
ON
OFF
S3
OFF
OFF
ON
OFF
D1
D2
D3
D4
D5
D6
D7
D8
D9
D10
S1
OFF
OFF
OFF
ON
OFF
OFF
OFF
OFF
OFF
OFF
S2
OFF
OFF
OFF
ON
S3
OFF
OFF
ON
OFF
D1
D2
D3
D4
D5
D6
D7
D8
D9
D10
S1
S2
ON
ON
OFF
OFF
OFF
OFF
OFF
OFF
OFF
OFF
S3
OFF
OFF
ON
OFF
NOTE
In order to boot from SPI NOR, jumper J3 must be set between pins 2 and 3.
D1
D2
D3
D4
D5
D6
D7
D8
D9
D10
S1
OFF
OFF
ON
S2
OFF
OFF
OFF
S3
OFF
OFF
ON
OFF
NOTE
SPI and EIM NOR have pin conflicts. Both cannot be used for the same configuration.
The default U-Boot configuration is set to SPI NOR.
The i.MX 6 SABRE-AI board can communicate with a host server (Windows or Linux) using the serial cable. Common
serial communication programs such as HyperTerminal, Tera Term, or PuTTY can be used. The example below describes the
serial terminal setup using HyperTerminal on a Windows host:
1. Connect the target and the Windows PC using a serial cable.
2. Open HyperTerminal on the Windows PC and select the settings as shown in the figure below.
2. Configure the U-Boot environment for network communications. Below is an example. The lines preceding with the
"#" character are comments and have no effect.
U-Boot > setenv serverip <your tftpserver ip>
U-Boot > setenv bootfile <your kernel uImage name on the tftp server>
U-Boot > setenv fdt_file <your dtb image name on the tftp server>
### The user can set fake MAC address via ethaddr enviroment if the MAC address is not
fused
5. Check the usage of "mmc" command. The "blk#" is equal to "<the offset of read/write>/<block length of the card>".
The "cnt" is equal to "<the size of read/write>/<block length of the card>".
U-Boot > help mmc
mmc - MMC sub system
Usage:
mmc read addr blk# cnt
mmc write addr blk# cnt
mmc erase blk# cnt
mmc rescan
mmc part - lists available partition on current mmc device
mmc dev [dev] [part] - show or set current mmc device [partition]
mmc list - lists available devices
6. Program the kernel uImage located in RAM at ${loadaddr} into the microSD. For example the command to write the
image with the size 0x800000 from ${loadaddr} to the offset of 0x100000 of the microSD card. Refer to the following
examples for the definition of the mmc Parameters.
blk# = (microSD Offset)/(SD block length) = 0x100000/0x200 = 0x800
cnt = (image Size)/(SD block length) = 0x800000/0x200 = 0x4000
This example assumes the kernel image is equal to 0x800000. If the kernel image exceeds 0x800000, increase the
image length. After issuing the tftp command, filesize U-Boot environment variable is set with the number of bytes
transferred. This can be checked to determine the correct size needed for the calculation. Use U-Boot command
printenv to see the value.
U-Boot > mmc dev 0
### suppose kernel uImage less than 8M
U-Boot > mmc write ${loadaddr} 0x800 0x4000
7. Program the dtb file located in RAM at ${fdt_addr} into the microSD.
U-Boot > tftpboot ${fdt_addr} ${fdt_file}
2. To create a partition in MMC/SD Slot 3, use the fdisk command in the Linux console:
root@freescale ~$ fdisk /dev/mmcblk0
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that the previous content
won't be recoverable.
The number of cylinders for this disk is set to 124368.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): p
Disk /dev/mmcblk0: 4075 MB, 4075290624 bytes
4 heads, 16 sectors/track, 124368 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Device Boot
Start
End
Blocks Id System
3. As described in Flash Memory Map, the rootfs partition should be located after kernel image; the first 0x800000 bytes
can be reserved for MBR, bootloader, and kernel sections. From the log shown above, the Units of current MMC/SD
card is 32768 bytes. The beginning cylinder of the first partition can be set as "0x300000/32768 = 96." The last
cylinder can be set according to the rootfs size. Create a new partition by typing:
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-124368, default 1): 96
Last cylinder or +size or +sizeM or +sizeK (96-124368, default 124368): Using
default value 124368
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read mmcblk0 partition table
p1
4. Format the MMC/SD partitions as types ext3 or ext4 type. For example, to use ext3:
root@freescale ~$ mkfs.ext3 /dev/mmcblk0p1
mke2fs 1.41.4 (27-Jan-2009)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
248992 inodes, 994184 blocks
49709 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1019215872
31 block groups
32768 blocks per group, 32768 fragments per group
8032 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736
5. Copy the rootfs contents to the MMC/SD card (copy the rootfs.ext2 to NFS rootfs).
mount -t ext3 -o loop /fsl-image-x11-sdk-imx6qsabresdrootfs.ext3 /mnt/cdrom
cd /mnt
mkdir mmcblk0p1
mount -t ext3 /dev/mmcblk0p1/mnt/mmcblk0p2/
cp -af /mnt/cdrom/* /mnt/mmcblk0p1/
umount /mnt/mmcblk0p1
umount /mnt/cdrom
4. U-Boot can load the kernel image and DTB file from your VFAT partition
automatically when you boot from the sd/mmc card.
S2-4 0
S1-[1:10] X
6. Reboot target board.
NOTE
Build U-Boot from source with SPI-NOR configuration settings:
1. MACHINE=<i.MX machine>-spi-nor bitbake u-boot-imx -c deploy
where <i.MX machine> can be the following machines:
imx6qsabreauto
imx6dlsabreauto
imx6solosabreauto
2. Copy the resulting image into your host system TFTP folder
4. Flash kernel.
tftpboot ${loadaddr} uImage
cp.b ${loadaddr} 80c0000 ${filesize}
11
7.1 Requirements
An SD/MMC card reader, like a USB card reader, is required. It will be used to transfer the boot loader and kernel images to
initialize the partition table and copy the root file system. To simplify the instructions, it is assumed that a 4GB SD/MMC
card is used.
Any Linux distribution can be used for the following procedure.
The Linux kernel running on the Linux host will assign a device node to the SD/MMC card reader. The kernel might decide
the device node name or udev rules might be used. In the following instructions, it is assumed that udev is not used.
To identify the device node assigned to the SD/MMC card, enter the command:
$ cat /proc/partitions
major minor #blocks name
8
0
78125000 sda
8
1
75095811 sda1
8
2
1 sda2
8
5
3028221 sda5
8
32 488386584 sdc
8
33 488386552 sdc1
8
16
3921920 sdb
8
18
3905535 sdb1
In this example, the device node assigned is /dev/sdb (a block is 1kB large).
NOTE
Make sure the device node is correct for the SD/MMC card. Otherwise, it may damage
your operating system or data on your computer.
The first 1 KB of the SD/MMC card, that includes the partition table, will be preserved.
This will copy uImage to the media at offset 1 MB (bs x seek = 512 x 2048 = 1MB).
The following command will copy the i.MX6Q SABREAI DTB image to the SD/MMC card:
$ sudo dd if=uImage-imx6q-sabreauto.dtb of=/dev/sdb bs=512 seek=20480 conv=fsync
This will copy uImage-imx6q-sabreauto.dtb to the media at offset 10 MB (bs x seek = 512 x 20480 = 10MB).
i.MX 6 SABRE-AI Linux User's Guide, Rev L3.10.17_1.0.0-ga, 05/2014
12
NOTE
On most Linux host operating systems, SD card will be mounted automatically upon
insertion. Therefore, before running fdisk, please make sure that SD card is unmounted
(via 'sudo umount /dev/sdb').
Type the following parameters (each followed by <ENTER>):
u
[switch the unit to sectors instead of cylinders]
d
[repeat this until no partition is reported by the 'p' command ]
n
[create a new partition]
p
[create a primary partition]
1
[the first partition]
+20M
[starting at offset sector #40960, i.e. 20MB, which leaves enough space for the
kernel, the boot loader and its configuration data]
<enter>
[using the default value will create a partition that spans to the last sector
of the medium]
w
[ this writes the partition table to the medium and fdisk exits]
The file system format ext3 or ext4 is a good option for removable media due to the built-in journaling.
$ sudo mkfs.ext3 /dev/sdb1
Or
$ sudo mkfs.ext4 /dev/sdb1
Extract a rootfs package to certain directory: extract fsl-image-fb-imx6qdlsolo.ext3 to /home/user/rootfs for example:
$ sudo mount -o loop -t ext3 fsl-image-fb-imx6qdlsolo.ext3 /home/user/rootfs
NOTE
The rootfs directory needs to be created manually.
Assume that the root file system files are located in /home/user/rootfs as in the previous step:
$
$
$
$
cd /home/user/rootfs
sudo cp -a * /home/user/mountpoint
sudo umount /home/user/mountpoint
sudo umount /home/user/rootfs
NOTE
Copying the file system takes several minutes depending on the size of your rootfs.
The file system content is now on the media.
13
NOTE
If MAC address has not burned into fuse, you must set MAC address to use network in
U-Boot.
setenv ethaddr xx:xx:xx:xx:xx:xx
15
Kernel is pre-configured to support only certain frequencies. The list of frequencies currently supported can be obtained from
cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
Check whether 850 MHz is listed in the table. If it is not, then kernel will chose the closest max frequency. In this case, it will
be 996 MHz.
echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 852000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_set_speed
In order to add the supported frequency, please check the kernel source arch/arm/mach-mx6/cpu_op-mx6.c. This process
involves performing a few mandatory steps.
For example, for 792 MHz, the _hex_ value will be '80002042', the 'div_select' divisor is specified in bits [6:0], and the PLL1
frequency is computed with the following command:
Frequency = OSC clk (which is 24MHz) * div_select/2.0
Home Page:
freescale.com
Web Support:
freescale.com/support
licenses granted hereunder to design or fabricate any integrated circuits based on the
Freescale reserves the right to make changes without further notice to any products
herein. Freescale makes no warranty, representation, or guarantee regarding the
suitability of its products for any particular purpose, nor does Freescale assume any
liability arising out of the application or use of any product or circuit, and specifically
disclaims any and all liability, including without limitation consequential or incidental
damages. Typical parameters that may be provided in Freescale data sheets and/or
specifications can and do vary in different applications, and actual performance may
vary over time. All operating parameters, including typicals, must be validated for
each customer application by customers technical experts. Freescale does not convey
any license under its patent rights nor the rights of others. Freescale sells products
pursuant to standard terms and conditions of sale, which can be found at the following
address: freescale.com/SalesTermsandConditions.
Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc.,
Reg. U.S. Pat. & Tm. Off. All other product or service names are the property of their
respective owners. ARM and ARM Cortex-A9 are registered trademarks of ARM
Limited.
2014 Freescale Semiconductor, Inc.