summaryrefslogtreecommitdiffstats
path: root/include/linux/mtd
Commit message (Collapse)AuthorAgeFilesLines
* mtd: ubi: add API call to rename volumes.Giorgio Dal Molin2016-09-271-0/+1
| | | | | Signed-off-by: Giorgio Dal Molin <iw3gtf@arcor.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: ubi: Add API calls to create/remove volumesSascha Hauer2016-09-221-0/+3
| | | | | | | | | | Currently we use a ioctl API to create/remove ubi volumes. This means we always have to carry all function code for ubi volume manipulation when the ioctl is compiled in. This adds a function API to create/remove volumes so that the linker can throw the unused code away later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: nand: add ONFI timing mode to nand_timings converterSascha Hauer2016-08-181-0/+3
| | | | | | | | | | | Ported from Linux commit 974647e: | Add a converter to retrieve NAND timings from an ONFI NAND timing mode. | At the moment, only SDR NAND timings are supported. | | Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com> | Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: nand: define struct nand_timingsSascha Hauer2016-08-181-0/+49
| | | | | | | | | | | | Ported from Linux commit bb5fd0b6da: | Define a struct containing the standard NAND timings as described in NAND | datasheets. | | Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com> | Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: nand: Enable subpage readsSascha Hauer2016-05-101-1/+1
| | | | | | | | Until now we did not support subpage reads for smaller binary sizes. Scanning UBI volumes on large page NANDs can be painfully slow, subpage reads can speed this up significantly, so enable subpage reads. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: nand: Pass page argument to read_subpage hookSascha Hauer2016-05-101-1/+1
| | | | | | | Similar to what the kernel does in e004debda (mtd: nand: add "page" argument for read_subpage hook). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mtd-imx-nand'Sascha Hauer2016-04-081-19/+0
|\
| * mtd: remove unused debug definesSascha Hauer2016-03-171-19/+0
| | | | | | | | | | | | | | MTD_DEBUG was only used by the i.MX Nand driver and is now unused. Remove the mtd specific debug defines. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: nand: export nand_check_erased_bufSascha Hauer2016-04-081-0/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: Introduce mtd_check_patternSascha Hauer2016-03-151-0/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: rename mtd_all_ff -> mtd_buf_all_ffSascha Hauer2016-03-151-1/+1
| | | | | | | | | | | | | | To make clear this function checks a given buffer and not data on a mtd device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: Introduce function to get mtd type stringSascha Hauer2016-03-151-0/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: Add support for marking blocks as goodSascha Hauer2016-03-153-0/+5
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: mtd_[read|write|erase]: check for valid input dataSascha Hauer2016-03-041-0/+2
| | | | | | | | mtd_[read|write|erase] are input functions to the mtd subsystem, so check for valid input data here rather than relying on the drivers doing this. The checks are copied from the Kernel as of 4.5-rc5 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: Make erase_info structs 64bit where necessarySascha Hauer2016-02-092-8/+8
| | | | | | | | Make the userspace structs 64bit where necessary. Since we do not have separated kernel/userspace in barebox we can just modifiy the original structs instead of adding separate 64bit structs. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Introduce include/linux/mutex.hYegor Yefremov2016-02-031-0/+2
| | | | | | | Move mutex related defines to its original place. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: nand: Add erased page bitflip check helper functionsMarkus Pargmann2016-01-041-0/+5
| | | | | | | | | | This adds the bitflip check helper functions from the kernel. They are used to check for bitflips in erased pages and correct them in the buffer so that UBI can work with it. Unfortunately most nand controllers do not have ECC for erased pages and don't do this on their own. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd nand: added 'bits_per_cell' propertyEnrico Jorns2015-09-231-0/+12
| | | | | | | This one is available in the kernel and used by the denali driver Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: m25p80: make it possible to use large blocks if desiredSascha Hauer2015-08-261-1/+3
| | | | | | | | | | Some SPI NOR flashes support 4K erase blocks. 4K erase blocks do not work with UBIFS which needs a minimum erase block size of 15360 bytes. Also bigger sectors are faster to erase. This patch adds a device tree option to use the bigger blocks instead of the default 4K blocks. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* Merge branch 'for-next/blspec'Sascha Hauer2015-07-061-0/+1
|\
| * fs: ubifs: Implement Linux rootargSascha Hauer2015-06-181-0/+1
| | | | | | | | | | | | | | | | Add the parameter to boot from ubifs fileystems. This assumes that there will be only one UBI device registered in the kernel, otherwise there is no way to predict the ubi number. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2015-07-031-1/+1
|\ \
| * | mtd: Make devname argument to add_mtd_device constSascha Hauer2015-06-291-1/+1
| |/ | | | | | | | | | | | | add_mtd_device duplicates the string where necessary, so make it const. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / mtd: Add mtd concat supportSascha Hauer2015-06-231-0/+34
|/ | | | | | | | 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>
* mtd: spi-nor: add SPI-NOR frameworkSteffen Trumtrar2015-05-291-0/+204
| | | | | | | | Import the SPI-NOR framework from linux kernel v3.19. Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: fixup device tree partitionsSascha Hauer2015-02-121-0/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: Add partitions to listSascha Hauer2015-02-121-0/+3
| | | | | | | So that we can iterate over the existing partitions from the master mtd device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: i.MX6: use generic calculation in nand bbu handlerStefan Christ2015-01-291-0/+37
| | | | | | | | | | | The parameters ECC Strength, BadBlockMarkerByte and BadBlockMarkerStartBit in the FCB structure depends on the nand chip's pagesize and oobsize. Instead of hardcoding these values into the imx6 bbu handler calculate these values on the fly. Therefore we export the necessary functions from the nand_mxs driver to use them in the bbu handler. Signed-off-by: Stefan Christ <s.christ@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Documentation: remove doxygen documentationSascha Hauer2014-06-262-8/+0
| | | | | | | The doxygen documentation is long outdated. Remove it. It will be replaced with sphinx based documentation later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: nand: create bb devices automaticallySascha Hauer2014-04-281-0/+2
| | | | | | | | When a mtd device can have bad blocks we want to create a bb device, so do this automatically. This allows us to drop bb device creation from the environment. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: Support for 4GB partitionsDmitry Lavnikevich2014-03-121-2/+2
| | | | | | | | | This patch implements correct way of creating partitions on mtd devices with size >= 4GB. Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com> Signed-off-by: Grigory Milev <g.milev@sam-solutions.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: Update internal API to support 64-bit device sizeDmitry Lavnikevich2014-03-122-3/+20
| | | | | | | | | | | | | | | | | | | MTD internal API presently uses 32-bit values to represent device size. This patch updates them to 64-bits but leaves the external API unchanged. In general, changing from 32-bit to 64-bit values cause little or no changes to the majority of the code with the following exceptions: - printk message formats; - division and modulus of 64-bit values (mtd_div_by_wb, mtd_div_by_eb may be used in some of such cases). Was tested on phyFLEX i.MX6. Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com> Signed-off-by: Grigory Milev <g.milev@sam-solutions.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mtd'Sascha Hauer2014-03-071-1/+4
|\ | | | | | | | | | | Conflicts: drivers/mtd/core.c net/eth.c
| * mtd: Simplify partitionsSascha Hauer2014-02-131-1/+4
| | | | | | | | | | | | | | Embed the partition information in struct mtd_info. This makes the mtd partition code simpler. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: nand: disable subpage readsSascha Hauer2014-03-031-1/+2
|/ | | | | | | | | | | | | | The default nand_read_subpage implementation returns -ENOSUPP, so we have to make sure that barebox never uses this implementation. By setting the NAND_SUBPAGE_READ flag to 0x0 we ensure NAND_HAS_SUBPAGE_READ() never returns true and also give the compiler a chance to optimize away some unused code. subpage reads are a rather exotic feature even in Linux. It is only used on largepage NANDs with soft ecc. Even if we have this case it needs non page aligned reads to actually profit from this feature. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Cc: Hattink, Tjalling [FINT] <T.Hattink@fugro.nl>
* mtd: Add subpagesize to mtd_info_userSascha Hauer2013-12-201-0/+1
| | | | | | | | | ubiformat needs the subpagesize to work correctly. The kernel uses sysfs to pass the subpagesize, but in barebox we have the possibility to extend struct mtd_info_user. Add a corresponding field and use it in ubiformat. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Add missing includesSascha Hauer2013-11-081-0/+1
| | | | | | | | A lot of files rely on include/driver.h including include/of.h (and this including include/errno.h. include the files explicitly so we can eventually get rid of including of.h from driver.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: Pass device_id to add_mtd_deviceSascha Hauer2013-10-291-1/+1
| | | | | | | | | Right now we do not support persistent names for mtd devices. The base name can be passed to add_mtd_device, but this is always appended with a dynamic number. With this patch add_mtd_device takes a device_id argument which can be used to create a mtd device with an exact name. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: ubi: Add support for opening a volume by cdevSascha Hauer2013-08-071-0/+1
| | | | | | Needed by ubifs support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* UBI: reimport UBI from Linux v3.10Sascha Hauer2013-07-252-0/+233
| | | | | | | | | | | 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-183/+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>
* mtd: nand: update to v3.11-rc1Sascha Hauer2013-07-235-277/+597
| | | | | | | | | | | | | | | | | | This updates the NAND stuff to Linux-3.11-rc1. It is synchronized as best as we can get: - locks removed - The splitting in different files we had to better support different features has been dropped. Instead this is now done mostly with the use of __maybe_unused Some barebox adjustments are forward ported, like: - Allow partial page writes - Optionally allow to erase bad blocks - check for all_ff before writing a page Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: introduce mtd_read_oob and mtd_write_oobSascha Hauer2013-07-221-0/+13
| | | | | | Directly copied from the Kernel as of 3.11-rc1 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: introduce ecc strengthSascha Hauer2013-07-222-0/+26
| | | | | | | This introduces the ecc stength fields in the structures and fills them in, but leaves them unused right now. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: sync bbm.h with Linux KernelSascha Hauer2013-07-221-22/+61
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: rename MTD_OOB_* to MTD_OPS_*Sascha Hauer2013-07-222-17/+20
| | | | | | To sync with the Linux kernel. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand_base: sync flash detection functions with linux 3.9's codeEric Bénard2013-05-171-0/+2
| | | | | | | | | this fix the problems introduced when detecting non ONFI flashes in commit 4c2bdc8728016b3412523e3264651651fe752860 "nand_base: detect more ONFI flash" Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/param'Sascha Hauer2013-05-061-0/+1
|\ | | | | | | | | Conflicts: drivers/mci/mci-core.c
| * mtd: Nand: Use dev_add_param_bool for erasebad parameterSascha Hauer2013-04-111-0/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: update NAND manufacturer names from the kernelJan Luebbe2013-04-111-9/+11
|/ | | | | Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>