u-boot-2014.10移植添加mtdparts命令和分区

Posted hulig7

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了u-boot-2014.10移植添加mtdparts命令和分区相关的知识,希望对你有一定的参考价值。

添加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 !










以上是关于u-boot-2014.10移植添加mtdparts命令和分区的主要内容,如果未能解决你的问题,请参考以下文章

u-boot-2014.10移植

u-boot-2014.10移植识别dm9000

u-boot-2014.10移植设置时钟/SDRAM

u-boot-2014.10移植支持nand

u-boot-2014.10移植修改环境变量的存储位置

移植kernel-3.10.79