之前分析过mfgtool的内容,最近从官网下载,返现新版的mfgtool工具将imx6各种版本的linux/android都使用一个工具进行烧录。所以从新分析一下。

新版与旧版的一个区别是烧写使用的uboot后缀是.imx,而不是原来的.bin。以后缀.imx结尾的uboot在镜像开头1k的地方添加了IVT表。

本文分析的MFG_TOOL版本是:IMX6_L5.1_2.1.0_MFG_TOOL。

参考链接


http://www.cnblogs.com/helloworldtoyou/p/5730750.html

vbscript


首先双击对应的vbscript启动mfgtool工具。一般从vbs的名称就能够看出是烧录何种cpu以及存储设备的类型。例如:

mfgtool2-android-mx6q-sabresd-emmc.vbs

表示烧录的镜像运行的系统是android, cpu是mx6q, 存储设备类型为emmc.

详细分析如下:

Set wshShell = CreateObject("WScript.shell")
wshShell.run "mfgtool2.exe -c ""linux"" -l ""eMMC-Android"" -s ""board=sabresd"" -s ""folder=sabresd"" -s ""soc=6q"" -s ""mmc=3"" -s ""data_type="""
Set wshShell = Nothing 参数的含义:
-c: 芯片配置文件夹名称 linux
-l: list名称,对应ucl2.xml文件中的LIST标签的name,后面会说明。
-s: 变量名称, cfg.ini以及ucl2.xml中会用到。

cfg.ini


脚本运行, mfgtool工具启动,解读cfg.ini文件,上面的vbs脚本中的参数会覆盖cfg.ini文件中的参数。

[profiles]
chip = Linux [platform]
board = SabreSD # vbs中 -l ""eMMC-Android"" 已经制定为eMMC-Android,所以下面的LIST无效。
[LIST]
name = SDCard [variable]
board = sabresd
mmc = 0
sxuboot=17x17arm2
sxdtb=17x17-arm2
7duboot=sabresd
7ddtb=sdb
6uluboot=14x14ddr3arm2
6uldtb=14x14-ddr3-arm2
ldo=
plus=
initramfs=fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot
seek = 1
sxnor=qspi2
7dnor=qspi1
6ulnor=qspi1
nor_part=0

ucl2.xml


根据 vbs和cfg.ini文件中的参数指定的LIST名称,选择正确的操作进行进行烧录。

这个目录里面有很多文件,烧录的时候要用到的uboot,内核,文件系统到RAM中,运行

  • 首先烧录Profiles/Linux/OS Firmware/firmware文件夹的镜像到RAM中运行系统。

  • 系统运行之后烧录Profiles/Linux/OS Firmware/files/android/sabresd/中的镜像到emmc中

<!-- 首先判断不同芯片USB的vid和pid-->
<CFG>
<STATE name="BootStrap" dev="MX6SL" vid="15A2" pid="0063"/>
<STATE name="BootStrap" dev="MX6D" vid="15A2" pid="0061"/>
<STATE name="BootStrap" dev="MX6Q" vid="15A2" pid="0054"/>
<STATE name="BootStrap" dev="MX6SX" vid="15A2" pid="0071"/>
<STATE name="BootStrap" dev="MX6UL" vid="15A2" pid="007D"/>
<STATE name="BootStrap" dev="MX7D" vid="15A2" pid="0076"/>
<STATE name="Updater" dev="MSC" vid="066F" pid="37FF"/>
</CFG> <LIST name="eMMC-Android" desc="Choose eMMC as media"> <!-- 将两个%号之间的参数使用vbs脚本和cfg.ini文件中的值进行替换 --> <!-- file ="firmware/u-boot-imx6qsabresd_sd.imx" -- >
<CMD state="BootStrap" type="boot" body="BootStrap" file ="firmware/u-boot-imx6q%plus%%board%_sd.imx" ifdev="MX6Q">Loading U-boot</CMD>
<CMD state="BootStrap" type="boot" body="BootStrap" file ="firmware/u-boot-imx6dl%board%_sd.imx" ifdev="MX6D">Loading U-boot</CMD>
<CMD state="BootStrap" type="boot" body="BootStrap" file ="firmware/u-boot-imx6sx%board%_emmc.imx" ifdev="MX6SX">Loading U-boot</CMD>
<CMD state="BootStrap" type="boot" body="BootStrap" file ="firmware/u-boot-imx7d%7duboot%_sd.imx" ifdev="MX7D">Loading U-boot</CMD>
<CMD state="BootStrap" type="boot" body="BootStrap" file ="firmware/u-boot-imx6ul%6uluboot%_emmc.imx" ifdev="MX6UL">Loading U-boot</CMD> <!-- 下载镜像到CPU的RAM中直接运行,当系统跑起来之后再烧录镜像到EMMC中。不同的CPU型号下载的地址不同 -->
<CMD state="BootStrap" type="load" file="firmware/zImage" address="0x12000000"
loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6Q MX6D">Loading Kernel.</CMD>
<CMD state="BootStrap" type="load" file="firmware/zImage" address="0x80800000"
loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6SL MX6SX MX7D MX6UL">Loading Kernel.</CMD> <CMD state="BootStrap" type="load" file="firmware/%initramfs%" address="0x12C00000"
loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6Q MX6D">Loading Initramfs.</CMD>
<CMD state="BootStrap" type="load" file="firmware/%initramfs%" address="0x83800000"
loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6SL MX6SX MX7D MX6UL">Loading Initramfs.</CMD> <CMD state="BootStrap" type="load" file="firmware/zImage-imx6q%plus%-%board%%ldo%.dtb" address="0x18000000"
loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6Q">Loading device tree.</CMD>
<CMD state="BootStrap" type="load" file="firmware/zImage-imx6dl-%board%%ldo%.dtb" address="0x18000000"
loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6D">Loading device tree.</CMD> <CMD state="BootStrap" type="jump" > Jumping to OS image. </CMD> <!-- 烧录镜像到EMMC中 -->
<!-- create partition -->
<!-- 先对EMMC进行分区 -->
<CMD state="Updater" type="push" body="send" file="mksdcard-android%data_type%.sh.tar">Sending partition shell</CMD>
<CMD state="Updater" type="push" body="$ tar xf $FILE "> Partitioning...</CMD>
<!-- data_type = "" , mmc = '3' -->
<CMD state="Updater" type="push" body="$ sh mksdcard-android%data_type%.sh /dev/mmcblk%mmc%"> Partitioning...</CMD> <!-- burn uboot -->
<CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk%mmc% bs=1k seek=384 conv=fsync count=129">clear u-boot arg</CMD>
<CMD state="Updater" type="push" body="$ echo 0 > /sys/block/mmcblk%mmc%boot0/force_ro">access boot partition 1</CMD> <CMD state="Updater" type="push" body="send" file="files/android/%folder%/u-boot-imx%soc%%plus%.imx" >Sending u-boot.bin</CMD> <!-- 将uboot烧录到emmc的boot0分区,在系统盘符里分区的序号是从0开始,也就是boot0, boot1 --> <CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk%mmc%boot0 bs=512 seek=2">write U-Boot to sd card</CMD>
<CMD state="Updater" type="push" body="$ echo 1 > /sys/block/mmcblk%mmc%boot0/force_ro"> re-enable read-only access </CMD>
<!-- 将boot1分区使能,那么启动的时候就会从boot1分区启动,emmc寄存器序号是从1开始,boot1,boot2.这里的boot1就是指上面的boot0 -->
<CMD state="Updater" type="push" body="$ mmc bootpart enable 1 1 /dev/mmcblk%mmc%">enable boot partion 1 to boot</CMD> <CMD state="Updater" type="push" body="$ ls -l /dev/mmc* ">Formatting sd partition</CMD> <CMD state="Updater" type="push" body="send" file="files/android/%folder%/boot-imx%soc%%plus%%ldo%.img" >Sending and writting boot.img</CMD> <CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk%mmc%p1">write boot.img</CMD> <CMD state="Updater" type="push" body="$ mkfs.ext4 -E nodiscard /dev/mmcblk%mmc%p5">Formatting system partition</CMD>
<CMD state="Updater" type="push" body="$ mkfs.ext4 -E nodiscard /dev/mmcblk%mmc%p6">Formatting cache partition</CMD> <CMD state="Updater" type="push" body="$ mkfs.ext4 -E nodiscard /dev/mmcblk%mmc%p7">Formatting device partition</CMD>
<CMD state="Updater" type="push" body="$ mount -o remount,size=512M rootfs /">change size of tmpfs</CMD>
<CMD state="Updater" type="push" body="send" file="files/android/%folder%/system.img" >Sending system.img</CMD>
<CMD state="Updater" type="push" body="$ simg2img $FILE /dev/mmcblk%mmc%p5">writting sparse system.img</CMD> <!-- Write userdata.img is optional, for some customer this is needed, but it's optional. -->
<!-- Also, userdata.img will have android unit test, you can use this to do some auto test. -->
<!-- <CMD state="Updater" type="push" onError="ignore" body="pipe dd of=/dev/mmcblk0p7" file="file/android/userdate.img"> Sending userdata.img(optional) </CMD>
<CMD state="Updater" type="push" body="frf">flush the memory.</CMD> -->
<CMD state="Updater" type="push" body="pipe dd of=/dev/mmcblk%mmc%p2 bs=512" file="files/android/%folder%/recovery-imx%soc%%plus%%ldo%.img">Sending and writting recovery.img</CMD> <CMD state="Updater" type="push" body="$ sync">Sync file system</CMD>
<CMD state="Updater" type="push" body="frf">Finishing rootfs write</CMD> <CMD state="Updater" type="push" body="$ echo Update Complete!">Done</CMD> </LIST>

Tony Liu

2016-11-11, Shenzhen

imx6 MFG TOOL 分析的更多相关文章

  1. imx6 lvds 代码分析

    查看imx6 kernel中lvds设备和驱动的初始化过程. 相关文档: arm/arm/mach-mx6/board-mx6q_sabresd.c kernel/drivers/video/mxc/ ...

  2. [IMX6]Android6.0移植和分析

    0. 知识点 中断(设备树) [IMX6]设备树分析--dts 1. 编译 Android6.0内核移植(1):分析编译日志 Android6.0内核移植(2):kernel编译内核 单独烧录kern ...

  3. jBPM4.4 no jBPM DB schema: no JBPM4_EXECUTION table. Run the create.jbpm.schema target first in the install tool.

    jBPM4.4 no jBPM DB schema: no JBPM4_EXECUTION table. Run the create.jbpm.schema target first in the ...

  4. imx6 u-boot.bin 和 u-boot.imx

    有些MFG TOOL烧录工具使用了u-boot.imx,而不是原来的u-boot.bin文件进行烧录. 这两个镜像的区别是,u-boot.bin文件编译后,会在u-boot.bin的开头添加一个大小为 ...

  5. Java内存泄露分析和解决方案及Windows自带查看工具

    Java内存泄漏是每个Java程序员都会遇到的问题,程序在本地运行一切正常,可是布署到远端就会出现内存无限制的增长,最后系统瘫痪,那么如何最快最好的检测程序的稳定性,防止系统崩盘,作者用自已的亲身经历 ...

  6. I.MX6 Manufacturing Tool V2 (MFGTool2) Update Command List (UCL) User Guide translate

    Manufacturing Tool V2 (MFGTool2) Update Command List (UCL) User Guide Contents(目录) Contents(目录)     ...

  7. 对freescale的mfgtool的ucl2.xml的理解

    转载于此:http://blog.csdn.net/bugouyonggan/article/details/8664898 对于Freescale MFG编程工具控制文件ucl2.xml的分析 为了 ...

  8. emmc boot1 boot2 partition

    使用mfg tool烧写android5.1的镜像之后,再使用旧版的mfg tool烧写linux或者android镜像,都不能正常启动,而且运行的uboot还是android5.1版本的uboot. ...

  9. 【.Net平台下插件开发】-MEF与MAF初步调研

    背景   Team希望开发一个插件的平台去让某搜索引擎变得更好.主要用于采集一些不满意信息(DSAT)给Dev.这些信息会由不同的team提供不同的 tool分析.有的提供仅仅是一个website,有 ...

随机推荐

  1. freemarker 直接使用List来遍历set集合,可能会报错

    转摘:http://www.javaweb1024.com/java/JavaWebzhongji/2015/04/08/528.html freemarker  直接使用List来遍历set集合,可 ...

  2. Dynamic Expression.Call Any

    public class Foo { public IList<string> Strings { get; set; } } class Program { static void Ma ...

  3. sql2005 全文索引

    1.打开全文索引 一.检查服务里面带有Full-text字样的服务是否存在并开启! [](http://images2015.cnblogs.com/blog/23017/201611/23017-2 ...

  4. eclipse远程调试

    -Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:8000Eclipse 菜单上的 Window > Preferences > ...

  5. div居中(内容+元素:水平+垂直)

    内容水平居中 text-align: center; 内容垂直居中 /*第一种 行内垂直居中*/ height: 43px; line-height:43px; /*我们将行距增加到和整个div一样高 ...

  6. 彻底搞清楚字符编码: ASCII, ISO_8859, GB2312,UCS, Unicode, Utf-8

    彻底搞清楚字符编码: ASCII, ISO_8859, GB2312,UCS, Unicode, U 1.ASCII: 0-127(128-255未使用),美国标准 2.IS0-8859-1(lati ...

  7. [听听音乐]love is blue

    在朋友圈里听到这首歌,好像是中央台天气预报用过的背景音乐.百度了一下,大致如下: 1967年,在维也纳举行的欧洲电视歌唱大赛,卢森堡歌手薇基·琳德洛丝(Vicky Leandros)演唱了一首由彼埃尔 ...

  8. 3DMark Sky Driver

    Futuremark今天宣布,3DMark Sky Diver测试场景已经正式发布,现有用户可以免费更新. 3DMark的十几年历史上,这是第一次为某个版本增加全新的测试场景.升级后的3DMark版本 ...

  9. 实现ScrollView中包含ListView,动态设置ListView的高度

    ScrollView 中包含 ListView 的问题 : ScrollView和ListView会冲突,会导致ListView显示不全 <?xml version="1.0" ...

  10. PHP 随机显示

    <?php  print_r(    array_rand(      array(        "新春快乐"=>"",        " ...