几个很好的nand nor flash的网页

Is an MTD device a block device or a char device?

First off, an MTD is a "Memory Technology Device", so it's just "MTD". An "MTD device" is a pleonasm.

Unix traditionally only knew block devices and character devices. Character devices were things like keyboards or mice, that you could read current data from, but couldn't be seek-ed and didn't have a size. Block devices had a fixed size and could be seek-ed. They also happened to be organized in blocks of multiple bytes, usually 512.

Flash doesn't match the description of either block or character devices. They behave similar to block device, but have differences. For example, block devices don't distinguish between write and erase operations. Therefore, a special device type to match flash characteristics was created: MTD.

So MTD is neither a block nor a char device. There are translations to use them, as if they were. But those translations are nowhere near the original, just like translated Chinese poems. 

Can I mount ext2 over an MTD device?

Ext2, ext3, XFS, JFS, FAT and other "conventional" file systems work with block devices. They are designed this way. Flashes are not block devices, they are very different beasts. Please, read this, and this FAQ entries.

Please, do not be confused by USB stick, MMC, SD, CompactFlash and other popular removable devices. Although they are also called "flash", they are not MTD devices. They are out of MTD subsystem's scope. Please, read this FAQ entry.

In order to use one of conventional file systems over an MTD device, you need a software layer which emulates a block device over the MTD device. These layers are often calledFlash Translation Layers (FTLs).

There is an extremely simple FTL layer in Linux MTD subsystem - mtdblock. It emulates block devices over MTD devices. There is also an mtdblock_ro module which emulates read-only block devices. When you load this module, it creates a block device for each MTD device in the system. The block devices are then accessible via /dev/mtdblockX device nodes.

But in many cases using mtdblock is a very bad idea because what it basically does if you change any sector of your mtdblockX device, it reads the whole corresponding eraseblock into the memory, erases the eraseblock, changes the sector in RAM, and writes the whole eraseblock back. This is very straightforward. If you have a power failure when the eraseblock is being erased, you lose all the block device sectors in it. The flash will likely decay soon because you will wear few eraseblocks out - most probably those ones which contain FAT/bitmap/inode table/etc.

Unfortunately it is a rather difficult task to create a good FTL layer and nobody still managed to implement one for Linux. But now when we have UBI (see here) it is much easier to do it on top of UBI.

It makes sense to use mtdblock_ro for read-only file systems or read-only mounts. For example, one may use SquashFS as it compresses data quite well. But think twice before using mtdblock in read-write mode. And don't try to use it on NAND flash as it is does not handle bad eraseblocks.


载自 :http://www.linux-mtd.infradead.org/faq/general.html


//===================================================

NAND vs. NOR

Beside the different silicon cell design, the most important difference between NAND and NOR Flash is the bus interface. NOR Flash is connected to a address / data bus direct like other memory devices as SRAM etc. NAND Flash uses a multiplexed I/O Interface with some additional control pins. NAND flash is a sequential access device appropriate for mass storage applications, while NOR flash is a random access device appropriate for code storage application. NOR Flash can be used for code storage and code execution. Code stored on NAND Flash can't be executed from there. It must be loaded into RAM memory and executed from there.


NORNAND
InterfaceBusI/O
Cell SizeLargeSmall
Cell CostHighLow
Read TimeFastSlow
Program Time single ByteFastSlow
Program Time multi ByteSlowFast
Erase TimeSlowFast
Power consumptionHighLow, but requires additional RAM
Can execute codeYesNo, but newer chips can execute a small loader out of the first page
Bit twiddlingnearly unrestricted1-3 times, also known as "partial page program restriction"
Bad blocks at ship timeNoAllowed

载自:http://www.linux-mtd.infradead.org/doc/nand.html
//======================================================

NOR & NAND

物理结构:
●NAND Flash把整个memory分成若干个Block,一个Block包含若干个Page,一个Page又包含512(+16)Byte或 2048(+64)Byte. 以Toshiba的TC58NWM9S3B NAND flash为例,它的容量是512Mbits,它总共有512个Block, 一个Block包含64个Page,而一个page是(2048+64)Byte.
查看更多精彩图片

查看更多精彩图片


●NOR Flash把整个memory分成若干个Sector.

Program & Erase:
●NOR和NAND flash的program都只能将数据位从1写到0,而不能将0写成1,所以在对flash进行写入之前必须对flash进行erase操作。
●NOR 和NAND flash的erase操作就是将某一擦除块的内容都写成1,擦写操作的最小单位是一个区块(NAND:block, NOR:sector或block),而不能是单个字节。NOR flash的erase通常包括两种,sector/block erase(块擦除), chip erase(芯片擦除);块擦除就是把某一擦除块的内容写成1,而芯片擦除则是把整个flash的内容都变成1。

操作指令:
●NOR Flash 除了读,其它的操作都不能像RAM那样直接对目标地址进行总线操作, 而是必须输入一串特殊的指令才能擦除或将数据写入到NOR Flash中.
●NAND Flash 的所有操作也是需要输入特定的命令(command)才能完成的.还是以Toshiba的TC58NWM9S3B NAND flash为例,
Page Program:     80h(CMD),     Column Address M(页内偏移地址), Page Address N, Data, 1    0h(CMD)
block erase:         60h(CMD),     Block address input:2cycle,     D0h(erase start cmd)
read:                    00h(CMD),     Column Address M, Page Address N,     30h(CMD)
ID read :              90h(ID Read CMD),     00h(Address 00)
status read:          70h(CMD)
Reset:                  FF(CMD)

NOR flash spec 摘要

if a program/erase operation fails, the device remains in the programming/erasing state and does not automatically return to Read Mode, In this case, either a software reset or a hardware reset is required to return the device to Read Mode.
   
DQ7(Data#Polling)
during program operation, DQ7 outputs the complement of the data.
when program operation completed, DQ7 outputs the data.
during erase operation, DQ7 outputs 0.
when erase operation completed, DQ7 outputs 1.
if program or erase operation fails, DQ7 outputs the data.

DQ6 (Toggle bit 1)


DQ5 (time-out)
if program or erase operates normally, DQ5 outputs 0.
if the internal timer times out during program or erase operation (indicates that the operation

has not been completed ), DQ5 outputs 1.
any attempt to program a 1 into a cell containing a 0 will fail (only erase operation can

change 0 back to 1), DQ5 outputs 1.

NOTE: In the case of internal time-out, reset command is required to return the device to Read 
mode.

DQ3 (Sector/Block Erase)
if sector/block erase operation starts, DQ3 outputs 1.

DQ2 (Toggle bit 2)


载自: http://blog.chinaunix.net/u2/70445/showart_1674219.html
//======================================================
从linux软件的角度看FLASH:??
------C runtime(glibc 2.x)------------------------------
------kernel inte**ce(system call)---------------------
------Filesystem(ext2, FAT, JFFS/JFFS2)-----------------
------MTD(/dev/fla?, block device)----------------------
------MTD(/dev/mtd?, char device)-----------------------
------Translation Layer(CFI, FTL, NFTL)-----------------
------NAND, NOR, AND------------------------------------
------Hardware level, FLASH(raw flash, DOC/DOM/CF)------

载自:http://hi.baidu.com/hilyjiang/blog/item/804165e73d857b2fb8382067.html
//======================================================

FLASH MEMORY wiki
载自:http://en.wikipedia.org/wiki/Flash_memory
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值