Difference between revisions of "CM-T3x: Linux: Booting from MMC/SD card"

From Compulab Mediawiki
Jump to: navigation, search
 
(No difference)

Revision as of 07:20, 31 January 2011

CM-T3530 can boot either from on-board NAND flash or from MMC/SD card. There are certain requirements for MMC/SD card format imposed by internal boot ROM of the OMAP35x processor. The following describes how to create bootable MMC/SD card for different use cases.

Creating a bootable MMC/SD card

In order to create a bootable MMC/SD card compatible with OMAP35x boot ROM, it is necessary to set a special geometry in the partition table. OMAP35x boot ROM can work only with MMC/SD cards that have 255 heads and 63 sectors/track.

Linux

Detailed description how use Linux fdisk utility to adjust MMC/SD card partition table to suit OMAP35X boot ROM requirements can be found at TI Embedded Processors Wiki.

Windows

Windows users can use HP USB Disk Storage Format Tool and follow the steps below:

  • Connect the card reader to the Windows machine where the formatting tool has been installed.
  • Insert MMC/SD card into the card reader.
  • Launch the HP USB Disk Storage Format Tool.
  • Select FAT32 as File System.
  • Click on Start.
  • After formatting is done click OK.

After a bootable MMC/SD card is created it can be used for recovery system startup, for X-Loader and U-Boot testing and for booting Linux entirely from MMC/SD.

Booting X-Loader and U-Boot

  • Copy X-Loader to the MMC/SD card's root directory and rename it as MLO. It is essential that the MLO will be the first file created on the MMC/SD card.
  • Copy U-Boot binary to the MMC/SD card's root directory and rename it as u-boot.bin.
  • Insert the MMC/SD card into SB-T3530 MMC/SD slot.
  • Power on the system while holding "SD Boot" (SW1) button on SB-T35.

Booting Linux

CM-T3530 can boot Linux from MMC/SD card. The MMC/SD card should have geometry parameters compatible with OMAP35X boot ROM (255 heads, 63 sectors/track) and two partitions: FAT32 partition for X-Loader, U-Boot and Linux kernel and ext3 partition for root filesystem.

After MMC/SD card geometry and partition table were updated, create FAT32 filesystem on the first partition and ext3 filsystem on the second partition:

sudo mkfs.vfat -F 32 /dev/sdc1
sudo mkfs.ext3 /dev/sdc2

In the above example we assumed that the card was recognized as /dev/sdc.

Mount the MMC/SD card FAT partition and copy X-Loader (MLO), U-Boot (u-boot.bin) and Linux kernel (uImage) to the MMC/SD card:

mkdir /mnt/card
mount /dev/sdc1 /mnt/card
cp /path/to/t3530-uboot/images/x-load.bin.ift /mnt/card/MLO
sync
cp /path/to/t3530-uboot/images/u-boot.bin /mnt/card
cp /path/to/t3530-linux/images/uImage-cm-t35.bin /mnt/card
umount /mnt/card

Extract Linux filesystem into the ext3 partition of the MMC/SD card:

mount /dev/sdc2 /mnt/card
cd /mnt/card
tar xjvf /path/to/t3530-linux/images/Angstrom-image.tar.bz2
umount /mnt/card

The MMC/SD card is now ready and can be used to boot Linux. The kernel parameters required for MMC/SD boot are

root=/dev/mmcblk0p2 console=ttyS2,115200 rootwait

See also

BeagleBoard MMC/SD boot