Difference between revisions of "CM-T335: U-Boot: Building Images"
(→Getting U-Boot sources) |
imported>Uri.mashiach |
||
(5 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
== Overview == | == Overview == | ||
− | CM-T335 firmware consists of two components: Secondary Program Loader (SPL) and U-Boot. | + | The CompuLab CM-T335 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. | Both components are based on [http://www.denx.de/wiki/U-Boot/WebHome U-Boot] source code. | ||
SPL is the bootstrap utility invoked by the CPU internal boot ROM code of the AM335x SoC. | SPL is the bootstrap utility invoked by the CPU internal boot ROM code of the AM335x SoC. | ||
Line 10: | Line 10: | ||
There are several options for cross-compilation toolchain setup. You can either compile your cross-compiler or use an already built cross-compiler. The cross-compiler should support the ARM embedded-application binary interface ("[http://en.wikipedia.org/wiki/Application_binary_interface#EABI EABI]") | There are several options for cross-compilation toolchain setup. You can either compile your cross-compiler or use an already built cross-compiler. The cross-compiler should support the ARM embedded-application binary interface ("[http://en.wikipedia.org/wiki/Application_binary_interface#EABI EABI]") | ||
* Pre-built toolchain (recommended): | * Pre-built toolchain (recommended): | ||
− | ** [ | + | ** [https://releases.linaro.org/components/toolchain/binaries/4.9-2017.01/arm-linux-gnueabihf/ Linaro 4.9-2017.01] |
* Tools for creating cross-compilers: | * Tools for creating cross-compilers: | ||
** [http://crosstool-ng.org/ Crosstool-ng]: Builds a cross-compiler from source. Non-distribution specific. | ** [http://crosstool-ng.org/ Crosstool-ng]: Builds a cross-compiler from source. Non-distribution specific. | ||
Line 21: | Line 21: | ||
==== Snapshot download ==== | ==== Snapshot download ==== | ||
− | * Download [http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=snapshot;h= | + | * Download [http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=snapshot;h=dda0dbfc69f3d560c87f5be85f127ed862ea6721;sf=tbz2 v2014.04] snapshot with your web browser. |
− | * Extract the downloaded archive {{filename|u-boot- | + | * Extract the downloaded archive {{filename|u-boot-dda0dbfc69f3d560c87f5be85f127ed862ea6721.tar.bz2}} |
<pre> | <pre> | ||
cd /home/development/cm-t335/u-boot | cd /home/development/cm-t335/u-boot | ||
− | tar xvf /path/to/downloaded/u-boot- | + | tar xvf /path/to/downloaded/u-boot-dda0dbfc69f3d560c87f5be85f127ed862ea6721.tar.bz2 |
mv u-boot u-boot-cm-t335 | mv u-boot u-boot-cm-t335 | ||
</pre> | </pre> | ||
Line 32: | Line 32: | ||
<pre> | <pre> | ||
cd /home/development/cm-t335/u-boot/u-boot-cm-t335 | cd /home/development/cm-t335/u-boot/u-boot-cm-t335 | ||
− | patch -p1 < /path/to/cm-t335-u-boot/u-boot/u-boot- | + | patch -p1 < /path/to/cm-t335-u-boot/u-boot/u-boot-v2014.04-cm-t335-2.4.patch |
</pre> | </pre> | ||
Line 42: | Line 42: | ||
git clone git://git.denx.de/u-boot.git u-boot-cm-t335 | git clone git://git.denx.de/u-boot.git u-boot-cm-t335 | ||
</pre> | </pre> | ||
− | * Create a branch for CM-T335 development. The CM-T335 patches are generated vs. | + | * Create a branch for CM-T335 development. The CM-T335 patches are generated vs. v2014.04 tag (dda0dbfc69f3d560c87f5be85f127ed862ea6721 commit) in the U-Boot tree. It is recommended to use exactly the same baseline to avoid merge conflicts. |
<pre> | <pre> | ||
− | git checkout -b cm-t335-dev | + | git checkout -b cm-t335-dev v2014.04 |
</pre> | </pre> | ||
* Apply the CM-T335 patch | * Apply the CM-T335 patch | ||
<pre> | <pre> | ||
cd /home/development/cm-t335/u-boot/u-boot-cm-t335 | cd /home/development/cm-t335/u-boot/u-boot-cm-t335 | ||
− | git apply /path/to/cm-t335-u-boot/u-boot/u-boot- | + | git apply /path/to/cm-t335-u-boot/u-boot/u-boot-v2014.04-cm-t335-2.4.patch |
</pre> | </pre> | ||
=== Building the firmware images === | === Building the firmware images === | ||
+ | In this section we assume that any version of Sourcery CodeBench Lite toolchain is installed on a host machine and it's location is added to a PATH. | ||
<pre> | <pre> | ||
export ARCH=arm | export ARCH=arm | ||
export CROSS_COMPILE=arm-none-linux-eabi- | export CROSS_COMPILE=arm-none-linux-eabi- | ||
make mrproper | make mrproper | ||
− | make | + | make cm_t335_config && make |
</pre> | </pre> | ||
Line 66: | Line 67: | ||
* [[U-Boot quick reference]] | * [[U-Boot quick reference]] | ||
* [[U-Boot images]] | * [[U-Boot images]] | ||
− | |||
* [http://www.denx.de/wiki/U-Boot/Documentation U-Boot documentation] | * [http://www.denx.de/wiki/U-Boot/Documentation U-Boot documentation] | ||
* [http://processors.wiki.ti.com/index.php/SD/MMC_format_for_OMAP3_boot SD/MMC format for OMAP3 boot] | * [http://processors.wiki.ti.com/index.php/SD/MMC_format_for_OMAP3_boot SD/MMC format for OMAP3 boot] |
Latest revision as of 08:31, 9 August 2022
Contents
Overview
The CompuLab CM-T335 System-on-Module / Computer-on-Module firmware consists of two components: Secondary Program Loader (SPL) and U-Boot. Both components are based on U-Boot source code. SPL is the bootstrap utility invoked by the CPU internal boot ROM code of the AM335x SoC. SPL performs minimal hardware initialization and loads U-Boot from the same boot device. U-Boot initializes hardware modules necessary for system boot and loads the operating system.
Building Firmware images for CM-T335
Cross-Compiler
There are several options for cross-compilation toolchain setup. You can either compile your cross-compiler or use an already built cross-compiler. The cross-compiler should support the ARM embedded-application binary interface ("EABI")
- Pre-built toolchain (recommended):
- Tools for creating cross-compilers:
- Crosstool-ng: Builds a cross-compiler from source. Non-distribution specific.
- Crossdev: Gentoo's cross-compiler builder. Needs Gentoo.
Getting U-Boot sources
There are two ways to get U-Boot sources that can be used as a baseline for CM-T335 SPL and 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 /home/development/cm-t335/u-boot directory for CM-T335 u-boot development.
Snapshot download
- Download v2014.04 snapshot with your web browser.
- Extract the downloaded archive u-boot-dda0dbfc69f3d560c87f5be85f127ed862ea6721.tar.bz2
cd /home/development/cm-t335/u-boot tar xvf /path/to/downloaded/u-boot-dda0dbfc69f3d560c87f5be85f127ed862ea6721.tar.bz2 mv u-boot u-boot-cm-t335
- This will create /home/development/cm-t335/u-boot/u-boot-cm-t335 directory containing U-Boot source code tree.
- Apply the CM-T335 patch
cd /home/development/cm-t335/u-boot/u-boot-cm-t335 patch -p1 < /path/to/cm-t335-u-boot/u-boot/u-boot-v2014.04-cm-t335-2.4.patch
Git clone
- Install git version control system.
- Create a clone of U-Boot tree
cd /home/development/cm-t335/u-boot git clone git://git.denx.de/u-boot.git u-boot-cm-t335
- Create a branch for CM-T335 development. The CM-T335 patches are generated vs. v2014.04 tag (dda0dbfc69f3d560c87f5be85f127ed862ea6721 commit) in the U-Boot tree. It is recommended to use exactly the same baseline to avoid merge conflicts.
git checkout -b cm-t335-dev v2014.04
- Apply the CM-T335 patch
cd /home/development/cm-t335/u-boot/u-boot-cm-t335 git apply /path/to/cm-t335-u-boot/u-boot/u-boot-v2014.04-cm-t335-2.4.patch
Building the firmware images
In this section we assume that any version of Sourcery CodeBench Lite toolchain is installed on a host machine and it's location is added to a PATH.
export ARCH=arm export CROSS_COMPILE=arm-none-linux-eabi- make mrproper make cm_t335_config && make
In the example above, CM-T335 firmware images for SPL (MLO) and U-Boot (u-boot.img) will be created in /home/development/cm-t335/u-boot/u-boot-cm-t335.