網路城邦
上一篇 回創作列表 下一篇   字體:
20130204 Freescale i.mx6 uboot for linux
2013/02/04 15:48:13瀏覽563|回應0|推薦0

相逢自是有緣,也許是孽緣...

##nfs
setenv bootargs 'console=ttymxc0,115200 root=/dev/nfs ip=dhcp nfsroot=192.168.123.152:/home/cat/ltib/rootfs,v3,tcp'
setenv serverip 192.168.123.152
tftpboot 0x10800000 uImage
bootm

#mmc boot (uboot start at 2048=0x800, ext2 start at 20000)
setenv bootargs 'console=ttymxc0,115200 root=/dev/mmcblk1p1 rootwait rw'
mmc dev 2; mmc read 0x10800000 0x800 0x2000; bootm

//---make sdcard
#copy uboot

dd if=u-boot-mx6q-arm2.bin of=/dev/sdb bs=512 && sync && sync
dd if=u-boot-mx6q-arm2.bin      of=/dev/sdb bs=512 seek=2 skip=2 && sync && sync

dd if=uImage of=/dev/sdb bs=512 seek=2048 conv=fsync

#discard disk data
dd if=/dev/zero of=/dev/sdb bs=512 count=10000
#copy uboot
dd if=u-boot-mx6q-sabresd.bin   of=/dev/sdb bs=512 && sync && sync
#copy uImage
dd if=uImage of=/dev/sdb bs=512 seek=2048 && sync && sync
#re-build MBR
fdisk /dev/sdb
u
d
n
p
1
20000
<enter>
w
#fedora mount SD automatically. Need remount it.
umount /media/disk
#format partition
mkfs.ext2 /dev/sdb1
#mount source file of rootfs.ext2
mkdir ./rootfs1
mount -o loop -t ext2 rootfs.ext2 ./rootfs1
#mount sd card
mkdir /home/cat/mountpoint
mount -t ext2 /dev/sdb1 /home/cat/mountpoint
#copy rootfs data to sd card
#cd /home/cat/imx51_image/L2.6.35_10.11.01_ER_images_MX5X/rootfs1
cd rootfs1
cp -rpa * /home/cat/mountpoint && sync && sync
umount /home/cat/mountpoint

##---modify uboot parameter

setenv bootargs_mmc 'setenv bootargs ${bootargs} ip=dhcp root=/dev/mmcblk1p1 rootwait ethact=FEC0'
setenv bootcmd_mmc 'run bootargs_base bootargs_mmc; mmc dev 2; mmc read ${loadaddr} 0x800 0x2000; bootm'
setenv bootcmd 'run bootcmd_mmc'
saveenv

( 心情隨筆心情日記 )
回應 列印 加入我的文摘
上一篇 回創作列表 下一篇

引用
引用網址:https://classic-blog.udn.com/article/trackback.jsp?uid=greatcat&aid=7279809