Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...


To build Embedian’s 
SMARC-FiMX7 u-boot and linux kernel, you will need to install the following Linaro arm compiler first: 

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

Info
iconfalse
$ wget -c http://releases.linaro.org/components/toolchain/binaries/6.4-2017.

...

11/arm-linux-gnueabihf/gcc-linaro-6.4.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz
$ sudo tar -C /opt -xJf gcc-linaro-6.4.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz
$ export CC=/opt/gcc-linaro-6.4.1-2017.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-


For u-boot 2017.03, Linux 4.9.11 and Linux 4.9.88, you need to use the following newer Linaro arm compilier. 

Info
iconfalse
$ wget -c httpshttp://releases.linaro.org/components/toolchain/binaries/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-gnueabihf.tar.xz
$ export CC=/opt/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-


For u-boot 2016.03 and Linux 4.1.15, you need to use the following newer Linaro arm compilier.

Info
iconfalse
$ wget -c httpshttp://releases.linaro.org/archive/15.05/components/toolchain/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-gnueabihf.tar.xz
$ export CC=/opt/gcc-linaro-4.9-2015.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-

...

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

Download:

For u-boot v2018.03: 

Info
iconfalse
$ git clone git@git.embedian.com:developer/smarc-t335x-uboot.git smarcfimx7-uboot
$ cd smarcfimx7-uboot
$ git checkout smarc-imx7_v2018.03_4.14.98_2.0.0_ga

For u-boot v2017.03: 

Info
iconfalse
$ git clone git@git.embedian.com:developer/smarc-t335x-uboot.git smarcfimx7-uboot
$ cd smarcfimx7-uboot
$ git checkout smarc-imx7_v2017.03_4.9.11_1.0.0_ga

...

Note
iconfalse
titleNote

Note1:

If the board is SMARC-FiMX7-S (Solo Core), use
$ make ARCH=arm CROSS_COMPILE=${CC} smarcfimx7s_ser3_defconfig

If the board is SMARC-FiMX7-D-2G (Dual Core with 2GB DDR3L), use
$ make ARCH=arm CROSS_COMPILE=${CC} smarcfimx7d_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 change to "ser0" instead. Same as SER1 and SER2.

Note 3:

The SMARC-FiMX7 module always boot up from the on-module SPI NOR flash. The factory default will be u-boot.imx pre-installed with SER3 as console output. In some cases when the SPI NOR flash is empty or needs to be upgraded. Users can shunt crossed the TEST# to ground. In this way, the SMARC-FiMX7 module will boot up to carrier SD card, if TEST# pin is shunt crossed. The u-boot.imx image are the same, the difference is how you flash u-boot.imx. This will be explained in the "Setup SD card" section.

...

Linux Kernel

...

Download:

For 4.14.98 (Based on Freescale imx_4.14.98_2.0.0_ga official release):

Info
iconfalse
$ git clone git@git.embedian.com:developer/smarc-fsl-linux-kernel.git
$ cd smarc-fsl-linux-kernel
$ git checkout smarc-imx7_4.14.98_2.0.0_ga


For 4.9.88 (Based on Freescale imx_4.9.88_2.0.0_ga official release):

Info
iconfalse
$ git clone git@git.embedian.com:developer/smarc-fsl-linux-kernel.git
$ cd smarc-fsl-linux-kernel
$ git checkout smarc-imx7_4.9.88_2.0.0_ga


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

...

Info
iconfalse
$ wget -c ftp://ftp.embedian.com/public/dev/minfs/ubuntu/xenial/imx7-ubuntu-16.04.2-armhf-2017-03-02.tar.gz

...

Info
iconfalse
$ wget -c ftp://ftp.embedian.com/public/dev/minfs/debian/jessie/imx7-debian-8.7-armhf-2017-03-02.tar.gz

...

Ubuntu 14.04 Download:

Info
iconfalse

$ wget -c ftp://ftp.embedian.com/public/dev/minfs/ubuntu/trusty/imx7-ubuntu1404ubuntu-14.04.tar.gz

Verify:

Info
iconfalse

$ md5sum imx7-ubuntu1404ubuntu-14.04.tar.gz
6cb950287c96f24901f4d1472a10324b  imx7-ubuntu1404.6cb950287c96f24901f4d1472a10324b  imx7-ubuntu-14.04.tar.gz

 

Yocto Build Root File System:

...

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

...

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

Info
iconfalse

$ export DISK=/dev/mmcblk0

Erase SD card:

Info
iconfalse

$ sudo dd if=/dev/zero of=${DISK} bs=1M count=16

...

Copy u-boot.imx to the boot partition. (Note: Rename u-boot-dtb.img to u-boot.img if your u-boot is v2018.03 or v2017.03)

Info
iconfalse
title~/smarcfimx7-uboot

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

...

Info
iconfalse
titleu-boot command prompt

U-Boot# mmc rescan; mmc dev; load mmc 0:1 0x90800000 u-boot.imx; sf probe; sleep 2; sf erase 0 0xc0000; sf write 0x90800000 0x400 86000c0000

If SPI NOR Flash is empty

...

Copy u-boot.imx to the boot partition. (Note: Rename u-boot-dtb.img to u-boot.img if your u-boot is v2018.03 or v2017.03)

Info
iconfalse
title~/smarcfimx7-uboot

$ sudo dd if=u-boot.imx of=${DISK} bs=512 seek=2 

...

Info
iconfalse
title~/smarc-fsl-linux-kernel

$ sudo cp -v arch/arm/boot/zImage /media/boot

Install Kernel Device Tree Binary

...

Info
iconfalse
titledirectory where your root file system is

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

Ubuntu 14.04:

Info
iconfalse
titledirectory where your root file system is

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

Copy Kernel Modules:

Info
iconfalse
title~/smarc-fsl-linux-kernel

$ sudo make ARCH=arm INSTALL_MOD_PATH=/media/rootfs modules_install


Note
titleNote
  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 that will tell i.MX7 internal ROM where to load u-boot. If the firmware in SPI flash need to be update or empty. Users could pull the TEST# pin on carrier board to low. In this way, SMARC-FiMX7 will boot up to SD card first. The command to copy u-boot.imx (rename u-boot-dtb.imx to u-boot.imx if using v2017.03) to SD card now is:
    $ sudo dd if=u-boot.imx of=${DISK} bs=512 seek=2 
    In this case, user will 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 60 bytes and 66 bytes (ENET2). It starts with Embedian's vendor code 10:0D:32. u-boot will read it and pass this parameter to kernel.
  3. If your rootfs is yocto built, the kernel modules will be included in the rootfs.

...

Edit: /etc/network/interfaces

Info
iconfalse

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

Add:

Info
iconfalse
title/media/rootfs/etc/network/interfaces

auto lo
iface lo inet loopback
 
auto eth0
iface eth0 inet dhcp

...

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

Info
iconfalse

$ export DISK=/dev/mmcblk0

Mount Partitions:

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

...


Copy zImage to rootfs partition:

Info
iconfalse

$ sudo cp -v /media/boot/zImage /media/rootfs/home/root

Note
titleNote
  1. If your rootfs is Ubuntu 14.04, copy to /media/rootfs/home/ubuntu instead of /media/rootfs/home/root

...

Copy device tree blob to rootfs partition:

Info
iconfalse

$ sudo cp -v /media/boot/dtbs/imx7s-smarcfimx7.dtb /media/rootfs/home/root/imx7s-smarcfimx7.dtb
$ sudo cp -v /media/boot/dtbs/imx7d-smarcfimx7.dtb /media/rootfs/home/root/imx7d-smarcfimx7.dtb 

Copy real rootfs to rootfs partition:

Yocto Built Root File Systems

Info
iconfalse

$ pushd /media/rootfs

$ sudo tar cvfz ~/smarcfimx7-emmc-rootfs.tar.gz .

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

$ popd

Ubuntu 14.04 Root File Systems

Info
iconfalse

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

Delete all contents starting with "SUBSYSTEM=="

$ pushd /media/rootfs

$ sudo tar cvfz ~/smarcfimx7-emmc-rootfs.tar.gz .

$ sudo mv ~/smarcfimx7-emmc-rootfs.tar.gz /media/rootfs/home/ubuntu

$ popd

Remove SD card:

Info
iconfalse
$ sync
$ sudo umount /media/boot
$ sudo umount /media/rootfs

...

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

Info
iconfalse

$ export DISK=/dev/mmcblk2

Erase SD card:

Info
iconfalse

$ sudo dd if=/dev/zero of=${DISK} bs=1M count=16

...

Install Kernel Device Tree Binary

Info
iconfalse

$ sudo mkdir -p /media/boot/dtbs

$ sudo cp -v imx7s-smarcfimx7.dtb imx7d-smarcfimxd.dtb /media/boot/dtbs

Install Root File System

...

Info
iconfalse

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

...

Unmount eMMC:

Info
iconfalse
$ sync
$ sudo umount /media/boot
$ sudo umount /media/rootfs

 

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


version 1.0a, 3/08/2017

Last updated 20182019-0211-08