Code which properly wants to handle Nand flash has to work
in a block based way since blocks are the entities that are erased or
may become bad. The regular mtd API works based on offsets in the device
which introduces unhandy 64bit arithmetics and the requirement to align
buffers to blocks.
This introduces the mtd peb API (PEB for physical Erase Block) which
allows the users to work in a block oriented way. The API is heavily
inspired by the UBI IO layer and in fact can replace parts thereof
later.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The mtd concat layer supports concatenating several MTD devices
into a single one. This is nearly as-is from the corresponding
Kernel code.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
With CONFIG_PARTITION_NEED_MTD enabled we use mtd rather than devfs
directly to create partitions on mtd devices. Since:
| commit b32cd8df87
| Author: Sascha Hauer <s.hauer@pengutronix.de>
| Date: Wed Apr 9 15:49:32 2014 +0200
|
| mtd: nand: bb: use mtd api directly
|
| The devfs layer just adds an addition indirection between mtd
| and the bb devices with no purpose. Drop it.
|
| Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The bad block aware device creation doesn't work if this option
is disabled. With this we remove CONFIG_PARTITION_NEED_MTD and always
use mtd partitions on mtd devices.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This is a fresh UBI import from Linux v3.10
This is done mainly to get fastmap support.
This was tested with the i.MX nand driver, the MXS nand driver and
on CFI NOR flash.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
CFI Flash is currently handled outside the mtd layer which makes it
a special case. Integrate it into mtd so that we get rid of this
special status.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Add the MSystem disk-on-chip G3 support, taken from the
linux kernel with few amendments to bring it into barebox.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Add a device to read and write to MTD data and oob
(/dev/mtdraw<N>).
The device is constrained in a separate source file, so that
further improvement of commands (such as nandwrite) could
make it useless, and easy to remove.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Split /dev/mtd and /dev/mtdoob devices.
Remove from mtd structure the mtdoob character device.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>