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

From Compulab Mediawiki
Jump to: navigation, search
 
(Booting Linux)
 
(3 intermediate revisions by 2 users not shown)
Line 2: Line 2:
  
 
== Creating a bootable MMC/SD card ==
 
== 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.
+
In order to create a bootable MMC/SD card compatible with OMAP3x boot ROM, it is necessary to set a special geometry in the partition table. OMAP3x boot ROM can work only with MMC/SD cards that have 255 heads and 63 sectors/track.
  
 
=== Linux ===
 
=== Linux ===
Detailed description how use Linux {{cmd|fdisk}} utility to adjust MMC/SD card partition table to suit OMAP35X boot ROM requirements can be found at [http://wiki.omap.com/index.php?title=MMC_Boot_Format TI Embedded Processors Wiki].
+
Detailed description how use Linux {{cmd|fdisk}} utility to adjust MMC/SD card partition table to suit OMAP3x boot ROM requirements can be found at [http://wiki.omap.com/index.php?title=MMC_Boot_Format TI Embedded Processors Wiki].
  
 
=== Windows ===
 
=== Windows ===
Line 21: Line 21:
 
* Copy X-Loader to the MMC/SD card's root directory and rename it as {{filename|MLO}}. It is essential that the MLO will be the first file created on the MMC/SD card.
 
* Copy X-Loader to the MMC/SD card's root directory and rename it as {{filename|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 {{filename|u-boot.bin}}.
 
* Copy U-Boot binary to the MMC/SD card's root directory and rename it as {{filename|u-boot.bin}}.
* Insert the MMC/SD card into SB-T3530 MMC/SD slot.
+
* Insert the MMC/SD card into SB-T35 MMC/SD slot or the CM-T3x on-board micro SD slot.
* Power on the system while holding "SD Boot" (SW1) button on SB-T35.
+
* Power on the system while holding {{parameter|SD Boot}} (SW1) button on SB-T35.
  
 
== Booting Linux ==
 
== 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.
+
CM-T3x can boot Linux from MMC/SD card. The MMC/SD card must have geometry parameters compatible with OMAP3x boot ROM (255 heads, 63 sectors/track) and at least two partitions: FAT32 partition for X-Loader, U-Boot and Linux kernel and ext4 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:
+
After MMC/SD card geometry and partition table were updated, create FAT32 filesystem on the first partition and ext4 filsystem on the second partition:
sudo mkfs.vfat -F 32 /dev/sdc1
+
<pre>
sudo mkfs.ext3 /dev/sdc2
+
sudo mkfs.vfat -F 32 /dev/sdc1
 +
sudo mkfs.ext4 /dev/sdc2
 +
</pre>
 
In the above example we assumed that the card was recognized as {{filename|/dev/sdc}}.
 
In the above example we assumed that the card was recognized as {{filename|/dev/sdc}}.
  
 
Mount the MMC/SD card FAT partition and copy X-Loader ({{filename|MLO}}), U-Boot ({{filename|u-boot.bin}}) and Linux kernel ({{filename|uImage}}) to the MMC/SD card:
 
Mount the MMC/SD card FAT partition and copy X-Loader ({{filename|MLO}}), U-Boot ({{filename|u-boot.bin}}) and Linux kernel ({{filename|uImage}}) to the MMC/SD card:
mkdir /mnt/card
+
<pre>
mount /dev/sdc1 /mnt/card
+
mkdir /mnt/card
cp /path/to/t3530-uboot/images/x-load.bin.ift /mnt/card/MLO
+
mount /dev/sdc1 /mnt/card
sync
+
cp /path/to/cm-t3x-uboot/images/x-load.bin /mnt/card/MLO
cp /path/to/t3530-uboot/images/u-boot.bin /mnt/card
+
sync
cp /path/to/t3530-linux/images/uImage-cm-t35.bin /mnt/card
+
cp /path/to/cm-t3x-uboot/images/u-boot.bin /mnt/card
umount /mnt/card
+
cp /path/to/cm-t3x-linux/images/uImage-cm-t3x.bin /mnt/card
 +
umount /mnt/card
 +
</pre>
  
Extract Linux filesystem into the ext3 partition of the MMC/SD card:
+
Extract the Linux filesystem into the ext4 partition of the MMC/SD card:
mount /dev/sdc2 /mnt/card
+
<pre>
cd /mnt/card
+
mount /dev/sdc2 /mnt/card
tar xjvf /path/to/t3530-linux/images/Angstrom-image.tar.bz2
+
cd /mnt/card
umount /mnt/card
+
tar xjvf /path/to/cm-t3x-linux/images/Angstrom-image.tar.bz2
 +
umount /mnt/card
 +
</pre>
  
 
The MMC/SD card is now ready and can be used to boot Linux. The kernel parameters required for MMC/SD boot are
 
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
+
 
 +
* for Linux kernel v2.6.36 and below:
 +
<pre>
 +
root=/dev/mmcblk0p2 console=ttyS2,115200n8 rootwait mmc_core.removable=0
 +
</pre>
 +
 
 +
* starting from Linux kernel v2.6.37:
 +
<pre>
 +
root=/dev/mmcblk0p2 console=ttyO2,115200n8 rootwait mmc_core.removable=0
 +
</pre>
  
 
== See also ==
 
== See also ==
Line 56: Line 71:
 
[[Category:U-Boot|Booting from MMC/SD card]]
 
[[Category:U-Boot|Booting from MMC/SD card]]
 
[[Category:CM-T3530|Linux: Booting from MMC/SD card]]
 
[[Category:CM-T3530|Linux: Booting from MMC/SD card]]
 +
[[Category:CM-T3517]]
 +
[[Category:CM-T3730]]

Latest revision as of 14:18, 9 January 2013

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 OMAP3x boot ROM, it is necessary to set a special geometry in the partition table. OMAP3x 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 OMAP3x 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-T35 MMC/SD slot or the CM-T3x on-board micro SD slot.
  • Power on the system while holding SD Boot (SW1) button on SB-T35.

Booting Linux

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

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

sudo mkfs.vfat -F 32 /dev/sdc1
sudo mkfs.ext4 /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/cm-t3x-uboot/images/x-load.bin /mnt/card/MLO
sync
cp /path/to/cm-t3x-uboot/images/u-boot.bin /mnt/card
cp /path/to/cm-t3x-linux/images/uImage-cm-t3x.bin /mnt/card
umount /mnt/card

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

mount /dev/sdc2 /mnt/card
cd /mnt/card
tar xjvf /path/to/cm-t3x-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

  • for Linux kernel v2.6.36 and below:
root=/dev/mmcblk0p2 console=ttyS2,115200n8 rootwait mmc_core.removable=0
  • starting from Linux kernel v2.6.37:
root=/dev/mmcblk0p2 console=ttyO2,115200n8 rootwait mmc_core.removable=0

See also

BeagleBoard MMC/SD boot