summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/onenand
Commit message (Collapse)AuthorAgeFilesLines
* drivers: remove duplicated #includeJianjun Kong2008-11-041-1/+0
| | | | | Signed-off-by: Jianjun Kong <jianjun@zeuux.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* [MTD] [NAND] OMAP2: add retry after read timeoutAdrian Hunter2008-09-161-3/+23
| | | | | | | | | Very occasionally, (about one in a million) read operations are ongoing after the timeout has expired. So, retry three times while the ongoing bit remains set. Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* [MTD] [OneNAND] OMAP3: add delay for GPIOAdrian Hunter2008-08-151-2/+7
| | | | | | | | | On OMAP3, the driver was occasionally not seeing the GPIO interrupt. Adding a small delay of one register read eliminates the problem. Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* [MTD] [OneNAND] Add OMAP2 / OMAP3 OneNAND driverAdrian Hunter2008-08-123-0/+785
| | | | | | | | | | | This driver had resided in the OMAP tree but is now to be in MTD. Original authors were: Jarkko Lavinen <jarkko.lavinen@nokia.com> and Juha Yrjölä IRQ and DMA support written by Timo Teras Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* [MTD] Define and use MTD_FAIL_ADDR_UNKNOWN instead of 0xffffffffAdrian Hunter2008-08-121-1/+1
| | | | | Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* [MTD] dataflash OTP supportDavid Brownell2008-08-011-0/+1
| | | | | | | | | | | | | | | Now that we can tell when we have one of the newer DataFlash chips, optionally expose the 128 bytes of OTP memory they provide. Tested on at45db642 revision B and D chips. Switch mtdchar over to a generic HAVE_MTD_OTP flag instead of adding another #ifdef for each type of chip whose driver has OTP support. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Bryan Wu <cooloney@kernel.org> Cc: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* Merge branch 'master' of ↵David Woodhouse2008-07-111-1/+1
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
| * [MTD] [MAPS] Fix cmdlineparse handling in mapping filesKyungmin Park2008-06-051-1/+1
| | | | | | | | | | | | | | Now it returns the 0 if cmdlineparse not supplied. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* | [MTD] [OneNAND] Check the ECC status first instead of controllerKyungmin Park2008-06-041-29/+25
|/ | | | | | | | | To get the correct information in case of power off recovery, it should read ECC status first Also remove previous workaround method. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [OneNAND] Allow for controller errors when readingAdrian Hunter2008-04-221-0/+15
| | | | | | | | | | | | | A power loss while writing can result in a page becoming unreadable. When the device is mounted again, reading that page gives controller errors. Upper level software like JFFS2 treat -EIO as fatal, refusing to mount at all. That means it is necessary to treat the error as an ECC error to allow recovery. Note that typically in this case, the eraseblock can still be erased and rewritten i.e. it has not become a bad block. Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [OneNAND] unlikely(x) || unlikely(y) => unlikely(x || y)Roel Kluin2008-04-221-2/+2
| | | | | Acked-By: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [OneNAND] proper onenand_bbt_read_oob() prototypeAdrian Bunk2008-04-221-3/+0
| | | | | | | | This patch adds a proper prototype for onenand_bbt_read_oob() in include/linux/mtd/onenand.h Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [OneNAND] Fix unlock all in Double Density Package (DDP)Kyungmin Park2008-02-161-15/+17
| | | | | Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] onenand: Add panic_write function to the onenand driverRichard Purdie2008-02-071-0/+108
| | | | | | | | | Implement the panic_write function for the onenand driver. This waits for any active command to complete/timeout, performs the write, waits for it to complete and then returns. Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [OneNAND] Use pre-alloced oob buffer instead of local bufferKyungmin Park2008-01-291-4/+5
| | | | Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
* [MTD] [OneNAND] Use the u_char instead of char in oobbufSheng Yongjie (Sam2008-01-291-1/+1
| | | | | | | | | In function onenand_verify_oob, local variable oobbuf shall be unsigned char. In the case of a value is >= 0x80, it's unequal in comparing the value in an unsigned char and signed char. Signed-off-by: Sheng Yongjie (Sam) <samsheng@trident.com.cn> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
* [MTD] [OneNAND] Check the initial bad block using ONENAND_CTRL_ERRORKyungmin Park2008-01-291-4/+2
| | | | | | Some chips don't set the ONENAND_CTRL_LOAD bit. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
* [MTD] [OneNAND] Get correct density from device IDKyungmin Park2008-01-291-4/+16
| | | | | | Use the higher bits for other purpose. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
* [MTD] [OneNAND] Consolidate OneNAND operation orderKyungmin Park2008-01-291-15/+4
| | | | | | | Consolidate OneNAND operation order as OneNAND Spec. It also doesn't break previous operation order. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
* [MTD] [OneNAND] fix call to onenand_verify when writing subpagesAdrian Hunter2008-01-291-1/+1
| | | | | Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
* [MTD] [OneNAND] Do not release chip twiceAdrian Hunter2008-01-291-3/+0
| | | | | Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
* [MTD] [OneNAND] Do not stop reading for ECC errorsAdrian Hunter2007-11-261-10/+22
| | | | | | | | | | When an ECC error occurs, the read should be completed anyway before returning -EBADMSG. Returning -EBADMSG straight away is incorrect. Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* Eliminate pointless casts from void* in a few driver irq handlers.Jeff Garzik2007-10-231-1/+1
| | | | Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* [MTD] [OneNAND] Fix wrong free the static address in onenand_simKyungmin Park2007-10-221-1/+0
| | | | | | Reported-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [OneNAND] onenand-sim: fix kernel-doc and typosRandy Dunlap2007-10-201-24/+25
| | | | | | | | Correct kernel-doc notation and descriptions. Correct other typos. Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [OneNAND] Avoid deadlock in erase callback; release chip lock first.Adrian Hunter2007-10-141-3/+4
| | | | | | | | | | | When the erase callback performs some other action on the flash, it's highly likely to deadlock unless we actually release the chip lock before calling it. This patch mirrors that same change already done for NAND. Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [OneNAND] Return only negative error codesAdrian Hunter2007-10-141-2/+2
| | | | | | | | | The OneNAND driver was confusing JFFS2 by returning positive error codes. Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [OneNAND] Synchronize block locking operationsAdrian Hunter2007-10-141-4/+14
| | | | | | | | | Ensure OneNAND's block locking operations are synchronized like all other operations. Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [OneNAND] Fix typo related with recent commitKyungmin Park2007-10-131-1/+1
| | | | | Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [OneNAND] fix numerous racesArtem Bityutskiy2007-09-231-75/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch make the OneNAND driver much less racy. It fixes our "onenand_wait: read timeout!" heisenbugs. The reason of these bugs was that the driver did not lock the chip when accessing OTP, and it screwed up OneNAND state when the OTP was read while JFFS2 was doing FS checking. This patch also fixes other races I spotted: 1. BBT was not protected 2. Access to ecc_stats was not protected Now the chip is locked when BBT is accessed. To fix all of these I basically split all interface functions on 'function()' and 'function_nolock()' parts. I tested this patch on N800 hardware - it fixes our problems. But I tested a little different version because our OneNAND codebase is slightly out-of-date. But it should be OK. This patch also includes the prin fixes I posted before. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [OneNAND] main read/write ops support for yaffs2Kyungmin Park2007-09-061-116/+233
| | | | | | | Now we can use yaffs2 on OneNAND Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [OneNAND] Use mtd_oob_ops at oob functionsKyungmin Park2007-08-301-15/+36
| | | | | | | | | To enable the main read/write at oob ops Next time we will commit the main read/write support for yaffs2 Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [ONENAND] onenand_sim.c: make struct info staticAdrian Bunk2007-08-011-1/+1
| | | | | | | This patch makes the needlessly global struct info static. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [ONENAND] Make onenand_sim compile on non-ARM platforms.David Woodhouse2007-07-101-9/+9
| | | | | | | | The whole point of a sim is that it should run almost anywhere. Gratuitously depending on '#define SZ_128K 131072' from an ARM-specific header isn't really a good idea. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] OneNAND Simulator supportKyungmin Park2007-06-303-0/+505
| | | | | | | | | | | | This simulate various OneNAND flash chips for the MTD onenand layer. It's simple implementation, only basic operations. It don't support the recent changes in NANDSIM such as lazy block allocation, bitflip, and so on. Note: This passed nand-tests. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [OneNAND] 2X program supportKyungmin Park2007-06-302-27/+128
| | | | | | | | | | | | | | | | | | | The 2X Program is an extension of Program Operation. Since the device is equipped with two DataRAMs, and two-plane NAND Flash memory array, these two component enables simultaneous program of 4KiB. Plane1 has only even blocks such as block0, block2, block4 while Plane2 has only odd blocks such as block1, block3, block5. So MTD regards it as 4KiB page size and 256KiB block size Now the following chips support it. (KFXXX16Q2M) Demux: KFG2G16Q2M, KFH4G16Q2M, KFW8G16Q2M, Mux: KFM2G16Q2M, KFN4G16Q2M, And more recent chips Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* Fix occurrences of "the the "Michael Opdenacker2007-05-091-1/+1
| | | | | Signed-off-by: Michael Opdenacker <michael@free-electrons.com> Signed-off-by: Adrian Bunk <bunk@stusta.de>
* [MTD] [OneNAND] Exit loop only when column start with 0Adrian Hunter2007-04-251-2/+2
| | | | | | | | | | The JFFS2 requests OOB function from column 0. But the oobtest in nand-tests doesn't. So we only exit loop only when column start with 0. Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [OneNAND] Fix access the past of the real oobfree arrayKyungmin Park2007-04-251-5/+12
| | | | | | | | | | | | | | | | Here it's not the case: all the entries are occupied by OOB chunks. Therefore, once we get into a loop like for (free = this->ecclayout->oobfree; free->length; ++free) { } we might end up scanning past the real oobfree array. Probably the best way out, as the same thing might happen for common NAND as well, is to check index against MTD_MAX_OOBFREE_ENTRIES. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [OneNAND] Update Samsung OneNAND official URLKyungmin Park2007-04-251-1/+1
| | | | | | | Update Samsung OneNAND official URL. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* Use menuconfig objects: MTDJan Engelhardt2007-04-191-8/+5
| | | | | | | | | Use menuconfigs instead of menus, so the whole menu can be disabled at once instead of going through all options. Signed-off-by: Jan Engelhardt <jengelh@gmx.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [OneNAND] Classify the page data and oob bufferKyungmin Park2007-03-091-6/+18
| | | | | | | | Classify the page data and oob buffer and it prevents the memory fragementation (writesize + oobsize) Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [OneNAND] Exit the loop when transferring/filling of the oob is finishedKyungmin Park2007-03-091-2/+4
| | | | | | | When transferring/filling of the oob is finished in OOB_AUTO, we exit the loop Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [OneNAND] add Nokia Copyright and a creditAdrian Hunter2007-03-091-0/+5
| | | | | | | | add Nokia Copyright and a credit Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [OneNAND] Fix typo & wrong commentsKyungmin Park2007-03-091-9/+11
| | | | | | | Fix typo & wrong comments Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [OneNAND] Use oob buffer instead of main one in oob functionsKyungmin Park2007-03-091-10/+13
| | | | | | | In oob functions, it is used main buffer instead of oob one. So fix it. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [NAND] make oobavail publicVitaly Wool2007-03-081-0/+1
| | | | | | | | | | | During the MTD rework the oobavail parameter of mtd_info structure has become private. This is not quite correct in terms of integrity and logic. If we have means to write to OOB area, then we'd like to know upfront how many bytes out of OOB are spare per page to be able to adapt to specific cases. The patch inlined adds the public oobavail parameter. Signed-off-by: Vitaly Wool <vwool@ru.mvista.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [ONENAND] onenand_base warning fixAndrew Morton2007-02-181-1/+1
| | | | | | | | drivers/mtd/onenand/onenand_base.c: In function 'onenand_bbt_read_oob': drivers/mtd/onenand/onenand_base.c:1033: warning: format '%i' expects type 'int', but argument 3 has type 'size_t' Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] remove unused ecctype,eccsize fields from struct mtd_infoArtem Bityutskiy2007-02-091-1/+0
| | | | | | | | | | | | Remove unused and broken mtd->ecctype and mtd->eccsize fields from struct mtd_info. Do not remove them from userspace API data structures (don't want to breake userspace) but mark them as obsolete by a comment. Any userspace program which uses them should be half-broken anyway, so this is more about saving data structure size. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] OneNAND: Invalidate bufferRAM after eraseAdrian Hunter2007-02-091-0/+25
| | | | | | | | | | OneNAND has internal bufferRAMs. The driver keeps track of what is in the bufferRAM to save having to load from the NAND core. After an erase operation, the driver must mark bufferRAM invalid if it refers to the erased block. Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
OpenPOWER on IntegriCloud