summaryrefslogtreecommitdiffstats
path: root/include/mtd
Commit message (Collapse)AuthorAgeFilesLines
* mtd: peb: Add function to skip bad blocksSascha Hauer2019-01-281-0/+1
| | | | | | | | This adds a function that given a pointer to a PEB number increases the number until the corresponding PEB is good. It also checks for the PEB number being inside the mtd device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: ubi: introduce barebox specific ioctl to get ubi_numSascha Hauer2016-09-221-0/+2
| | | | | | | | Code wishing to manipulate ubi devices from outside the ubi layer needs the ubi_num as reference. Add an ioctl to get the ubi_num from a filedescriptor. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* stdio: replace fprintf(stderr,...) with eprintfSascha Hauer2016-04-151-1/+1
| | | | | | | We have a shortcut for fprintf(stderr, so use it. This is done to be able to remove fprintf in the next step. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: ubi: Add function to get ubi number from mtd deviceSascha Hauer2016-04-081-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: ubi: make ubi_detach_mtd_dev ubi internalSascha Hauer2016-04-081-1/+1
| | | | | | | | | | We want to extend the functionality of the ubi detach function, but we don't want to change the original detach function to make UBI updates easier. This adds a barebox specific detach function which encapsulates the original UBI function. Also this makes the original ubi detach function internal to ubi. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: Create nand_bitflip commandSascha Hauer2016-04-061-0/+3
| | | | | | | | | | | | | | | | | | | This adds a command to flip bits in a Nand flash. This is useful for testing purposes to check if flipped bits are corrected and if the driver returns the correct number of bitflips. The command writes a configurable number of bitflips to a single Nand page. If the -r option is not given the results are reproducible, so calling the same command twice will revert the bitflips. The command uses the raw read/write Nand operations which are probably less tested than the regular read/write operations, so the command may produce surprising results. As of writing the command has been tested with the GPMI Nand driver and the imx-nand driver with fixes posted. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove now unused libmtdSascha Hauer2016-04-061-149/+0
| | | | | | | The only user of libmtd was ubiformat which now uses the mtd-peb API, so remove the now unused libmtd. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ubiformat: Use mtd-peb APISascha Hauer2016-04-062-4/+3
| | | | | | | | This changes ubiformat from the libmtd API to the mtd-peb API. This makes the libmtd API unnecessary and it can be removed in the next step. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: Introduce mtd-peb APISascha Hauer2016-04-061-0/+21
| | | | | | | | | | | | | | 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>
* UBI: reimport UBI from Linux v3.10Sascha Hauer2013-07-252-99/+728
| | | | | | | | | | | 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>
* UBI: remove old ubi supportSascha Hauer2013-07-241-374/+0
| | | | | | | To update to the latest UBI support from the Kernel first remove the old UBI support. Without it the update will be even less reviewable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* libmtd: rename functions from mtd_* to libmtd_*Sascha Hauer2013-02-141-4/+4
| | | | | | | | | | The kernel nowadays has mtd_read/write and other functions. In barebox we also have these functions, but with a different prototype, namely they correspond to the libmtd userspace functions. Rename these functions to libmtd_* to avoid name clashes with future mtd updates. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lib: add barebox version of libmtdWolfram Sang2012-12-191-0/+149
| | | | | | | | Based on mtd-utils and stripped down to needed functionality and reworked to barebox interfaces. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lib: add libubigenWolfram Sang2012-12-191-0/+182
| | | | | | | Imported from mtd-utils and stripped down to needed functionality. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lib: add libscanWolfram Sang2012-12-191-0/+101
| | | | | | | | Imported from mtd-utils and stripped down to needed functionality. Add prefix to functions so we have a clean namespace. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: utils: apply macros for message printoutsWolfram Sang2012-12-191-0/+47
| | | | | | | | mtd-utils have a few macros for printouts. Provide the wrappers to make it easier to import them. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ubi: bump ubi-media.h to newest versionWolfram Sang2012-12-191-25/+30
| | | | | | | Needed for ubiformat, we are interested in image_seq especially. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ubi: consolidate ubi-media.hWolfram Sang2012-12-191-0/+369
| | | | | | | | We have two versions in the tree. Use the newer one, and put it into the mtd directory while we are at it. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-3/+0
| | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* barebox ubi changesSascha Hauer2010-07-051-0/+32
| | | | | | This adds the layer between barebox and UBI. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add ubi support from u-boot. Just enough to compile and scanSascha Hauer2010-07-051-0/+268
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>