Message-ID: <1996767369.4443.1710825913406.JavaMail.root@dns3> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_4442_1385307728.1710825913406" ------=_Part_4442_1385307728.1710825913406 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html SMARC-FiMX6

SMARC-FiMX6

=20 =20

Build and Install= Linux System for SMARC-FiMX6 (Solo, Dual Lite, Dual and Quad Core= )


This document provides instructions for advanced users how Embedian offe= rs patches and builds a customized version of u-boot and linux kernel for E= mbedian's SMARC-FiMX6 product platform and how to install the imag= es to bring the evaluation board up and running. 

Our aim is to fully support our hardw= are through device drivers. We also provide unit tests so that testing a bo= ard is easy and custom development can start precisely.

A= vailability


= SMARC-FiMX6 at Embedian

C= arrier Board


S= BC-SMART-BEE (module and carrier board) at Embedian

SBC-SMART-MEN (module and carrier board) at Embedian<= /p>

EVK-STD-CARRIER (universal carrier board for all SMARC modules) a= t Embedian

Basic Resources


 

ARM Cross Compiler: GCC


This is a pre-built (32bit) version of Linaro GCC that runs on gen= eric linux, so 64bit users need to make sure they have installed the 32bit = libraries for their distribution.

debian based extra pkgs: (sudo apt-get update ; sudo apt-get instal= l xyz)

Ubuntu 12.04

 

ia32-libs

Debian 7 (Wheezy)

sudo dpkg --add-architecture i386

libc6:i386 libstdc++6:i386 libncurses5:i386= zlib1g:i386

Ubuntu 12.10 -> 14.04

 

libc6:i386 libstdc++6:i386 li= bncurses5:i386 zlib1g:i386

Red Hat/Centos/Fedora

 

libstdc++.i686 ncurses-devel.i686 zlib.i686

Red Hat based (rpm)

extra

pkgs: (yum install xyz)

Red Hat/Centos/Fedora

 

libstdc++.i686 ncurses-devel.i686 zlib.i686

Ubuntu 12.04

 

ia32-libs

Ubuntu 12.10 -> 14.04

 

libc6:i386 libstdc++6:i386 li= bncurses5:i386 zlib1g:i386


To build Embedian=E2=80=99s SMARC= -FiMX6 u-boot and linux kernel, you will need to install the following= Linaro arm compiler: 

For u-boot 2018.03&nb= sp;and Linux 4.14.98, you need to use the = following newer Linaro arm compilier.&nb= sp;

=20
=20
=20
$ wget -c http://releases.linaro.org/compo=
nents/toolchain/binaries/6.4-2017.11/arm-linux-gnueabihf/gcc-linaro-6.4.1-2=
017.11-x86_64_arm-linux-gnueabihf.tar.xz
$ sudo tar -C /opt -xJf gcc-linaro-6.4.1-2017.11-x86_64_arm-linux-gnue=
abihf.tar.xz
$ export CC=3D/opt/gcc-linaro-6.4.1-2017.11-x86_64_arm-linux-gnueabihf=
/bin/arm-linux-gnueabihf-
=20
=20
=20


For u-boot 2017= .03Linux 4.9.11 and Linux 4.9.88,&n= bsp;use the following Linaro arm compilier. 

=20
=20
=20
$ wget -c http://releases.linaro.org/components/toolchain/binarie=
s/6.2-2016.11/arm-linux-gnueabihf/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux=
-gnueabihf.tar.xz
$ sudo tar -C /opt -xJf gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnue=
abihf.tar.xz
$ export CC=3D/opt/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf=
/bin/arm-linux-gnueabihf-
=20
=20
=20


For u-boot 2015= .04 and Linux 4.1.15, use the following Li= naro arm compilier. 

=20
=20
=20
$ wget -c http://releases.linaro.org/archive/15.05/components/too=
lchain/binaries/arm-linux-gnueabihf/gcc-linaro-4.9-2015.05-x86_64_arm-linux=
-gnueabihf.tar.xz
$ sudo tar -C /opt -xJf gcc-linaro-4.9-2015.05-x86_64_arm-linux-gnueab=
ihf.tar.xz
$ export CC=3D/opt/gcc-linaro-4.9-2015.05-x86_64_arm-linux-gnueabihf/b=
in/arm-linux-gnueabihf-
=20
=20
=20

&n= bsp;
For <= span style=3D"color: rgb(0,51,102);">u-boot 2014.04, and Linux 3.14, use= the following Linaro arm compilier.

=20
=20
=20
$ wget http://releases.linaro.org/archive/13.04/components/toolch=
ain/binaries/gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux.tar.=
xz
$ sudo tar -C /opt -xJf gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-201=
30415_linux.tar.xz
$ export CC=3D/opt/gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415=
_linux/bin/arm-linux-gnueabihf-
=20
=20
=20

Test:

If this test fails, verify that you have the 32bit libraries ins= talled on your development system.

=20
=20
=20

$ ${CC}gcc --version<= /code>
arm-linux-gnueabihf-gcc (crosstool-NG linaro-1.13.1-4.7-2= 013.04-20130415 - Linaro GCC 2013.04) 4.7.3 20130328 (prerelease)Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO=

warranty; not even for MERCHANTABILITY or FITNESS FOR A = PARTICULAR PURPOSE.

=20
=20
=20

Generating SSH Keys


We recommend you use SSH keys to establish a secure connection between y= our computer and Embedian Gitlab server. The steps below will walk you thro= ugh generating an SSH key and then adding the public key to our Gitlab acco= unt.

Step 1. Check for SSH keys


First, we need to check for existing ssh keys on your computer. Op= en up Git Bash and run:

=20
$ cd ~/.ssh
$ ls
# Lists the files in your .ssh directory
=20

Check the directory listing to see if you have a file named either=  id_rsa.pub or id_dsa.pub. If you = don't have either of those files go to step 2. Otherw= ise, you already have an existing keypair, and you can skip to step 3.

Step 2. Generate a new SSH key


To generate a new SSH key, enter the code below. We want the defau= lt settings so when asked to enter a file in which to save the key, just pr= ess enter.

=20
$ ssh-keygen -t rsa -C "your_email@example.com"
# Creates a new ssh key, using the provided email as a label
# Generating public/private rsa key pair.
# Enter file in which to save the key (/c/Users/you/.ssh/id_rsa): [Press en=
ter]
$ ssh-add id_rsa
=20

Now you need to enter a passphrase.

=20
Enter passphrase (empty for no passphrase): [Type a passphrase]
Enter same passphrase again: [Type passphrase again]
=20

Which should give you something like this:

=20
Your identification has been saved in /c/Users/you/.ssh/id_rsa.
Your public key has been saved in /c/Users/you/.ssh/id_rsa.pub.
The key fingerprint is:
01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@example.com=20

Step 3. Add your SSH key to Embedian Gitlab Ser= ver


Copy the key to your clipboard.

=20
$ cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAABDAQABAAABAQDQUEnh8uGpfxaZVU6+uE4bsDrs/tEE5/BPW7j=
MAxak
6qgOh6nUrQGBWS+VxMM2un3KzwvLRJSj8G4TnTK2CSmlBvR+X8ZeXNTyAdaDxULs/StVhH+QRtF=
EGy4o
iMIzvIlTyORY89jzhIsgZzwr01nqoSeWWASd+59JWtFjVy0nwVNVtbek7NfuIGGAPaijO5Wnshr=
2uChB
Pk8ScGjQ3z4VqNXP6CWhCXTqIk7EQl7yX2GKd6FgEFrzae+5Jf63Xm8g6abbE3ytCrMT/jYy5OO=
j2XSg
6jlxSFnKcONAcfMTWkTXeG/OgeGeG5kZdtqryRtOlGmOeuQe1dd3I+Zz3JyT your_email@exa=
mple.c
om
=20

Go to Embedian Git Server. At Profile Setting --> SSH Keys --> Add SSH Key =

Paste your public key and press "Add Key" and your are done.

Bootloader: U-Boot 


Clone the U-Boot source code from Embedian Git Server.

Download:

For u-boot v2018.03: 

=20
=20
=20
$ git clone git@git.embedian.com:developer/smarc-t335x-uboot.git smarc=
fimx6-uboot
$ cd smarcfimx6-uboot
$ git checkout smarc-imx6_v2018.03_4.14.98_2.0.0_ga
=20
=20
=20


For u-boot v2017.= 03: 

=20
=20
=20
$ git clone git@git.embedian.com:developer/smarc-t335x-uboot.git smarc=
fimx6-uboot
$ cd smarcfimx6-uboot
$ git checkout smarc-imx_v2017.03_4.9.11_1.0.0_ga
=20
=20
=20


For u-boot v2015.04:
 

=20
=20
=20
$ git clone git@git.embedian.com:developer/smarc-t335x-uboot.git smarc=
fimx6-uboot
$ cd smarcfimx6-uboot
$ git checkout smarc-imx_v2015.04_4.1.15_1.0.0_ga
=20
=20
=20

Configure and Build:

=20
=20
=20
$ make ARCH=3Darm CROSS_COMPILE=3D${CC} distclean
$ make ARCH=3Darm CROSS_COMPILE=3D${CC} smarcfimx6_quad_1g_ser3_defcon=
fig
$ make ARCH=3Darm CROSS_COMPILE=3D${CC}
=20
=20
=20
= =20

Note

=20
=20

Note1:=

If the board is SMARC-FiMX6-Q-2G or SMARC-FiMX6-D-2G, use
$ make ARCH=3Darm CROSS_COMPILE=3D${CC} = smarcfimx6_quad_2g_ser3_defconfig

 If the board is SMARC= -FiMX6-Q-1G or SMARC-FiMX6-D-1G, use
$ make ARCH=3Darm CROSS_COMPILE=3D${CC} smarcfimx6_quad_1g_ser3_= defconfig

 If the board is= SMARC-FiMX6-U-1G, use
$ make ARCH=3Darm CROSS_COMPILE=3D${CC} smarcfimx6_dl_1g_ser3_defconfig=

 If the board is= SMARC-FiMX6-S, use
$ make ARCH=3Darm CROSS_COMPILE=3D${CC} smarcfimx6_solo_ser3_defconfig

If the board is SMARC-FiMX6-= S-1G, use
$ make AR= CH=3Darm CROSS_COMPILE=3D${CC} smarcfimx6_solo_1g_ser3_defconfig

 If the board is SMARC= -FiMX6-QP-1G, use
$ make A= RCH=3Darm CROSS_COMPILE=3D${CC} smarcfimx6_quadplus_1g_ser3_defconfig

 If the board is SMARC= -FiMX6-QP-2G, use
$ make A= RCH=3Darm CROSS_COMPILE=3D${CC} smarcfimx6_quadplus_2g_ser3_defconfig

Note 2:

"ser3" stands for console debug port. In this example= , we uses SER3 as debug port. If user uses SER0 as your debug port, make ch= ange to "ser0" instead. Same as SER1 and SER2.

Note 3:

The SMARC-FiMX6 module always boot= up from the on-module SPI NOR flash. The f= actory default will be u-boot.imx pre-insta= lled with SER3 as console output. In some cases when the SP= I NOR flash is empty or needs to be upgraded. Users can shu= nt crossed the TEST# to ground. In this way= , the SMARC-FiMX6 module will boot up to ca= rrier SD card, if TEST# pin is shunt crosse= d. The u-boot.imx image are the same, the d= ifference is how you flash u-boot.imx. This will= be explained in the "Setup SD card" section.

=20
=20
=20


For u-boot v2014.= 04:
 <= /p>=20

=20
=20
$ git clone git@git.embedian.com:developer/smarc-t335x-uboot.git smarc=
fimx6-uboot
$ cd smarcfimx6-uboot
$ git checkout smarc-imx_v2014.04_3.14.28_1.0.0_ga
=20
=20
=20

Configure and Build:

=20
=20
=20
$ make ARCH=3Darm CROSS_COMPILE=3D${CC} distclean
$ make ARCH=3Darm CROSS_COMPILE=3D${CC} smarcfimx6_quad_1g_ser3_config=
$ make ARCH=3Darm CROSS_COMPILE=3D${CC}
=20
=20
=20
= =20

Note

=20
=20

Note1:=

If the board is SMARC-FiMX6-Q-2G or SMARC-FiMX6-D-2G, use
$ make ARCH=3Darm CROSS_COMPILE=3D${CC} = smarcfimx6_quad_2g_ser3_config

 If the board is SMARC= -FiMX6-Q-1G or SMARC-FiMX6-D-1G, use
$ make ARCH=3Darm CROSS_COMPILE=3D${CC} smarcfimx6_quad_1g_ser3_= config

 If the board is SMARC= -FiMX6-U-1G, use
$ make AR= CH=3Darm CROSS_COMPILE=3D${CC} smarcfimx6_dl_1g_ser3_config

 If the board is SMARC= -FiMX6-S, use
$ make ARCH= =3Darm CROSS_COMPILE=3D${CC} smarcfimx6_solo_ser3_config

Note 2:

"ser3" stands for console debug port. In this example= , we uses SER3 as debug port. If user uses SER0 as your debug port, make ch= ange to "ser0" instead. Same as SER1 and SER2.

Note 3:

The SMARC-FiMX6 module always boot= up from the on-module SPI NOR flash. The f= actory default will be u-boot.imx pre-insta= lled with SER3 as console output. In some cases when the SP= I NOR flash is empty or needs to be upgraded. Users can shu= nt crossed the TEST# to ground. In this way= , the SMARC-FiMX6 module will boot up to ca= rrier SD card, if TEST# pin is shunt crosse= d. The u-boot.imx image are the same, the d= ifference is how you flash u-boot.imx. This will= be explained in the "Setup SD card" section.

=20
=20
=20

Li= nux Kernel


Download:

For 4.14.98 (Based on F= reescale imx_4.14.98_2.0.0_ga official release):

 

=20
=20
=20
$ git clone git@git.embedian.com:developer/smarc-fsl-linux-kernel.git<=
/pre>
$ cd smarc-fsl-linux-kernel
$ git checkout smarc-imx6_4.14.98_2.0.0_ga
=20
=20
=20


For 4.9.88 (Based on Fr= eescale imx_4.9.88_2.0.0_ga official release):

=20
=20
=20
$ git clone git@git.embedian.com:developer/smarc-fsl-linux-kernel.git<=
/pre>
$ cd smarc-fsl-linux-kernel
$ git checkout smarc-imx6_4.9.88_2.0.0_ga
=20
=20
=20


For 4.9.11 (Based= on Freescale imx_4.9.11_1.0.0_ga official release):

=20
=20
=20
$ git clone git@git.embedian.com:developer/smarc-fsl-linux-kernel.git<=
/pre>
$ cd smarc-fsl-linux-kernel
$ git checkout smarc-imx_4.9.11_1.0.0_ga
=20
=20
=20


For 4.1.15 (Based on Fr= eescale imx_4.1.15_1.0.0_ga official release):

=20
=20
=20
$ git clone git@git.embedian.com:developer/smarc-fsl-linux-kernel.git<=
/pre>
$ cd smarc-fsl-linux-kernel
$ git checkout smarc-imx_4.1.15_1.0.0_ga
=20
=20
=20

Configure and Build:

=20
=20
=20
$ make ARCH=3Darm CROSS_COMPILE=3D${CC} distclean
$ make ARCH=3Darm CROSS_COMPILE=3D${CC} smarcfimx6_defconfig
$ make ARCH=3Darm CROSS_COMPILE=3D${CC} zImage modules imx6q-smarcfimx=
6.dtb imx6dl-smarcfimx6.dtb imx6qp-smarcfimx6.dtb
=20
=20
=20


For 3.14.28 (Based on Freescale imx_3.14.28_1.0.0_ga of= ficial release):

=20
=20
=20
$ git clone git@git.embedian.com:developer/smarc-fsl-linux-kernel.git<=
/pre>
$ cd smarc-fsl-linux-kernel
$ git checkout smarc-imx_3.14.28_1.0.0_ga
=20
=20
=20

Configure and Build:

=20
=20
=20
$ make ARCH=3Darm CROSS_COMPILE=3D${CC} distclean
$ make ARCH=3Darm CROSS_COMPILE=3D${CC} smarcfimx6_defconfig
$ make ARCH=3Darm CROSS_COMPILE=3D${CC} zImage modules imx6q-smarcfimx=
6.dtb imx6dl-smarcfimx6.dtb
=20
=20
=20
= =20
=20

Note1:=

If the board is QuadPlus core, the device tree blob is imx6qp-smar= cfimx6.dtb.

If the board is Dual or Quad core, the device tree blob is imx6q-smarcfi= mx6.dtb.

If the board is Dual Lite or Solo core, the device tree blob is imx6dl-s= marcfimx6.dtb

If you are using LVDS panel, rep= lace the corresponding device tree file by the following.

For WVGA (800x480) LVD= S panel:
imx6qp-smarcfimx6.dtb --> imx6qp-smar= cfimx6-wvga.dtb
imx6q-smarcfimx6.dtb --> imx6q-smarcfimx6-wvga.dtb<= br />imx6dl-smarcfimx6.dtb --> imx6dl-smarcfimx6-wvga.dtb

For XGA (1024x768) LVD= S panel:
imx6qp-smarcfimx6.dtb -->= imx6qp-smarcfimx6-xga.dtb
imx6q-smarcfimx6.dtb --&= gt; imx6q-smarcfimx6-xga.dtb
imx6dl-smarcfimx6.dtb --> imx= 6dl-smarcfimx6-xga.dtb 

For WXGA (1366x768) LV= DS panel:
imx6qp-smarcfimx6.dtb -->= ; imx6qp-smarcfimx6-wxga.dtb
imx6q-smarcfimx6.dtb --> imx= 6q-smarcfimx6-wxga.dtb

imx6dl-smarcfimx6.dtb --> imx6dl-sm= arcfimx6-wxga.dtb

For 1080p (1920x1080) = LVDS panel:
imx6qp-smarcfimx6.dtb --&= gt; imx6qp-smarcfimx6-1080p.dtb
imx6q-smarcfimx6.dtb --> = imx6q-smarcfimx6-1080p.dtb

imx6dl-smarcfimx6.dtb --> imx6d= l-smarcfimx6-1080p.dtb

=20
=20
=20

Root File System


Ubuntu 16.04:<= /span>

User Password
root root
ubuntu temppwd

Ubuntu 16.04 Download:

=20
=20
=20
$ wget -c ftp://ftp.embedian.com/public/dev/minfs/ubuntu/xenial/imx6-u=
buntu-16.04.2-armhf-2017-03-02.tar.gz
=20
=20
=20

Verify:

=20
=20
=20
$ md5sum imx6-ubuntu-16.04.2-armhf-2017-03-02.tar.gz
0a3b5cf7b2f6c65856e07f21c17f3129  imx6-ubuntu-16.04.2-armhf-2017-=
03-02.tar.gz
=20
=20
=20


Debian 8.7:

User Password
root root
debian temppwd

Debian 8 Download:

=20
=20
=20
$ wget -c ftp://ftp.embedian.com/public/dev/minfs/debian/jessie/imx6-d=
ebian-8.7-armhf-2017-03-02.tar.gz
=20
=20
=20

Verify:

=20
=20
=20
$ md5sum imx6-debian-8.7-armhf-2017-03-02.tar.gz
beb77ef08400cb9f1780e8a80f47add6  imx6-debian-8.7-armhf-2017-03-02.tar=
.gz
=20
=20
=20


Ubuntu 14.04:

User Password
root root
ubuntu temppwd

Ubuntu 14.04 Download:

=20
=20
=20

$ wget -c ftp://ftp.embedian= .com/public/dev/minfs/ubuntu/trusty/imx6-ubuntu-14.04.tar.gz<= /p>=20

=20
=20

Verify:

=20
=20
=20

$ md5sum imx6-ubuntu-14.04.t= ar.gz
f1420197b9581468f586ae3a4181b125  imx6-ubuntu= -14.04.tar.gz

=20
=20
=20

 

Yocto Build Root File S= ystem:

User Password
root N/A

Find the yocto pre-built root file systems here at Em= bedian's ftp site based on your module CPU variants.

Se= tup SD Card


For these instruction, we are assuming: DISK=3D/dev/mmcblk0, "= ;lsblk" is very useful for determining the device id.

=20
=20
=20

$ export DISK=3D/dev/mmcblk0=

=20
=20
=20

Erase SD card:

=20
=20
=20

$ sudo = dd if=3D/dev/zero of=3D${DISK} bs=3D1M count=3D16

=20
=20
=20

Create Partition Layout:

With util-linux v2.26, sfdisk was rewritten and is now based on = libfdisk.

=20
=20

sfdisk

=20
=20
$ sudo sfd= isk --version
sfdisk from util-linux 2.27.1
=20
=20
=20

Create Partitions:

=20
=20

sfdisk >=3D2.26.x

=20 Icon=20
=20
$ sudo sfd= isk ${DISK} <<-__EOF__
1M<= code class=3D"java plain">,48M,0x83,*
,,,-
__EOF__
=20
=20
=20
=20

sfdisk <=3D2.25

=20 Icon=20
=20
$ sudo sfd= isk --in-order --Linux --unit M ${DISK} <<-__EOF__
1,48,0x83,*
,,,-
__EOF__
=20
=20
=20

Format Partitions:

=20
=20
=20
for: DISK=3D/dev/mmcblk0
$ sudo mkf= s.vfat -F 16 ${DISK}p1 -n boot
$ sudo mkf= s.ext4 ${DISK}p2 -L rootfs
 
for: DISK=3D/dev/sdX
$ sudo mkf= s.vfat -F 16 ${DISK}1 -n boot
$ sudo mkf= s.ext4 ${DISK}2 -L rootfs
=20
=20
=20

Mount Partitions:

On some systems, these partitions may be auto-mounted...

=20
=20
=20
$ sudo mkd= ir -p /media/boot/
$ sudo mkd= ir -p /media/rootfs/
 
for: DISK=3D/dev/mmcblk0
$ sudo mou= nt ${DISK}p1 /media/boot/
$ sudo mou= nt ${DISK}p2 /media/rootfs/
 
for: DISK=3D/dev/sdX
$ sudo mou= nt ${DISK}1 /media/boot/
$ sudo mou= nt ${DISK}2 /media/rootfs/
=20
=20
=20

Install Bootloader

If SPI NOR Flash is not empty

The u-boot.imx is pre-installed = in SPI NOR flash at factory default. SMARC-FiMX6 is designed to always boot= up from SPI NOR flash and to load zImage, device tree blob and root file s= ystems based on the setting of BOOT_SEL. If users need to fuse the= ir own u-boot or perform u-boot upgrade. This section will instruct you how= to do that.

Copy u-boot.imx to the boot partition.&nb= sp;(Note: Rename u-boot-dtb.img = to u-boot.img if your u-boot is v2017.03)

=20
=20

~/smarcfimx6-uboot

=20
=20

$ sudo cp = -v u-boot.imx /media/boot/u-boot.imx
=20
=20
=20

Fuse u-boot.imx to the SPI NOR flash.

Stop at U-Boot command prompt (Press any = key when booting up). Copy and Paste the following script under u-boot comm= and prompt.

=20
=20

u-boot command prompt

=20
=20

U-Boot# mmc rescan; mmc dev; load m=
mc 0:1 0x10800000 u-boot.imx; sf probe; sleep 2; sf erase 0 0xc0000; sf write 0x10800000 0x400 a0000=20
=20
=20

If SPI NOR Flash is empty

In some cases, when SPI NOR flash is eras= ed or the u-boot is under development, we need a way to boot from SD card f= irst. Users need to shunt cross the TEST# pin to ground. In this way,= SMARC-FiMX6 will always boot up from SD card. 

Copy u-boot.imx to the boot partition.&nb= sp;(Note: Rename u-boot-dtb.img = to u-boot.img if your u-boot is v2017.03)

=20
=20

~/smarcfimx6-uboot

=20
=20

$ sudo dd if=3Du-boot.imx of=3D${DISK} bs= =3D512 seek=3D2 
=20
=20
=20
=20 Icon=20
=20
  1. If your u-boot hasn't been finalized= and still under development, it is recommended to shunt cross the test pin= and boot directly from SD card first. Once your u-boot is fully tested and= finalized, you can fuse your u-boot to SPI NOR flash.<= /li>
  2. When TEST# pin of SMARC-FiMX6= is not shunt crossed, it will always boot up from SPI NOR flash. U-boot wi= ll read the BOOT_SEL configuration and determine where it should l= oad zImage and device tree blob. When TEST# is shunt crossed (pull low), it= will always boot up from SD card.
=20
=20
=20

uEnv.txt based bootscript

Create "uEnv.txt" boot script: ($ vim uEnv.txt)

=20
=20

~/uEnv.txt

=20
=20

#####HDMI######
#optargs=3D"video=3Dmxcfb0:dev=3Dhdmi,1280x720= M@60,if=3DRGB24,bpp=3D32 consoleblank=3D0"
#####LVDS#####
#o= ptargs=3D"video=3Dmxcfb0:dev=3Dldb,if=3DRGB24,bpp=3D32 consoleblank=3D= 0 fbmem=3D24M vmalloc=3D400M"
#####Parallel LCD Setting#####
#optargs=3D"video=3Dmxcfb0:dev=3Dlcd,CLAA-WVGA,if=3DRGB24,bpp=3D32 co= nsoleblank=3D0 fbmem=3D24M vmalloc=3D400M"
#####Parallel LCD to C= H7055A (VESA Timing Format) Setting #####
#optargs=3D"video=3Dmxc= fb0:dev=3Dlcd,768x576M@75,if=3DRGB24,bpp=3D32 consoleblank=3D0"
#= optargs=3D"video=3Dmxcfb0:dev=3Dlcd,1280x1024M@60,if=3DRGB24,bpp=3D32 = consoleblank=3D0"
#optargs=3D"video=3Dmxcfb0:dev=3Dlcd,640x4= 80M@60,if=3DRGB24,bpp=3D32 consoleblank=3D0"

console=3Dttymxc4,115200
mmcdev=3D0
mmcpart=3D1
image= =3DzImage
loadaddr=3D0x12000000
fdt_addr=3D0x18000000
mmcroo= t=3D/dev/mmcblk1p2 ro
mmcrootfstype=3Dext4 rootwait fixrtc
netdev= =3Deth0
ethact=3DFEC0
ipaddr=3D192.168.1.150
serverip=3D192.= 168.1.53
gatewayip=3D192.168.1.254
mmcargs=3Dsetenv bootargs cons= ole=3D${console} root=3D${mmcroot} rootfstype=3D${mmcrootfstype} ${optargs}=
uenvcmd=3Drun loadzimage; run loadfdt; run mmcboot
=20
=20
=20

Copy uEnv.txt to the boot partition:

=20
=20

~/

=20
=20

$ sudo cp -v ~/uEnv.txt /med= ia/boot/

=20
=20
=20

Install Kernel zImage

Copy zImage to the boot partition:

=20
=20

~/smarc-fsl-linux-kernel

=20
=20

$ sudo cp -v arch/arm/boot/z= Image /media/boot

=20
=20
=20

Install Kernel Device Tree Binary

=20
=20
=20

$ sudo mkdir -p /media/boot/= dtbs

$ sudo cp -v arch/arm/boot/d= ts/imx6q-smarcfimx6.dtb arch/arm/boot= /dts/imx6dl-smarcfimx6.dtb /media/boot/dtbs

=20
=20
=20
=20

Note

=20 Icon=20
=20
  1. If you are using LVDS panel, copy the corresponding device tree blob in= to SD card as follows.


For WVGA (800x48= 0) LVDS panel:
$ sudo cp -v arch/arm/boot/dts/imx6qp-smarcfimx6-wvga.dtb /media/= boot/dtbs/imx6qp-= smarcfimx6.dtb
$ sudo cp = -v arch/arm/boot/dts/imx6q-smarcfimx6-wvga.dtb /media/boot/dtbs/imx6q-smarcfimx6.dtb
$ sudo cp -v arch/arm/boot/dts/imx6dl-smarcfi= mx6-wvga.dtb /media/boot/dtbs/= imx6dl-smarcfimx6.dtb 

For XGA (1024x768) LVD= S panel:
$ sudo cp -v arch/arm/boot/dts/imx6qp-smarcfimx6-xga.dtb /media/boot/dt= bs/imx6qp-smarcfimx6.dtb
=
$ sudo cp -v arch/arm/boot/dts= /imx6q-smarcfimx6-xga.dtb /media/boot/dtbs/imx6q-smarcfimx6.dtb
$ sudo cp -v arch/arm/boot/dts/imx6dl-smarcfimx6-xga.dtb /media/bo= ot/dtbs/imx6dl-smarcfimx6.dtb<= /span> 

For WXGA (1366x768) LV= DS panel:
$ sudo cp -v arch/arm/boot/dts/imx6qp-smarcfimx6-wxga.dtb /media/boot/= dtbs/imx6qp-smarcfimx6.dtb
$ sudo cp -v arch/arm/boot/d= ts/imx6q-smarcfimx6-wxga.dtb /media/boot/dtbs/imx6q-smarcfimx6.dtb
$ sudo cp -v arch/arm/boot/dts/imx6dl-smarcfimx6-wxga.dtb /medi= a/boot/dtbs/imx6dl-smarcfimx6.= dtb 

For 1080p (1920x1080) = LVDS panel:
$ sudo cp -v arch/arm/boot/dts/imx6qp-smarcfimx6-1080p.dtb /media/bo= ot/dtbs/imx6qp-smarcfimx6.dtb<= br />$ sudo cp -v arch/arm/boo= t/dts/imx6q-smarcfimx6-1080p.dtb /media/boot/dtbs/imx6q-smarcfimx6.dtb
$ sudo cp -v arch/arm/boot/dts/imx6dl-smarcfimx6-1080p.dtb = /media/boot/dtbs/imx6dl-smarcf= imx6.dtb 

=20
=20
=20

Install Root File System and Kernel Modules


Copy Root File System:

Yocto Pre-Built Rootfs:=

=20
=20

directory where your root file system is

=20
=20

$ sudo tar xvfz <filename= .tar.gz> -C /media/rootfs

=20
=20
=20

Ubuntu 14.04:<= /span>

=20
=20

directory where your root file system is

=20
=20

$ sudo tar xvfz imx6= -ubuntu1404.tar.gz -C /media/rootfs

=20
=20
=20

Copy Kernel Modules:

=20
=20

~/smarc-fsl-linux-kernel

=20
=20

$ sudo make ARCH=3Darm INSTA= LL_MOD_PATH=3D/media/rootfs modules_install

=20
=20
=20
=20

Note

=20 Icon=20
=20
  1. After compiled u-boot, it will generated u-boot.imx (u-boot-dtb.imx if = using u-boot v2017.03) and u-boot.bin. The only difference is IVT header th= at will tell i.MX6 internal ROM where to load u-boot. If the firmware in SP= I flash need to be update or empty. Users could pull the TEST# pin= on carrier board to low. In this way, SMARC-= FiMX6 will boot up to SD card first. The u-boot we need to use now wil= l be u-boot.imx. The command to copy u-boot.imx to SD card now is:=
    $ sudo dd if=3Du-boot.imx = of=3D${DISK} bs=3D512 seek=3D2 
    In this case, user wi= ll only need to copy uEnv.txt, zImage and device tree= blob to partition one of your boot device.  
  2. MAC address is factory pre-installed at on board I2C EEPROM at offset 6= 0 bytes. It starts with Embedian's vendor code 10:0D:32. u-boot wi= ll read it and pass this parameter to kernel.
  3. If your rootfs is yocto built, the kernel modules will be included in t= he rootfs.
=20
=20
=20

Networking:

Edit: /etc/network/interfaces

=20
=20
=20

$ sudo vim /media/rootfs/etc/network/interfaces

=20
=20
=20

Add:

=20
=20

/media/rootfs/etc/network/interfaces

=20
=20

auto lo
iface lo inet loopback
 
auto eth0
iface eth0 inet dhcp
=20
=20
=20


Remove SD card:

=20
=20
=20
$ sync
$ sudo umo= unt /media/boot
$ sudo umo= unt /media/rootfs
=20
=20
=20

Setu= p eMMC


Setting up eMMC usually is the last step at development stage after the = development work is done at your SD card or NFS environments. From software= point of view, eMMC is nothing but a non-removable SD card on board. For&n= bsp;SMARC-FiMX6, the SD card is always emulated as /dev/mmcblk1 an= d on-module eMMC is always emulated as /dev/mmcblk3. Setting up eMMC now is= nothing but changing the device descriptor. 

This section gives a step-by-step procedure to setup eMMC flash. Users c= an write a shell script your own at production to simplify the steps.

First, we need to backup the final firmware from your SD card or NFS.

Prepare for eMMC binaries from SD card (or NFS):=

Insert SD card into your Linux PC. For these instructions, we are assumi= ng: DISK=3D/dev/mmcblk0, "lsblk" is very useful for determining t= he device id.

For these instruction, we are assuming: DISK=3D/dev/mmcblk0, "lsblk= " is very useful for determining the device id.

=20
=20
=20

$ export DISK=3D/dev/mmcblk0=

=20
=20
=20

Mount Partitions:

On some systems, these partitions may be auto-mounted...

=20
=20
=20
$ sudo mkd= ir -p /media/boot/
$ sudo mkd= ir -p /media/rootfs/
 
for: DISK=3D/dev/mmcblk0
$ sudo mou= nt ${DISK}p1 /media/boot/
$ sudo mou= nt ${DISK}p2 /media/rootfs/
 
for: DISK=3D/dev/sdX
$ sudo mou= nt ${DISK}1 /media/boot/
$ sudo mou= nt ${DISK}2 /media/rootfs/
=20
=20
=20

 

Copy zImage to rootfs p= artition:

=20
=20
=20

$ sudo cp -v /media/boot/zIm= age /media/rootfs/home/root

=20
=20
=20
=20

Note

=20 Icon=20
=20
  1. If your rootfs is Ubuntu 14.04, copy to /media/rootfs/home/ubuntu instead of /media/rootfs/h= ome/root
=20
=20
=20


Copy uEnv.txt to = rootfs partition:

Copy and paste the following contents to /media/rootfs/home/root ($ sudo= vim /media/rootfs/home/root/uEnv.txt)

=20
=20
=20

#####HDMI######
#optargs=3D"video=3Dmxcfb0:dev=3Dhdmi,1280x720= M@60,if=3DRGB24,bpp=3D32 consoleblank=3D0"
#####LVDS#####
#o= ptargs=3D"video=3Dmxcfb0:dev=3Dldb,if=3DRGB24,bpp=3D32 consoleblank=3D= 0 fbmem=3D24M vmalloc=3D400M"
#####Parallel LCD Setting#####
#optargs=3D"video=3Dmxcfb0:dev=3Dlcd,CLAA-WVGA,if=3DRGB24,bpp=3D32 co= nsoleblank=3D0 fbmem=3D24M vmalloc=3D400M"
#####Parallel LCD to C= H7055A (VESA Timing Format) Setting #####
#optargs=3D"video=3Dmxc= fb0:dev=3Dlcd,768x576M@75,if=3DRGB24,bpp=3D32 consoleblank=3D0"
#= optargs=3D"video=3Dmxcfb0:dev=3Dlcd,1280x1024M@60,if=3DRGB24,bpp=3D32 = consoleblank=3D0"
#optargs=3D"video=3Dmxcfb0:dev=3Dlcd,640x4= 80M@60,if=3DRGB24,bpp=3D32 consoleblank=3D0"

console=3Dttymxc4,115200
mmcdev=3D2
mmcpart=3D1
image= =3DzImage
loadaddr=3D0x12000000
fdt_addr=3D0x18000000
mmcroo= t=3D/dev/mmcblk3p2 ro
mmcrootfstype=3Dext4 rootwait fixrtc
netdev= =3Deth0
ethact=3DFEC0
ipaddr=3D192.168.1.150
serverip=3D192.= 168.1.53
gatewayip=3D192.168.1.254
mmcargs=3Dsetenv bootargs cons= ole=3D${console} root=3D${mmcroot} rootfstype=3D${mmcrootfstype} ${optargs}=
uenvcmd=3Drun loadzimage; run loadfdt; run mmcboot
=20
=20
=20

Copy device tree blob t= o rootfs partition:

=20
=20
=20
$ sudo cp -v /media/boot/dtbs/imx6qp-smarcfimx6.dtb /media/rootfs/home=
/root/imx6qp-smarcfimx6.dtb
$ sudo cp -v /media/boot/dtbs/imx6q-smarcf= imx6.dtb /media/rootfs/home/root/imx6q-smarcfimx6.dtb
$ sudo cp -v /me= dia/boot/dtbs/imx6dl-smarcfimx6.dtb /media/rootfs/home/root/imx6dl-smarcfim= x6.dtb 
=20
=20
=20


<= /u>

=20
=20

Note

=20 Icon=20
=20
  1. If you are using LVDS panel, copy the corresponding device tree blob in= to eMMC as follows.

For WVGA (800x480) LVD= S panel:
$ sudo cp -v arch/arm/boot/dts/imx6qp-smarcfimx6-wvga.dtb /media/boot/d= tbs/imx6qp-smarcfimx6.dtb
$ sudo cp -v arch/arm/boot/dt= s/imx6q-smarcfimx6-wvga.dtb /media/boot/dtbs/imx6q-smarcfimx6.dtb
$ sudo cp -v arch/arm/boot/dts/imx6dl-smarcfimx6-wvga.dtb /media= /boot/dtbs/imx6dl-smarcfimx6.d= tb 

For XGA (1024x768) LVD= S panel:
$ sudo cp -v arch/arm/boot/dts/imx6qp-smarcfimx6-xga.dtb /media/boot/dt= bs/imx6qp-smarcfimx6.dtb
=
$ sudo cp -v arch/arm/boot/dts= /imx6q-smarcfimx6-xga.dtb /media/boot/dtbs/imx6q-smarcfimx6.dtb
$ sudo cp -v arch/arm/boot/dts/imx6dl-smarcfimx6-xga.dtb /media/bo= ot/dtbs/imx6dl-smarcfimx6.dtb<= /span> 

For WXGA (1366x768) LV= DS panel:
$ sudo cp -v arch/arm/boot/dts/imx6qp-smarcfimx6-wxga.dtb /media/boot/= dtbs/imx6qp-smarcfimx6.dtb
$ sudo cp -v arch/arm/boot/d= ts/imx6q-smarcfimx6-wxga.dtb /media/boot/dtbs/imx6q-smarcfimx6.dtb
$ sudo cp -v arch/arm/boot/dts/imx6dl-smarcfimx6-wxga.dtb /medi= a/boot/dtbs/imx6dl-smarcfimx6.= dtb 

For 1080p (1920x1080) = LVDS panel:
$ sudo cp -v arch/arm/boot/dts/imx6qp-smarcfimx6-1080p.dtb /media/bo= ot/dtbs/imx6qp-smarcfimx6.dtb<= br />$ sudo cp -v arch/arm/boo= t/dts/imx6q-smarcfimx6-1080p.dtb /media/boot/dtbs/imx6q-smarcfimx6.dtb
$ sudo cp -v arch/arm/boot/dts/imx6dl-smarcfimx6-1080p.dtb = /media/boot/dtbs/imx6dl-smarcf= imx6.dtb 

=20
=20
=20

 

Copy real rootfs to rootfs partition:

<= strong>Yocto Built Root File Systems

=20
=20
=20

$ pushd /media/rootfs=

$ sudo tar cvfz ~/smarcfimx6= -emmc-rootfs.tar.gz .

$ sudo mv ~/smarcfimx6-emmc-= rootfs.tar.gz /media/rootfs/home/root

$ popd

=20
=20
=20

<= strong>Ubuntu 14.04 Root File Systems

=20
=20
=20

$ sudo vim /media/rootfs/etc= /udev/rules.d/70-persistent-net.rules

Delete all contents starting with = "SUBSYSTEM=3D=3D"

$ pushd /media/rootfs

$ sudo tar cvfz ~/smarcfimx6= -emmc-rootfs.tar.gz .

$ sudo mv ~/smarcfimx6-emmc-= rootfs.tar.gz /media/rootfs/home/root

$ popd

=20
=20
=20

Remove SD card:

=20
=20
=20
$ sync
$ sudo umo= unt /media/boot
$ sudo umo= unt /media/rootfs
=20
=20
=20

Copy Binaries to eMMC from SD card:

Insert this SD card into your SMARC-FiMX6 device and boot into SD card.<= /p>

Now it will be almost the same as you did when setup your SD card, but t= he eMMC device descriptor is /dev/mmcblk3 now.

=20
=20
=20

$ export DISK=3D/dev/mmcblk3

=20
=20
=20

Erase SD card:

=20
=20
=20

$ sudo = dd if=3D/dev/zero of=3D${DISK} bs=3D1M count=3D16

=20
=20
=20

Create Partition Layout:

=20
=20
=20

$ sudo = sfdisk ${DISK} <<-__EOF__

1M<= code class=3D"java plain">,48M,0x83,*
,,,-
__EOF__
=20
=20
=20

Format Partitions:

=20
=20
=20
$ sudo mkfs.vfat -F  16   ${DISK}p1 -n boot
$ sudo mkf= s.ext4 ${DISK}p2 -L rootfs
=20
=20
=20

Mount Partitions:

=20
=20
=20
$ sudo mkd= ir -p /media/boot/
$ sudo mkd= ir -p /media/rootfs/
$ sudo mou= nt ${DISK}p1 /media/boot/
$ sudo mou= nt ${DISK}p2 /media/rootfs/
=20
=20
=20

Install binaries for partition 1

Copy uEnv.txt/zImage/*.dtb to the boot partition

=20
=20
=20

$ sudo cp = -v zImage uEnv.txt /media/boot/
=20
=20
=20

Install Kernel Device Tree Binary

=20
=20
=20

$ sudo mkdir -p /media/boot/= dtbs

$ sudo cp imx6qp-smarcfimx6.= dtb imx6q-smarcfimx6.dtb imx6dl-smarcfimx6.dtb /media/boot/dtbs

=20
=20
=20

Install Root File System


=20
=20
=20

$ sudo tar -zxvf smarcfimx6-= emmc-rootfs.tar.gz -C /media/rootfs

=20
=20
=20

 

Unmount eMMC:

=20
=20
=20
$ sync
$ sudo umo= unt /media/boot
$ sudo umo= unt /media/rootfs
=20
=20
=20

 

Switch your Boot Select to eMMC and you will be able to boot up from eMM= C now.


version 1.0a, 3/23/2015

Last updated 2019-11-16

------=_Part_4442_1385307728.1710825913406--