Skip to content

UCM iMX8M Mini imx boot image build (ga2)

vraevsky edited this page Jul 2, 2019 · 1 revision

UCM-iMX8M-Mini imx-boot image build (ga2)

Supported machines:

  • ucm-imx8m-mini

Define a MACHINE environment variable with respect to a required machine:

export MACHINE=ucm-imx8m-mini

Prerequisites

It is up to developer to setup arm64 build environment:

  • Download a tool chain from Linaro
  • Set environment variables:
export ARCH=arm64
export CROSS_COMPILE=/usr/bin/aarch64-linux-gnu-
  • Create a folder to organize the files:
mkdir imx8mm
cd imx8mm
export SRC_ROOT=$(pwd)
  • Download CompuLab BSP
git clone -b devel-imx8mm-4.14.98 https://github.com/compulab-yokneam/meta-compulab-bsp.git
export BSP=$(pwd)/meta-compulab-bsp
export PATCHES=${BSP}/meta-bsp-imx8mm/recipes-bsp/u-boot/compulab/imx8mm

Mkimage Setup

  • Download the mkimage from:
git clone https://source.codeaurora.org/external/imx/imx-mkimage.git
git -C imx-mkimage checkout rel_imx_4.14.98_2.0.0_ga

Arm Trusted Firmware Setup

Download the ATF from:

git clone https://source.codeaurora.org/external/imx/imx-atf.git
git -C imx-atf checkout rel_imx_4.14.98_2.0.0_ga
  • Make bl31.bin
make -C imx-atf PLAT=imx8mm bl31
cp -v imx-atf/build/imx8mm/release/bl31.bin ${SRC_ROOT}/imx-mkimage/iMX8M/

Firmware iMX setup

Download the firmware-imx file from:

wget http://www.freescale.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.1.bin
bash firmware-imx-8.1.bin --auto-accept
cp -v $(find firmware* | awk '/train|hdmi_imx8|dp_imx8/' ORS=" ") ${SRC_ROOT}/imx-mkimage/iMX8M/

U-Boot

  • Download the U-Boot source and apply the CompuLab BSP patches:
git clone https://source.codeaurora.org/external/imx/uboot-imx.git
git -C uboot-imx checkout -b uboot-compulab rel_imx_4.14.98_2.0.0_ga
git -C uboot-imx am ${PATCHES}/*.patch
  • Compile the U-Boot
make -C uboot-imx ${MACHINE}_defconfig
make -C uboot-imx
  • Copy files to the mkimage directory:
cp -v $(find uboot-imx | awk '/u-boot-spl.bin$|u-boot.bin$|u-boot-nodtb.bin$|ucm.*\.dtb$|mkimage$/&&(!/doc/&&!/include/)' ORS=" ") ${SRC_ROOT}/imx-mkimage/iMX8M/

Compiling the flash.bin imx-boot image:

  • First! Unset these variables:
unset ARCH CROSS_COMPILE
  • Issue build this way:
cd ${SRC_ROOT}/imx-mkimage/iMX8M
sed "s/\(^dtbs = \).*/\1${MACHINE}.dtb/;s/\(mkimage\)_uboot/\1/" soc.mak > Makefile
make clean
make flash_evk SOC=iMX8MM

Flashing

dd if=flash.bin of=/dev/<your device> bs=1K seek=33 status=progress