Contents [hide]
Introduction
What is eMMC?eMMC describes an architecture consisting of an embedded storage solution with MMC interface, flash memory and controller.In one line it is a flash/nand over MMC interface. The OMAP processor follows a 2 stage boot process. Details on the boot procedure can be found at the [boot sequence] page. What is fastboot?
eMMC layout
Protective master boot recordThe master boot record is the first sector on the hard drive (LBA 0). As mentioned above, legacy BIOSes will boot from this sector. To protect the GUID partitions on the drive from legacy OSes, the MBR partition table normally contains a single partition entry of type 0xEE, filling the entire drive. GUID Partition Table (GPT)The second sector (LBA 1) contains the primary GPT header, followed immediately by 16K (32 sectors) of the primary GUID Partition Entry Array. In conformance with the EFI spec, another copy of these data should be located at the end of the disk as well, with the secondary GPT header in the last accessible sector and the secondary GUID Partition Entry Array immediately preceding it.In current implementation secondary GPT is not included. eMMC partition layout
Fastboot flowchartAdding a support on am37xevm for eMMC fastboot updateDownload patches for x-loader,u-boot and kernel
/* go to user directory */ $cd <MY_DIR> /* extract downloader patch files */ $tar -xzvf EMMC_patch_rev01.tar.gz x-loader build
/* download x-loader source if not available */ $git clone git:///rowboat/x-loader.git $cd x-loader /* checkout mentioned commit id */ $git checkout e6e39e34104f28b8bd62307971ab89e736cb9388 /* apply patch for raw boot */ $git am <MY_DIR>/EMMC_patch_rev01/x-loader/0001-eMMC-raw-boot-support-is-added.patch
$make CROSS_COMPILE=arm-eabi- distclean $make CROSS_COMPILE=arm-eabi- omap3evm_config $make CROSS_COMPILE=arm-eabi- This command will build the x-loader Image "x-load.bin"
To create the MLO file used for booting from a MMC/SD card, sign the x-loader image using the signGP tool found in the Tools/signGP directory of the Devkit. Note: you will need to copy the signGP tool from the Tools/signGP directory to the directory that contains the x-load.bin file $ ./signGP ./x-load.bin The signGP tool will create a .ift file, rename the x-load.bin.ift to MLO $ mv x-load.bin.ift MLO
$dd if=<eMMC_raw_header> of=./MLO.final $dd if=<MLO-Path>/MLO of=./MLO.final conv=notrunc oflag=append u-boot build
/* download u-boot source if not available */ $git clone git:///rowboat/u-boot.git $cd u-boot /* checkout mentioned commit id */ $git checkout 81c20af53410ac7201ee18de66579b758c94c970 /* apply patches for eMMC and fastboot updat*/ $git am <MY_DIR>/EMMC_patch_rev01/u-boot/0001-GPT-partition-creation.patch $git am <MY_DIR>/EMMC_patch_rev01/u-boot/0002-fastboot-support-for-eMMC-partition.patch $git am <MY_DIR>/EMMC_patch_rev01/u-boot/0003-eMMC-raw-boot-support-is-added.patch
$make CROSS_COMPILE=arm-eabi- distclean $make CROSS_COMPILE=arm-eabi- omap3_evm_config $make CROSS_COMPILE=arm-eabi- kernel build
/* download u-boot source if not available */ $git clone git:///rowboat/kernel.git $cd kernel /* checkout mentioned commit id, branch is:rowboat-kernel-2.6.37 */ $git checkout 1a12433ffdd56a2b87504b3fe5efdcb924c90553 /* apply patches for EFI and ext4 file system support*/ $git am <MY_DIR>/EMMC_patch_rev01/kernel/0001-enabling-ext4-and-EFI-file-system-support.patch
$make ARCH=arm CROSS_COMPILE=arm-eabi- distclean $make ARCH=arm CROSS_COMPILE=arm-eabi- omap3_evm_android_defconfig $make ARCH=arm CROSS_COMPILE=arm-eabi- uImage buid android file system
Prepare Imagesboot.img$mkdir <YOUR_PATH>/images $cd <YOUR_PATH>/images $cp <ANDROID_SOURCE>/kernel/arch/arm/boot/zImage .
on fs mount ext4 /dev/block/mmcblk0p6 /system wait ro mount ext4 /dev/block/mmcblk0p8 /data wait noatime nosuid nodev mount ext4 /dev/block/mmcblk0p7 /cache wait noatime nosuid nodev
$cd <ANDROID_SOURCE> $find out/target/product/omap3evm -name *.img -exec rm -f {} \; $make TARGET_PRODUCT=omap3evm OMAPES=5.x
$cp <ANDROID_SOURCE>/out/target/product/omap3evm/ramdisk.img . $cp <ANDROID_SOURCE>/out/host/linux-x86/bin/mkbootimg . $./mkbootimg --kernel zImage --ramdisk ramdisk.img --base 0x80000000 --cmdline "console=ttyO0,115200n8 androidboot.console=ttyO0 mem=256M root=/dev/ram0 rw initramfs=0x81000000,8M init=/init ip=off omap_vout.vid1_static_vrfb_alloc=y vram="2M" omapfb.vram=0:2M" -o boot.img system.img$cd <YOUR_PATH>/images /* creating 250MB, it can be configure as per need */ $dd if=/dev/zero of=./system.img bs=1M count=250 $mkfs.ext4 system.img $mkdir mnt-point $sudo mount -t ext4 -o loop system.img mnt-point/ $cp -rfp <ANDROID_SOURCE>/out/target/product/omap3evm/system/* mnt-point/ $sudo umount mnt-point userdata.img$cd <YOUR_PATH>/images /* creating 30MB, it can be configure as per need */ $dd if=/dev/zero of=./userdata.img bs=1M count=30 $mkfs.ext4 userdata.img $sudo mount -t ext4 -o loop userdata.img mnt-point/ $cp -rfp <ANDROID_SOURCE>/out/target/product/omap3evm/data/* mnt-point/ $cp -rfp <ANDROID_SOURCE>/out/target/product/omap3evm/root/data/* mnt-point/ $sudo umount mnt-point cache.img$cd <YOUR_PATH>/images /* creating 30MB, it can be configure as per need */ $dd if=/dev/zero of=./cache.img bs=1M count=30 $mkfs.ext4 cache.img Using FastbootCreating the GPT table on eMMC and flash raw images
#fastboot Fastboot entered...
/* locate fastboot in android filesystem */ $cd <ANDROID_SOURCE>/out/host/linux-x86/bin/ /* search for fastboot devices */ $./fastboot devices /* create GPT table on eMMC/SD card */ $./fastboot oem format /* flash all partitions: ./fastboot flash <name> <binary> */ /* flash xloader */ $./fastboot flash xloader ./MLO.final /* flash bootloader */ $./fastboot flash bootloader ./u-boot.bin /* flash boot image */ $./fastboot flash boot ./boot.img /* flash file system - system image */ $./fastboot flash system ./system.img /* flash user data */ $./fastboot flash userdata ./userdata.img /* flash cache partition */ $./fastboot flash cache ./cache.img /* reboot target */ $./fastboot reboot How to change GPT configuration
static struct partition partitions[] = { { "-", 128 }, { "xloader", 128 }, { "bootloader", 512 }, /* "misc" partition is required for recovery */ { "misc", 128 }, { "-", 384 }, { "recovery", 8*1024 }, { "boot", 8*1024 }, { "system", 256*1024 }, { "cache", 32*1024 }, { "userdata", 32*1024}, { "media", 0 }, { 0, 0 }, }; Technical Support and Product UpdatesFor further information or to report any problems, contact For community support join
|
|