xref: /OK3568_Linux_fs/buildroot/package/mfgtools/readme.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunMfgTools Howto
2*4882a593Smuzhiyun==============
3*4882a593Smuzhiyun
4*4882a593Smuzhiyun1. Build your mfgtool image
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunMake sure to enable the following Buildroot options:
7*4882a593Smuzhiyun
8*4882a593SmuzhiyunBR2_PACKAGE_FREESCALE_IMX=y
9*4882a593SmuzhiyunBR2_PACKAGE_IMX_UUC=y
10*4882a593SmuzhiyunBR2_TARGET_ROOTFS_CPIO=y
11*4882a593SmuzhiyunBR2_TARGET_ROOTFS_CPIO_GZIP=y
12*4882a593SmuzhiyunBR2_TARGET_ROOTFS_CPIO_UIMAGE=y
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunAlso modify your kernel configuration to have:
15*4882a593Smuzhiyun
16*4882a593SmuzhiyunCONFIG_USB_GADGET=y
17*4882a593SmuzhiyunCONFIG_USB_MASS_STORAGE=y
18*4882a593SmuzhiyunCONFIG_FSL_UTP=y
19*4882a593SmuzhiyunCONFIG_MMC_BLOCK_MINORS=16
20*4882a593Smuzhiyun
21*4882a593Smuzhiyun2. Go into the output and create the necessary folders
22*4882a593Smuzhiyun
23*4882a593Smuzhiyun$ cd output
24*4882a593Smuzhiyun$ mkdir -p "Profiles/Linux/OS Firmware/firmware"
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun3. Create your XML update script named ucl2.xml
27*4882a593Smuzhiyun
28*4882a593SmuzhiyunYou can find a sample XML at:
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun$ wget https://storage.googleapis.com/boundarydevices.com/ucl2.xml \
31*4882a593Smuzhiyun  -O Profiles/Linux/OS\ Firmware/ucl2.xml
32*4882a593Smuzhiyun
33*4882a593Smuzhiyun4. Copy the U-Boot, Kernel and initramfs images to the appropriate
34*4882a593Smuzhiyunfolder
35*4882a593Smuzhiyun
36*4882a593Smuzhiyun$ cp images/u-boot.imx images/zImage images/imx6q-sabrelite.dtb \
37*4882a593Smuzhiyun  images/rootfs.cpio.uboot Profiles/Linux/OS\ Firmware/firmware/
38*4882a593Smuzhiyun
39*4882a593Smuzhiyun5. Copy the prebuilt binaries to be flashed
40*4882a593Smuzhiyun
41*4882a593SmuzhiyunDepending on your ucl2.xml file, the sample doesn't flash anything.
42*4882a593Smuzhiyun
43*4882a593Smuzhiyun6. Run the MfgTools client:
44*4882a593Smuzhiyun
45*4882a593Smuzhiyun$ ./host/bin/mfgtoolcli -l mmc -s uboot_defconfig=imx \
46*4882a593Smuzhiyun  -s dtbname=imx6q-sabrelite.dtb -s initramfs=rootfs.cpio.uboot \
47*4882a593Smuzhiyun  -s mmc=1 -p 1
48*4882a593Smuzhiyun
49*4882a593SmuzhiyunFor more information about the tools options, please read the
50*4882a593Smuzhiyun"Manufacturing Tool V2 Quick Start Guide.docx" documentation contained
51*4882a593Smuzhiyunin every mfgtools package from NXP website[1].
52*4882a593Smuzhiyun
53*4882a593SmuzhiyunNote: All the above commands require your Linux host user to have
54*4882a593Smuzhiyunpermissions to access the USB devices. Please make sure to have udev
55*4882a593Smuzhiyunrules that allow the user to communicate with the BootROM IDs
56*4882a593Smuzhiyun(Freescale USB recovery) as well as the one used for the UTP Linux
57*4882a593Smuzhiyunimage (0x066F:0x37FF).  Using 'sudo' in front of the mfgtoolcli
58*4882a593Smuzhiyuncommand would also grant you the necessary permission but it is *not*
59*4882a593Smuzhiyunrecommended.
60*4882a593Smuzhiyun
61*4882a593SmuzhiyunAlso, if your U-Boot environment doesn't include mfgtools bootargs,
62*4882a593Smuzhiyunmake sure to set the following:
63*4882a593Smuzhiyun
64*4882a593Smuzhiyunsetenv bootargs "console=${console},${baudrate} g_mass_storage.stall=0 \
65*4882a593Smuzhiyun	g_mass_storage.removable=1 g_mass_storage.idVendor=0x066F \
66*4882a593Smuzhiyun	g_mass_storage.idProduct=0x37FF g_mass_storage.iSerialNumber=\"\" \
67*4882a593Smuzhiyun	g_mass_storage.file=/fat"
68*4882a593Smuzhiyun
69*4882a593Smuzhiyun[1] http://www.nxp.com/products/software-and-tools/software-development-tools/i.mx-software-and-tools/i.mx-6-series-software-and-development-tool-resources:IMX6_SW
70