summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
Commit message (Collapse)AuthorAgeFilesLines
* trivial: s/flasg/flash/Uwe Kleine-König2015-01-271-1/+1
| | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sizes.h: move include/sizes.h to include/linux/sizes.hMasahiro Yamada2015-01-081-1/+1
| | | | | | | | | | | | | | This file originates in Linux. Linux has it under include/linux/ directory since commit dccd2304cc90. Let's move it to the same place as well in barebox. This commit was generated by the following commands: find -name '*.[chS]' | xargs sed -i -e 's:<sizes.h>:<linux/sizes.h>:' git mv include/sizes.h include/linux/ Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Fix typo collumn -> columnSascha Hauer2014-12-111-3/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/imx'Sascha Hauer2014-12-081-0/+1
|\
| * imx6: clk: Gate off ENFC clock before setting clock rateDmitry Lavnikevich2014-11-261-0/+1
| | | | | | | | | | | | | | | | | | This fixes NAND initialization issue which appears occasionally on some i.MX6 SoCs (particulary was observed on phyCARD-i.MX6 with i.MX6Solo). Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: ubi: get_bad_peb_limit from mtd masterJan Weitzel2014-11-201-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | Like mentioned in the coment we need the size of the entire flash chip. Check if a master exists and take his size. Otherwise the limit will be too small and kernel prints: UBI warning: print_rsvd_warning: cannot reserve enough PEBs for \ bad PEB handling, reserved 19, need 20 Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: nand_orion: remove unused goto labelUwe Kleine-König2014-11-101-1/+1
|/ | | | | | | | | | | This fixes the following warning: drivers/mtd/nand/nand_orion.c: In function ‘orion_nand_probe’: drivers/mtd/nand/nand_orion.c:145:1: warning: label ‘no_res’ defined but not used [-Wunused-label] Fixes: 1a215f5 ("nand: Add Marvell Orion NAND driver") Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/ubi'Sascha Hauer2014-10-025-42/+40
|\
| * UBI: bugfix in ubi_wl_flush()Richard Weinberger2014-09-111-2/+2
| | | | | | | | | | | | | | | | Use the _safe variant because we're iterating over a list where items get deleted and freed. Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
| * UBI: init_volumes: Ignore volumes with no LEBsRichard Weinberger2014-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UBI assumes that ubi_attach_info will only contain ubi_ainf_volume structures for volumes with at least one LEB. In scanning mode this is true because UBI can nicely create a ubi_ainf_volume on demand while creating the EBA table. For fastmap this is not true, the fastmap on-flash structure has a list of all volumes, the ubi_ainf_volume structures are created from this list. So it can happen that an empty volume ends up in init_volumes(). We can easely deal with that by looking into ->leb_count too. Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
| * UBI: fastmap: do not miss bit-flipsBrian Norris2014-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The return value from 'ubi_io_read_ec_hdr()' was stored in 'err', not in 'ret'. This fix makes sure Fastmap-enabled UBI does not miss bit-flip while reading EC headers, events and scrubs the affected PEBs. This issue was reported by Coverity Scan. Artem: improved the commit message. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Richard Weinberger <richard@nod.at> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
| * UBI: fix the volumes tree sorting criteriaHeiko Schocher2014-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Commig "604b592 UBI: fix rb_tree node comparison in add_map" broke fastmap backward compatibility and older fastmap images cannot be mounted anymore. The reason is that it changes the volumes RB-tree sorting criteria. This patch fixes the problem. Artem: re-write the commit message Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Richard Weinberger <richard@nod.at> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
| * UBI: fix rb_tree node comparison in add_mapMike Snitzer2014-09-111-2/+2
| | | | | | | | | | | | | | | | | | The comparisons used in add_vol() shouldn't be identical. Pretty sure the following is correct but it is completely untested. Signed-off-by: Mike Snitzer <snitzer@redhat.com> Acked-by: Richard Weinberger <richard@nod.at> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
| * UBI: fix ubi free PEBs count calculationTanya Brokhman2014-09-111-0/+3
| | | | | | | | | | | | | | | | | | | | The ubi->free_count should be updated with every insert/remove to/from the ubi->free list. Signed-off-by: Tanya Brokhman <tlinder@codeaurora.org> Reviewed-by: Dolev Raviv <draviv@codeaurora.org> Acked-by: Richard Weinberger <richard@nod.at> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
| * UBI: fix error path in __wl_get_pebTanya Brokhman2014-09-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | In case of an error (if there are not free PEB's for example), __wl_get_peb will return a negative value. In order to prevent access violation we need to test the returned value prior to using it later on. Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org> Reviewed-by: Dolev Raviv <draviv@codeaurora.org> Acked-by: Richard Weinberger <richard@nod.at> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
| * UBI: fix some use after free bugsDan Carpenter2014-09-111-4/+4
| | | | | | | | | | | | | | Move the kmem_cache_free() calls down a couple lines. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
| * UBI: avoid program operation on NOR flash after erasure interruptedQi Wang 王起 (qiwang)2014-09-111-32/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nor_erase_prepare() will be called before erase a NOR flash, it will program '0' into a block to mark this block. But program data into a erasure interrupted block can cause program timtout(several minutes at most) error, could impact other operation on NOR flash. So UBIFS can read this block first to avoid unneeded program operation. This patch try to put read operation at head of write operation in nor_erase_prepare(), read out the data. If the data is already corrupt, then no need to program any data into this block, just go to erase this block. This patch is validated on Micron NOR flash, part number is:JS28F512M29EWHA Signed-off-by: Qi Wang <qiwang@micron.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
| * UBI: fix error return codeJulia Lawall2014-09-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set the return variable to an error code as done elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Reviewed-by: Richard Weinberger <richard@nod.at>
* | Merge branch 'for-next/resource-err-ptr'Sascha Hauer2014-10-025-2/+21
|\ \
| * | resource: Let dev_request_mem_region return an error pointerSascha Hauer2014-09-164-2/+14
| | | | | | | | | | | | | | | | | | For all users fix or add the error check. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | resource: Let dev_request_mem_region_by_name return an error pointerSascha Hauer2014-09-161-0/+7
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/mtd'Sascha Hauer2014-10-023-0/+128
|\ \ \
| * | | mtd: add mtdram device (which build mtd over ram area - useful for FRAM oder ↵Sebastian Block2014-09-093-0/+128
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MRAM) Change since v1 (Sascha, thanks for review): * use xzalloc instead of kzalloc and control check * correct help and names * fix coding style issue * remove verbose and unneeded messages This adds support for MTD in RAM devices (like FRAM or MRAM). Signed-off-by: Sebastian Block <basti@linux-source.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2014-10-022-3/+3
|\ \ \
| * | | Subject: [PATCH] cfi: print size in human readable formatFranck Jullien2014-09-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The CFI size is now printed in a human readable format. It also adds "0x" prefix to the printed address. Signed-off-by: Franck Jullien <franck.jullien@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | nand: orion: Limit to Kirkwood platformEzequiel Garcia2014-09-091-1/+1
| |/ / | | | | | | | | | | | | | | | | | | This driver is only available on Kirkwood SoCs, so add proper dependency. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / / nand: atmel: runtime to generate galois tableBo Shen2014-09-221-4/+117
|/ / | | | | | | | | Signed-off-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/marvell'Sascha Hauer2014-09-053-0/+168
|\ \
| * | nand: Add Marvell Orion NAND driverEzequiel Garcia2014-09-013-0/+168
| |/ | | | | | | | | | | | | | | | | This commit adds NAND support for the controller present in Kirkwood SoCs. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: atmel_nand: add support for device treeRaphaël Poggi2014-09-031-1/+110
| | | | | | | | | | Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: atmel_nand: retrieve ecc_mode from pdataRaphaël Poggi2014-09-021-1/+1
| | | | | | | | | | | | | | | | | | By retrieving the ecc_mode from pdata we can use the same code for device tree and non device tree probing. Which was not possible before, because ecc_mode was arbitrarily set to NAND_ECC_SOFT. Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: nand: add has_pmecc memberRaphaël Poggi2014-09-021-1/+1
|/ | | | | | | By adding this structure member, we can retrieve the pmecc config, through the device tree. Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2014-08-071-2/+9
|\ | | | | | | | | Conflicts: lib/Makefile
| * mtd: atmel_nand: enable PMECC for 8k page nandRaphael Poggi2014-07-181-0/+1
| | | | | | | | | | | | | | | | Enable the PMECC to support 8k page. Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com> Acked-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: atmel_nand: fix bit error correctionRaphael Poggi2014-07-181-1/+2
| | | | | | | | | | | | | | | | | | | | When pmecc uses a 1024 sector size to correct bit error, the gf dimension must be 14. So this commit chooses the right degree for different sector size (512 or 1024). Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: atmel_nand: increase chip_delayRaphael Poggi2014-07-181-1/+1
| | | | | | | | | | | | | | | | Some nand like Micron MT29F32G08ABAAAWP need more than 20us. Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com> Acked-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: atmel_nand: add SOFT_BCH supportRaphael Poggi2014-07-171-0/+5
| | | | | | | | | | | | | | | | To use soft ecc with nand with 8k page, we need the BCH support. This commit adds the possibilty for atmel_nand to enable SOFT_BCH. Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: omap gpmc: reserve 14 byte/subpage for ECC in BCH8 romcodeSascha Hauer2014-08-011-8/+2
| | | | | | | | | | | | | | As done in the Kernel. The Kernel has a comment this is done to be compatible with the ROM code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: omap gpmc: fix ecc bytes/sizeSascha Hauer2014-08-011-6/+6
|/ | | | | | The ecc bytes / size are per subpage, not per page. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers/mtd: fix NULL pointer dereference in partition lock/unlockZahari Doychev2014-07-091-0/+6
| | | | | | | | Some mtd device does not support lock and unlock functions. Adding this check avoids crashing when mtd_part_lock/unlock are called for such devices. Signed-off-by: Zahari Doychev <zahari.doychev@linux.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: delete partition erase size initialisationRenaud Barbier2014-07-031-1/+0
| | | | | | | Delete the partition erase size initialisation to let the code that follows determine the biggest partition erase size. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: use long long dev param for sizeHerve Codina2014-06-131-1/+1
| | | | | Signed-off-by: Herve Codina <Herve.CODINA@celad.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: remove address of the Free Software FoundationAntony Pavlov2014-06-1116-63/+0
| | | | | | | | | | | | | | | | | | The FSF address has changed; The FSF site says that address is Free Software Foundation 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA (see http://www.fsf.org/about/contact/) Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: partition: implement lock/unlockSascha Hauer2014-06-101-0/+28
| | | | | | | CFI Nor flashes need lock/unlock which is not implemented for partitions. Fix this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: partition: Fix multi eraseregion chipsSascha Hauer2014-06-101-17/+24
| | | | | | | | | | | | | The current code counts the eraseregions a new partition spans and sets the partitions number of eraseregions accordingly, but the code forgets to allocate and fill in the eraseregions for the partition mtd device. This makes the erase operation crash with a NULL pointer exception. This patch fixes this with the same approach the kernel uses: Set the number of eraseregions to 1 unconditionally and the eraseregion size to the maximum of the eraseregions found in the partition. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: fix mtd erasesizeHerve Codina2014-06-101-1/+10
| | | | | | | Set mtd erasize using max erasesize from erase regions Signed-off-by: Herve Codina <Herve.CODINA@celad.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: Fix writesize parameter valueHerve Codina2014-06-101-1/+1
| | | | | Signed-off-by: Herve Codina <Herve.CODINA@celad.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2014-06-042-5/+10
|\ | | | | | | | | Conflicts: commands/devinfo.c
| * mtd: m25p80: update Micron IDsSascha Hauer2014-05-151-2/+4
| | | | | | | | | | | | | | Update Micron IDs from Linux-3.15-rc5. Skip n25q512a for now since it needs flag status polling. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: partitions: only add write functions when mtd write support is enabledSascha Hauer2014-05-151-3/+6
| | | | | | | | | | | | Makes the binary a few bytes smaller. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>