summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/onenand
Commit message (Collapse)AuthorAgeFilesLines
* [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] 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/+0Star
| | | | | | | | 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/+2Star
| | | | | | 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/+4Star
| | | | | | | 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/+0Star
| | | | | 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-241-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/+0Star
| | | | | | 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/+5Star
| | | | | | | | | 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/+0Star
| | | | | | | | | | | | 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>
* [MTD] OneNAND: Select correct chip's bufferRAM for DDPAdrian Hunter2007-02-091-8/+16
| | | | | | | | | | | OneNAND double-density package (DDP) has two chips, each with their own bufferRAM. The driver will skip loading data from the NAND core if the data can be found in a bufferRAM, however in that case, the correct chip's bufferRAM must be selected before reading from bufferRAM. Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
* [MTD] OneNAND: Error message printing and bad block scan errosKyungmin Park2007-02-072-30/+148
| | | | | | | | Provide the bad block scan with its own read function so that important error messages that are not from the the bad block scan, can always be printed. Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
* [MTD] OneNAND: Subpage write returned incorrect length writtenAdrian Hunter2007-02-071-11/+9Star
| | | | | | | | | When a write is done, the length written is returned. When a single subpage is written the length returned should be the subpage size, however the page size was being returned. Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
* [MTD] OneNAND: Do not allow oob write past end of pageAdrian Hunter2007-02-061-0/+7
| | | | | | | | | OneNAND can write oob to successive pages, but NAND does not do that. For compatibility, disallow OneNAND from writing past the end of the page. Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
* [MTD] OneNAND: Fix typo and remove unnecessary goto statementKyungmin Park2007-02-021-8/+4Star
| | | | | | | In previos patch, there's typo so fix it Remove unnecessary goto statement Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
* [MTD] OneNAND: Reduce internal BufferRAM operationsKyungmin Park2007-02-021-24/+23Star
| | | | | | | | | | It use blockpage instead of a pair (block, page). It can also cover a small chunk access. 0x00, 0x20, 0x40 and so on. And in JFFS2 behavior, sometimes it reads two pages alternatively. e.g., It first reads A page, B page and A page. So we check another bufferram to find requested page. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
* [MTD] OneNAND: Remove line of code that was meant to be deleted in OOB_AUTOKyungmin Park2007-02-021-9/+5Star
| | | | | | | | - Iterations of the patch to add oob auto-placement support to OneNAND left a line of code that was meant to have been deleted. - read mtd->oobsize in onenand_transfer_auto_oob to optimized memcpy Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
* [MTD] OneNAND: Add support for auto-placement of out-of-band dataAdrian Hunter2007-02-012-37/+171
| | | | | | | | Enable the use of oob operation mode MTD_OOB_AUTO with OneNAND. Note that MTD_OOB_RAW is still not supported. Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>