summaryrefslogtreecommitdiff
path: root/drivers/mtd/onenand
AgeCommit message (Collapse)AuthorFilesLines
2009-01-15ARM: OMAP: Fix gpio by switching to generic gpio calls, v2Jarkko Nikula1-3/+3
Fix compile by removing remaining omap specific gpio calls. Based on earlier patches by Jarkko Nikula. Also remove old GPIO key code, there is already a patch to do this with gpio_keys. Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-01-05Merge branch 'master' of ↵David Woodhouse1-5/+5
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 Conflicts: arch/arm/mach-pxa/corgi.c arch/arm/mach-pxa/poodle.c arch/arm/mach-pxa/spitz.c
2008-12-23[MTD] struct device - replace bus_id with dev_name(), dev_set_name()Kay Sievers2-2/+2
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-11ARM: OMAP: use gpio_to_irqDavid Brownell1-3/+3
Have most uses of OMAP_GPIO_IRQ() use gpio_to_irq() instead. Calls used for table initialization are left alone, at least this time around. (This patch is for code in both the OMAP tree and mainline.) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-11ARM: OMAP: switch to gpio_direction_inputDavid Brownell1-1/+1
More switchover to the cross-platform GPIO interface: use gpio_direction_input(), not an OMAP-specific call. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-11ARM: OMAP: switch to standard gpio get/set callsDavid Brownell1-1/+1
This patch replaces some legacy OMAP GPIO calls with the "new" (not really, any more!) calls that work on most platforms. The calls addressed by this patch are the simple ones to get and set values ... for code that's in mainline, including the implementations of those calls. Except for the declarations and definitions of those calls, all of these changes were performed by a simple SED script. Plus, a few "if() set() else set()" branches were merged by hand. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-10[MTD] update internal API to support 64-bit device sizeAdrian Hunter1-4/+4
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. Extending the external API is a separate issue for several reasons. First, no one needs it at the moment. Secondly, whether the implementation is done with IOCTLs, sysfs or both is still debated. Thirdly external API changes require the internal API to be accepted first. Note that although the MTD API will be able to support 64-bit device sizes, existing drivers do not and are not required to do so, although NAND base has been updated. 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 - NAND base support - 32-bit local variables used by mtdpart and mtdconcat - naughtily assuming one structure maps to another in MEMERASE ioctl Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-11-26[MTD] [NAND] OMAP: OneNAND: header file relocation (part 2)Adrian Hunter1-3/+2
Include <linux/dma-mapping.h> and <linux/io.h>, not files from <asm/*> Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-11-24[MTD] [NAND] OMAP: OneNAND: header file relocationAdrian Hunter1-6/+6
Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-10-21[MTD] [NAND] OMAP2: remove duplicated #includeHuang Weiyi1-1/+0
Removed duplicated #include <asm/arch/gpmc.h> in drivers/mtd/onenand/omap2.c. Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-09-16[MTD] [NAND] OMAP2: add retry after read timeoutAdrian Hunter1-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>
2008-08-15[MTD] [OneNAND] OMAP3: add delay for GPIOAdrian Hunter1-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>
2008-08-12[MTD] [OneNAND] Add OMAP2 / OMAP3 OneNAND driverAdrian Hunter3-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>
2008-08-12[MTD] Define and use MTD_FAIL_ADDR_UNKNOWN instead of 0xffffffffAdrian Hunter1-1/+1
Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-08-02[MTD] dataflash OTP supportDavid Brownell1-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>
2008-07-11Merge branch 'master' of ↵David Woodhouse1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
2008-06-05[MTD] [MAPS] Fix cmdlineparse handling in mapping filesKyungmin Park1-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>
2008-06-04[MTD] [OneNAND] Check the ECC status first instead of controllerKyungmin Park1-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>
2008-04-23[MTD] [OneNAND] Allow for controller errors when readingAdrian Hunter1-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>
2008-04-22[MTD] [OneNAND] unlikely(x) || unlikely(y) => unlikely(x || y)Roel Kluin1-2/+2
Acked-By: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2008-04-22[MTD] [OneNAND] proper onenand_bbt_read_oob() prototypeAdrian Bunk1-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>
2008-02-16[MTD] [OneNAND] Fix unlock all in Double Density Package (DDP)Kyungmin Park1-15/+17
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2008-02-07[MTD] onenand: Add panic_write function to the onenand driverRichard Purdie1-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>
2008-01-29[MTD] [OneNAND] Use pre-alloced oob buffer instead of local bufferKyungmin Park1-4/+5
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2008-01-29[MTD] [OneNAND] Use the u_char instead of char in oobbufSheng Yongjie (Sam1-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>
2008-01-29[MTD] [OneNAND] Check the initial bad block using ONENAND_CTRL_ERRORKyungmin Park1-4/+2
Some chips don't set the ONENAND_CTRL_LOAD bit. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2008-01-29[MTD] [OneNAND] Get correct density from device IDKyungmin Park1-4/+16
Use the higher bits for other purpose. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2008-01-29[MTD] [OneNAND] Consolidate OneNAND operation orderKyungmin Park1-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>
2008-01-29[MTD] [OneNAND] fix call to onenand_verify when writing subpagesAdrian Hunter1-1/+1
Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2008-01-29[MTD] [OneNAND] Do not release chip twiceAdrian Hunter1-3/+0
Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2007-11-26[MTD] [OneNAND] Do not stop reading for ECC errorsAdrian Hunter1-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>
2007-10-24Eliminate pointless casts from void* in a few driver irq handlers.Jeff Garzik1-1/+1
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2007-10-22[MTD] [OneNAND] Fix wrong free the static address in onenand_simKyungmin Park1-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>
2007-10-20[MTD] [OneNAND] onenand-sim: fix kernel-doc and typosRandy Dunlap1-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>
2007-10-14[MTD] [OneNAND] Avoid deadlock in erase callback; release chip lock first.Adrian Hunter1-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>
2007-10-14[MTD] [OneNAND] Return only negative error codesAdrian Hunter1-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>
2007-10-14[MTD] [OneNAND] Synchronize block locking operationsAdrian Hunter1-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>
2007-10-13[MTD] [OneNAND] Fix typo related with recent commitKyungmin Park1-1/+1
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-09-23[MTD] [OneNAND] fix numerous racesArtem Bityutskiy1-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>
2007-09-06[MTD] [OneNAND] main read/write ops support for yaffs2Kyungmin Park1-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>
2007-08-30[MTD] [OneNAND] Use mtd_oob_ops at oob functionsKyungmin Park1-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>
2007-08-01[MTD] [ONENAND] onenand_sim.c: make struct info staticAdrian Bunk1-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>
2007-07-10[MTD] [ONENAND] Make onenand_sim compile on non-ARM platforms.David Woodhouse1-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>
2007-06-30[MTD] OneNAND Simulator supportKyungmin Park3-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>
2007-06-30[MTD] [OneNAND] 2X program supportKyungmin Park2-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>
2007-05-09Fix occurrences of "the the "Michael Opdenacker1-1/+1
Signed-off-by: Michael Opdenacker <michael@free-electrons.com> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2007-04-25[MTD] [OneNAND] Exit loop only when column start with 0Adrian Hunter1-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>
2007-04-25[MTD] [OneNAND] Fix access the past of the real oobfree arrayKyungmin Park1-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>
2007-04-25[MTD] [OneNAND] Update Samsung OneNAND official URLKyungmin Park1-1/+1
Update Samsung OneNAND official URL. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-04-20Use menuconfig objects: MTDJan Engelhardt1-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>