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

From Compulab Mediawiki
Jump to: navigation, search
 
(Replacing page with '{{:Transclusion: CL-SOM-iMX7: U-Boot: Building Images}} Category:U-Boot Category:CL-SOM-iMX7')
Line 1: Line 1:
== Overview ==
+
{{:Transclusion: CL-SOM-iMX7: U-Boot: Building Images}}
CL-SOM-iMX7 firmware consists of single U-Boot binary image.
 
It is based on [http://www.denx.de/wiki/U-Boot/WebHome U-Boot] source code.
 
U-Boot is 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.
 
 
 
== 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.
 
We assume that you have created {{filename|/home/development/cl-som-imx7/u-boot}} directory for CL-SOM-iMX7 u-boot development.
 
 
 
==== Snapshot download ====
 
* Download [http://git.denx.de/?p=u-boot.git;a=snapshot;h=8cbb389bb3da80cbf8911f8386cbff92c6a78afe;sf=tgz v2016.09] snapshot with your web browser.
 
* Extract the downloaded archive {{filename|u-boot-8cbb389.tar.gz}}
 
<pre>
 
cd /home/development/cl-som-imx7/u-boot
 
tar xvf /path/to/downloaded/u-boot-8cbb389.tar.gz
 
mv u-boot u-boot-cl-som-imx7
 
</pre>
 
: This will create {{filename|/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
 
<pre>
 
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-v2016.09-cl-som-imx7-*.patch
 
</pre>
 
 
 
==== Git clone ====
 
* Install [http://git-scm.com/ git] version control system.
 
* Create a clone of U-Boot tree
 
<pre>
 
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
 
</pre>
 
* Create a branch for CL-SOM-iMX7 development. The CL-SOM-iMX7 patches are generated vs. v2016.09 tag (8cbb389bb3da80cbf8911f8386cbff92c6a78afe commit) in the U-Boot tree. It is recommended to use exactly the same baseline to avoid merge conflicts.
 
<pre>
 
git checkout -b cl-som-imx7-dev v2016.09
 
</pre>
 
* Apply CL-SOM-iMX7 patch
 
<pre>
 
git am /path/to/cl-som-imx7-u-boot-package/u-boot/patches/*.patch
 
</pre>
 
 
 
=== Building the firmware images ===
 
* First, compileU-Boot. The following commands create the {{filename|u-boot.imx}} binary (along with other image types):
 
<pre>
 
export ARCH=arm
 
export CROSS_COMPILE=arm-none-linux-eabi-
 
make mrproper
 
make cl_som_imax7_defconfig && make
 
</pre>
 
* Rename the U-Boot binary image file:
 
<pre>
 
cp u-boot.imx cl-som-imx7-firmware
 
</pre>
 
* You can now install the {{filename|cl-som-imx7-firmware}} file into an SD card or CL-SOM-iMX7 SPI flash.
 
  
 
[[Category:U-Boot]]
 
[[Category:U-Boot]]
 
[[Category:CL-SOM-iMX7]]
 
[[Category:CL-SOM-iMX7]]

Revision as of 10:40, 18 October 2017

Git clone

  • Install git version control system.
  • Create a clone of U-Boot tree
cd /home/development/cl-som-imx7/u-boot
git clone https://github.com/compulab/u-boot.git -b v2017.07-cl-som-imx7-1.9 u-boot-cl-som-imx7
cd u-boot-cl-som-imx7
  • Create a branch for CL-SOM-iMX7 development
git checkout -b cl-som-imx7-1.9-devel

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=640 bs=1K | tr '\000' '\377' > 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