Chinaunix首页 | 论坛 | 博客
  • 博客访问: 203259
  • 博文数量: 93
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 978
  • 用 户 组: 普通用户
  • 注册时间: 2014-11-10 15:46
个人简介

青春无悔

文章分类

全部博文(93)

文章存档

2015年(16)

2014年(77)

我的朋友

分类: LINUX

2014-11-10 17:19:36

Uboot下的烧写命令:
1.配置IP,方便tftp协议传输(根据实际需要)
setenv ipaddr 172.18.48.244;setenv serverip 172.18.48.170;setenv netmask 255.255.252.0;saveenv;

2.配置rootfs启动命令(根据实际需要)
setenv nandroot ubi0:rootfs rw ubi.mtd=5,2048;saveenv;

//SPI Flash
* 0x00000 - 0x20000  : First copy of SPL
* 0x20000 - 0xE0000  : U-Boot
* 0xE0000 - 0x100000 : U-Boot Environment
* 0x100000 - 0x200000: Reserved
3.烧写MLO/Uboot
3.1.烧写MLO
sf probe 0
tftp 0x80200000 MLO.byteswap;
sf erase 0x0 0x20000;sf write 0x80200000 0x0 0x20000;
3.2.烧写Uboot
tftp 0x80200000 u-boot.img;
sf erase 0x20000 0xc0000;sf write 0x80200000 0x20000 0xc0000;

//Nand Flash
0x00500000@0x00000000(kernel)
0x04000000@0x00500000(rootfs)
0x0BB00000@0x04500000(data)
4.烧写Kernel
tftp 0x80200000 uImage;nand erase 0x00000000 0x00500000
;nand write 0x80200000 0x0000000 0x500000


5.烧写rootfs
mw.b 0x80200000 0xFF 0x04000000;
tftp 0x80200000 ubi.img;nand erase 0x00500000 0x04000000
;nand write 0x80200000 0x00500000 0x04000000


sf probe 0;tftp 0x80200000 u-boot.img;sf erase 0x20000 0xc0000;sf write 0x80200000 0x20000 0xc0000;


==========================================================
从SD Card烧写
U-Boot# sf probe 0
U-Boot# sf erase 0 +200000
U-Boot# mmc rescan
U-Boot# fatload mmc 0 ${loadaddr} MLO
U-Boot# sf write ${loadaddr} 0 0x20000
U-Boot# fatload mmc 0 ${loadaddr} u-boot.img
U-Boot# sf write ${loadaddr} 0x20000 0x60000

U-Boot# fatload mmc 0 ${loadaddr} uImage
U-Boot# nand erase 0x00000000 0x00500000
;nand write ${loadaddr} 0x0000000 0x500000


U-Boot# mw.b ${loadaddr} 0xFF 0x04000000;
U-Boot# fatload mmc 0 ${loadaddr} ubi.img;
U-Boot# nand erase 0x00500000 0x04000000
;nand write ${loadaddr} 0x00500000 0x04000000

=============================================================
//qt动态库
export LD_LIBRARY_PATH=/media/mmcblk0p2/usr/lib:$LD_LIBRARY_PATH

ifconfig eth0 172.18.53.220 broadcast 172.18.55.254 netmask 255.255.252.0

busybox tftp:

tftp -g -r u-boot.img 172.18.49.179//(电脑的IP)




=================MLO的升级=======================
mtd_debug erase /dev/mtd0 0 131072
mtd_debug write /dev/mtd0 0 101169 /tmp/MLO.byteswap

root@am335x-evm:/tmp# mtd_debug info /dev/mtd0
mtd.type = MTD_NORFLASH
mtd.flags = MTD_CAP_NORFLASH
mtd.size = 131072 (128K)
mtd.erasesize = 4096 (4K)
mtd.writesize = 1
mtd.oobsize = 0
regions = 0

root@am335x-evm:/tmp# mtd_debug erase /dev/mtd0 0 131072【擦除整个分区】
Erased 131072 bytes from address 0x00000000 in flash
root@am335x-evm:/tmp# du -sh /tmp/MLO.byteswap             
100.0K  /tmp/MLO.byteswap
root@am335x-evm:/tmp## ls -l MLO.byteswap | awk '{print $5}'        
101169
root@am335x-evm:/tmp# mtd_debug write /dev/mtd0 0 101169 /tmp/MLO.byteswap 【写入新内容,写入大小等于实际文件大小,否则出错!】
Copied 101169 bytes from /tmp/MLO.byteswap to address 0x00000000 in flash

=================U-boot的升级=======================
mtd_debug erase /dev/mtd1 0 786432
mtd_debug write /dev/mtd1 0 482400 /tmp/u-boot.img

root@am335x-evm:/tmp# mtd_debug info /dev/mtd1                            
mtd.type = MTD_NORFLASH
mtd.flags = MTD_CAP_NORFLASH
mtd.size = 786432 (768K)
mtd.erasesize = 4096 (4K)
mtd.writesize = 1
mtd.oobsize = 0
regions = 0

root@am335x-evm:/tmp# mtd_debug erase /dev/mtd1 0 786432     【擦除整个分区】               
Erased 786432 bytes from address 0x00000000 in flash
root@am335x-evm:/tmp# ls -l /tmp/u-boot.img                              
-rw-r--r--    1 root     root        482400 Jun 26 12:01 /tmp/u-boot.img
root@am335x-evm:/tmp# mtd_debug write /dev/mtd1 0 482400 /tmp/u-boot.img   【写入新内容,写入大小等于实际文件大小,否则出错!】      
Copied 482400 bytes from /tmp/u-boot.img to address 0x00000000 in flash
root@am335x-evm:/tmp#

=================Evn clear=======================
mtd_debug erase /dev/mtd2 0 131072

root@(none):~# mtd_debug info /dev/mtd2
mtd.type = MTD_NORFLASH
mtd.flags = MTD_CAP_NORFLASH
mtd.size = 131072 (128K)
mtd.erasesize = 4096 (4K)
mtd.writesize = 1
mtd.oobsize = 0
regions = 0
root@am335x-evm:/tmp# mtd_debug erase /dev/mtd2 0 131072     【擦除整个分区】

阅读(994) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~