CM-T3x: Building Firmware Images

From Compulab Mediawiki
Jump to: navigation, search

Overview

CM-T3530 and CM-T3730 (henceforth collectively referred to as CM-T3x) firmware consists of two components: X-Loader and U-Boot.
X-Loader is the bootstrap utility invoked by the CPU internal boot ROM code of the OMAP3 SoC. X-Loader performs minimal hardware initializations and loads U-Boot.
U-Boot initializes hardware modules necessary for system boot and loads the operating system.

Building Firmware images for CM-T3x

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 the sources

Getting X-Loader sources

X-Loader source code is included in the Compulab U-Boot package as a tar.gz archive and can be found in the x-loader folder. We assume that you have created /home/development/cm-t3x/x-loader directory for CM-T3x X-Loader development.

cd /home/development/cm-t3x/x-loader
tar xvf /path/to/x-loader-cm-t3x-3.tar.gz
mv x-loader x-loader-cm-t3x
cd x-loader-cm-t3x

Getting U-Boot sources

There are two ways to get U-Boot sources that can be used as a baseline for CM-T3x 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-t3x/u-boot directory for CM-T3x U-Boot development.

Snapshot download
  • Download v2013.10 snapshot with your web browser.
  • Extract the downloaded archive u-boot-183acb700378a8cfc5d50a01a65de93fb2c24586.tar.bz2
cd /home/development/cm-t3x/u-boot
tar xvf /path/to/downloaded/u-boot-183acb700378a8cfc5d50a01a65de93fb2c24586.tar.bz2
mv u-boot u-boot-cm-t3x
This will create /home/development/cm-t3x/u-boot/u-boot-cm-t3x directory containing U-Boot source code tree.
  • Apply the CM-T3x patch
cd /home/development/cm-t3x/u-boot/u-boot-cm-t3x
patch -p1 < /path/to/cm-t3x-u-boot/u-boot/u-boot-2013.10-cm-t3x-5.patch
Git clone
  • Install git version control system.
  • Create a clone of U-Boot tree
cd /home/development/cm-t3x/u-boot
git clone git://git.denx.de/u-boot.git u-boot-cm-t3x
  • Create a branch for CM-T3x development. The CM-T3x patches are generated vs. v2013.10 tag (183acb700378a8cfc5d50a01a65de93fb2c24586 commit) in the U-Boot tree. It is recommended to use exactly the same baseline to avoid merge conflicts.
git checkout -b cm-t3x-dev v2013.10
  • Apply the CM-T3x patch
cd /home/development/cm-t3x/u-boot/u-boot-cm-t3x
git apply /path/to/cm-t3x-u-boot/u-boot/u-boot-2013.10-cm-t3x-5.patch

Building the firmware images

Building X-Loader images

export ARCH=arm
export CROSS_COMPILE=arm-none-linux-eabi-
make mrproper
make cm-t3x_config
make

In the example above, CM-T3x firmware X-Loader image (x-load.bin) will be created in /home/development/cm-t3x/x-loader/x-loader-cm-t3x.

Building U-Boot images

export ARCH=arm
export CROSS_COMPILE=arm-none-linux-eabi-
make mrproper
make cm_t35

In the example above, CM-T3x firmware U-Boot image (u-boot.bin) will be created in /home/development/cm-t3x/u-boot/u-boot-cm-t3x. This image is fit for both CM-T3530 and CM-T3730.

See also