U-Boot操作Flash (NOR, NAND & SPI)


U-Boot中操作三种flash的命令集:

Action NOR NAND SPI
Copy Flash to RAM cp.[bwl] nand read eeprom read
Write to Flash from RAM cp.[bwl] nand write eeprom write
Dump Flash md.[bwl] nand dump eeprom read ; md.[bwl]
Ease Flash erase nand erase n/a
Write Protection protect on
protect off
nand lock
nand unlock
n/a
Additional Info flinfo
imls
nand info
nand bad
n/a

U-Boot源代码下载地址

U-Boot中查看命令帮助:

  1. MB680> help cp  
  2. MB680> help nand  
  3. MB680> help eeprom  

nor烧写命令:

  1. MB680> nfs $load_addr /export/u-boot.bin  
  2. MB680> protect off 1:0-4  
  3. MB680> erase 1:0-4  
  4. MB680> cp.b $load_addr A0000000 $filesize  
  5. MB680> protect on 1:0-4  
nor烧写内置命令:
  1. MB680> nfs $load_addr /export/u-boot.bin  
  2. MB680> run unprot  
  3. MB680> run update  

nand烧写命令:

  1. MB680> nfs $load_addr /export/u-boot.bin  
  2. MB680> nand erase 0 40000  
  3. MB680> nand write $load_addr 0 40000  

U-Boot启动内核的时候使用的命令是nand read.i c0008000 80000 500000;bootm c0008000

在nand中0x80000处开始的5M的数据拷到sdram0xc0008000处,从这个地址开始执行。

spi烧写命令:

  1. MB680> nfs $load_addr /export/u-boot.bin  
  2. MB680> eeprom write $load_addr 0 $filesize  

相关内容