mtd零星记录

查看Flash分区情况:

root@DD-WRT:~# cat /proc/mtd 
dev:    size   erasesize  name
mtd0: 00020000 00010000 "RedBoot"
mtd1: 007c0000 00010000 "linux"
mtd2: 00270000 00010000 "rootfs"
mtd3: 00410000 00010000 "ddwrt"
mtd4: 00010000 00010000 "nvram"
mtd5: 00010000 00010000 "board_config"
mtd6: 00800000 00010000 "fullflash"
mtd7: 00020000 00010000 "fullboot"
root@DD-WRT:~#

用dd备份分区(如果有fullash分区)

root@DD-WRT:~# dd if=/dev/mtd6 of=/tmp/741_fullflash.bin
16384+0 records in
16384+0 records out
root@DD-WRT:~#

刷成编程器固件命令(前提是有fullash分区)

root@DD-WRT:~# mtd -r write fullflash /tmp/741_fullflash.bin
16384+0 records in
16384+0 records out
root@DD-WRT:~#

 

编程openwrt固件时修改mach-tl-mr3x20.c(对应3420)增加一个fullash

}, {
  .name  = "fullflash",
  .offset  = 0,
  .size  = 0x800000,

  .mask_flags = MTD_WRITEABLE,

}

  .size  = 0x800000, 这个是flash大小8M

去掉  .mask_flags = MTD_WRITEABLE,是分区可以写,否者只可读

MTD subsystem has the following interfaces.

MTD character devices - usually referred to as /dev/mtd0, /dev/mtd1, and so on. These character devices provide I/O access to the raw flash. They support a number of ioctl calls for erasing eraseblocks, marking them as bad or checking if an eraseblock is bad, getting information about MTD devices, etc.
The sysfs interface is relatively newer and it provides full information about each MTD device in the system. This interface is easily extensible and developers are encouraged to use the sysfs interface instead of older ioctl or /proc/mtd interfaces, when possible. The sysfs interface for the mtd subsystem is documentated in the kernel, and currently can be found at Documentation/ABI/testing/sysfs-class-mtd.
The /proc/mtd proc file system file provides general MTD information. This is a legacy interface and the sysfs interface provides more information.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值