CM-T335: U-Boot: Firmware Overview

From Compulab Mediawiki
Jump to: navigation, search

Introduction

This article describes firmware for the CompuLab CM-T335 System-on-Module / Computer-on-Module. CM-T335 firmware consists of two components: Secondary Program Loader (SPL) and U-Boot. SPL is the bootstrap utility invoked by the CPU internal boot ROM code of the AM335x SoC. The AM335x boot ROM tries to boot from the micro SD card. If no media present in the micro SD card socket or no valid boot image is found, the boot ROM will try to boot from the NAND flash. SPL performs minimal hardware initializations and loads U-Boot from the same boot storage device. U-Boot initializes hardware modules necessary for system boot and loads the operating system.

SPL

SPL resides in a file on a micro SD card or in the first erase block of the system NAND flash. In case a micro SD card is used as boot media, SPL binary should be present in card's root directory and named MLO. It is loaded into the CPU internal SRAM immediately after system reset.

SPL is responsible for initial clock setup, DDR initialization and boot media controller initialization. After basic hardware setup SPL loads U-Boot bootloader into the system RAM and transfers control to the U-Boot bootloader.

U-Boot

U-Boot is the bootloader used on CM-T335. It allows flexible selection of operating system boot modes, provides scripting facilities and command line interface through a serial port.
U-Boot resides in the system NAND flash starting from offset 0x200000 or in a file on a micro SD card. In case a micro SD card is used as boot media, U-Boot binary should be present in card's root directory and named u-boot.img.

U-Boot allows booting operating system from the on-board NAND flash, SD card or from network (from TFTP server). Please consult U-Boot quick reference and U-Boot project documentation for U-Boot features and commands description.

U-Boot environment

U-Boot environment resides on the NAND flash at offset 0x300000. The environment size is 16KiB and it uses 1MiB of NAND flash storage size for various NAND flash chips compatibility.

Boot sources

CM-T335 can boot from either a micro SD card, or the on-board NAND flash. The boot source sequence is hard coded as shown below and cannot be overridden:

  1. micro SD card
  2. on-board NAND flash

Default NAND flash mapping

CM-T335 NAND flash mapping
Offset Description Size (megabytes)
0x0 SPL 2
0x200000 U-Boot 1
0x300000 U-Boot environment 1
0x400000 Device Tree Blob 1
0x500000 Splash Screen image 4
0x900000 Linux kernel 6
0xF00000 Linux filesystem remaining NAND flash space

Default SD card mapping

CM-T335 SD card mapping
Partition Description Offset (Bytes) Size (Bytes)
/dev/sdc1 Boot 0x100000 0x75A2000
/dev/sdc2 Linux file system 0x76A2000 remaining SD card space

fdisk output for the 8GB sample SD card:

Disk /dev/sdc: 7948 MB, 7948206080 bytes
245 heads, 62 sectors/track, 1021 cylinders, total 15523840 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x9f700771

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *        2048      242959      120456    c  W95 FAT32 (LBA)
/dev/sdc2          242960    15523839     7640440   83  Linux


Admolition note.png Micro SD card supplied by CompuLab with CM-T335 modules may not have the above layout. In such case the above layout can be created with fdisk utility.

See also