pmon下nandflash相关操作

龙芯平台下nandflash相关操作
pmon下
查看nandflash设备(只能通过打印信息查看)

NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
NAND_ECC_NONE selected by board driver. This is not recommended !!

查看文件系统支持

Supported filesystems [mtd, net, fat, fs, disk, iso9660, socket, tty, ram]

查看nandflash分区和容量使用情况;

PMON> mtdparts
device <nand-flash>,#parts = 2

 #: name        size            offset          mask_flags
 0: kernel      0x00a00000(10m) 0x00000000(0m)  3
 1: rootfs      0x07600000(118m)        0x00a00000(10m) 0

mtdparts INFO:
  now-active:   mtdparts=nand-flash:10M@0(kernel)ro,-(rootfs)
  <NOTE>:you can use command(CMD:  unset mtdparts ) to become the default !!! 

PMON> 

擦除第一分区(其他分区类似);

PMON> mtd_erase /dev/mtd0

ERASE the device:"/dev/mtd0",SKIP bad-blocks

mtd_erase working: 
009c0000  
mtd_erase work done!

把u盘里的二进制拷贝到nandflash里

PMON> devcp /dev/fs/fat@usb0/vmlinuz /dev/mtd0

从nandflash加载内核

load /dev/mtd0

从串口启动ramdisk内核

PMON> g rdinit=/sbin/init console=ttyS0,115200

若pmon下加入了yaffs2文件系统驱动,可以yaffs2加载

Supported filesystems [mtd, net, fs/yaffs2, fat, fs, disk, iso9660, socket, tty, ram]
PMON> load /dev/fs/yaffs2@mtd0/vmlinuz

查看nandflash分区里的目录文件

PMON> load /dev/fs/yaffs2@mtd0/

命令行设置nandflash分区容量,下面设置后,第一个分区40M,第二个分区40~最大容量;

PMON> set mtdparts nand-flash:40M@0(kernel)ro,-(rootfs)
已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页