CL-SOM-iMX6: Linux: Manual Installation
Contents
Introduction
This article provides an introduction on how to install the Debian example root filesystem image on the CompuLab CL-SOM-iMX6 System-on-Module / Computer-on-Module NAND or SSD.
Preparation steps
- Obtain a PC workstation with a serial communication port.
- For networked installation you need to install a TFTP server on the host PC. For Windows machines we recommend TFTPD32 included in the Linux package for CL-SOM-iMX6 (link below).
- Download the Linux package for CL-SOM-iMX6 from CompuLab website. Unzip the package to a directory on your host workstation.
- All image files mentioned below can be found in the images subdirectory.
- Connect the host PC to the SB-FX6 base-board (connector P60) via the serial cable supplied with the evaluation kit.
- Start the terminal emulation software on your PC. Set baud rate to 115200 bps, 8 bit per frame, 1 stop bit, no parity, no flow control.
- Turn on the CL-SOM-iMX6 evaluation system. The U-Boot boot-loader will start and you will get a command prompt.
If the boot settings of your CL-SOM-iMX6 are different than the default, you may need to press and hold Ctrl-C while turning the CL-SOM-iMX6 on, in order to get command prompt. |
Installation and Deployment Files
Installation media or TFTP export directory
- kernel.img
- imx6qp-sbc-som-imx6-hdmi.dtb
- ramdisk.img
- boot.scr
Installation media or NFS export directory
- rootfs.tar.bz2
- kernel.update.tar.bz2
- murata.update.tar.bz2
- startx.update.tar.bz2 - Optional
- clsysreconf.update.tar.bz2 - Optional
Boot into the installation environment (ramdisk)
The first step in CL-SOM-iMX6 Linux installation is starting the installation environment (Linux kernel and Ramdisk image). This can be done using the following media:
Using installation environment on MMC/SD card
- Copy files listed in Installation and Deployment Files from Linux package for CL-SOM-iMX6 to the root directory on the first partition of the media.
The partition can be formatted as either ext2/3/4 or FAT file system.
- Insert the MMC/SD card into the SD socket (P6) on the SB-FX6.
- Use the following U-boot commands to boot the installation environment on the CL-SOM-iMX6 quad/dual lite configuration:
CL-SOM-iMX6 #
setenv loadaddr 0x10800000 mmc dev 2; mmc rescan load mmc 2 ${loadaddr} boot.scr source ${loadaddr}
- Continue to the Install Kernel and Root Files System Images section.
Using installation environment on USB storage
- Copy files listed in Installation and Deployment Files from Linux package for CL-SOM-iMX6 to the root directory on the first partition of the media.
The partition can be formatted as either ext2/3/4 or FAT file system.
- Insert the USB storage into a USB socket on the SB-FX6.
- Use the following U-boot commands to boot the installation environment on a CL-SOM-iMX6 quad/dual lite configuration:
CL-SOM-iMX6 #
setenv loadaddr 0x10800000 usb start load usb 0 ${loadaddr} boot.scr source ${loadaddr}
- Continue to the Install Kernel and Root Files System Images section.
Using installation environment from TFTP server
- Connect the CL-SOM-iMX6 Ethernet port (connector P9 marked as "CM ETHERNET" on the SB-FX6) to your local network.
- Copy files listed in Installation media or TFTP export directory from Linux package for CL-SOM-iMX6 to a TFTP server export directory:
- - On Windows machine: copy files to the same folder and point the TFTP server to that folder
- - On Linux machine: copy files to the TFTP server root directory, usually /tftpboot or /tftproot.
- You can use U-boot dhcp command to obtain IP address or manually set ipaddr environment variable:
CL-SOM-iMX6 # setenv ipaddr <CL-SOM-iMX6 ip address>
- Set the serverip environment variable and save the new environment:
CL-SOM-iMX6 # setenv serverip <tftp server host ip address> CL-SOM-iMX6 # saveenv
- Set a correct value for the fdt_file variable:
CL-SOM-iMX6 # setenv fdt_file imx6q-sbc-som-imx6.dtb
- Use the following U-Boot commands to boot Linux on CL-SOM-iMX6:
CL-SOM-iMX6 #
setenv fdt_high 0xffffffff setenv fdt_addr 0x15000000 setenv bootm_low 0x15000000 setenv bootm_size 0x20000000 setenv load_addr 0x10800000 setenv ramdisk_addr 0x12000000 setenv bootargs 'root=/dev/ram0 rw ramdisk_size=16384 console=ttymxc3,115200 ip=dhcp' tftpboot ${load_addr} kernel.img && tftpboot ${fdt_addr} ${fdt_file} && tftpboot ${ramdisk_addr} ramdisk.img bootz ${load_addr} ${ramdisk_addr} ${fdt_addr}
- Continue to the Install Kernel and Root Files System Images section.
Install Kernel and Root Files System Images
After the ramdisk image is loaded the bash shell prompt shows up:
root@cl-ramdisk:/#
The next step is installing the kernel and Debian Linux images. The following media can be used as a source for installation:
Mount MMC/SD Card
- Insert the MMC/SD card into the SD socket (P6) on the SB-FX6.
- The MMC/SD card is mounted automatically under /media/mmcblk2pX. Where X is the partition number.
- If for some reason the MMC/SD card hasn't been mounted automatically, use the following mount command:
root@cl-ramdisk:~# mkdir -p /media/mmcblk2pX && mount /dev/mmcblk2pX /media/mmcblk2pX
- Continue to the Install Images section.
Mount USB Storage Device
- Plug the USB storage device to the lower port on the dual USB host connector P13 of the SB-FX6.
- The USB device is mounted automatically under /media/sdXY. Where X is the device letter and Y is the partition number.
- If for some reason the USB storage device hasn't been mounted automatically, use the following mount command:
root@cl-ramdisk:~# mkdir -p /media/sdXY && mount /dev/sdXY /media/sdXY
- Continue to the Install Images section.
Mount NFS drive
All followed instructions will be invoked in the CompuLab ram-disk environment.
The environment prompt is: root@cl-ramdisk:~# |
- Connect the CL-SOM-iMX6 Ethernet port (connector P9 marked as "CM ETHERNET" on the SB-FX6) to your local network.
- Copy files listed in Installation media or NFS export directory from Linux package for CL-SOM-iMX6 to an NFS server export directory.
- Obtain an IP address for the CL-SOM-iMX6:
DHCP | Static |
---|---|
basename /sys/devices/platform/enet.0/net/eth? |
basename /sys/devices/platform/enet.0/net/eth?` <ip address> |
- Mount the NFS share containing the kernel.update.tar.bz2 and the rootfs.tar.bz2 files:
mount -o nolock <host ip>:/path/to/nfs/share /mnt/net
Install Images
Once the ramdisk image is loaded and the media containing the CL-SOM-iMX6 Kernel and Debian Linux images is mounted, the installation can be done on either of the following:
- NAND
- EMMC
Prepare Target Media
NAND | eMMC |
---|---|
ubiformat --yes /dev/mtd4
ubiattach -m 4 -d 0
ubimkvol /dev/ubi0 -m -N rootfs
mkdir -p /media/rootfs && mount -t ubifs ubi0:rootfs /media/rootfs |
echo -e "n\np\n1\n\n+100M\na\n1\nt\nc\nn\np\n2\n\n\nw\neof\n" | fdisk /dev/mmcblk3
mkfs.ext4 -L boot /dev/mmcblk3p1
mkfs.ext4 -L rootfs /dev/mmcblk3p2
mkdir -p /media/rootfs && mount /dev/mmcblk3p2 /media/rootfs mkdir -p /media/rootfs/boot && mount /dev/mmcblk3p1 /media/rootfs/boot |
Extract Rootfs
- Extract the content of rootfs.tar.bz2 onto the /media/rootfs:
tar -xvpjf /mount/point/rootfs.tar.bz2 -C /media/rootfs && sync
- Extract the content of kernel.update.tar.bz2 onto the /media/rootfs:
tar -xvpjf /mount/point/kernel.update.tar.bz2 -C /media/rootfs && sync
- Extract the content of murata.update.tar.bz2 onto the /media/rootfs:
tar -xvpjf /mount/point/murata.update.tar.bz2 -C /media/rootfs && sync
- Extract the content of startx.update.tar.bz2 onto the /media/rootfs:
tar -xvpjf /mount/point/startx.update.tar.bz2 -C /media/rootfs && sync
- Extract the content of clsysreconf.update.tar.bz2 onto the /media/rootfs:
tar -xvpjf /mount/point/clsysreconf.update.tar.bz2 -C /media/rootfs && sync
Commit Installation
NAND | eMMC |
---|---|
See Display Options for more information about fdt_file export fdt_file=imx6qp-sbc-imx6-hdmi.dtb flash_erase /dev/mtd3 0 0 nandwrite -p /dev/mtd3 /media/rootfs/boot/zImage-cl-som-imx6 nandwrite -p /dev/mtd3 -s 0x780000 /media/rootfs/boot/${fdt_file}
umount /media/rootfs |
umount /media/rootfs/boot umount /media/rootfs |
After Installation
If the boot settings of the CL-SOM-iMX6 are different than default, you may need to press and hold Ctrl-C while turning the CL-SOM-iMX6 on, in order to get command prompt. |
Boot Environment
All followed instructions will be invoked in the U-Boot environment.
The environment prompt is: CL-SOM-iMX6 # |
Common Environment Variables
setenv bootdelay 3 setenv loadaddr 0x10800000 setenv fdt_high 0xffffffff setenv fdt_addr 0x15000000 setenv bootm_low 0x15000000 setenv bootm_size 0x20000000 setenv zImage zImage-cl-som-imx6 setenv fdt_file imx6qp-sbc-imx6-hdmi.dtb setenv console console=ttymxc3,115200
Display Options
CL-SOM-iMX6 evaluation platform has six video output interfaces: LCD, DVI, HDMI, 2xLVDS and MIPI.
Only four of them can be configured at the same time. The default configuration is: LCD, HDMI and 2xLVDS.
Default Video Output Mapping
Using a correct device tree file allows changing the default (mxcfb0) mapping.
LCD(P50) | DVI(J6) | HDMI(J5) | MIPI(P19) |
---|---|---|---|
setenv fdt_file imx6qp-sbc-imx6.dtb
LCD 800x480@58 HDMI 1920x1080@50 LVDS(P53) 1366x768 LVDS(P17) 1368x768 |
setenv fdt_file imx6qp-sbc-imx6-dvi.dtb
DVI 1920x1080@50 HDMI 1920x1080@50 LVDS(P53) 1366x768 LVDS(P17) 1368x768 |
setenv fdt_file imx6qp-sbc-imx6-hdmi.dtb
HDMI 1920x1080@50 LCD 800x480@58 LVDS(P53) 1366x768 LVDS(P17) 1368x768 |
setenv fdt_file imx6qp-sbc-imx6-mipi.dtb
MIPI(P19) 480x800@50 HDMI 1920x1080@50 LVDS(P53) 1366x768 LVDS(P17) 1368x768 |
Boot Parameters
NAND | eMCC |
---|---|
setenv set_media 'echo nand is ready' setenv set_args 'setenv bootargs ${console} root=ubi0:rootfs rw rootfstype=ubifs ubi.mtd=rootfs' setenv load_kernel 'nand read ${loadaddr} 0 800000' setenv load_dtb 'nand read ${fdt_addr} 780000 10000' |
setenv set_media 'setenv mmcdev 3; mmc dev ${mmcdev}' setenv set_args 'setenv bootargs ${console} root=/dev/mmcblk3p2 rootfstype=ext4 rw rootwait' setenv load_kernel 'load mmc ${mmcdev} ${loadaddr} ${zimage}' setenv load_dtb 'load mmc ${mmcdev} ${fdt_addr} ${fdt_file}' |
Boot Command
- Extra boot parameters
setenv set_args+ 'setenv bootargs ${bootargs} ${video} vmalloc=256M cma=384M ip=dhcp'
- Default boot command
setenv set_boot 'run set_media; run set_args; run set_args+; run load_kernel; run load_dtb;' setenv bootcmd 'run set_boot; bootz ${loadaddr} - ${fdt_addr}'