之前分析过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. 字符串全排列(permutation)

    Reference: http://www.cnblogs.com/sujz/archive/2011/06/16/2082831.html 问题:给定字符串S,生成该字符串的全排列. 方法1:依次从 ...

  2. POJ 3277 City Horizon(扫描线+线段树)

    题目链接 类似求面积并..2Y.. #include <cstdio> #include <cstring> #include <string> #include ...

  3. html5调用手机摄像头,实现拍照上传功能

    今天做手机网站,想实现手机扫描二维码功能.首先实现在浏览器中调用手机摄像头,实现拍照功能并且把拍下的照片显示在页面并上传到服务器上,然后再在服务器端进行分析. 首先实现在浏览器中调用摄像头,当然用现在 ...

  4. Autoencoder

    AutoencoderFrom Wikipedia An autoencoder, autoassociator or Diabolo network[1]:19 is an artificial n ...

  5. NBOJv2 Problem 1009 蛤玮的魔法(二分)

    Problem 1009: 蛤玮的魔法 Time Limits:  1000 MS   Memory Limits:  65536 KB 64-bit interger IO format:  %ll ...

  6. 暑假训练round2 D: 好序列(Manacher)

    Problem 1061: 好序列 Time Limits:  1000 MS   Memory Limits:  65536 KB 64-bit interger IO format:  %lld  ...

  7. Redis 笔记与总结7 PHP + Redis 信息管理系统(用户信息的增删改查)

    1. PHP 连接 Redis 访问 redis 官方网站的 client 栏目:http://www.redis.io/clients#php,可以获取 redis 的 php 扩展. 其中 php ...

  8. PHP 设计模式 笔记与总结(1)命名空间 与 类的自动载入

    ① PHP 面向对象高级特性 ② 11 种 PHP 设计模式 ③ PSR-0,Composer,Phar 等最流行的技术 目标是掌握 PHP 各类设计模式,以及具备设计纯面向对象框架和系统的能力 [命 ...

  9. VIM常用快捷键~网页上查找

    转自~木枫林 转自~鸟哥的私房菜 第十章.vim 程序编辑器 第十章.vim 程序编辑器 最近更新日期:2009/08/20 2. vi 的使用 2.1 简易执行范例 2.2 按键说明 2.3 一个案 ...

  10. xml追加节点

    添加方法 public void XmlAppend(VisitM vm) { XmlDocument xmldoc = new XmlDocument(); string path = Server ...