Difference between revisions of "CM-T3x: U-Boot: Firmware Overview"

From Compulab Mediawiki
Jump to: navigation, search
(Introduction)
(Boot sources)
Line 24: Line 24:
 
U-Boot environment can reside on the NAND flash or on the MMC/SD card.
 
U-Boot environment can reside on the NAND flash or on the MMC/SD card.
 
In case the NAND flash is used, two blocks at offset 0x260000 are used for the U-Boot environment.<br>
 
In case the NAND flash is used, two blocks at offset 0x260000 are used for the U-Boot environment.<br>
In case the MMC/SD card is used, the environment resides in cylinder 16 (offset 0x75A9E00 - in bytes).
+
In case the MMC/SD card is used, 32 sectors (512 byte) at offset 0x400 are used for the U-Boot environment.
  
 
== Boot sources ==
 
== Boot sources ==
=== CM-T3730 ===
+
CM-T3730 with on-board NAND flash, CM-T3530 and CM-T3517 can boot either from on-board NAND flash or from MMC/SD card.
CM-T3730 does not have an on-board NAND flash, therefore it can only boot from the on-board micro SD card.
+
The boot source can be selected using jumper E6 or button SW1 on SB-T35:
 
 
=== CM-T3530, CM-T3517 with SB-T35 base board ===
 
CM-T3530 and CM-T3517 can boot either from on-board NAND flash or from MMC/SD card. The boot source can be selected using jumper E6 or button SW1 on SB-T35:
 
 
* To boot the system from the on-board NAND flash make sure that jumper E6 is not present.
 
* To boot the system from the on-board NAND flash make sure that jumper E6 is not present.
 
* To boot the system from the MMC/SD card install jumper E6 before power-on or hold button SW1 during system startup.
 
* To boot the system from the MMC/SD card install jumper E6 before power-on or hold button SW1 during system startup.
 +
CM-T3730 with no on-board NAND flash can only boot from the on-board micro SD card.
  
 
Please refer to [[CM-T3x: Linux: Booting from MMC/SD card]] for further details.
 
Please refer to [[CM-T3x: Linux: Booting from MMC/SD card]] for further details.
Line 77: Line 75:
 
! Partition
 
! Partition
 
! Description
 
! Description
! Size (Cylinders)
 
 
! Offset (Bytes)
 
! Offset (Bytes)
 +
! Size (Bytes)
 +
|-
 +
| /dev/sdc
 +
| U-Boot environment
 +
| 0x400
 +
| 0x4000
 
|-
 
|-
 
| /dev/sdc1
 
| /dev/sdc1
 
| Boot
 
| Boot
| 15
+
| 0x100000
| 0x7E00
+
| 0x75A2000
 
|-
 
|-
 
| /dev/sdc2
 
| /dev/sdc2
| U-Boot environment
 
| 1
 
| 0x75A9E00
 
|-
 
| /dev/sdc3
 
 
| Linux file system
 
| Linux file system
 +
| 0x7700000
 
| remaining MMC/SD card space
 
| remaining MMC/SD card space
| 0x7D82000
 
 
|}
 
|}
  
{{filename|fdisk}} output for the 4GB sample MMC/SD card:
+
{{filename|fdisk}} output for the 8GB sample MMC/SD card:
 
<pre>
 
<pre>
Disk /dev/sdc: 3965 MB, 3965190144 bytes
+
Disk /dev/sde: 8035 MB, 8035237888 bytes
255 heads, 63 sectors/track, 482 cylinders
+
32 heads, 32 sectors/track, 15326 cylinders, total 15693824 sectors
Units = cylinders of 16065 * 512 = 8225280 bytes
+
Units = sectors of 1 * 512 = 512 bytes
 
Sector size (logical/physical): 512 bytes / 512 bytes
 
Sector size (logical/physical): 512 bytes / 512 bytes
 
I/O size (minimum/optimal): 512 bytes / 512 bytes
 
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
+
Disk identifier: 0x710ab397
  
 
   Device Boot      Start        End      Blocks  Id  System
 
   Device Boot      Start        End      Blocks  Id  System
/dev/sdc1   *           1          15     120456    c  W95 FAT32 (LBA)
+
/dev/sde1   *       2048      242959     120456    c  W95 FAT32 (LBA)
/dev/sdc2              16         16        8032+  da  Non-FS data
+
/dev/sde2         243712    15693823     7725056   83  Linux
/dev/sdc3              17        482     3743145   83  Linux
 
 
</pre>
 
</pre>
  
{{note|Cylinder size and number of the first two partitions must match! Otherwise U-Boot can damage files that will overlap with U-Boot environment!}}
+
{{note|Offset and size of the first partition must match! Otherwise U-Boot can damage files that will overlap with U-Boot environment!}}
  
 
== Know issues ==
 
== Know issues ==

Revision as of 15:50, 14 November 2012

Introduction

This article describes firmware for CM-T3x system-on-module product line. The CM-T3x product line includes the following modules:

CM-T3x firmware consists of two components: X-Loader and U-Boot. X-Loader is the bootstrap utility invoked by the boot ROM code of the OMAP3x SoC. X-Loader performs minimal hardware initialization and loads stage two bootloader, namely U-Boot. U-Boot initializes hardware modules necessary for system boot and loads the operating system.

X-Loader

X-Loader resides in the first erase block of the system NAND flash or in a file on MMC/SD card. It is loaded into the CPU internal SRAM immediately after system reset. The CPU internal boot ROM determines what storage media to use in accordance with BOOT_SOURCE signal value (pin 65 of connector P1 on CM-T3x). SB-T35 allows easy switch between NAND and MMC/SD boot.

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

U-Boot

U-Boot is the stage two bootloader used on CM-T3x. It allows flexible selection of operating system boot modes, provides scripting facilities and command line interface through serial port.

U-Boot resides in the system NAND flash starting from offset 0x80000 or in a file on MMC/SD card. In case an MMC/SD card is used as boot media, U-Boot binary should be present in card's root directory and named u-boot.bin.

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

U-Boot environment

U-Boot environment can reside on the NAND flash or on the MMC/SD card. In case the NAND flash is used, two blocks at offset 0x260000 are used for the U-Boot environment.
In case the MMC/SD card is used, 32 sectors (512 byte) at offset 0x400 are used for the U-Boot environment.

Boot sources

CM-T3730 with on-board NAND flash, CM-T3530 and CM-T3517 can boot either from on-board NAND flash or from MMC/SD card. The boot source can be selected using jumper E6 or button SW1 on SB-T35:

  • To boot the system from the on-board NAND flash make sure that jumper E6 is not present.
  • To boot the system from the MMC/SD card install jumper E6 before power-on or hold button SW1 during system startup.

CM-T3730 with no on-board NAND flash can only boot from the on-board micro SD card.

Please refer to CM-T3x: Linux: Booting from MMC/SD card for further details.

Default NAND flash mapping

CM-T3x NAND flash mapping
Offset Description Size (kilobytes)
0x0 X-Loader 512
0x80000 U-Boot 640
0x120000 Reserved 1280
0x260000 U-Boot environment 256
0x2a0000 Linux kernel 4096
0x6a0000 Linux filesystem remaining NAND flash space


Default MMC/SD card mapping

CM-T3x MMC/SD card mapping
Partition Description Offset (Bytes) Size (Bytes)
/dev/sdc U-Boot environment 0x400 0x4000
/dev/sdc1 Boot 0x100000 0x75A2000
/dev/sdc2 Linux file system 0x7700000 remaining MMC/SD card space

fdisk output for the 8GB sample MMC/SD card:

Disk /dev/sde: 8035 MB, 8035237888 bytes
32 heads, 32 sectors/track, 15326 cylinders, total 15693824 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: 0x710ab397

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1   *        2048      242959      120456    c  W95 FAT32 (LBA)
/dev/sde2          243712    15693823     7725056   83  Linux


Admolition note.png Offset and size of the first partition must match! Otherwise U-Boot can damage files that will overlap with U-Boot environment!

Know issues

  • If U-Boot environment variable bootdelay is set to 0 or an invalid value, automatic OS boot cannot be stopped.