Difference between revisions of "Transclusion: CL-SOM-iMX7: U-Boot: Building Images"

From Compulab Mediawiki
Jump to: navigation, search
(See also)
 
Line 1: Line 1:
== Overview ==
 
The CompuLab CL-SOM-iMX7 System-on-Module / Computer-on-Module firmware consists of two components: Secondary Program Loader (SPL) and U-Boot.
 
Both components are based on [http://www.denx.de/wiki/U-Boot/WebHome U-Boot] source code.<br>
 
SPL is the bootstrap utility invoked by the CPU internal boot ROM code of the i.MX7 SoC.
 
U-Boot initializes hardware modules necessary for system boot and loads the operating system.<br>
 
The latest U-Boot package is available at the [http://www.compulab.com/products/computer-on-modules/cl-som-imx7-freescale-i-mx-7-system-on-module/#devres CL-SOM-iMX7 Resources] web page.
 
 
== Building Firmware images for CL-SOM-iMX7 ==
 
=== Getting U-Boot sources ===
 
There are two ways to get U-Boot sources that can be used as a baseline for CL-SOM-iMX7 U-Boot.
 
You can create a copy of "Das U-Boot" source tree or download a snapshot and extract it.<br>
 
We assume that you have created {{filename|/home/development/cl-som-imx7/u-boot}} directory for CL-SOM-iMX7 u-boot development.
 
 
 
==== Snapshot download ====
 
==== Snapshot download ====
 
* Download [http://git.denx.de/?p=u-boot.git;a=snapshot;h=d85ca029f257b53a96da6c2fb421e78a003a9943;sf=tgz v2017.07] snapshot with your web browser.
 
* Download [http://git.denx.de/?p=u-boot.git;a=snapshot;h=d85ca029f257b53a96da6c2fb421e78a003a9943;sf=tgz v2017.07] snapshot with your web browser.
Line 58: Line 45:
 
dd if=u-boot.img of=cl-som-imx7-firmware bs=1K seek=64 conv=notrunc
 
dd if=u-boot.img of=cl-som-imx7-firmware bs=1K seek=64 conv=notrunc
 
</pre>
 
</pre>
* You can now install the {{filename|cl-som-imx7-firmware}} file into an SD card or CL-SOM-iMX7 SPI flash.
 
 
== See also ==
 
 
* [[U-Boot: Quick reference]]
 
* [[U-Boot images]]
 
* [http://www.denx.de/wiki/U-Boot/Documentation U-Boot documentation]
 

Revision as of 16:25, 26 October 2017

Snapshot download

  • Download v2017.07 snapshot with your web browser.
  • Extract the downloaded archive u-boot-d85ca02.tar.gz
cd /home/development/cl-som-imx7/u-boot
tar xvf /path/to/downloaded/u-boot-d85ca02.tar.gz
mv u-boot* u-boot-cl-som-imx7
This will create /home/development/cl-som-imx7/u-boot/u-boot-cl-som-imx7 directory containing U-Boot source code tree.
  • Apply the CL-SOM-iMX7 patch
cd /home/development/cl-som-imx7/u-boot/u-boot-cl-som-imx7
patch -p1 < /path/to/cl-som-imx7-u-boot-package/u-boot/u-boot-*.patch

Git clone

  • Install git version control system.
  • Create a clone of U-Boot tree
cd /home/development/cl-som-imx7/u-boot
git clone git://git.denx.de/u-boot.git u-boot-cl-som-imx7
cd /home/development/cl-som-imx7/u-boot/u-boot-cl-som-imx7
  • Create a branch for CL-SOM-iMX7 development. The CL-SOM-iMX7 patches are generated vs. v2017.07 tag (d85ca029f257b53a96da6c2fb421e78a003a9943 commit) in the U-Boot tree. It is recommended to use exactly the same baseline to avoid merge conflicts.
git checkout -b cl-som-imx7-dev v2017.07
  • Apply CL-SOM-iMX7 patch
git am /path/to/cl-som-imx7-u-boot-package/u-boot/patches/*.patch

Building the firmware images

  • First, compile U-Boot. The following commands create the u-boot.imx binary (along with other image types):
export ARCH=arm
export CROSS_COMPILE=arm-none-linux-eabi-
make mrproper
make cl-som-imx7_defconfig && make
  • Merge the SPL and U-Boot images into one firmware image:
dd if=/dev/zero count=576 bs=1K | tr '\000' '\377' > of=cl-som-imx7-firmware
dd if=SPL of=cl-som-imx7-firmware bs=1K seek=1 conv=notrunc
dd if=u-boot.img of=cl-som-imx7-firmware bs=1K seek=64 conv=notrunc