CM-A510: U-Boot: Building Images

From Compulab Mediawiki
Revision as of 12:18, 2 February 2015 by Lifshitz (talk) (Building the firmware images)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Overview

The CompuLab CM-A510 System-on-Module / Computer-on-Module firmware consists of two components: Binary Header and U-Boot. Binary Header is the bootstrap utility invoked by the CPU internal boot ROM code of the 88AP510 SoC. Binary Header performs DRAM initialization. U-Boot initializes hardware modules necessary for system boot and loads the operating system.

Building Firmware images for CM-A510

Cross-Compiler

CM-A510 firmware was compiled using Marvell Little Endian Cross Compiler, available at Marvell Extranet

Getting U-Boot sources

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

Snapshot download

  • Download v2009.08 snapshot with your web browser.
  • Extract the downloaded archive u-boot-3d35d87.tar.gz
cd /home/development/cm-a510/u-boot
tar xvf /path/to/downloaded/u-boot-3d35d87.tar.gz
mv u-boot u-boot-cm-a510
This will create /home/development/cm-a510/u-boot/u-boot-cm-a510 directory containing U-Boot source code tree.
  • Apply the CM-A510 patch
cd /home/development/cm-a510/u-boot/u-boot-cm-a510
patch -p1 < /path/to/cm-a510-u-boot/u-boot/u-boot-v2009.08-cm-a510-2.patch

Git clone

  • Install git version control system.
  • Create a clone of U-Boot tree
cd /home/development/cm-a510/u-boot
git clone git://git.denx.de/u-boot.git u-boot-cm-a510
  • Create a branch for CM-A510 development. The CM-A510 patches are generated vs. v2009.08 tag (3d35d87d5482de23cd5dc4d7721b1086107cae50 commit) in the U-Boot tree. It is recommended to use exactly the same baseline to avoid merge conflicts.
git checkout -b cm-a510-dev v2009.08
  • Apply the CM-A510 patch
cd /home/development/cm-a510/u-boot/u-boot-cm-a510
git apply /path/to/cm-a510-u-boot/u-boot/u-boot-v2009.08-cm-a510-2.patch

Building the firmware images

In this section we assume that Marvell Little Endian Cross Compiler is installed on a host machine and it's location is added to the PATH.

export ARCH=arm
export CROSS_COMPILE=arm-marvell-linux-gnueabi-
make mrproper

Building Binary Header

In order to compile a firmware Binary Header execute the following commands:

cd tools/brom_bin_hdr/
make clean
make

The resulting binary header file is: tools/binary_hdr.bin

Configuring firmware build system

CM-A510 firmware build system should be configured properly to support various production option of the board. To configure the build system, execute the following command:

make cm_a510_config [OPTIONS]

Where OPTIONS are defined as follows:

  • DRAM size
    • For 1G DDR3 installed on board add: DRAM=CM_A510_1G
    • For 512M DDR3 installed on board add: DRAM=CM_A510_512M
  • NAND
    • If the board has NAND option add: NAND=1


Example of configuring a build system for 1G board with NAND:

make cm_a510_config DRAM=CM_A510_1G NAND=1

Compiling firmware images

After executing the make command:

make

the following binary images will be created:

  • u-boot-cm_a510_1G_spi.bin - U-Boot and Binary Header combined to a single binary, compatible for boot from SPI flash.
  • u-boot-cm_a510_1G_sata.bin - U-Boot binary, compatible for boot from SATA drive.
  • u-boot-cm_a510_1G_sata_header.bin - Binary Header, compatible for boot from SATA drive.

See also