iMx53开发


fastboot烧写
首先进入uboot命令行
setenv fastboot_dev mmc0
fas
然后在dos
按照需要烧写:
fastboot flash bootloader \\192.168.40.243\work\imx_r10.2_myandroid\bootable\bootloader\uboot-imx\u-boot-no-padding.bin
fastboot flash bootloader \\192.168.40.243\work\lhyz\myandroid-r94-ok\bootable\bootloader\uboot-imx\u-boot-no-padding.bin
fastboot flash bootloader \\192.168.40.243\work\imx_r10.2_myandroid\bootable\bootloader\uboot-imx\u-boot.bin

fastboot flash kernel \\192.168.40.243\work\lhyz\myandroid-r9.2.1\kernel_imx\arch\arm\boot\uImage
fastboot flash system \\192.168.40.243\work\lhyz\myandroid-r9.2.1\out\target\product\imx51_bbg\system.img
fastboot flash uramdisk \\192.168.40.243\work\lhyz\myandroid-r9.2.1\out\target\product\imx51_bbg\uramdisk.img
fastboot flash userdata \\192.168.40.243\work\lhyz\myandroid-r9.2.1\out\target\product\imx51_bbg\userdata.img
fastboot flash kernel \\192.168.40.243\work\lhyz\myandroid-r94-ok\kernel_imx\arch\arm\boot\uImage
fastboot flash kernel \\192.168.40.243\work\lhyz\kernel_imx_r92\arch\arm\boot\uImage
fastboot flash kernel \\192.168.40.243\work\lhyz\kernel_imx_t3\arch\arm\boot\uImage
fastboot flash kernel \\192.168.40.243\work\lhyz\kernel_imx_1064\arch\arm\boot\uImage
fastboot flash uramdisk \\192.168.40.243\work\lhyz\myandroid-r94-ok\out\target\product\imx51_bbg\uramdisk.img
fastboot flash uramdisk \\192.168.0.100\share\903\image\t3\uramdisk.img
fastboot flash system \\192.168.0.100\share\903\image\t3\system.img
fastboot flash system \\192.168.0.100\share\903\image\wei\0820\system.img
fastboot flash uramdisk \\192.168.0.100\share\903\image\wei\0820\uramdisk.img
fastboot flash userdata \\192.168.40.243\work\lhyz\t3_image\userdata.img
烧完后重启
fastboot reboot

setenv bootargs_android 'console=ttymxc0 video=mxcdi0fb:RGB24,720P60 video=mxcdi1fb:RGB565,1024x768M@55 di1_primary gpu_memory=32M ip=off root=/dev/nfs init=/init nfsroot=192.168.0.10:/nfs/rootfs ip=192.168.0.100::::usb0 androidboot.console=ttymxc0 '


git 常用命令
./repo init -u git://192.168.1.25/platform/manifest.git -b r10.2_t4 //初始化
git reset --hard ORIG_HEAD //回退到原始版本
git pull          //从服务器更新代码到本地

一、打tag的命令是先hard reset到自己模块(包含自己和组员)最后一次提交的位置,然后git tag tagname。Tagname的取法要统一,小项目名+完成阶段+日期。比如bsp完成了第二阶段的目标(7月6号的阶段目标),就可以命令tag为bsp-phase2-20110630
如果碰到没有全部完成,但是需要进release测试的,就把tag冠名ongoing, 如bsp-ongoing-20110630
如果碰到完成了某个bugfix,就 把BUG Number包含进去,如bsp-PRxxx-20110630 (PR指ProblemResolve,xxx指bug在JIRA系统里的编号)

二、上传tag的命令是git push review --tags
一、tag的命名加一个“工程名”的字段即 “工程名-小项目名-完成阶段-日期”;这样曾良均做整合版本的时候就知道android下有哪些工程有了需要包含的修改;

二、打tag可以指定位置,命令格式为git tag tagname commit,如git tag kernel_imx-pwrsave-phase2-20110631 cd8c0beb9ecec5e68c0535a416aea972d5f67251

三、上传某个特定tag的命令是git push review tagname.这样可以避免把本地自己命名的tag误传到服务器。


#uboot读取seltest uramdisk改成3M
setenv bootcmd_selftest 'mmc read 1 ${loadaddr} 0x3800 0x2000;mmc read 1 ${rd_loadaddr} 0x5800 0x2000;'

setenv bootargs 'console=ttymxc0 init=/linuxrc androidboot.console=ttymxc0 video=mxcdi0fb:RGB666,XGA ldb=di0 di0_primary ip=off gpu_nommu,gpu_memory=64M'

#写乱mmc uboot参数区,可清除所有变量,用默认设置
mmc write 0 91000000 600 10

sf probe 0:1
sf erase d0000 1000


#SD卡启动Android时,默认讲system挂载为只读,把system挂载为可读可写模式,在kernel串口命令行下打入如下命令:
mount -o remount -rw /dev/block/mmcblk1p2 /system
mount -o remount -rw /dev/block/mmcblk0p2 /system


git review服务器:192.168.1.25
git发邮件脚本: /home/git/repositories/android/platform/bionic.git/hooks/post-receive

mx51 903 uboot参数:

setenv bootcmd 'run bootcmd_SD1 bootcmd_SD2'


setenv bootcmd_SD1 'run bootargs_base bootargs_android'


setenv bootcmd_SD2 'mmc read 0 ${loadaddr} 0x800 0x1800;mmc read 0 ${rd_loadaddr} 0x3000 0x800;bootm ${loadaddr} ${rd_loadaddr}'


setenv bootargs_base 'setenv bootargs console=ttymxc0,115200'


setenv bootargs_android 'setenv bootargs ${bootargs} init=/init androidboot.console=ttymxc0 video=mxcdi0fb:RGB24,720P60 video=mxcdi1fb:RGB565,1024x768M@55 di1_primary gpu_memory=32M'


setenv loadaddr '0x90800000'


setenv rd_loadaddr '0x90C00000'


setenv netdev 'eth0'


setenv ethprime 'FEC0'


setenv uboot_addr '0xa0000000'


setenv uboot 'u-boot.bin'


setenv kernel 'uImage'


setenv rd_loadaddr '0x90C00000'


setenv nfsroot '/opt/eldk/arm'


setenv bootargs_base 'setenv bootargs console=ttymxc0,115200 gpu_memory=16M'


setenv bootargs_nfs 'setenv bootargs ${bootargs} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp'


setenv bootcmd_net 'run bootargs_base bootargs_nfs; tftpboot ${loadaddr} ${kernel}; bootm'


setenv prg_uboot 'tftpboot ${loadaddr} ${uboot}; protect off ${uboot_addr} 0xa003ffff; erase ${uboot_addr} 0xa003ffff; cp.b ${loadaddr} ${uboot_addr} ${filesize};'


setenv bootcmd 'run bootcmd_SD'


setenv bootcmd_SD 'run bootargs_base bootargs_android;mmc read 0 ${loadaddr} 0x800 2000;mmc read 0 ${rd_loadaddr} 0x3000 0x258;bootm ${loadaddr}'


setenv bootargs_android 'setenv bootargs ${bootargs}  androidboot.console=ttymxc0 init=/init di1_primary calibration'


setenv bootcmd_android_recovery 'run bootargs_base bootargs_android_recovery;mmc read 0 ${loadaddr} 0x800 0x2000;bootm'


setenv bootargs_android_recovery 'setenv bootargs ${bootargs} init=/init root=/dev/mmcblk0p4 rootfs=ext4 di1_primary '


setenv stdin 'serial'


setenv stdout 'serial'


setenv stderr 'serial'


setenv ethact 'FEC0'


mx51 uboot参数:

setenv bootdelay '1'

setenv loadaddr '0x90800000'

setenv rd_loadaddr '0x90B00000'

setenv crc_mode '0'

setenv kernel_mode ''

setenv ubootversion 'uboot_version=05/04/11'

setenv bootcmd 'run bootcmd_nand'

setenv nand_read_kernel 'nand read ${loadaddr} 0x0 0x500000'

setenv nand_read_rd 'nand read ${rd_loadaddr} 0x500000  0x200000'

setenv bootcmd_nand 'run bootargs_base bootargs_android bootargs_nand; run nand_read_kernel; run nand_read_rd; bootm ${loadaddr} ${rd_loadaddr}'

setenv bootargs_base 'setenv bootargs console=ttymxc0,115200'

setenv bootargs_nand 'setenv bootargs ${bootargs} ubi.mtd=4'

setenv bootargs_android 'setenv bootargs ${bootargs} init=/init androidboot.console=ttymxc0 ${ubootversion} ${kernel_mode} video=mxcdi0fb:RGB24,800x600M@60 video=mxcdi1fb:YUV444,720P60 tve di1_primary'

setenv netdev 'eth0'

setenv ethprime 'FEC0'

setenv uboot_addr '0xa0000000'

setenv uboot 'u-boot.bin'

setenv kernel 'uImage'

setenv nfsroot '/opt/eldk/arm'

setenv bootargs_nfs 'setenv bootargs ${bootargs} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp'

setenv bootcmd_net1 'run bootargs_base bootargs_nfs; tftpboot ${loadaddr} ${kernel}; bootm '

setenv bootcmd_net '${bootcmd_net1} mmcinit;cp.b 0x100000 ${loadaddr} 0x250000; cp.b 0x400000 ${rd_loadaddr} 0x4B000; bootm ${loadaddr} ${rd_loadaddr}'

setenv prg_uboot1 'tftpboot ${loadaddr} ${uboot}; protect off ${uboot_addr} 0xa003ffff; '

setenv prg_uboot '${prg_uboot1} erase ${uboot_addr} 0xa003ffff; cp.b ${loadaddr} ${uboot_addr} ${filesize}; bootargs=console=ttymxc0,115200 ip=dhcp mem=480M init=/init wvga calibration'

setenv bootcmd_SD1 'run bootargs_base bootargs_android bootargs_SD'

setenv bootcmd_SD2 'mmc read 0 ${loadaddr} 0x800 0x1800;mmc read 0 ${rd_loadaddr} 0x2000 0x1000;bootm ${loadaddr} ${rd_loadaddr}'

setenv bootargs_SD 'setenv bootargs ${bootargs}'

setenv mtdparts 'mtdparts=nand0:0x500000@0x0(KERNEL),0x200000@0x500000(RAMDISK),0x100000@0x700000(MISC),0x1400000@0x800000(RECOVERY),-@0x1c00000(ROOT)'

setenv mtdids 'nand0=nand0'

setenv partition 'nand0,4'

setenv mtddevnum '4'

setenv mtddevname 'ROOT'

setenv ethact 'FEC0'

saveenv

 


mx51 R10.1 SD卡启动 uboot参数:

setenv loadaddr '0x90800000'

setenv rd_loadaddr '0x90D00000'

setenv bootargs 'console=ttymxc0,115200'

setenv bootargs_android 'init=/init root=/dev/mmcblk0p2 rootfstype=ext4 console=ttymxc0,115200 gpu_memory=16M androidboot.console=ttymxc0 video=mxcdi0fb:800x600M@60 ${ubootversion} ${kernel_mode} di1_primary'

setenv bootargs_base 'init=/init root=/dev/mmcblk0p2 rootfstype=ext4 console=ttymxc0,115200 gpu_memory=16M androidboot.console=ttymxc0 video=mxcdi0fb:800x600M@60 ${ubootversion} ${kernel_mode} di1_primary`

setenv bootcmd_SD1 'mmc read 0 ${loadaddr} 0x800 0x2000'

setenv bootcmd_SD2 'mmc read 0 ${rd_loadaddr} 0x3000 0x300;bootm ${loadaddr} ${rd_loadaddr}'

setenv bootcmd 'run bootcmd_SD1 bootcmd_SD2'

saveenv


mx53 uboot参数:
setenv baudrate '115200'
setenv loadaddr '0x70800000'
setenv netdev 'eth0'
setenv ethprime 'FEC0'
setenv uboot 'u-boot.bin'
setenv kernel 'uImage'
setenv loadaddr '0x70800000'
setenv rd_loadaddr '0x70D00000'
setenv nfsroot '/opt/eldk/arm'
setenv bootargs_base 'setenv bootargs console=ttymxc0,115200'
setenv bootargs_nfs 'setenv bootargs ${bootargs} root=/dev/nfs init=/init nfsroot=192.168.0.10:/nfs/rootfs ip=192.168.0.100::::usb0 console=ttymxc0,115200 console=tty0,v3,tcp'
setenv bootargs_android 'setenv bootargs ${bootargs} androidboot.console=ttymxc0 init=/init di1_primary video=mxcdi1fb:RGB666,XGA hdmi ldb=di1 gpu_memory=32M'
setenv bootcmd 'run bootcmd_SD; bootm ${loadaddr} ${rd_loadaddr}'
setenv bootcmd_eMMC 'run bootargs_base bootargs_android;mmc read 1 ${loadaddr} 0x800 2000;mmc read 1 ${rd_loadaddr} 0x3000 0x258;bootm ${loadaddr} ${rd_loadaddr}'
setenv bootcmd_net 'run bootargs_base bootargs_nfs; tftpboot ${loadaddr} ${kernel}; bootm'
setenv bootcmd_android_recovery 'run bootargs_base bootargs_android_recovery;mmc read 0 ${loadaddr} 0x800 0x2000;bootm
bootargs_android_recovery=setenv bootargs ${bootargs} init=/init root=/dev/mmcblk0p4 rootfs=ext4'
setenv bootargs 'console=ttymxc0 init=/init androidboot.console=ttymxc0 video=mxcdi0fb:RGB666,XGA ldb=di0 di0_primary ip=off gpu_nommu,gpu_memory=64M'
setenv ethact 'FEC0'
setenv bootcmd_SD 'mmc read 0 ${loadaddr} 0x800 0x2000; mmc read 0 ${rd_loadaddr} 0x3000 0x1000;'
setenv stdin 'serial'
setenv stdout 'serial'
setenv stderr 'serial'

saveenv

NFS启动:
setenv bootcmd 'run bootcmd_eMMC; bootm ${loadaddr} ${rd_loadaddr}'
setenv bootargs_base 'setenv bootargs ${bootargs} root=/dev/nfs init=/init nfsroot=192.168.0.10:/nfs/rootfs ip=192.168.0.100::::usb0'
setenv bootargs 'console=ttymxc0 video=mxcdi0fb:RGB666,vga ldb=di0 di0_primary ip=off gpu_nommu,gpu_memory=64M root=/dev/nfs init=/init nfsroot=192.168.0.10:/nfs/rootfs ip=192.168.0.100::::usb0 androidboot.console=ttymxc0 '
setenv bootargs 'console=ttymxc0 di1_primary video=mxcdi1fb:RGB666,VGA-SVGA ldb=di1 gpu_memory=32M ip=off root=/dev/nfs init=/init nfsroot=192.168.0.10:/nfs/rootfs ip=192.168.0.100::::usb0 androidboot.console=ttymxc0 '
903 nfs:
setenv bootargs_nfs 'setenv bootargs ${bootargs} ip=off root=/dev/nfs init=/init nfsroot=192.168.0.10:/nfs/rootfs ip=192.168.0.100::::usb0,v3,tcp'

setenv bootargs_android 'setenv bootargs ${bootargs} ${bootargs_nfs} video=mxcdi0fb:RGB24,720P60 video=mxcdi1fb:RGB565,1024x768M@55 di1_primary gpu_memory=32M androidboot.console=ttymxc0 '

 
imx53_smd开发板uboot参数:
setenv ethaddr 00:04:9f:00:ea:d3
setenv fec_addr 00:04:9f:00:ea:d3
setenv loadaddr 0x70800000         
setenv rd_loadaddr 0x70D00000      
setenv bootcmd 'run bootcmd_SD; bootm ${loadaddr} ${rd_loadaddr}'
setenv bootcmd_SD 'mmc read 0 ${loadaddr} 0x800 0x3000; mmc read 0 ${rd_loadaddr} 0x3000 0x300;'
setenv bootargs 'console=ttymxc0,115200 init=/init androidboot.console=ttymxc0 video=mxcdi1fb:RGB666,XGA ldb=di1 di1_primary ip=off gpu_memory=64M'
saveenv

setenv bootcmd_SD 'mmc read 0 ${loadaddr} 0x800 0x2000; mmc read 0 ${rd_loadaddr} 0x3000 0x1000;'

格式化SD卡
sudo mkfs.vfat /dev/sdb1
sudo mkfs.ext4 /dev/sdb2 -O ^extent -L system
sudo mkfs.ext4 /dev/sdb4 -O ^extent -L recovery
sudo mkfs.ext4 /dev/sdb5 -O ^extent -L data
sudo mkfs.ext4 /dev/sdb6 -O ^extent -L cache
复制系统文件到SD卡
sudo dd if=u-boot.bin of=/dev/sdb bs=1K skip=1 seek=1; sync
sudo dd if=uImage of=/dev/sdb bs=1M seek=1; sync
sudo dd if=SD/uramdisk.img of=/dev/sdb bs=1M seek=6; sync
sudo dd if=SD/system.img of=/dev/sdb2 bs=128k; sync

sudo dd if=/home/bill/work/mx53/r10.2_t4/kernel_imx/arch/arm/boot/uImage of=/dev/sdb bs=1M seek=1; sync
sudo dd if=/home/bill/work/mx53/r10.2_t4/out/target/product/imx53_smd/uramdisk.img of=/dev/sdb bs=1M seek=6; sync
sudo dd if=/home/bill/work/mx53/r10.2_t4/out/target/product/imx53_smd/recovery.img of=/dev/sdb4; sync
sudo dd if=/home/bill/work/mx53/r10.2_t4/out/target/product/imx53_smd/system.img of=/dev/sdb2 bs=128k; sync

 

logcat -b radio &

#创建视频需要的节点
mknod /dev/null c 1 3
/bin/busybox mknod /dev/fb0 c 29 0
/bin/busybox mknod /dev/fb1 c 29 1
/bin/busybox mknod /dev/fb2 c 29 2
mknod /dev/video0 c 81 0
mknod /dev/video16 c 81 1

./mxc_v4l2_overlay.out -iw 800 -ih 480 -ow 800 -oh 480 -it 20 -il 140 -r 0 -fr 30 -fg -t 10
/unit_tests/mxc_v4l2_overlay.out -iw 800 -ih 480 -ow 720 -oh 480 -it 0 -il 0 -r 0 -fr 30 -fg -t 1200

rm /dev/tty
ln -s /dev/ttymxc0 /dev/tty
/data/t232

#初始化MCU
hffaa8001010a
hffaa8001010a
hffaa8101010a

#切换到DVD模式
hffaa8d01010a
hffaa8e00010a

hffaa8d05010a

#切换到ARM模式
hffaa8d0a010a
hffaa8e00010a

#调节功放音量
hffaa8b08180a

#蓝牙电源
echo 1 > /sys/class/rfkill/rfkill0/state

#调试摄像头
adb push \\192.168.40.248\work\zh\camera\rgb_4p\rgb_4p system/bin
chmod 777 /system/bin/rgb_4p
rgb_4p 320 240 16 0 0


\\192.168.40.248\work\zh\myandroid_R9\bootable\bootloader\uboot-imx-nand\u-boot.bin
\\192.168.40.248\work\zh\myandroid_R9\kernel_imx\arch\arm\boot\uImage
\\192.168.40.248\work\zh\myandroid_R9\out\target\product\imx51_bbg\android_root.img
\\192.168.40.248\work\zh\myandroid_R9\out\target\product\imx51_bbg\uramdisk.img

\\192.168.0.97\all\home\hui\myandroid_R9\trunk\kernel_imx\arch\arm\boot\uImage
\\192.168.0.97\all\home\hui\myandroid_R9\trunk\out\target\product\imx51_bbg\android_root.img

#用ATK工具烧写文件到nand
00000000 uboot
00300000 uImage
00600000 uramdisk
00800000 android_recovery //注意,有分2k page和4k page,打包方法如下介绍
01C00000 android_root //注意,有分2k page和4k page,打包方法如下介绍

#删除触摸屏校准文件,开机重新校准
rm /data/system/calibration

打包成uboot可识别的内核:
mkimage -A arm -O linux -T kernel -C none -a 0x90008000 -e 0x90008000 -n "Android Linux Kernel" -d arch/arm/boot/Image arch/arm/boot/uImage_nozip

在Android下打包uboot可识别的uramdisk:
out/host/linux-x86/bin/mkbootfs out/target/product/imx51_bbg/root | out/host/linux-x86/bin/minigzip > out/target/product/imx51_bbg/ramdisk.img
bootable/bootloader/uboot-imx/tools/mkimage  -A arm -O linux -T ramdisk -C none -a 0x90308000 -n "Android Root Filesystem" -d out/target/product/imx51_bbg/ramdisk.img out/target/product/imx51_bbg/uramdisk.img
#mx53
out/host/linux-x86/bin/mkbootfs out/target/product/imx53_smd/rootfs | out/host/linux-x86/bin/minigzip > out/target/product/imx53_smd/ramdisk.img
bootable/bootloader/uboot-imx/tools/mkimage  -A arm -O linux -T ramdisk -C none -a 0x70308000 -n "Android Root Filesystem" -d out/target/product/imx53_smd/ramdisk.img out/target/product/imx53_smd/uramdisk.img

在Android下打包SD卡启动的system.img:
【1】解压SD卡格式的system.img到目录abc,
mkdir abc
sudo mount system.img -o loop abc/
【2】把需要修改的内容复制到abc,如开机动画bootanimation.zip
cp bootanimation.zip abc/media
【3】直接sudo umount abc/ 即可
或者
【3】把abc目录打包回system.img
num_blocks=`du -sk out/target/product/imx51_bbg/abc | tail -n1 | awk '{print $1;}'`; if [ $num_blocks -lt 20480 ]; then extra_blocks=3072; else extra_blocks=20480; fi ; if [ "" != "" ]; then num_blocks=; num_inodes=4096; else num_blocks=`expr $num_blocks + $extra_blocks` ; num_inodes=`find out/target/product/imx51_bbg/system | wc -l` ; num_inodes=`expr $num_inodes + 500`; fi; out/host/linux-x86/bin/genext2fs -a -d out/target/product/imx51_bbg/system -b $num_blocks -N $num_inodes -m 0 out/target/product/imx51_bbg/obj/PACKAGING/systemimage_unopt_intermediates/system.img;
tune2fs -L system out/target/product/imx51_bbg/obj/PACKAGING/systemimage_unopt_intermediates/system.img
tune2fs -j out/target/product/imx51_bbg/obj/PACKAGING/systemimage_unopt_intermediates/system.img
tune2fs -O uninit_bg,dir_index out/target/product/imx51_bbg/obj/PACKAGING/systemimage_unopt_intermediates/system.img
tune2fs -C 1 out/target/product/imx51_bbg/obj/PACKAGING/systemimage_unopt_intermediates/system.img
e2fsck -fyD out/target/product/imx51_bbg/obj/PACKAGING/systemimage_unopt_intermediates/system.img ;
out/host/linux-x86/bin/acp -fpt out/target/product/imx51_bbg/obj/PACKAGING/systemimage_unopt_intermediates/system.img out/target/product/imx51_bbg/system.img


在Android下打包UBI文件系统android_root.img,android_recovery.img:
#2K page:
out/host/linux-x86/bin/mkfs.ubifs -d out/target/product/imx51_bbg/system -o out/target/product/imx51_bbg/obj/PACKAGING/systemimage_unopt_intermediates/system.img -m 2048 -e 129024 -c 2048 -x none
out/host/linux-x86/bin/acp -fpt out/target/product/imx51_bbg/obj/PACKAGING/systemimage_unopt_intermediates/system.img out/target/product/imx51_bbg/system.img
out/host/linux-x86/bin/mkfs.ubifs -d out/target/product/imx51_bbg/data -o out/target/product/imx51_bbg/userdata.img -m 2048 -e 129024 -c 2048 -x none
out/host/linux-x86/bin/ubinize -o out/target/product/imx51_bbg/android_root.img -m 2048 -p 128KiB -s 512 -O 512 out/target/product/imx51_bbg/ubinize.ini
out/host/linux-x86/bin/mkfs.ubifs -d out/target/product/imx51_bbg/recovery/root -o out/target/product/imx51_bbg/recovery.img -m 2048 -e 129024 -c 2048 -x none
out/host/linux-x86/bin/ubinize -o out/target/product/imx51_bbg/android_recovery.img -m 2048 -p 128KiB -s 512 -O 512 out/target/product/imx51_bbg/ubinize_reco.ini

#4K page:
out/host/linux-x86/bin/mkfs.ubifs -d out/target/product/imx51_bbg/system -o out/target/product/imx51_bbg/obj/PACKAGING/systemimage_unopt_intermediates/system.img -m 4096 -e 516096 -c 4096 -x none
out/host/linux-x86/bin/acp -fpt out/target/product/imx51_bbg/obj/PACKAGING/systemimage_unopt_intermediates/system.img out/target/product/imx51_bbg/system.img
out/host/linux-x86/bin/mkfs.ubifs -d out/target/product/imx51_bbg/data -o out/target/product/imx51_bbg/userdata.img -m 4096 -e 516096 -c 4096 -x none
out/host/linux-x86/bin/ubinize -o out/target/product/imx51_bbg/android_root.img -m 4096 -p 512KiB out/target/product/imx51_bbg/ubinize.ini
out/host/linux-x86/bin/mkfs.ubifs -d out/target/product/imx51_bbg/recovery/root -o out/target/product/imx51_bbg/recovery.img -m 4096 -e 516096 -c 40 -x none
out/host/linux-x86/bin/ubinize -o out/target/product/imx51_bbg/android_recovery.img -m 4096 -p 512KiB out/target/product/imx51_bbg/ubinize_reco.ini

编译内核要编译成uImage:
make uImage -j2 ARCH=arm CROSS_COMPILE=arm-linux-

生成uboot能识别的uramdisk:
~/work/android_r9/myandroid_R9/bootable/bootloader/uboot-imx/tools/mkimage  -A arm -O linux -T ramdisk -C none -a 0x70308000 -n "Android Root Filesystem" -d ./ramdisk.img ./uramdisk.img

\\192.168.40.248\work\android_r9\myandroid_R9\kernel_imx\arch\arm\boot\uImage

kernel启动命令行的一些设置:
noinitrd console=ttymxc0,115200 root=/dev/mtdblock2 rw rootfstype=jffs2 ip=off
root=/dev/nfs init=/init nfsroot=192.168.1.10:/nfs/rootfs ip=192.168.1.100 console=ttymxc0,115200 fbcon=rotate:1
root=/dev/mtdblock2 rw rootfstype=ubifs noinitrd mtdparts=nand_mtd:0x300000@0x300000(uImage),0x1c00000@0x10000000(rootfs) rw console=ttymxc0,115200 fbcon=rotate:1

U-Boot环境变量设置:
setenv nand_read_kernel 'nand read ${loadaddr} 0x300000 0x290000'
setenv nand_read_rd 'nand read ${rd_loadaddr} 0x600000 0x4B000'
setenv bootcmd_nand 'run bootargs_base bootargs_android bootargs_nand; run nand_read_kernel; run nand_read_rd; bootm ${loadaddr} ${rd_loadaddr}'
setenv bootargs_base 'setenv bootargs console=ttymxc0,115200'
setenv bootargs_nand 'setenv bootargs ${bootargs} ubi.mtd=3'
setenv bootargs_android 'setenv bootargs ${bootargs} init=/init androidboot.console=ttymxc0'
setenv loadaddr 0x90800000
setenv rd_loadaddr 0x90B00000

#busybox启动
setenv bootargs_android 'setenv bootargs ${bootargs} init=/linuxrc androidboot.console=ttymxc0'

#如果停留在Touchscreen Calibration界面,意思即校准触摸屏.如果不想校正,可去掉wvga calibration,跳过此界面
setenv bootargs_android 'setenv bootargs ${bootargs} init=/init androidboot.console=ttymxc0 console=tty0'
saveenv
#串口3(ttymxc2)用来做调试控制台
setenv bootargs_android 'setenv bootargs ${bootargs} init=/init androidboot.console=ttymxc2 console=tty0 wvga calibration'
setenv bootargs_base 'setenv bootargs console=ttymxc2,115200'
saveenv

NSF启动环境变量设置:
setenv bootargs_android 'setenv bootargs ${bootargs} root=/dev/nfs init=/init nfsroot=192.168.0.10:/nfs/rootfs ip=192.168.0.100::::usb0 console=ttymxc0,115200 console=tty0 wvga fbcon=rotate:1'
setenv bootargs_android 'setenv bootargs ${bootargs} root=/dev/nfs init=/init nfsroot=192.168.1.10:/nfs/rootfs ip=192.168.1.100::usb0 console=ttymxc0,115200 fbcon=rotate:1 video=mxcdi0fb:RGB565,800x480M-16@60 di0_primary wvga calibration'
setenv bootargs_android 'setenv bootargs ${bootargs} init=/init androidboot.console=ttymxc0 video=mxcdi0fb:RGB24,800x480M@60 video=mxcdi1fb:RGB24,800x480M@60 di0_primary calibration'
setenv bootargs_android 'setenv bootargs ${bootargs} init=/init androidboot.console=ttymxc0 video=mxcdi0fb:RGB24,800x480M@60 video=mxcdi1fb:YUV444,720P60 tve calibration'
mx51:
setenv bootargs_android 'setenv bootargs ${bootargs} root=/dev/nfs init=/init nfsroot=192.168.0.10:/nfs/rootfs ip=192.168.0.100::::usb0 androidboot.console=ttymxc0 video=mxcdi0fb:RGB24,800x600M@60 video=mxcdi1fb:RGB24,800x480M@60 di0_primary'

mxcdi1fb:TV-PAL

 

svn import --no-ignore uboot-imx-nand svn://192.168.0.97/iMx51_Android/Android2.2/trunk/bootable/bootloader/uboot-imx-nand -m "iMx51 android r9 nand uboot for ZhongHong" --username hui --password
svn import --no-ignore kernel_imx svn://192.168.0.97/iMx51_Android/Android2.2/trunk/ -m "iMx51 android r9 Linux-2.6.31 kernel for ZhongHong" --username hui --password
svn import --no-ignore kernel_imx svn://192.168.0.97/iMx51_Android/imx-android-r9.2/trunk  -m "iMx51 android r9.2 Linux-2.6.31 kernel for ZhongHong" --username hui --password
svn import --no-ignore kernel_imx svn://192.168.0.97/iMx51_Android/imx-android-r10/trunk  -m "iMx51 android2.3 (BSP r10) Linux-2.6.35 kernel for ZhongHong" --username hui --password
svn import --no-ignore luvcview_port https://192.168.0.121:8443/svn/BSP/Android/iMX51/Base/trunk/luvcview_port -m "quick camera preview project. add by hui" --username liuyh --password ***
svn import --no-ignore kernel_imx https://product/svn/903/myandroid_R9.2.1 -m "iMx51 android r92.2 kernel for product 903 of lhyz" --username bill --password
svn import --no-ignore myandroid-r94-ok https://product/svn/903_R9.4/myandroid_R9.4 -m "iMx51 android r92.2 kernel for product 903 R9.4 of lhyz" --username bill --password
svn import --no-ignore myandroid-r9.2.1 https://192.168.0.100/svn/903/myandroid_R9.2.1 -m "iMx51 android r92.2.1 orig android for product 903 of lhyz" --username bill --password


objdump -x libmedia_jni.so | grep NEEDED

logcat Vold:* *:S&
logcat SerialPort:* *:S&
logcat bluedroid:* *:S&
logcat glgpsd:* *:S&

chmod u+r /system/lib/*
ls -l /system/lib/*

 

 

SMDKC110:

dnw 40000000

U-Boot
onenand erase 0 80000;onenand  write 40000000 0 80000

zImage
dnw 40000000;onenand erase 600000 500000;onenand write 40000000 600000 500000;re

ramdisk
onenand erase b00000 300000;onenand write 40000000 b00000 300000

system.img
onenand erase e00000 7800000;onenand write.yaffs2 40000000 e00000 5A00000

userdata.img
onenand erase b800000 14800000;onenand write.yaffs 40000000 b800000 1080


onenand erase 0 10000000

onenand write 57e00000 0 40000

onenand erase 0 40000;onenand write c0008000 0 40000

当你uboot跑起来之后再用仿真器或者USB下载到c0008000 再用如下命令烧写.

SMDK6410:
Clean
onenand erase 04600000 02800000

U-Boot
onenand erase 0 40000;onenand write c0008000 0 40000
       测试:onenand erase 80000 80000;onenand write c0008000 80000 80000

zImage
dnw;onenand erase 600000 300000;onenand write c0008000 600000 300000;re

ramdisk
onenand erase 900000 100000;onenand write c0008000 900000 100000

system.img
onenand erase a00000 4300000;onenand write.yaffs2 c0008000 a00000  377F040

userdata.img
####onenand erase A000000 5E00000;onenand write.yaffs2 c0008000 A000000 2559C0
onenand erase A000000 5E00000;onenand write.yaffs2 c0008000 A000000      2559C0

onenand erase 4d00000 5300000


SMDKC100:
U-Boot
nand erase 0 40000;nand  write c0000000 0 40000
onenand erase 0 40000;onenand  write c0008000 0 40000

zImage
dnw;nand erase 600000 300000;nand write c0000000 600000 300000
dnw;onenand erase 600000 300000;onenand write c0008000 600000 300000;re

ramdisk
nand erase 900000 100000;nand write c0000000 900000 100000
onenand erase 900000 100000;onenand write c0008000 900000 100000

system.img
nand erase a00000 4300000;nand write.yaffs2 c0000000 a00000 352f980
onenand erase a00000 4300000;onenand write.yaffs2 c0008000 a00000 ?

userdata.img
nand erase 9000000 7000000;nand write.yaffs c0000000 9000000 840
onenand erase 9000000 7000000;onenand write.yaffs c0008000 9000000 840

 

root=/dev/nfs init=/init nfsroot=192.168.1.10:/nfs ip=192.168.1.100 console=ttySAC2,115200 no_console_suspend=1
root=/dev/nfs init=/init nfsroot=192.168.1.10:/nfs ip=192.168.1.100 console=ttySAC2,115200
console=ttySAC2,115200,mem=256M
nfs cdc
root=/dev/nfs init=/init nfsroot=192.168.1.10://nfsroot/rootfs ip=192.168.1.100 console=ttySAC2,115200 fbcon=rotate:1


root=/dev/nfs init=/init nfsroot=192.168.1.10:/nfs ip=192.168.1.100 console=tty0 console=ttySAC2,115200 fbcon=rotate:3
root=/dev/nfs init=/linuxrc nfsroot=192.168.1.10:/nfs ip=192.168.1.100 console=tty0 console=ttySAC2,115200 fbcon=rotate:3

#邱俊涛svn linux-2.6.27-android
init=/init console=ttySAC2,115200 root=/dev/nfs nfsroot=192.168.1.110:/home/win_share/root ip=192.168.1.100:192.168.1.110:192.168.1.110:255.255.255.0:ubuntu9.04:usb0:off
init=/init console=ttySAC2,115200 root=/dev/nfs nfsroot=192.168.1.10:/nfs ip=192.168.1.100:192.168.1.1:192.168.1.1:255.255.255.0:ubuntu9.04:usb0:off

#linux2.6.24 onenand 配置
root=/dev/mtdblock2 rw rootfstype=jffs2 init=/linuxrc console=ttySAC2,115200
root=/dev/mtdblock3 rw rootfstype=jffs2 init=/linuxrc console=ttySAC2,115200
init=/linuxrc console=ttySAC2,115200

sudo smbmount //192.168.16.99/开发部/ /mnt/ -o iocharset=utf8,codepage=cp936,username=liuyihui,password=lyh2009
sudo smbmount //192.168.16.248/all/ ./mnt -o iocharset=utf8,codepage=cp936,username=lyh,password=23456
sudo smbmount //172.16.10.248/all/ ./mnt -o iocharset=utf8,codepage=cp936,username=hui,password=linux
sudo smbmount //192.168.0.97/Share/ /mnt -o iocharset=utf8,codepage=cp936,username=svn,password=

sudo smbmount //192.168.16.247/samsung  /mnt/ -o username=hui%pwd
sudo smbmount //192.168.16.247/android-1.5  /mnt/ -o username=hui%pwd


将luther_ramdisk.img打包成u-boot下载格式
mkimage -A arm -O linux -T ramdisk -C none -a 0x50800000 -n "ramdisk" -d luther_ramdisk.img luther_ramdisk.img-uboot.img

#在当前目录及其子目录下查找*.txt文件,并将查找到的文件信息显示出来。注意:{}和\之间有空格;不要少了最后的分号
find ./ -name "*.mk" -exec grep "apns" {} -nH \;
find . -type d -iname ".svn" -exec rm -rf {} \;
询Linux应用程序运行依赖哪些库
arm-linux-objdump -x rootfs_imx_test/usr/sbin/lsusb | grep NEED

改变控制台debug消息显示级别,可以打印printk(DEBUG ...)信息
echo > /proc/sys/kernel/printk "8"

把system.img挂载区重新挂到可写
mount -o rw,remount -t yaffs2 /dev/block/mtdblock0 /system
mount -o rw,remount -t yaffs2 /dev/block/mmcblk0 /system


echo "at">/dev/ttyspi0

./memdmp E0200E00 182

md e0200f00

 

./configure --with-linux=/home/hui/work/zh/myandroid_R9/kernel_imx --host=arm-linux

#有的编译器没有arm-linux-,编译某些代码需要arm-linux-,因此需要链接
ln -s arm-eabi-addr2line arm-linux-addr2line
ln -s arm-eabi-ar arm-linux-ar
ln -s arm-eabi-as arm-linux-as
ln -s arm-eabi-c++ arm-linux-c++
ln -s arm-eabi-c++filt arm-linux-c++filt
ln -s arm-eabi-cpp arm-linux-cpp
ln -s arm-eabi-g++ arm-linux-g++
ln -s arm-eabi-gcc arm-linux-gcc
ln -s arm-eabi-gccbug arm-linux-gccbug
ln -s arm-eabi-gcov arm-linux-gcov
ln -s arm-eabi-gdb arm-linux-gdb
ln -s arm-eabi-gdbtui arm-linux-gdbtui
ln -s arm-eabi-gprof arm-linux-gprof
ln -s arm-eabi-ld arm-linux-ld
ln -s arm-eabi-nm arm-linux-nm
ln -s arm-eabi-objcopy arm-linux-objcopy
ln -s arm-eabi-objdump arm-linux-objdump
ln -s arm-eabi-ranlib arm-linux-ranlib
ln -s arm-eabi-readelf arm-linux-readelf
ln -s arm-eabi-run arm-linux-run
ln -s arm-eabi-size arm-linux-size
ln -s arm-eabi-strings arm-linux-strings
ln -s arm-eabi-strip arm-linux-strip

export TARGET_TYPE=%MISSING%
export cross_stack_direction=-1
export cross_signum=64
export cross_linuxthreads=0

#启动停止svn服务
sudo svnserve -d  -r /home/root/
killall svnserve


不同3G模块移植
【1】
打开:out\target\product\imx51_bbg\root\init.rc
根据不同模块修改:
#ZTE C100, add by hui
service ril-daemon /system/bin/rild -l /system/lib/libreference-ril.so -- -d /dev/ttyUSB0 -u /dev/ttyUSB2
#WCDMA U6300V, add by hui
#service ril-daemon /system/bin/rild -l /system/lib/libreference-ril.so -- -d /dev/ttyUSB1 -u /dev/ttyUSB2
【2】
打开:out\target\product\imx51_bbg\system\etc\init.gprs-pppd
根据不同模块修改:
#below is config for U6300 WCDMA modem
/system/bin/pppd  /dev/ttyUSB2 9600 mru 1280 mtu 1280 nodetach debug dump defaultroute usepeerdns novj novjccomp noipdefault ipcp-accept-local ipcp-accept-remote connect-delay 5000 linkname ppp0
#below is config for ZTE CDMA modem
#/system/bin/pppd  /dev/ttyUSB0 115200 mru 1280 mtu 1280 nodetach debug dump defaultroute usepeerdns novj novjccomp noipdefault ipcp-accept-local ipcp-accept-remote connect-delay 5000 linkname ppp0 name "card" password "card"


在我们的工作经常要验证不同相同源码不同配置内核版本,比如imx51_evk,imx53_smd,imx53_t4.imx_51_t3,
可以针对每个配置生成一个.config,
mkdir imx53_smd
cp .config_imx53_smd imx53_smd/.config
make uImage O=imx53_smd -j4
mkdir imx53_t4
cp .config_imx53_t4 imx53_t4/.config
make uImage O=imx53_t4 -j4

备份M9短信,电话本数据库,
cat /data/data/com.android.providers.telephony/databases/mmssms.db > /sdcard/mmssms.db
cat /sdcard/mmssms.db > /data/data/com.android.providers.telephony/databases/mmssms.db
cat /data/data/com.android.providers.contacts/databases/contacts2.db > contacts2.db


这样备份LINUX
tar -cvpzf /media/Data/linux_bak.tgz –exclude=/proc –exclude=/lost+found –exclude=/media –exclude=/mnt –exclude=/sys /

 

你可能感兴趣的:(iMx53开发)