Android gingerbread eMMC booting
| This page is currently under construction. The content of this page is due to change quite frequently and thus the quality and accuracy are not guaranteed until this message has been removed. Please feel free to contribute to this page while construction is in progress. |
Contents[hide] |
Introduction
- AM37xevm has on board NAND and MMC interface.Either interface can be used for booting a system.
- NAND boot is raw boot, as it reads raw data and manipulate it.
- MMC boot is FAT boot, as it reads file from mmc sector and manipulated it.
- eMMC boot can be FAT boot or raw boot.
- MMC and NAND boot is already supported by android devkit releases available at http://arowboat.org
- This wiki highlights on
- Adding eMMC support for fastboot
- Updating images to eMMC over fastboot
- eMMC boot
- Wiki will also act as porting guide to port eMMC support on other platforms.
Note: All patches described in
this documents are validated on Texas Intruments's AM37xevm board.
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?
- Fastboot is the method that android uses to flash the android build onto the target.
- Fastboot protocol specification is found HERE
- Fastboot speeds up your development NOT the time it takes to boot.
- Also,fastboot is used to updated x-loader,bootloader,kernel,systemfs,userdata etc. by oem
eMMC layout
- In the discussion that follows, “sector” refers to a 512-byte disk sector, addressed by its Logical Block Address (LBA). Although the UEFI specs allow for disk sectors of other sizes, in practice 512 bytes is the norm.
Protective master boot record
The 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
- GPT allows a large number of partitions on a drive.Choosing a parition scheme may vary across oem vendor.Partition scheme described here is most choosen by oem for mobile/handheld device.
| Partition# | Name# | Size# | Strat LBA-End LBR | Description# |
| 0 | MBR & GPT | 0x00000000-0x000000FF | Master Boot Record and GUID Partition Table | |
| 1 | x-loader(MLO) | 256KB | 0x00000100-0x000001FF | First stage bootloader |
| 2 | bootloader(u-boot.bin) | 384KB | 0x00000200-0x000005FF | Second stage bootloader |
| 3 | misc | 128KB | 0x00000600-0x000006FF | Reserved.This partition can be used for internal purpose |
| 4 | recovery (zImage + recovery-ramdisk.img) | 8MB | 0x00000A00-0x000049FF | recovery partition |
| 5 | boot (boot.img = zImage + ramdisk.img) | 8MB | 0x00004A00-0x000089FF | Partition contains kernel + ramdisk images. |
| 6 | system (system.img) | 256MB | 0x00008A00-0x000889FF | android file system |
| 7 | cache (cache.img) | 32MB | 0x00088A00-0x000989FF | Partition will be used to store application cache |
| 8 | userdata (userdata.img) | 32MB | 0x00098A00-0x000A89FF | Partition contains userdata supplied by oem vendor like configuration files,utilities etc.. |
| 9 | media | Remaining | 0x000A8A00-0x00762761 | Partition contains media files; supplied by oem vendor |
Fastboot flowchart
![]()
Adding a support on am37xevm for eMMC fastboot
update
Download patches for x-loader,u-boot and kernel
- Download patch files from [HERE]
/* go to user directory */
$cd <MY_DIR>
/* extract downloader patch files */
$tar -xzvf EMMC_patch_rev01.tar.gz
x-loader build
- Download source(if it is not downloaded) and apply patch
/* download x-loader source if not available */
$git clone git://gitorious.org/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
- Build x-loader
$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
- Append eMMC raw header
- Download eMMC raw header :'eMMC_raw_header' (right
click and "save link as")
- Download eMMC raw header :'eMMC_raw_header' (right
$dd if=<eMMC_raw_header> of=./MLO.final
$dd if=<MLO-Path>/MLO of=./MLO.final conv=notrunc oflag=append
u-boot build
- Download source(if it is not downloaded)and apply patch
/* download u-boot source if not available */
$git clone git://gitorious.org/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
- Build u-boot
$make CROSS_COMPILE=arm-eabi- distclean
$make CROSS_COMPILE=arm-eabi- omap3_evm_config
$make CROSS_COMPILE=arm-eabi-
kernel build
- Download source(if it is not downloaded)and apply patch
/* download u-boot source if not available */
$git clone git://gitorious.org/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
- Build kernel
$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
- Follow build step given at#[HERE]
Prepare Images
boot.img
$mkdir <YOUR_PATH>/images
$cd <YOUR_PATH>/images
$cp <ANDROID_SOURCE>/kernel/arch/arm/boot/zImage .
- Update init.rc file and rebuit images
- Add following lines to <ANDROID_SOURCE>/out/target/product/omap3evm/root/init.rc
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
- Rebuilt images
$cd <ANDROID_SOURCE>
$find out/target/product/omap3evm -name *.img -exec rm -f {} \;
$make TARGET_PRODUCT=omap3evm OMAPES=5.x
- Prepare boot.img
$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 Fastboot
Creating the GPT table on eMMC and flash
raw images
- Create mmc card for FAT boot mentioned at HERE
- On Target
- Connect target to host machine using USB cable.Connect USB cable to OTG port on target
- Boot target with a stock u-boot and MLO
- Prompt at u-boot and enter following command
#fastboot
Fastboot entered...
- On Host Machine
/* 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
- GPT configuration has been defined in "<ANDROID_PATH>/u-boot/board/ti/evm/mmc.c" as below. Kindly change as per need
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 Updates
For further information or to report any problems, contact
http://e2e.ti.com/android
http://support.ti.com
For community support join
http://groups.google.com/group/rowboat
For IRC #rowboat on irc.freenode.net
Android gingerbread eMMC booting的更多相关文章
- Android eMMC Booting
Android eMMC Booting Contents [hide] 1 eMMC binaries 1.1 Creating the GPT table 1.2 Modifying .IMG F ...
- Android MMC/EMMC/MTD Partition Layout
Android devices have a couple of partitions to store different data. The common ones are the recover ...
- In Depth : Android Boot Sequence / Process
In Depth : Android Boot Sequence / Process What happened when I press power on button in my Android ...
- Android Initializing a Build Environment
from://https://source.android.com/source/initializing.html#next-download-the-source Initializing a B ...
- Delphi XE5 常见问题解答
Delphi XE5 常见问题解答 有关于新即时试用的问题吗?请看看 RAD Studio 即时试用常见问答. 常见问题 什么是 Delphi? Embarcadero? Delphi? XE5 是易 ...
- 【转】Android-Input 按键字符映射文件&输入设备配置文件
https://source.android.com/devices/input/key-character-map-files 按键字符映射文件 按键字符映射文件(.kcm 文件)负责将 Andro ...
- 碎碎念android eMMC【转】
本文转载自:https://blog.csdn.net/Fybon/article/details/44242549 一./dev/blockroot@:/dev/block #ls bootdevi ...
- I.MX6 Android 5.1 回到 Android 4.2 emmc 启动
/*************************************************************************** * I.MX6 Android 5.1 回到 ...
- AM335x Android eMMC mkmmc-android.sh hacking
# AM335x Android eMMC mkmmc-android.sh hacking # # . 有空解读一下android的分区文件. # . 代码来源:https://github.com ...
随机推荐
- NYOJ-289 苹果 TLE 分类: NYOJ 2013-12-29 17:52 282人阅读 评论(0) 收藏
#include<stdio.h> struct apple{ int m; int v; }app[1010]; int money(int i,int v); int main(){ ...
- .NET设计模式(9):桥接模式(Bridge Pattern)(转)
概述 在软件系统中,某些类型由于自身的逻辑,它具有两个或多个维度的变化,那么如何应对这种“多维度的变化”?如何利用面向对象的技术来使得该类型能够轻松的沿着多个方向进行变化,而又不引入额外的复杂度?这就 ...
- smarty模板技术
一.什么是smarty?smarty是一个使用php写出来的模板php模板引擎,它提供了逻辑与外在内容的分离,简单的讲,目的就是要使用php程序员同美工分离,使用的程序员改变程序的逻辑内容不会影响到美 ...
- yum install 与 yum groupinstall 的区别
原文:http://blog.51yip.com/linux/1171.html yum 提供二种安装软件的方式 1,yum install 它安装单个软件,以及这个软件的依赖关系 2,yum gro ...
- 【面试题】Round A China New Grad Test 2014总结
我也有够懒的,今天才跑来写总结,自觉面壁中… 上一篇是Practice Round,今天是Round A,五道题. 每次做完都想说,其实题不难..但在做的过程中总是会各种卡,只有自己一行一行实现了,才 ...
- HDU3487 Play With Chains(Splay)
很裸的Splay,抄一下CLJ的模板当作复习,debug了一个下午,收获是终于搞懂了以前看这个模板里不懂的内容.以前用这个模板的时候没有看懂为什么get函数返回的前缀要加个引用,经过一下午的debug ...
- poj 1704
Georgia and Bob Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 7233 Accepted: 2173 D ...
- HDU 1828 / POJ 1177 Picture (线段树扫描线,求矩阵并的周长,经典题)
做这道题之前,建议先做POJ 1151 Atlantis,经典的扫描线求矩阵的面积并 参考连接: http://www.cnblogs.com/scau20110726/archive/2013/0 ...
- java与.net之间xml传递,xml最前面多了个?
最近做一个项目,是java提供webservice供.net调用.参数采用xml格式.首先碰到的问题: 1).net这边采用XmlSerializer 方式序列化对象传递给对方.对方在本机调试可以收到 ...
- eclipse加速
eclipse老是building workspace及自动更新问题,eclipse加速 最近用Eclipse开发oPhone的一个项目,每次打开Eclipse的时候,总是在build workspa ...