添加mtdparts命令,改命令可以查看当前分区,在启动参数里面可以以分区名代表地址和长度
grep "cmd_mtdpart" * -nR
搜索可知,mtdpart在cmd_mtdparts.c里面定义
common/Makefile:147:obj-$(CONFIG_CMD_MTDPARTS) += cmd_mtdparts.o
因此需要定义CONFIG_CMD_MTDPARTS,CONFIG_MTD_DEVICE
#define MTDIDS_DEFAULT "nand0=smdk2440-0"
#define MTDPARTS_DEFAULT "mtdparts=smdk2440-0:256k(bootloader),"
"128k(params),"
"2m(kernel),"
"-(rootfs)"
参考别人, 在board_init_r 里面添加run_command("mtdparts default", 0);即可
重新编译烧录
nfs 30000000 192.168.1.113:/home/flinn/mini2440/bin/mini_mdev_fs.jffs2
nand erase.part rootfs
nand write.jffs2 30000000 260000 $filesize
set bootargs console=ttySAC0,115200 root=/dev/mtdblock3 rootfstype=jffs2
OK, nor is fine !
相关文章