]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mtd: docg3: add fast mode
authorRobert Jarzmik <robert.jarzmik@free.fr>
Sat, 19 Nov 2011 15:02:57 +0000 (16:02 +0100)
committerArtem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
Thu, 8 Dec 2011 21:49:55 +0000 (23:49 +0200)
commitb3bfa15dc355c240d8be5235ce4f5dbf0100a51b
tree05f12b306686ceda203c993036df3b39dc8ccd6f
parenteab6f5d19d1500fc93e4ca08eb02abf90b7de0e3
mtd: docg3: add fast mode

Docg3 chips can work in 3 modes : normal MLC mode, fast
mode and reliable mode. Normally, as docg3 is a MLC chip, it
should be configured to work in normal mode.

In both normal mode, each page is distinct. This
means that writing to page 12 of blocks 14,15 writes only to
that page, and reading from page 12 of blocks 14,15 reads
only from that page.

In reliable and fast modes, pages are coupled by pairs, and
are clones one of each other. This means that the available
capacity of the chip is halved. Pages are coupled in each
block, and page of index 2*n contains the same data as page
2*n+1 of the same block.

In fast mode, the reads occur a bit faster, but are a bit
less reliable that in normal mode.

When reading from page 2*n, the chip reads bytes from both
page 2*n and page 2*n+1, makes a logical and for each byte,
and returns the result. As programming a page means
"clearing bits", even if a bit was not cleared on one page
because the flash is worn out, the other page has the bit
cleared, and the result of the "AND" gives a correct result.

When writing to page 2*n, the chip writes data to both page
2*n and page 2*n+1.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Reviewed-by: Ivan Djelic <ivan.djelic@parrot.com>
Reviewed-by: Mike Dunn <mikedunn@newsguy.com>
drivers/mtd/devices/docg3.c
drivers/mtd/devices/docg3.h