Embedded MMC(eMMC) boot

From OMAPpedia

Jump to: navigation, search


[edit] eMMC boot

[edit] Introduction

The OMAP processor follows a 2 stage boot process, where the ROM code first loads the x-loader into internal SRAM and executes it, which then loads the u-boot into SDRAM and executes it. Details on the boot procedure can be found at the boot sequence page.

eMMC is an embedded MMC device that can contain the x-loader and u-boot, as well as the kernel and filesystem. OMAP supports both RAW and FAT boot from eMMC device in Slot-2.

[edit] eMMC FAT boot

FAT boot method is the same as MMC/SD Configuration flashing and booting procedure. MMC/SD card must be formatted with the correct partitions prior to flashing any device. Once the MMC/SD is configured it will contain two separate partitions that will be used to boot the device. The FAT32 partition is used for uboot, xloader, and kernel. The ext3 partitions is used for the actual file system. Once both of these are loaded onto an MMC/SD the device can boot up and run the selected file system.

But eMMC is an Embedded device. So we have to partition and format the the eMMC using kernel utility(fdisk, mke2fs) and that available in FileSystem.

[edit] Normal (existing) Linux Boot

Step-1 : ROM code transfers X-loader to SRAM and executes it.
Step-2 : X-Loader transfers U-Boot to DRAM and executes it.
Step-3 : U-Boot transfers the OS Kernel to DRAM and executes it.

[edit] eMMC RAW boot

Step-1 : ROM code reads 0th sector from eMMC device.
Step-2 : Check TOC, sets up SDRAM using configuration headers in the TOC.
Step-3 : ROM code reads 1st sector from eMMC device. 
Step-4 : Decode the length of the image and load address(SRAM) of the x-loader. And execute it.
Step-5 : X-Loader transfers U-Boot to DRAM and executes it.
Step-6 : U-boot reads Kernel from FAT partition to SDRAM and executes it.
Step-7 : Kernel reads Filesystem.

The Final destination of this RAW boot is to avoid the step-4 & step-5(as above). I.e. there is still a chance to kill x-loader completely and depend solely on bootloader.

Following sections discuss about the eMMC RAW boot Flashing Procedure

[edit] eMMC boot Procedure for 3630-SDP

1. S9 dip switch settings for MMC/SD boot: 0001 1111

2. Create the x-loader and u-boot for 3630-SDP

3. Add the TOC in x-loader
Use the Attached 'eMMC_raw_header' (size 512 bytes)– 
and add at beginning of the signed x-loader(MLO) => assume this new file name is “mlo-mmc2”.

'eMMC_raw_header' (right click and "save link as")

4. Copy the following files(in order) in bootable MMC/SD card
- u-boot.bin
- mlo-mmc2

5. Restart board to Boot from MMC/SD card 

6. Flashing(x-loader and u-boot) to eMMC device

mmc init 0
mmc init 1
fatload mmc 0  80000000 mlo-mmc2
mmc write.i 1 0x80000000 0 ${filesize}
fatload mmc 0 80000000 u-boot.bin
mmc write.i 1 0x80000000 80000 ${filesize}

mmc init 0
mmc init 1
fatload mmc 0 80000000 mlo-mmc2
mmc write 1 80000000 0 25
fatload mmc 0 80000000 u-boot.bin
mmc write 1 80000000 400 16B

7. Remove the MMC/SD card; Change the Dip-switch to boot from eMMC device and restart the SDP. 
S9 dip switch for eMMC boot: 1110 1111

[edit] eMMC boot Procedure for ZOOM3

1. H/W Modification in SOM board.

The desired SYS_BOOT configuration is:
SYS_BOOT[5:0]: 110001            USB -> UART3 -> MMC1 -> MMC2
Pullup Pulldown
SYS_BOOT[5]R73 R89
SYS_BOOT[3]R87 R44
SYS_BOOT[0]R86 R45
• All in RED color - resistors that should be installed according to the value
    given in the schematic. Although most of the SYS_BOOT resistors are 4.75 kohm, 
    2 are not: R73 (1 kohm), R44 (0 ohms).
• Other 6(not in red) need to removed.  

2. Create the x-loader and u-boot for ZOOM3

3. Same as step-3 for SDP
4. Same as step-4 for SDP
5. Same as step-5 for SDP
6. Same as step-6 for SDP

7. Remove the MMC/SD card; Change and restart the board

[edit] eMMC boot Procedure for OMAP4

For eMMC boot on the Blaze or Blaze Tablet, follow the instructions listed in the Release Notes, such as: http://omapedia.org/wiki/4AI.1.4-P1_OMAP4_Icecream_Sandwich_Release_Notes#Flashing_the_OMAP4_Hardware. More details about using Fastboot can be found on the page Android_Fastboot.

[edit] eMMC RAW boot & manage rest of space for user Data

eMMC device is a quite big size and full space is not required to hold the binaries. For example we have the following partition for each image

Start Offset in Hex Size in bytes
X-Loader 0 4*(64*2048)
U-Boot 0x80000 10*(64*2048)
Boot Env 0x1c0000 6*(64*2048)
Kernel 0x280000 40*(64*2048)
File System 0x780000 --rest---

For ZOOM2 and ZOOM3 rest of the space in eMMC(16GB, usable space ~15GB) device can be used as File System or Userspace. I.e. (15GB-7.5MB) ie. ~14.9GB can be use as a multiple pertitions(file system and user memory). Here is an sample 'eMMC_raw_header(2)' of having two partition (4GB and ~10GB), that required to add in MLO file :

Also this can be achive by following steps -
Step-1 : Boot from eMMC device as step mentioned above.
Step-2 : use /sbin/fdisk  to create the partiton(s).
        Disk /dev/mmcblk0: 15.9 GB, 15931539456 bytes
        255 heads, 63 sectors/track, 1936 cylinders
        Units = cylinders of 16065 * 512 = 8225280 bytes

                  Device Boot      Start       End    Blocks    Id   System
        /dev/mmcblk0p1               2          66      522112+  83  Linux
        /dev/mmcblk0p2              67        1936    15020775   83  Linux

Step-3 : format the partition (e.g. mkdosfs -F 32 /dev/mmcblk0p1).
Step-4 : Dont flash(eMMC - xloader/ u-boot) further.
Personal tools